Changeset - r8131:7a50db7be0ff
[Not reviewed]
master
! ! !
rubidium - 17 years ago 2007-12-25 11:26:07
rubidium@openttd.org
(svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h'
134 files changed with 180 insertions and 169 deletions:
0 comments (0 inline, 0 general)
src/ai/ai.h
Show inline comments
 
/* $Id$ */
 

	
 
#ifndef AI_H
 
#define AI_H
 

	
 
#include "../functions.h"
 
#include "../network/network.h"
 
#include "../player.h"
 
#include "../command_type.h"
 
#include "../core/random_func.hpp"
 

	
 
/* How DoCommands look like for an AI */
 
struct AICommand {
 
	uint32 tile;
 
	uint32 p1;
 
	uint32 p2;
src/ai/default/default.cpp
Show inline comments
 
@@ -23,12 +23,14 @@
 
#include "../../airport.h"
 
#include "../../depot.h"
 
#include "../../variables.h"
 
#include "../../bridge.h"
 
#include "../../date.h"
 
#include "../../tunnelbridge_map.h"
 
#include "../../window_func.h"
 
#include "../../functions.h"
 
#include "default.h"
 

	
 

	
 
// remove some day perhaps?
 
static uint _ai_service_interval;
 

	
src/ai/trolly/build.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "../../stdafx.h"
 
#include "../../openttd.h"
 
#include "../../debug.h"
 
#include "../../functions.h"
 
#include "../../map.h"
 
#include "../../road_map.h"
 
#include "../../vehicle.h"
 
#include "../../command_func.h"
 
#include "trolly.h"
 
#include "../../engine.h"
src/ai/trolly/pathfinder.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "../../stdafx.h"
 
#include "../../openttd.h"
 
#include "../../bridge_map.h"
 
#include "../../debug.h"
 
#include "../../functions.h"
 
#include "../../map.h"
 
#include "../../command_func.h"
 
#include "trolly.h"
 
#include "../../depot.h"
 
#include "../../tunnel_map.h"
 
#include "../../bridge.h"
src/ai/trolly/trolly.cpp
Show inline comments
 
@@ -17,13 +17,12 @@
 
 *  -- TrueLight :: 2005-09-01
 
 */
 

	
 
#include "../../stdafx.h"
 
#include "../../openttd.h"
 
#include "../../debug.h"
 
#include "../../functions.h"
 
#include "../../road_map.h"
 
#include "../../station_map.h"
 
#include "table/strings.h"
 
#include "../../map.h"
 
#include "../../command_func.h"
 
#include "trolly.h"
src/aircraft_cmd.cpp
Show inline comments
 
@@ -4,13 +4,12 @@
 
 * This file deals with aircraft and airport movements functionalities */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "aircraft.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "station_map.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "timetable.h"
 
@@ -30,12 +29,14 @@
 
#include "newgrf_sound.h"
 
#include "date.h"
 
#include "spritecache.h"
 
#include "cargotype.h"
 
#include "strings_func.h"
 
#include "command_func.h"
 
#include "window_func.h"
 
#include "functions.h"
 

	
 
void Aircraft::UpdateDeltaXY(Direction direction)
 
{
 
	uint32 x;
 
#define MKIT(a, b, c, d) ((a & 0xFF) << 24) | ((b & 0xFF) << 16) | ((c & 0xFF) << 8) | ((d & 0xFF) << 0)
 
	switch (this->subtype) {
src/aircraft_gui.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file aircraft_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "aircraft.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "vehicle.h"
 
#include "engine.h"
src/airport_gui.cpp
Show inline comments
 
@@ -3,24 +3,24 @@
 
/** @file airport_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "window_gui.h"
 
#include "gui.h"
 
#include "station_gui.h"
 
#include "viewport.h"
 
#include "sound.h"
 
#include "command_func.h"
 
#include "vehicle.h"
 
#include "station.h"
 
#include "airport.h"
 
#include "depot.h"
 
#include "window_func.h"
 

	
 
static byte _selected_airport_type;
 

	
 
static void ShowBuildAirportPicker();
 

	
 

	
src/articulated_vehicles.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file articulated_vehicles.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "vehicle.h"
 
#include "articulated_vehicles.h"
 
#include "engine.h"
 
#include "train.h"
 
#include "roadveh.h"
 
#include "newgrf_callbacks.h"
src/autoreplace_cmd.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "roadveh.h"
 
#include "ship.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "news.h"
 
#include "player.h"
 
#include "engine.h"
 
#include "debug.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
 
@@ -16,12 +15,13 @@
 
#include "aircraft.h"
 
#include "cargotype.h"
 
#include "group.h"
 
#include "order.h"
 
#include "strings_func.h"
 
#include "command_func.h"
 
#include "functions.h"
 

	
 
/*
 
 * move the cargo from one engine to another if possible
 
 */
 
static void MoveVehicleCargo(Vehicle *dest, Vehicle *source)
 
{
src/autoreplace_gui.cpp
Show inline comments
 
@@ -2,23 +2,23 @@
 

	
 
/** @file autoreplace_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "command_func.h"
 
#include "variables.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
 
#include "group.h"
 
#include "rail.h"
 
#include "strings_func.h"
 
#include "window_func.h"
 

	
 
static RailType _railtype_selected_in_replace_gui;
 

	
 
static bool _rebuild_left_list;
 
static bool _rebuild_right_list;
 

	
src/blitter/8bpp_debug.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file 8bpp_debug.cpp */
 

	
 
#include "../stdafx.h"
 
#include "../zoom_func.h"
 
#include "../functions.h"
 
#include "../core/random_func.hpp"
 
#include "8bpp_debug.hpp"
 

	
 
static FBlitter_8bppDebug iFBlitter_8bppDebug;
 

	
 
void Blitter_8bppDebug::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
 
{
src/bridge_gui.cpp
Show inline comments
 
@@ -2,23 +2,23 @@
 

	
 
/** @file bridge_gui.cpp Graphical user interface for bridge construction */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "command_func.h"
 
#include "economy_func.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "bridge.h"
 
#include "strings_func.h"
 
#include "window_func.h"
 

	
 
static struct BridgeData {
 
	uint8 last_size;
 
	uint count;
 
	TileIndex start_tile;
 
	TileIndex end_tile;
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -6,13 +6,12 @@
 
#include "openttd.h"
 
#include "train.h"
 
#include "roadveh.h"
 
#include "ship.h"
 
#include "aircraft.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "vehicle.h"
 
#include "articulated_vehicles.h"
 
#include "textbuf_gui.h"
 
@@ -26,12 +25,13 @@
 
#include "newgrf_engine.h"
 
#include "date.h"
 
#include "cargotype.h"
 
#include "group.h"
 
#include "road_map.h"
 
#include "strings_func.h"
 
#include "window_func.h"
 

	
 

	
 
enum BuildVehicleWidgets {
 
	BUILD_VEHICLE_WIDGET_CLOSEBOX = 0,
 
	BUILD_VEHICLE_WIDGET_CAPTION,
 
	BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING,
src/clear_cmd.cpp
Show inline comments
 
@@ -4,13 +4,12 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "clear_map.h"
 
#include "rail_map.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "player.h"
 
#include "viewport.h"
 
#include "command_func.h"
 
#include "tunnel_map.h"
 
#include "bridge_map.h"
 
@@ -20,12 +19,14 @@
 
#include "table/sprites.h"
 
#include "unmovable_map.h"
 
#include "genworld.h"
 
#include "industry.h"
 
#include "water_map.h"
 
#include "tile_cmd.h"
 
#include "vehicle.h"
 
#include "functions.h"
 

	
 
/*
 
 * In one terraforming command all four corners of a initial tile can be raised/lowered (though this is not available to the player).
 
 * The maximal amount of height modifications is archieved when raising a complete flat land from sea level to MAX_TILE_HEIGHT or vice versa.
 
 * This affects all corners with a manhatten distance smaller than MAX_TILE_HEIGHT to one of the initial 4 corners.
 
 * Their maximal amount is computed to 4 * \sum_{i=1}^{h_max} i  =  2 * h_max * (h_max + 1).
src/command.cpp
Show inline comments
 
@@ -2,25 +2,25 @@
 

	
 
/** @file command.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "map.h"
 
#include "tile_map.h"
 
#include "gui.h"
 
#include "command_func.h"
 
#include "player.h"
 
#include "network/network.h"
 
#include "variables.h"
 
#include "genworld.h"
 
#include "newgrf_storage.h"
 
#include "strings_func.h"
 
#include "gfx_func.h"
 
#include "functions.h"
 

	
 
const char *_cmd_text = NULL;
 

	
 
/**
 
 * Helper macro to define the header of all command handler macros.
 
 *
src/console.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file console.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "textbuf_gui.h"
 
#include "window_gui.h"
 
#include "player.h"
 
#include "variables.h"
 
#include "string.h"
 
@@ -16,12 +15,13 @@
 
#include <string.h>
 
#include "console.h"
 
#include "network/network.h"
 
#include "network/network_data.h"
 
#include "network/network_server.h"
 
#include "core/alloc_func.hpp"
 
#include "window_func.h"
 

	
 
#define ICON_BUFFER 79
 
#define ICON_HISTORY_SIZE 20
 
#define ICON_LINE_HEIGHT 12
 
#define ICON_RIGHT_BORDERWIDTH 10
 
#define ICON_BOTTOM_BORDERWIDTH 12
src/console_cmds.cpp
Show inline comments
 
@@ -4,13 +4,12 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "console.h"
 
#include "debug.h"
 
#include "engine.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "saveload.h"
 
#include "string.h"
 
#include "variables.h"
 
#include "network/network_data.h"
 
#include "network/network_client.h"
 
@@ -25,12 +24,14 @@
 
#include "screenshot.h"
 
#include "genworld.h"
 
#include "date.h"
 
#include "network/network.h"
 
#include "strings_func.h"
 
#include "viewport.h"
 
#include "window_func.h"
 
#include "functions.h"
 

	
 
// ** scriptfile handling ** //
 
static FILE *_script_file;
 
static bool _script_running;
 

	
 
// ** console command / variable defines ** //
src/date.cpp
Show inline comments
 
@@ -7,14 +7,15 @@
 
#include "date.h"
 
#include "variables.h"
 
#include "vehicle.h"
 
#include "network/network.h"
 
#include "network/network_data.h"
 
#include "network/network_server.h"
 
#include "currency.h"
 
#include "window_func.h"
 
#include "functions.h"
 
#include "currency.h"
 
#ifdef DEBUG_DUMP_COMMANDS
 
#include "saveload.h"
 
#endif
 

	
 
Year      _cur_year;
 
Month     _cur_month;
src/debug.cpp
Show inline comments
 
@@ -5,13 +5,12 @@
 
#include "stdafx.h"
 
#include <stdio.h>
 
#include <stdarg.h>
 
#include "openttd.h"
 
#include "console.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "network/core/core.h"
 

	
 
#if defined(ENABLE_NETWORK)
 
SOCKET _debug_socket = INVALID_SOCKET;
 
#endif /* ENABLE_NETWORK */
src/debug.h
Show inline comments
 
@@ -126,7 +126,10 @@ const char *GetDebugString();
 
		DEBUG(misc, 0, "[%s] %" OTTD_PRINTF64 "u [avg: %.1f]\n", str, __sum__, __sum__/(double)__i__);\
 
		__i__ = 0;\
 
		__sum__ = 0;\
 
	}\
 
}
 

	
 
void ShowInfo(const char *str);
 
void CDECL ShowInfoF(const char *str, ...);
 

	
 
#endif /* DEBUG_H */
src/depot.cpp
Show inline comments
 
@@ -3,18 +3,18 @@
 
/** @file depot.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "vehicle.h"
 
#include "depot.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "map.h"
 
#include "table/strings.h"
 
#include "saveload.h"
 
#include "order.h"
 
#include "window_func.h"
 

	
 
DEFINE_OLD_POOL_GENERIC(Depot, Depot)
 

	
 
/**
 
 * Gets a depot from a tile
 
 *
src/depot_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file depot_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "train.h"
 
#include "roadveh.h"
 
#include "ship.h"
 
#include "aircraft.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
@@ -19,12 +18,13 @@
 
#include "depot.h"
 
#include "vehicle_gui.h"
 
#include "station_map.h"
 
#include "newgrf_engine.h"
 
#include "spritecache.h"
 
#include "strings_func.h"
 
#include "window_func.h"
 

	
 
/*
 
 * Since all depot window sizes aren't the same, we need to modify sizes a little.
 
 * It's done with the following arrays of widget indexes. Each of them tells if a widget side should be moved and in what direction.
 
 * How long they should be moved and for what window types are controlled in ShowDepotWindow()
 
 */
src/disaster_cmd.cpp
Show inline comments
 
@@ -36,12 +36,13 @@
 
#include "airport.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "table/sprites.h"
 
#include "date.h"
 
#include "strings_func.h"
 
#include "functions.h"
 

	
 
enum DisasterSubType {
 
	ST_Zeppeliner,
 
	ST_Zeppeliner_Shadow,
 
	ST_Small_Ufo,
 
	ST_Small_Ufo_Shadow,
src/dock_gui.cpp
Show inline comments
 
@@ -3,24 +3,24 @@
 
/** @file dock_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "tile_map.h"
 
#include "station.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "station_gui.h"
 
#include "viewport.h"
 
#include "sound.h"
 
#include "command_func.h"
 
#include "variables.h"
 
#include "water.h"
 
#include "window_func.h"
 

	
 
static void ShowBuildDockStationPicker();
 
static void ShowBuildDocksDepotPicker();
 

	
 
static Axis _ship_depot_direction;
 

	
src/driver.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file driver.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "driver.h"
 
#include "functions.h"
 
#include "string.h"
 

	
 
#include "sound/sound_driver.hpp"
 
#include "music/music_driver.hpp"
 
#include "video/video_driver.hpp"
 

	
src/economy.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file economy.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "currency.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "map.h"
 
#include "news.h"
 
#include "player.h"
 
@@ -37,12 +36,14 @@
 
#include "date.h"
 
#include "cargotype.h"
 
#include "player_face.h"
 
#include "group.h"
 
#include "strings_func.h"
 
#include "tile_cmd.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
/**
 
 * Multiply two integer values and shift the results to right.
 
 *
 
 * This function multiplies two integer values. The result is
 
 * shifted by the amount of shift to right.
src/elrail.cpp
Show inline comments
 
@@ -46,13 +46,12 @@
 
 */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "station_map.h"
 
#include "viewport.h"
 
#include "functions.h" /* We should REALLY get rid of this goddamn file, as it is butt-ugly */
 
#include "variables.h" /* ... same here */
 
#include "landscape.h"
 
#include "rail_type.h"
 
#include "debug.h"
 
#include "tunnel_map.h"
 
#include "road_map.h"
src/engine.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file engine.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/strings.h"
 
#include "engine.h"
 
#include "player.h"
 
#include "command_func.h"
 
#include "vehicle.h"
 
#include "news.h"
 
@@ -21,12 +20,14 @@
 
#include "table/engines.h"
 
#include "group.h"
 
#include "string.h"
 
#include "misc/autoptr.hpp"
 
#include "strings_func.h"
 
#include "viewport.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
EngineInfo _engine_info[TOTAL_NUM_ENGINES];
 
RailVehicleInfo _rail_vehicle_info[NUM_TRAIN_ENGINES];
 
ShipVehicleInfo _ship_vehicle_info[NUM_SHIP_ENGINES];
 
AircraftVehicleInfo _aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES];
 
RoadVehicleInfo _road_vehicle_info[NUM_ROAD_ENGINES];
src/engine_gui.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file engine_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "engine.h"
 
#include "command_func.h"
 
#include "economy_func.h"
src/fileio.cpp
Show inline comments
 
@@ -2,18 +2,18 @@
 

	
 
/** @file fileio.cpp Standard In/Out file operations */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "fileio.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "variables.h"
 
#include "debug.h"
 
#include "fios.h"
 
#include "core/alloc_func.hpp"
 
#include "core/math_func.hpp"
 
#ifdef WIN32
 
#include <windows.h>
 
#else
 
#include <pwd.h>
 
#include <unistd.h>
 
#endif
 
@@ -761,6 +761,34 @@ void SanitizeFilename(char *filename)
 
			case '<': case '>': case '|': case '"':
 
				*filename = '_';
 
				break;
 
		}
 
	}
 
}
 

	
 
void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize)
 
{
 
	FILE *in;
 
	byte *mem;
 
	size_t len;
 

	
 
	in = fopen(filename, "rb");
 
	if (in == NULL) return NULL;
 

	
 
	fseek(in, 0, SEEK_END);
 
	len = ftell(in);
 
	fseek(in, 0, SEEK_SET);
 
	if (len > maxsize || (mem = MallocT<byte>(len + 1)) == NULL) {
 
		fclose(in);
 
		return NULL;
 
	}
 
	mem[len] = 0;
 
	if (fread(mem, len, 1, in) != 1) {
 
		fclose(in);
 
		free(mem);
 
		return NULL;
 
	}
 
	fclose(in);
 

	
 
	*lenp = len;
 
	return mem;
 
}
src/fileio.h
Show inline comments
 
@@ -109,10 +109,12 @@ static inline const char *FioGetSubdirec
 
	return _subdirs[subdir];
 
}
 

	
 
void SanitizeFilename(char *filename);
 
void AppendPathSeparator(char *buf, size_t buflen);
 
void DeterminePaths(const char *exe);
 
void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize);
 
bool FileExists(const char *filename);
 

	
 
extern char *_personal_dir; ///< custom directory for personal settings, saves, newgrf, etc.
 

	
 
#endif /* FILEIO_H */
src/fios.cpp
Show inline comments
 
@@ -5,18 +5,18 @@
 
 */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "string.h"
 
#include "variables.h"
 
#include "functions.h"
 
#include "heightmap.h"
 
#include "table/strings.h"
 
#include "fios.h"
 
#include "fileio.h"
 
#include "core/alloc_func.hpp"
 
#include "functions.h"
 
#include <sys/types.h>
 
#include <sys/stat.h>
 

	
 
#ifdef WIN32
 
# include <tchar.h>
 
# include <io.h>
src/fontcache.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file fontcache.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "debug.h"
 
#include "table/sprites.h"
 
#include "table/control_codes.h"
 
#include "spritecache.h"
 
#include "string.h"
 
#include "fontcache.h"
 
#include "spriteloader/spriteloader.hpp"
 
#include "blitter/factory.hpp"
 
#include "gfx_func.h"
 
#include "core/alloc_func.hpp"
 
#include "core/math_func.hpp"
 

	
 
#ifdef WITH_FREETYPE
 

	
 
#include <ft2build.h>
 
#include FT_FREETYPE_H
 
#include FT_GLYPH_H
src/functions.h
Show inline comments
 
@@ -4,17 +4,14 @@
 

	
 
#ifndef FUNCTIONS_H
 
#define FUNCTIONS_H
 

	
 
#include "core/random_func.hpp"
 
#include "command_type.h"
 
#include "window_type.h"
 
#include "openttd.h"
 

	
 
void UpdateTownMaxPass(Town *t);
 

	
 
/* clear_land.cpp */
 
void DrawHillyLandTile(const TileInfo *ti);
 
void DrawClearLandTile(const TileInfo *ti, byte set);
 
void DrawClearLandFence(const TileInfo *ti);
 
void TileLoopClearHelper(TileIndex tile);
 

	
 
@@ -22,16 +19,12 @@ void TileLoopClearHelper(TileIndex tile)
 
bool CheckPlayerHasMoney(CommandCost cost);
 
void SubtractMoneyFromPlayer(CommandCost cost);
 
void SubtractMoneyFromPlayerFract(PlayerID player, CommandCost cost);
 
bool CheckOwnership(Owner owner);
 
bool CheckTileOwnership(TileIndex tile);
 

	
 
/* standard */
 
void ShowInfo(const char *str);
 
void CDECL ShowInfoF(const char *str, ...);
 

	
 
/* openttd.cpp */
 
static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); }
 
static inline TileIndex RandomTile() { return TILE_MASK(Random()); }
 

	
 
/* texteff.cpp */
 
void AddAnimatedTile(TileIndex tile);
 
@@ -64,39 +57,24 @@ void MarkTileDirty(int x, int y);
 
/**
 
 * Mark a tile given by its index dirty for repaint.
 
 *
 
 * @ingroup dirty
 
 */
 
void MarkTileDirtyByTile(TileIndex tile);
 
void InvalidateWindow(WindowClass cls, WindowNumber number);
 
void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_index);
 
void InvalidateWindowClasses(WindowClass cls);
 
void InvalidateWindowClassesData(WindowClass cls);
 
void DeleteWindowById(WindowClass cls, WindowNumber number);
 
void DeleteWindowByClass(WindowClass cls);
 

	
 
bool EnsureNoVehicleOnGround(TileIndex tile);
 

	
 
/**
 
 * Mark all viewports dirty for repaint.
 
 *
 
 * @ingroup dirty
 
 */
 
void MarkAllViewportsDirty(int left, int top, int right, int bottom);
 
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost);
 
void ShowFeederIncomeAnimation(int x, int y, int z, Money cost);
 

	
 
bool CheckIfAuthorityAllows(TileIndex tile);
 
Town *ClosestTownFromTile(TileIndex tile, uint threshold);
 
void ChangeTownRating(Town *t, int add, int max);
 

	
 
uint GetTownRadiusGroup(const Town* t, TileIndex tile);
 
void ShowHighscoreTable(int difficulty, int8 rank);
 

	
 
void AfterLoadTown();
 
void UpdatePatches();
 
void AskExitGame();
 
void AskExitToGameMenu();
 

	
 
void RedrawAutosave();
 

	
 
StringID RemapOldStringID(StringID s);
 
@@ -112,17 +90,12 @@ enum {
 
	SLD_NEW_GAME,
 
};
 
void ShowSaveLoadDialog(int mode);
 

	
 
/* callback from drivers that is called if the game size changes dynamically */
 
void GameSizeChanged();
 
bool FileExists(const char *filename);
 
const char *GetCurrentLocale(const char *param);
 
void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize);
 

	
 
void LoadFromConfig();
 
void SaveToConfig();
 
void CheckConfig();
 
int ttd_main(int argc, char* argv[]);
 
void HandleExitGameRequest();
 

	
 
#endif /* FUNCTIONS_H */
src/genworld.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file genworld.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "player.h"
 
#include "table/sprites.h"
 
#include "variables.h"
 
#include "thread.h"
 
#include "command_func.h"
src/genworld_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file genworld_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "heightmap.h"
 
#include "functions.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "gfxinit.h"
 
@@ -22,12 +21,13 @@
 
#include "genworld.h"
 
#include "network/network.h"
 
#include "thread.h"
 
#include "date.h"
 
#include "newgrf_config.h"
 
#include "strings_func.h"
 
#include "window_func.h"
 

	
 
/**
 
 * In what 'mode' the GenerateLandscapeWindowProc is.
 
 */
 
enum glwp_modes {
 
	GLWP_GENERATE,
src/gfx.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file gfx.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "gfx_func.h"
 
#include "spritecache.h"
 
#include "string.h"
 
#include "table/palettes.h"
 
#include "table/sprites.h"
 
#include "variables.h"
 
@@ -17,12 +16,13 @@
 
#include "debug.h"
 
#include "zoom_func.h"
 
#include "texteff.hpp"
 
#include "blitter/factory.hpp"
 
#include "video/video_driver.hpp"
 
#include "strings_func.h"
 
#include "core/math_func.hpp"
 

	
 
byte _dirkeys;        ///< 1 = left, 2 = up, 4 = right, 8 = down
 
bool _fullscreen;
 
CursorVars _cursor;
 
bool _ctrl_pressed;   ///< Is Ctrl pressed?
 
bool _shift_pressed;  ///< Is Shift pressed?
src/gfxinit.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file gfxinit.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "gfxinit.h"
 
#include "spritecache.h"
 
#include "table/sprites.h"
 
#include "fileio.h"
 
#include "fios.h"
 
#include "string.h"
src/graph_gui.cpp
Show inline comments
 
@@ -3,22 +3,22 @@
 
/** @file graph_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "player.h"
 
#include "economy_func.h"
 
#include "variables.h"
 
#include "date.h"
 
#include "cargotype.h"
 
#include "strings_func.h"
 
#include "core/alloc_func.hpp"
 
#include "window_func.h"
 

	
 
/* Bitmasks of player and cargo indices that shouldn't be drawn. */
 
static uint _legend_excluded_players;
 
static uint _legend_excluded_cargo;
 

	
 
/************************/
src/group_cmd.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file group_cmd.cpp Handling of the engine groups */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "variables.h"
 
#include "functions.h"
 
#include "player.h"
 
#include "table/strings.h"
 
#include "command_func.h"
 
#include "vehicle.h"
 
#include "saveload.h"
 
#include "debug.h"
 
@@ -16,12 +15,14 @@
 
#include "train.h"
 
#include "aircraft.h"
 
#include "string.h"
 
#include "vehicle_gui.h"
 
#include "misc/autoptr.hpp"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
/**
 
 * Update the num engines of a groupID. Decrease the old one and increase the new one
 
 * @note called in SetTrainGroupID and UpdateTrainGroupID
 
 * @param i     EngineID we have to update
 
 * @param old_g index of the old group
src/group_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file group_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "vehicle.h"
 
@@ -19,12 +18,13 @@
 
#include "date.h"
 
#include "group.h"
 
#include "viewport.h"
 
#include "debug.h"
 
#include "strings_func.h"
 
#include "core/alloc_func.hpp"
 
#include "window_func.h"
 

	
 

	
 
struct Sorting {
 
	Listing aircraft;
 
	Listing roadveh;
 
	Listing ship;
src/gui.h
Show inline comments
 
@@ -5,12 +5,13 @@
 
#ifndef GUI_H
 
#define GUI_H
 

	
 
#include "window_type.h"
 
#include "vehicle_type.h"
 
#include "gfx_type.h"
 
#include "economy_type.h"
 

	
 
/* main_gui.cpp */
 
void CcPlaySound10(bool success, TileIndex tile, uint32 p1, uint32 p2);
 
void CcBuildCanal(bool success, TileIndex tile, uint32 p1, uint32 p2);
 
void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2);
 

	
src/heightmap.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file heightmap.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "variables.h"
 
#include "functions.h"
 
#include "heightmap.h"
 
#include "clear_map.h"
 
#include "table/strings.h"
 
#include "void_map.h"
 
#include "debug.h"
 
#include "gui.h"
src/industry_cmd.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file industry_cmd.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "clear_map.h"
 
#include "functions.h"
 
#include "industry_map.h"
 
#include "station_map.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "map.h"
 
#include "train.h"
 
@@ -37,12 +36,14 @@
 
#include "misc/autoptr.hpp"
 
#include "autoslope.h"
 
#include "transparency.h"
 
#include "water.h"
 
#include "strings_func.h"
 
#include "tile_cmd.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
void ShowIndustryViewWindow(int industry);
 
void BuildOilRig(TileIndex tile);
 

	
 
static byte _industry_sound_ctr;
 
static TileIndex _industry_sound_tile;
src/industry_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file industry_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
src/intro_gui.cpp
Show inline comments
 
@@ -3,25 +3,26 @@
 
/** @file intro_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "player.h"
 
#include "network/network.h"
 
#include "variables.h"
 
#include "settings.h"
 
#include "heightmap.h"
 
#include "genworld.h"
 
#include "network/network_gui.h"
 
#include "newgrf.h"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
static const Widget _select_game_widgets[] = {
 
{    WWT_CAPTION, RESIZE_NONE, 13,   0, 335,   0,  13, STR_0307_OPENTTD,         STR_NULL},
 
{      WWT_PANEL, RESIZE_NONE, 13,   0, 335,  14, 194, 0x0,                      STR_NULL},
 
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12,  10, 167,  22,  33, STR_0140_NEW_GAME,        STR_02FB_START_A_NEW_GAME},
 
{ WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325,  22,  33, STR_0141_LOAD_GAME,       STR_02FC_LOAD_A_SAVED_GAME},
src/landscape.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "bridge_map.h"
 
#include "heightmap.h"
 
#include "clear_map.h"
 
#include "date.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "player.h"
 
#include "spritecache.h"
 
#include "table/sprites.h"
 
#include <stdarg.h>
 
#include "viewport.h"
 
@@ -20,12 +19,15 @@
 
#include "void_map.h"
 
#include "water_map.h"
 
#include "tgp.h"
 
#include "genworld.h"
 
#include "tile_cmd.h"
 
#include "core/alloc_func.hpp"
 
#include "functions.h"
 
#include "window_func.h"
 
#include "functions.h"
 

	
 
extern const TileTypeProcs
 
	_tile_type_clear_procs,
 
	_tile_type_rail_procs,
 
	_tile_type_road_procs,
 
	_tile_type_town_procs,
src/main_gui.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file main_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "heightmap.h"
 
#include "currency.h"
 
#include "functions.h"
 
#include "spritecache.h"
 
#include "station.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "gui.h"
 
@@ -39,12 +38,13 @@
 
#include "date.h"
 
#include "vehicle_gui.h"
 
#include "transparency_gui.h"
 
#include "newgrf_config.h"
 
#include "rail_gui.h"
 
#include "road_gui.h"
 
#include "functions.h"
 

	
 
#include "network/network_data.h"
 
#include "network/network_client.h"
 
#include "network/network_server.h"
 
#include "network/network_gui.h"
 
#include "industry.h"
src/map.cpp
Show inline comments
 
@@ -2,17 +2,17 @@
 

	
 
/** @file map.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "direction_func.h"
 
#include "core/bitmath_func.hpp"
 
#include "core/alloc_func.hpp"
 
#include "core/math_func.hpp"
 

	
 
#if defined(_MSC_VER) && _MSC_VER >= 1400 /* VStudio 2005 is stupid! */
 
/* Why the hell is that not in all MSVC headers?? */
 
extern "C" _CRTIMP void __cdecl _assert(void *, void *, unsigned);
 
#endif
 

	
src/misc.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file misc.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "currency.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "news.h"
 
#include "player.h"
 
#include "string.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
@@ -23,12 +22,13 @@
 
#include "date.h"
 
#include "cargotype.h"
 
#include "group.h"
 
#include "viewport.h"
 
#include "economy_func.h"
 
#include "zoom_func.h"
 
#include "functions.h"
 

	
 
char _name_array[512][32];
 

	
 
void InitializeVehicles();
 
void InitializeWaypoints();
 
void InitializeDepots();
src/misc_cmd.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file misc_cmd.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "table/strings.h"
 
#include "command_func.h"
 
#include "economy_func.h"
 
#include "player.h"
 
#include "gui.h"
 
@@ -17,12 +16,13 @@
 
#include "variables.h"
 
#include "livery.h"
 
#include "player_face.h"
 
#include "strings_func.h"
 
#include "vehicle.h"
 
#include "gfx_func.h"
 
#include "functions.h"
 

	
 
/** Change the player's face.
 
 * @param tile unused
 
 * @param flags operation to perform
 
 * @param p1 unused
 
 * @param p2 face bitmasked
src/misc_gui.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file misc_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "heightmap.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "newgrf.h"
 
#include "newgrf_text.h"
 
#include "saveload.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
@@ -38,12 +37,14 @@
 
#include "player_face.h"
 
#include "strings_func.h"
 
#include "fileio.h"
 
#include "fios.h"
 
#include "tile_cmd.h"
 
#include "zoom_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
/* Variables to display file lists */
 
FiosItem *_fios_list;
 
int _saveload_mode;
 

	
 

	
src/music_gui.cpp
Show inline comments
 
@@ -3,20 +3,20 @@
 
/** @file music_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "functions.h"
 
#include "fileio.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "music.h"
 
#include "music/music_driver.hpp"
 
#include "window_gui.h"
 
#include "strings_func.h"
 
#include "window_func.h"
 

	
 
static byte _music_wnd_cursong;
 
static bool _song_is_active;
 
static byte _cur_playlist[NUM_SONGS_PLAYLIST];
 

	
 

	
src/network/core/tcp.cpp
Show inline comments
 
@@ -8,13 +8,12 @@
 

	
 
#include "../../stdafx.h"
 
#include "../../debug.h"
 
#include "../../openttd.h"
 
#include "../../variables.h"
 
#include "table/strings.h"
 
#include "../../functions.h"
 

	
 
#include "../network_data.h"
 
#include "packet.h"
 
#include "tcp.h"
 

	
 
/** Very ugly temporary hack !!! */
src/network/network.cpp
Show inline comments
 
@@ -6,13 +6,12 @@
 
extern const char _openttd_revision[];
 

	
 
#ifdef ENABLE_NETWORK
 

	
 
#include "../openttd.h"
 
#include "../debug.h"
 
#include "../functions.h"
 
#include "../string.h"
 
#include "../strings_func.h"
 
#include "../map.h"
 
#include "../command_func.h"
 
#include "../variables.h"
 
#include "../date.h"
 
@@ -28,12 +27,14 @@ extern const char _openttd_revision[];
 
#include "network_gui.h"
 
#include "../console.h" /* IConsoleCmdExec */
 
#include <stdarg.h> /* va_list */
 
#include "../md5.h"
 
#include "../fileio.h"
 
#include "../texteff.hpp"
 
#include "../core/random_func.hpp"
 
#include "../window_func.h"
 

	
 
/* Check whether NETWORK_NUM_LANDSCAPES is still in sync with NUM_LANDSCAPE */
 
assert_compile((int)NETWORK_NUM_LANDSCAPES == (int)NUM_LANDSCAPE);
 

	
 
// global variables (declared in network_data.h)
 
CommandPacket *_local_command_queue;
src/network/network_client.cpp
Show inline comments
 
@@ -7,25 +7,25 @@
 
#include "../string.h"
 
#include "../openttd.h"
 
#include "network_data.h"
 
#include "core/tcp.h"
 
#include "../date.h"
 
#include "table/strings.h"
 
#include "../functions.h"
 
#include "network_client.h"
 
#include "network_gamelist.h"
 
#include "network_gui.h"
 
#include "../saveload.h"
 
#include "../command_func.h"
 
#include "../console.h"
 
#include "../variables.h"
 
#include "../ai/ai.h"
 
#include "../core/alloc_func.hpp"
 
#include "../fileio.h"
 
#include "../md5.h"
 
#include "../strings_func.h"
 
#include "../window_func.h"
 

	
 
// This file handles all the client-commands
 

	
 

	
 
// So we don't make too much typos ;)
 
#define MY_CLIENT DEREF_CLIENT(0)
src/network/network_gui.cpp
Show inline comments
 
@@ -8,13 +8,12 @@
 
#include "../table/sprites.h"
 
#include "network.h"
 
#include "../date.h"
 

	
 
#include "../fios.h"
 
#include "table/strings.h"
 
#include "../functions.h"
 
#include "network_data.h"
 
#include "network_client.h"
 
#include "network_gui.h"
 
#include "network_gamelist.h"
 
#include "../gui.h"
 
#include "../window_gui.h"
 
@@ -23,12 +22,14 @@
 
#include "network_server.h"
 
#include "network_udp.h"
 
#include "../settings.h"
 
#include "../string.h"
 
#include "../town.h"
 
#include "../newgrf.h"
 
#include "../functions.h"
 
#include "../window_func.h"
 

	
 
#define BGC 5
 
#define BTC 15
 

	
 
struct chatquerystr_d : public querystr_d {
 
	int dest;
src/network/network_server.cpp
Show inline comments
 
@@ -10,13 +10,12 @@
 
#include "network_data.h"
 
#include "core/tcp.h"
 
#include "../train.h"
 
#include "../aircraft.h"
 
#include "../date.h"
 
#include "table/strings.h"
 
#include "../functions.h"
 
#include "network_server.h"
 
#include "network_udp.h"
 
#include "../console.h"
 
#include "../command_func.h"
 
#include "../saveload.h"
 
#include "../vehicle.h"
src/newgrf.cpp
Show inline comments
 
@@ -6,13 +6,12 @@
 

	
 
#include <stdarg.h>
 

	
 
#include "openttd.h"
 
#include "debug.h"
 
#include "fileio.h"
 
#include "functions.h"
 
#include "engine.h"
 
#include "spritecache.h"
 
#include "station.h"
 
#include "sprite.h"
 
#include "newgrf.h"
 
#include "variables.h"
src/newgrf_config.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file newgrf_config.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "debug.h"
 
#include "variables.h"
 
#include "string.h"
 
#include "saveload.h"
 
#include "md5.h"
 
#include "network/network_data.h"
src/newgrf_engine.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file newgrf_engine.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "variables.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "engine.h"
 
#include "train.h"
 
#include "player.h"
 
#include "station.h"
 
#include "airport.h"
 
#include "newgrf.h"
src/newgrf_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file newgrf_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "variables.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "newgrf.h"
 
#include "newgrf_config.h"
 
#include "strings_func.h"
 
#include "window_func.h"
 

	
 
/** Parse an integerlist string and set each found value
 
 * @param p the string to be parsed. Each element in the list is seperated by a
 
 * comma or a space character
 
 * @param items pointer to the integerlist-array that will be filled with values
 
 * @param maxitems the maximum number of elements the integerlist-array has
src/newgrf_house.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file newgrf_house.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "variables.h"
 
#include "debug.h"
 
#include "viewport.h"
 
#include "landscape.h"
 
#include "date.h"
 
#include "town.h"
 
@@ -22,12 +21,13 @@
 
#include "newgrf_spritegroup.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_town.h"
 
#include "newgrf_sound.h"
 
#include "newgrf_commons.h"
 
#include "transparency.h"
 
#include "functions.h"
 

	
 
static BuildingCounts    _building_counts;
 
static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX];
 

	
 
HouseOverrideManager _house_mngr(NEW_HOUSE_OFFSET, HOUSE_MAX, INVALID_HOUSE_ID);
 

	
src/newgrf_industries.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file newgrf_industries.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "variables.h"
 
#include "landscape.h"
 
#include "table/strings.h"
 
#include "industry.h"
 
#include "industry_map.h"
 
#include "newgrf.h"
 
@@ -17,12 +16,13 @@
 
#include "newgrf_industries.h"
 
#include "newgrf_industrytiles.h"
 
#include "newgrf_commons.h"
 
#include "newgrf_text.h"
 
#include "newgrf_town.h"
 
#include "date.h"
 
#include "window_func.h"
 

	
 
/* Since the industry IDs defined by the GRF file don't necessarily correlate
 
 * to those used by the game, the IDs used for overriding old industries must be
 
 * translated when the idustry spec is set. */
 
IndustryOverrideManager _industry_mngr(NEW_INDUSTRYOFFSET, NUM_INDUSTRYTYPES, INVALID_INDUSTRYTYPE);
 
IndustryTileOverrideManager _industile_mngr(NEW_INDUSTRYTILEOFFSET, NUM_INDUSTRYTILES, INVALID_INDUSTRYTILE);
src/newgrf_industrytiles.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file newgrf_industrytiles.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "variables.h"
 
#include "debug.h"
 
#include "viewport.h"
 
#include "landscape.h"
 
#include "newgrf.h"
 
#include "industry.h"
 
@@ -20,12 +19,13 @@
 
#include "industry_map.h"
 
#include "clear_map.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "sprite.h"
 
#include "transparency.h"
 
#include "functions.h"
 

	
 
static uint32 GetGRFParameter(IndustryGfx indtile_id, byte parameter)
 
{
 
	const IndustryTileSpec *indtspec = GetIndustryTileSpec(indtile_id);
 
	const GRFFile *file = indtspec->grf_prop.grffile;
 

	
src/newgrf_spritegroup.h
Show inline comments
 
@@ -5,12 +5,14 @@
 
#ifndef NEWGRF_SPRITEGROUP_H
 
#define NEWGRF_SPRITEGROUP_H
 

	
 
#include "town.h"
 
#include "industry.h"
 
#include "newgrf_storage.h"
 
#include "core/bitmath_func.hpp"
 
#include "gfx_type.h"
 

	
 
/**
 
 * Gets the value of a so-called newgrf "register".
 
 * @param i index of the register
 
 * @pre i < 0x110
 
 * @return the value of the register
src/newgrf_town.cpp
Show inline comments
 
@@ -3,13 +3,13 @@
 
/** @file newgrf_town.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "variables.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "core/bitmath_func.hpp"
 
#include "town.h"
 

	
 
/** This function implements the town variables that newGRF defines.
 
 * @param variable that is queried
 
 * @param parameter unused
 
 * @param available will return false if ever the variable asked for does not exist
src/news_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "news.h"
 
@@ -14,12 +13,13 @@
 
#include "sound.h"
 
#include "variables.h"
 
#include "date.h"
 
#include "string.h"
 
#include "transparency.h"
 
#include "strings_func.h"
 
#include "window_func.h"
 

	
 
/** @file news_gui.cpp
 
 *
 
 * News system is realized as a FIFO queue (in an array)
 
 * The positions in the queue can't be rearranged, we only access
 
 * the array elements through pointers to the elements. Once the
src/npf.cpp
Show inline comments
 
@@ -5,24 +5,24 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "bridge_map.h"
 
#include "debug.h"
 
#include "tile_cmd.h"
 
#include "bridge.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "npf.h"
 
#include "aystar.h"
 
#include "pathfind.h"
 
#include "station.h"
 
#include "station_map.h"
 
#include "depot.h"
 
#include "tunnel_map.h"
 
#include "network/network.h"
 
#include "water_map.h"
 
#include "tunnelbridge_map.h"
 
#include "functions.h"
 

	
 
static AyStar _npf_aystar;
 

	
 
/* The cost of each trackdir. A diagonal piece is the full NPF_TILE_LENGTH,
 
 * the shorter piece is sqrt(2)/2*NPF_TILE_LENGTH =~ 0.7071
 
 */
src/oldloader.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file oldloader.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "station_map.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "town.h"
 
#include "industry.h"
 
#include "station.h"
 
#include "player.h"
 
#include "engine.h"
 
@@ -22,12 +21,13 @@
 
#include "debug.h"
 
#include "depot.h"
 
#include "newgrf_config.h"
 
#include "ai/ai.h"
 
#include "date.h"
 
#include "zoom_func.h"
 
#include "functions.h"
 

	
 
enum {
 
	HEADER_SIZE = 49,
 
	BUFFER_SIZE = 4096,
 

	
 
	OLD_MAP_SIZE = 256 * 256
src/oldpool.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file oldpool.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "oldpool.h"
 
#include "core/alloc_func.hpp"
 

	
 
/**
 
 * Clean a pool in a safe way (does free all blocks)
 
 */
src/openttd.cpp
Show inline comments
 
@@ -10,13 +10,12 @@
 
#include "saveload.h"
 
#include "map.h"
 

	
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "bridge_map.h"
 
#include "functions.h"
 
#include "mixer.h"
 
#include "spritecache.h"
 
#include "gfxinit.h"
 
#include "gui.h"
 
#include "landscape.h"
 
#include "station.h"
 
@@ -117,40 +116,12 @@ void CDECL ShowInfoF(const char *str, ..
 
	vsnprintf(buf, lengthof(buf), str, va);
 
	va_end(va);
 
	ShowInfo(buf);
 
}
 

	
 

	
 
void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize)
 
{
 
	FILE *in;
 
	byte *mem;
 
	size_t len;
 

	
 
	in = fopen(filename, "rb");
 
	if (in == NULL) return NULL;
 

	
 
	fseek(in, 0, SEEK_END);
 
	len = ftell(in);
 
	fseek(in, 0, SEEK_SET);
 
	if (len > maxsize || (mem = MallocT<byte>(len + 1)) == NULL) {
 
		fclose(in);
 
		return NULL;
 
	}
 
	mem[len] = 0;
 
	if (fread(mem, len, 1, in) != 1) {
 
		fclose(in);
 
		free(mem);
 
		return NULL;
 
	}
 
	fclose(in);
 

	
 
	*lenp = len;
 
	return mem;
 
}
 

	
 
extern const char _openttd_revision[];
 
static void showhelp()
 
{
 
	char buf[4096], *p;
 

	
 
	p = buf;
src/order_cmd.cpp
Show inline comments
 
@@ -5,25 +5,26 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "order.h"
 
#include "airport.h"
 
#include "vehicle.h"
 
#include "depot.h"
 
#include "functions.h"
 
#include "table/strings.h"
 
#include "waypoint.h"
 
#include "command_func.h"
 
#include "station.h"
 
#include "player.h"
 
#include "news.h"
 
#include "saveload.h"
 
#include "vehicle_gui.h"
 
#include "cargotype.h"
 
#include "aircraft.h"
 
#include "strings_func.h"
 
#include "core/alloc_func.hpp"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
DEFINE_OLD_POOL_GENERIC(Order, Order)
 

	
 
/**
 
 *
 
 * Unpacks a order from savegames made with TTD(Patch)
src/order_gui.cpp
Show inline comments
 
@@ -5,13 +5,12 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "road_map.h"
 
#include "station_map.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "vehicle.h"
 
#include "station.h"
 
#include "town.h"
 
@@ -23,12 +22,13 @@
 
#include "water_map.h"
 
#include "vehicle_gui.h"
 
#include "timetable.h"
 
#include "cargotype.h"
 
#include "order.h"
 
#include "strings_func.h"
 
#include "window_func.h"
 

	
 
enum OrderWindowWidgets {
 
	ORDER_WIDGET_CLOSEBOX = 0,
 
	ORDER_WIDGET_CAPTION,
 
	ORDER_WIDGET_TIMETABLE_VIEW,
 
	ORDER_WIDGET_ORDER_LIST,
src/os/macosx/splash.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "../../stdafx.h"
 
#include "../../openttd.h"
 
#include "../../variables.h"
 
#include "../../debug.h"
 
#include "../../functions.h"
 
#include "../../gfx_func.h"
 
#include "../../fileio.h"
 
#include "../../blitter/factory.hpp"
 

	
 
#include "splash.h"
 

	
src/os2.cpp
Show inline comments
 
@@ -5,15 +5,16 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "variables.h"
 
#include "string.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "functions.h"
 
#include "fileio.h"
 
#include "fios.h" // opendir/readdir/closedir
 
#include "functions.h"
 
#include "core/random_func.hpp"
 

	
 
#include <dirent.h>
 
#include <unistd.h>
 
#include <sys/stat.h>
 
#include <stdlib.h>
 
#include <time.h>
src/player_face.h
Show inline comments
 
@@ -2,12 +2,14 @@
 

	
 
/** @file player_face.h Functionality related to the player's face */
 

	
 
#ifndef PLAYER_FACE_H
 
#define PLAYER_FACE_H
 

	
 
#include "core/random_func.hpp"
 

	
 
/** The gender/race combinations that we have faces for */
 
enum GenderEthnicity {
 
	GENDER_FEMALE    = 0, ///< This bit set means a female, otherwise male
 
	ETHNICITY_BLACK  = 1, ///< This bit set means black, otherwise white
 

	
 
	GE_WM = 0,                                         ///< A male of Caucasian origin (white)
src/player_gui.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file player_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "viewport.h"
 
#include "player.h"
 
#include "command_func.h"
 
@@ -23,12 +22,14 @@
 
#include "newgrf.h"
 
#include "network/network_data.h"
 
#include "network/network_client.h"
 
#include "network/network_gui.h"
 
#include "player_face.h"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
static void DoShowPlayerFinances(PlayerID player, bool show_small, bool show_stickied);
 
static void DoSelectPlayerFace(PlayerID player, bool show_big);
 

	
 
static void DrawPlayerEconomyStats(const Player *p, byte mode)
 
{
src/players.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file players.cpp
 
 */
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "engine.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "map.h"
 
#include "player.h"
 
#include "town.h"
 
@@ -27,12 +26,13 @@
 
#include "group.h"
 
#include "settings.h"
 
#include "window_func.h"
 
#include "tile_map.h"
 
#include "strings_func.h"
 
#include "gfx_func.h"
 
#include "functions.h"
 

	
 
/**
 
 * Sets the local player and updates the patch settings that are set on a
 
 * per-company (player) basis to reflect the core's state in the GUI.
 
 * @param new_player the new player
 
 * @pre IsValidPlayer(new_player) || new_player == PLAYER_SPECTATOR || new_player == OWNER_NONE
src/rail_gui.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file rail_gui.cpp File for dealing with rail construction user interface */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "tile_cmd.h"
 
#include "landscape.h"
 
#include "date.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
@@ -23,12 +22,14 @@
 
#include "debug.h"
 
#include "variables.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_station.h"
 
#include "train.h"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
#include "bridge_map.h"
 
#include "rail_map.h"
 
#include "road_map.h"
 
#include "station_map.h"
 
#include "tunnel_map.h"
src/road.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "rail_map.h"
 
#include "road_map.h"
 
#include "road_internal.h"
 
#include "water_map.h"
 

	
 
bool IsPossibleCrossing(const TileIndex tile, Axis ax)
src/road_gui.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file road_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "station_gui.h"
 
#include "viewport.h"
 
#include "sound.h"
 
@@ -17,12 +16,14 @@
 
#include "variables.h"
 
#include "road_cmd.h"
 
#include "road_map.h"
 
#include "station_map.h"
 
//needed for catchments
 
#include "station.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 

	
 
static void ShowRVStationPicker(RoadStop::Type rs);
 
static void ShowRoadDepotPicker();
 

	
 
static bool _remove_button_clicked;
src/roadveh_cmd.cpp
Show inline comments
 
@@ -34,12 +34,14 @@
 
#include "newgrf_sound.h"
 
#include "yapf/yapf.h"
 
#include "date.h"
 
#include "cargotype.h"
 
#include "strings_func.h"
 
#include "tunnelbridge_map.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 

	
 
static const uint16 _roadveh_images[63] = {
 
	0xCD4, 0xCDC, 0xCE4, 0xCEC, 0xCF4, 0xCFC, 0xD0C, 0xD14,
 
	0xD24, 0xD1C, 0xD2C, 0xD04, 0xD1C, 0xD24, 0xD6C, 0xD74,
 
	0xD7C, 0xC14, 0xC1C, 0xC24, 0xC2C, 0xC34, 0xC3C, 0xC4C,
src/roadveh_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file roadveh_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "roadveh.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "vehicle.h"
src/saveload.cpp
Show inline comments
 
@@ -13,13 +13,12 @@
 
 * <li>repeat this until everything is done, and flush any remaining output to file
 
 * </ol>
 
 */
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "vehicle.h"
 
#include "station.h"
 
#include "thread.h"
 
#include "town.h"
 
#include "player.h"
 
#include "saveload.h"
 
@@ -27,12 +26,13 @@
 
#include "variables.h"
 
#include "table/strings.h"
 
#include "window_func.h"
 
#include "strings_func.h"
 
#include "gfx_func.h"
 
#include "core/alloc_func.hpp"
 
#include "functions.h"
 
#include <list>
 

	
 
extern const uint16 SAVEGAME_VERSION = 83;
 
uint16 _sl_version;       ///< the major savegame version identifier
 
byte   _sl_minor_version; ///< the minor savegame version, DO NOT USE!
 

	
src/screenshot.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/strings.h"
 
#include "fileio.h"
 
#include "viewport.h"
 
#include "player.h"
 
#include "screenshot.h"
 
#include "variables.h"
src/settings.cpp
Show inline comments
 
@@ -19,13 +19,12 @@
 
 * @see SaveLoad
 
 */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "currency.h"
 
#include "functions.h"
 
#include "screenshot.h"
 
#include "sound.h"
 
#include "string.h"
 
#include "variables.h"
 
#include "network/network.h"
 
#include "settings.h"
src/settings.h
Show inline comments
 
@@ -88,7 +88,12 @@ extern Patches _patches_newgame;
 
bool IConsoleSetPatchSetting(const char *name, int32 value);
 
void IConsoleGetPatchSetting(const char *name);
 
void IConsoleListPatches();
 
const SettingDesc *GetPatchFromName(const char *name, uint *i);
 
bool SetPatchValue(uint index, const Patches *object, int32 value);
 

	
 
void LoadFromConfig();
 
void SaveToConfig();
 
void CheckConfig();
 
void UpdatePatches();
 

	
 
#endif /* SETTINGS_H */
src/settings_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file settings_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "currency.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
@@ -21,12 +20,14 @@
 
#include "variables.h"
 
#include "settings.h"
 
#include "vehicle.h"
 
#include "date.h"
 
#include "newgrf_townname.h"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
static uint32 _difficulty_click_a;
 
static uint32 _difficulty_click_b;
 
static byte _difficulty_timeout;
 

	
 
static const StringID _units_dropdown[] = {
src/ship_cmd.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file ship_cmd.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "ship.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "tile_cmd.h"
 
#include "landscape.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "timetable.h"
 
#include "command_func.h"
 
@@ -31,12 +30,14 @@
 
#include "newgrf_text.h"
 
#include "newgrf_sound.h"
 
#include "date.h"
 
#include "spritecache.h"
 
#include "misc/autoptr.hpp"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D};
 

	
 
static const TrackBits _ship_sometracks[4] = {
 
	TRACK_BIT_X | TRACK_BIT_LOWER | TRACK_BIT_LEFT,  // 0x19, // DIAGDIR_NE
 
	TRACK_BIT_Y | TRACK_BIT_UPPER | TRACK_BIT_LEFT,  // 0x16, // DIAGDIR_SE
src/ship_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file ship_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "ship.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "vehicle.h"
src/signs.cpp
Show inline comments
 
@@ -2,24 +2,25 @@
 

	
 
/** @file signs.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "player.h"
 
#include "signs.h"
 
#include "saveload.h"
 
#include "command_func.h"
 
#include "variables.h"
 
#include "string.h"
 
#include "misc/autoptr.hpp"
 
#include "strings_func.h"
 
#include "viewport.h"
 
#include "zoom_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
SignID _new_sign_id;
 
uint _total_signs;
 

	
 
/* Initialize the sign-pool */
 
DEFINE_OLD_POOL_GENERIC(Sign, Sign)
src/signs_gui.cpp
Show inline comments
 
@@ -3,23 +3,23 @@
 
/** @file signs_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "textbuf_gui.h"
 
#include "window_gui.h"
 
#include "player.h"
 
#include "signs.h"
 
#include "debug.h"
 
#include "variables.h"
 
#include "command_func.h"
 
#include "strings_func.h"
 
#include "core/alloc_func.hpp"
 
#include "window_func.h"
 

	
 
static const Sign **_sign_sort;
 
static uint _num_sign_sort;
 

	
 
static char _bufcache[64];
 
static const Sign *_last_sign;
src/smallmap_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file smallmap_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "bridge_map.h"
 
#include "clear_map.h"
 
#include "industry_map.h"
 
#include "industry.h"
 
#include "station_map.h"
 
#include "table/strings.h"
src/sound.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file sound.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "map.h"
 
#include "mixer.h"
 
#include "sound.h"
 
#include "vehicle.h"
 
#include "viewport.h"
src/sound/win32_s.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "../stdafx.h"
 
#include "../openttd.h"
 
#include "../driver.h"
 
#include "../functions.h"
 
#include "../mixer.h"
 
#include "../core/alloc_func.hpp"
 
#include "win32_s.h"
 
#include <windows.h>
 
#include <mmsystem.h>
 

	
src/spritecache.cpp
Show inline comments
 
@@ -4,18 +4,18 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "variables.h"
 
#include "string.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "spritecache.h"
 
#include "table/sprites.h"
 
#include "fileio.h"
 
#include "spriteloader/grf.hpp"
 
#include "core/alloc_func.hpp"
 
#include "core/math_func.hpp"
 
#ifdef WITH_PNG
 
#include "spriteloader/png.hpp"
 
#endif /* WITH_PNG */
 
#include "blitter/factory.hpp"
 

	
 
/* Default of 4MB spritecache */
src/station.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file station.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "bridge_map.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "station_map.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "station.h"
 
#include "viewport.h"
 
@@ -29,12 +28,14 @@
 
#include "yapf/yapf.h"
 
#include "date.h"
 
#include "cargotype.h"
 
#include "roadveh.h"
 
#include "station_gui.h"
 
#include "zoom_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
Station::Station(TileIndex tile)
 
{
 
	DEBUG(station, cDebugCtorLevel, "I+%3d", index);
 

	
 
	xy = tile;
src/station_cmd.cpp
Show inline comments
 
@@ -40,12 +40,14 @@
 
#include "cargotype.h"
 
#include "autoslope.h"
 
#include "transparency.h"
 
#include "water.h"
 
#include "station_gui.h"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
DEFINE_OLD_POOL_GENERIC(Station, Station)
 
DEFINE_OLD_POOL_GENERIC(RoadStop, RoadStop)
 

	
 

	
 
/**
src/station_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file station_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "station.h"
 
#include "player.h"
 
@@ -22,12 +21,13 @@
 
#include "table/sprites.h"
 
#include "cargotype.h"
 
#include "station_gui.h"
 
#include "station.h"
 
#include "strings_func.h"
 
#include "core/alloc_func.hpp"
 
#include "window_func.h"
 

	
 
typedef int CDECL StationSortListingTypeFunction(const void*, const void*);
 

	
 
static StationSortListingTypeFunction StationNameSorter;
 
static StationSortListingTypeFunction StationTypeSorter;
 
static StationSortListingTypeFunction StationWaitingSorter;
src/string.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file string.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "table/control_codes.h"
 
#include "debug.h"
 
#include "core/alloc_func.hpp"
 

	
 
#include <stdarg.h>
src/strings.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file strings.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "currency.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "table/strings.h"
 
#include "namegen.h"
 
#include "station.h"
 
#include "town.h"
 
#include "vehicle.h"
 
@@ -31,12 +30,13 @@
 
#include "vehicle.h"
 
#include "newgrf_engine.h"
 
#include "spritecache.h"
 
#include "fontcache.h"
 
#include "gui.h"
 
#include "strings_func.h"
 
#include "functions.h"
 
#if defined(TTD_BIG_ENDIAN)
 
#include "core/endian_func.hpp"
 
#endif
 

	
 
/* for opendir/readdir/closedir */
 
# include "fios.h"
src/subsidy_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file subsidy_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "station.h"
 
#include "industry.h"
 
#include "town.h"
 
#include "player.h"
 
#include "economy_func.h"
 
#include "variables.h"
src/terraform_gui.cpp
Show inline comments
 
@@ -5,22 +5,22 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "bridge_map.h"
 
#include "clear_map.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "player.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "sound.h"
 
#include "command_func.h"
 
#include "vehicle.h"
 
#include "signs.h"
 
#include "variables.h"
 
#include "functions.h"
 

	
 
void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	if (success) {
 
		SndPlayTileFx(SND_1F_SPLAT, tile);
 
	} else {
src/texteff.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file texteff.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "tile_cmd.h"
 
#include "landscape.h"
 
#include "viewport.h"
 
#include "saveload.h"
 
#include "console.h"
 
#include "string.h"
 
@@ -18,12 +17,13 @@
 
#include "date.h"
 
#include "texteff.hpp"
 
#include "video/video_driver.hpp"
 
#include "transparency.h"
 
#include "strings_func.h"
 
#include "core/alloc_func.hpp"
 
#include "functions.h"
 

	
 
enum {
 
	MAX_TEXTMESSAGE_LENGTH = 200,
 
	INIT_NUM_TEXT_MESSAGES =  20,
 
	MAX_CHAT_MESSAGES      =  10,
 
};
src/tgp.cpp
Show inline comments
 
@@ -3,22 +3,22 @@
 
/** @file tgp.cpp OTTD Perlin Noise Landscape Generator, aka TerraGenesis Perlin */
 

	
 
#include "stdafx.h"
 
#include <math.h>
 
#include "openttd.h"
 
#include "clear_map.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "table/strings.h"
 
#include "clear_map.h"
 
#include "variables.h"
 
#include "void_map.h"
 
#include "tgp.h"
 
#include "console.h"
 
#include "genworld.h"
 
#include "core/alloc_func.hpp"
 
#include "core/random_func.hpp"
 

	
 
/*
 
 *
 
 * Quickie guide to Perlin Noise
 
 * Perlin noise is a predictable pseudo random number sequence. By generating
 
 * it in 2 dimensions, it becomes a useful random map, that for a given seed
src/timetable_cmd.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file timetable_cmd.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "variables.h"
 
#include "table/strings.h"
 
#include "command_func.h"
 
#include "date.h"
 
#include "player.h"
 
#include "vehicle.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 

	
 
static void ChangeTimetable(Vehicle *v, VehicleOrderID order_number, uint16 time, bool is_journey)
 
{
 
	Order *order = GetVehicleOrder(v, order_number);
 

	
src/timetable_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file timetable_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "variables.h"
 
#include "table/strings.h"
 
#include "command_func.h"
 
#include "date.h"
 
#include "engine.h"
 
#include "gui.h"
src/town.h
Show inline comments
 
@@ -3,14 +3,14 @@
 
/** @file town.h */
 

	
 
#ifndef TOWN_H
 
#define TOWN_H
 

	
 
#include "oldpool.h"
 
#include "player.h"
 
#include "functions.h"
 
#include "core/random_func.hpp"
 
#include "cargo_type.h"
 

	
 
enum {
 
	HOUSE_NO_CLASS   = 0,
 
	NEW_HOUSE_OFFSET = 110,
 
	HOUSE_MAX        = 512,
 
	INVALID_TOWN     = 0xFFFF,
 
@@ -347,8 +347,14 @@ VARDEF Town *_cleared_town;
 
VARDEF int _cleared_town_rating;
 

	
 
uint OriginalTileRandomiser(uint x, uint y);
 
void ResetHouses();
 

	
 
void ClearTownHouse(Town *t, TileIndex tile);
 
void AfterLoadTown();
 
void UpdateTownMaxPass(Town *t);
 
bool CheckIfAuthorityAllows(TileIndex tile);
 
Town *ClosestTownFromTile(TileIndex tile, uint threshold);
 
void ChangeTownRating(Town *t, int add, int max);
 
uint GetTownRadiusGroup(const Town* t, TileIndex tile);
 

	
 
#endif /* TOWN_H */
src/town_cmd.cpp
Show inline comments
 
@@ -41,12 +41,13 @@
 
#include "autoslope.h"
 
#include "waypoint.h"
 
#include "transparency.h"
 
#include "tunnelbridge_map.h"
 
#include "strings_func.h"
 
#include "string.h"
 
#include "window_func.h"
 

	
 

	
 
/* Initialize the town-pool */
 
DEFINE_OLD_POOL_GENERIC(Town, Town)
 

	
 
Town::Town(TileIndex tile)
src/town_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file town_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "town.h"
 
#include "viewport.h"
 
#include "gui.h"
 
#include "window_gui.h"
src/town_map.h
Show inline comments
 
@@ -5,12 +5,13 @@
 
#ifndef TOWN_MAP_H
 
#define TOWN_MAP_H
 

	
 
#include "town.h"
 
#include "date.h"
 
#include "tile_map.h"
 
#include "functions.h"
 

	
 
/**
 
 * Get the index of which town this house/street is attached to.
 
 * @param t the tile
 
 * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_ROAD)
 
 * @return TownID
src/train_cmd.cpp
Show inline comments
 
@@ -39,12 +39,14 @@
 
#include "date.h"
 
#include "cargotype.h"
 
#include "group.h"
 
#include "table/sprites.h"
 
#include "tunnelbridge_map.h"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 

	
 
static bool TrainCheckIfLineEnds(Vehicle *v);
 
static void TrainController(Vehicle *v, bool update_image);
 

	
 
static const byte _vehicle_initial_x_fract[4] = {10, 8, 4,  8};
src/train_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file train_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "vehicle.h"
 
#include "viewport.h"
src/transparency_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "transparency.h"
src/tree_cmd.cpp
Show inline comments
 
@@ -18,12 +18,14 @@
 
#include "economy_func.h"
 
#include "town.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "genworld.h"
 
#include "transparency.h"
 
#include "functions.h"
 
#include "player.h"
 

	
 
/**
 
 * List of tree placer algorithm.
 
 *
 
 * This enumeration defines all possible tree placer algorithm in the game.
 
 */
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -32,12 +32,13 @@
 
#include "newgrf_sound.h"
 
#include "autoslope.h"
 
#include "transparency.h"
 
#include "tunnelbridge_map.h"
 
#include "table/bridge_land.h"
 
#include "strings_func.h"
 
#include "functions.h"
 

	
 

	
 
const Bridge orig_bridge[] = {
 
/*
 
	     year of availablity
 
	     |  minimum length
src/unix.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file unix.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "table/strings.h"
 
#include "variables.h"
 
#include "textbuf_gui.h"
 
#include "functions.h"
 
#include "core/random_func.hpp"
 

	
 
#include <dirent.h>
 
#include <unistd.h>
 
#include <sys/stat.h>
 
#include <time.h>
 
#include <signal.h>
src/unmovable_cmd.cpp
Show inline comments
 
@@ -21,12 +21,14 @@
 
#include "variables.h"
 
#include "table/unmovable_land.h"
 
#include "genworld.h"
 
#include "bridge.h"
 
#include "autoslope.h"
 
#include "transparency.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
/** Destroy a HQ.
 
 * During normal gameplay you can only implicitely destroy a HQ when you are
 
 * rebuilding it. Otherwise, only water can destroy it.
 
 * @param pid Player requesting the destruction of his HQ
 
 * @param flags docommand flags of calling function
src/vehicle.cpp
Show inline comments
 
@@ -39,12 +39,14 @@
 
#include "newgrf_engine.h"
 
#include "newgrf_sound.h"
 
#include "group.h"
 
#include "order.h"
 
#include "strings_func.h"
 
#include "zoom_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
#define INVALID_COORD (0x7fffffff)
 
#define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))
 

	
 

	
 
/* Tables used in vehicle.h to find the right command for a certain vehicle type */
src/vehicle.h
Show inline comments
 
@@ -809,12 +809,14 @@ static inline uint32 GetCmdSendToDepot(V
 

	
 
static inline uint32 GetCmdSendToDepot(const Vehicle *v)
 
{
 
	return GetCmdSendToDepot(v->type);
 
}
 

	
 
bool EnsureNoVehicleOnGround(TileIndex tile);
 

	
 
/* This one is not used anymore. */
 
VARDEF VehicleID _vehicle_id_ctr_day;
 
VARDEF Vehicle *_place_clicked_vehicle;
 

	
 

	
 
#endif /* VEHICLE_H */
src/vehicle_gui.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file vehicle_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "player.h"
 
#include "station.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "vehicle.h"
 
#include "engine.h"
 
@@ -29,12 +28,14 @@
 
#include "roadveh.h"
 
#include "depot.h"
 
#include "cargotype.h"
 
#include "group.h"
 
#include "group_gui.h"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
struct Sorting {
 
	Listing aircraft;
 
	Listing roadveh;
 
	Listing ship;
 
	Listing train;
src/video/cocoa/wnd_quartz.mm
Show inline comments
 
@@ -39,13 +39,12 @@
 

	
 
#include "../../stdafx.h"
 
#include "../../debug.h"
 
#include "../../variables.h"
 
#include "../../core/geometry_type.hpp"
 
#include "cocoa_v.h"
 
#include "../../functions.h"
 
#include "../../core/math_func.hpp"
 
#include "../../gfx_func.h"
 

	
 
#undef Rect
 

	
 

	
src/video/cocoa/wnd_quickdraw.mm
Show inline comments
 
@@ -39,13 +39,12 @@
 

	
 
#include "../../stdafx.h"
 
#include "../../debug.h"
 
#include "../../variables.h"
 
#include "../../core/geometry_type.hpp"
 
#include "cocoa_v.h"
 
#include "../../functions.h"
 
#include "../../core/math_func.hpp"
 
#include "../../gfx_func.h"
 

	
 
#undef Rect
 

	
 

	
src/video/dedicated_v.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
#include "../stdafx.h"
 

	
 
#ifdef ENABLE_NETWORK
 

	
 
#include "../openttd.h"
 
#include "../debug.h"
 
#include "../functions.h"
 
#include "../gfx_func.h"
 
#include "../network/network.h"
 
#include "../console.h"
 
#include "../variables.h"
 
#include "../genworld.h"
 
#include "../fileio.h"
src/video/sdl_v.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
#include "../stdafx.h"
 

	
 
#ifdef WITH_SDL
 

	
 
#include "../openttd.h"
 
#include "../debug.h"
 
#include "../functions.h"
 
#include "../gfx_func.h"
 
#include "../sdl.h"
 
#include "../variables.h"
 
#include "../blitter/factory.hpp"
 
#include "../network/network.h"
 
#include "sdl_v.h"
src/video/win32_v.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "../stdafx.h"
 
#include "../openttd.h"
 
#include "../functions.h"
 
#include "../gfx_func.h"
 
#include "../variables.h"
 
#include "../win32.h"
 
#include "../blitter/factory.hpp"
 
#include "../network/network.h"
 
#include "win32_v.h"
src/water_cmd.cpp
Show inline comments
 
@@ -28,12 +28,14 @@
 
#include "industry_map.h"
 
#include "newgrf.h"
 
#include "newgrf_canal.h"
 
#include "misc/autoptr.hpp"
 
#include "transparency.h"
 
#include "strings_func.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
/** Array for the shore sprites */
 
static const SpriteID _water_shore_sprites[] = {
 
	0,
 
	SPR_SHORE_TILEH_1,  // SLOPE_W
 
	SPR_SHORE_TILEH_2,  // SLOPE_S
src/waypoint.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file waypoint.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 

	
 
#include "command_func.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "map.h"
 
#include "order.h"
 
#include "rail_map.h"
 
#include "bridge_map.h"
 
#include "saveload.h"
 
@@ -23,12 +22,14 @@
 
#include "date.h"
 
#include "newgrf.h"
 
#include "string.h"
 
#include "misc/autoptr.hpp"
 
#include "strings_func.h"
 
#include "viewport.h"
 
#include "functions.h"
 
#include "window_func.h"
 

	
 
enum {
 
	MAX_WAYPOINTS_PER_TOWN = 64,
 
};
 

	
 
DEFINE_OLD_POOL_GENERIC(Waypoint, Waypoint)
src/widget.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file widget.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "player.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "viewport.h"
 
#include "window_gui.h"
 
#include "window_func.h"
 

	
 

	
 
static Point HandleScrollbarHittest(const Scrollbar *sb, int top, int bottom)
 
{
 
	Point pt;
 
	int height, count, pos, cap;
 

	
src/win32.cpp
Show inline comments
 
@@ -2,13 +2,12 @@
 

	
 
/** @file win32.cpp Implementation of MS Windows system calls */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "saveload.h"
 
#include "string.h"
 
#include "gfx_func.h"
 
#include "textbuf_gui.h"
 
#include "fileio.h"
 
#include <windows.h>
 
@@ -19,12 +18,14 @@
 
#include <shlobj.h> // SHGetFolderPath
 
#include "variables.h"
 
#include "win32.h"
 
#include "fios.h" // opendir/readdir/closedir
 
#include "fileio.h"
 
#include "core/alloc_func.hpp"
 
#include "functions.h"
 
#include "core/random_func.hpp"
 
#include <ctype.h>
 
#include <tchar.h>
 
#include <errno.h>
 
#include <sys/types.h>
 
#include <sys/stat.h>
 
#include <shlobj.h>
src/window.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
/** @file window.cpp windowing system, widgets and events */
 

	
 
#include "stdafx.h"
 
#include <stdarg.h>
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "player.h"
 
#include "viewport.h"
 
#include "console.h"
 
#include "variables.h"
 
#include "table/sprites.h"
src/window_func.h
Show inline comments
 
@@ -36,7 +36,14 @@ void RelocateAllWindows(int neww, int ne
 
void DeleteNonVitalWindows();
 
void DeleteAllNonVitalWindows();
 
void HideVitalWindows();
 
void ShowVitalWindows();
 
Window **FindWindowZPosition(const Window *w);
 

	
 
void InvalidateWindow(WindowClass cls, WindowNumber number);
 
void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_index);
 
void InvalidateWindowClasses(WindowClass cls);
 
void InvalidateWindowClassesData(WindowClass cls);
 
void DeleteWindowById(WindowClass cls, WindowNumber number);
 
void DeleteWindowByClass(WindowClass cls);
 

	
 
#endif /* WINDOW_FUNC_H */
0 comments (0 inline, 0 general)