Changeset - r679:3a7b08cc8504
[Not reviewed]
master
0 51 2
tron - 19 years ago 2004-12-15 22:18:54
tron@openttd.org
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
53 files changed with 81 insertions and 23 deletions:
0 comments (0 inline, 0 general)
Makefile
Show inline comments
 
@@ -575,6 +575,7 @@ C_SOURCES += industry_gui.c
 
C_SOURCES += intro_gui.c
 
C_SOURCES += landscape.c
 
C_SOURCES += main_gui.c
 
C_SOURCES += map.c
 
C_SOURCES += md5.c
 
C_SOURCES += minilzo.c
 
C_SOURCES += misc.c
ai.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 
#include "player.h"
 
#include "vehicle.h"
 
#include "engine.h"
ai_build.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 
#include "command.h"
 
#include "ai.h"
 
#include "engine.h"
ai_new.c
Show inline comments
 
@@ -16,6 +16,7 @@
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "command.h"
 
#include "ai.h"
 
#include "town.h"
ai_pathfinder.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 
#include "command.h"
 
#include "ai.h"
 

	
ai_shared.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 
#include "ai.h"
 
#include "vehicle.h"
 

	
aircraft_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "engine.h"
 
#include "command.h"
aircraft_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "vehicle.h"
airport.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 
#include "airport.h"
 

	
 
AirportFTAClass *CountryAirport;
airport_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "viewport.h"
bridge_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "viewport.h"
clear_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "viewport.h"
 
#include "command.h"
 

	
command.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "command.h"
 
#include "player.h"
disaster_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "command.h"
 
#include "news.h"
dock_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "station.h"
 
#include "gui.h"
economy.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "news.h"
 
#include "player.h"
 
#include "station.h"
industry_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "viewport.h"
 
#include "command.h"
 
#include "industry.h"
industry_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
//#include "gui.h"
 
#include "window.h"
 
#include "gfx.h"
landscape.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 
#include <stdarg.h>
 
#include "gfx.h"
 
#include "viewport.h"
 
#include "command.h"
 
#include "vehicle.h"
 

	
 
byte _map_type_and_height[TILES_X * TILES_Y];
 
byte _map5[TILES_X * TILES_Y];
 
byte _map3_lo[TILES_X * TILES_Y];
 
byte _map3_hi[TILES_X * TILES_Y];
 
byte _map_owner[TILES_X * TILES_Y];
 
byte _map2[TILES_X * TILES_Y];
 
byte _map_extra_bits[TILES_X * TILES_Y/4];
 

	
 
extern const TileTypeProcs
 
	_tile_type_clear_procs,
 
	_tile_type_rail_procs,
macros.h
Show inline comments
 
@@ -66,8 +66,6 @@ static inline int64 BIGMULS(int32 a, int
 
//#define IS_INSIDE_1D(x, base, size) ((x) >= (base) && (x) < (base) + (size))
 
#define IS_INSIDE_1D(x, base, size) ( (uint)((x) - (base)) < ((uint)(size)) )
 

	
 
#define TILE_X_BITS 8
 
#define TILE_Y_BITS 8
 
#define LANDSCAPE_SIZE_FACTOR 1
 

	
 
#define TILE_FROM_XY(x,y) (int)((((y) >> 4) << TILE_X_BITS) + ((x) >> 4))
 
@@ -82,12 +80,6 @@ enum {
 
};
 
#define CORRECT_Z(tileh) (CORRECT_Z_BITS & (1 << tileh))
 

	
 
#define TILES_X (1 << TILE_X_BITS)
 
#define TILES_Y (1 << TILE_Y_BITS)
 

	
 
#define TILE_X_MAX (TILES_X-1)
 
#define TILE_Y_MAX (TILES_Y-1)
 

	
 
#define TILE_ASSERT(x) assert( TILE_MASK(x) == (x) );
 

	
 
extern uint SafeTileAdd(uint x, int add, const char *exp, const char *file, int line);
main_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "viewport.h"
map.c
Show inline comments
 
new file 100644
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 

	
 
byte _map_type_and_height[TILES_X * TILES_Y];
 
byte _map5[TILES_X * TILES_Y];
 
byte _map3_lo[TILES_X * TILES_Y];
 
byte _map3_hi[TILES_X * TILES_Y];
 
byte _map_owner[TILES_X * TILES_Y];
 
byte _map2[TILES_X * TILES_Y];
 
byte _map_extra_bits[TILES_X * TILES_Y / 4];
map.h
Show inline comments
 
new file 100644
 
#ifndef MAP_H
 
#define MAP_H
 

	
 
#define TILE_X_BITS 8
 
#define TILE_Y_BITS 8
 

	
 
#define TILES_X (1 << TILE_X_BITS)
 
#define TILES_Y (1 << TILE_Y_BITS)
 

	
 
#define TILE_X_MAX (TILES_X - 1)
 
#define TILE_Y_MAX (TILES_Y - 1)
 

	
 
extern byte _map_type_and_height[TILES_X * TILES_Y];
 
extern byte _map5[TILES_X * TILES_Y];
 
extern byte _map3_lo[TILES_X * TILES_Y];
 
extern byte _map3_hi[TILES_X * TILES_Y];
 
extern byte _map_owner[TILES_X * TILES_Y];
 
extern byte _map2[TILES_X * TILES_Y];
 
extern byte _map_extra_bits[TILES_X * TILES_Y / 4];
 

	
 
#endif
misc.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "gfx.h"
 
#include "assert.h"
misc_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "viewport.h"
network.c
Show inline comments
 
#include "stdafx.h"
 
#include "map.h"
 
#include "network_data.h"
 

	
 
#if defined(WITH_REV)
oldloader.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "town.h"
 
#include "industry.h"
 
#include "station.h"
order_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "gfx.h"
pathfind.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 
#include "pathfind.h"
 

	
 
// remember which tiles we have already visited so we don't visit them again.
players.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "player.h"
 
#include "town.h"
 
#include "vehicle.h"
rail_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 
#include "command.h"
rail_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "viewport.h"
road_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 
#include "command.h"
road_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "viewport.h"
roadveh_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "engine.h"
 
#include "command.h"
roadveh_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "gfx.h"
ship_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "command.h"
 
#include "pathfind.h"
ship_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "gfx.h"
smallmap_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "window.h"
 
#include "gfx.h"
sound.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 
#include "sound.h"
 
#include "vehicle.h"
 
#include "window.h"
station_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "station.h"
 
#include "gfx.h"
 
#include "window.h"
town_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "viewport.h"
 
#include "town.h"
 
#include "command.h"
train_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "command.h"
 
#include "pathfind.h"
train_gui.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gui.h"
 
#include "gfx.h"
tree_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "viewport.h"
 
#include "command.h"
 
#include "town.h"
ttd.c
Show inline comments
 
#include "stdafx.h"
 
#include "table/strings.h"
 
#include "map.h"
 

	
 
#define VARDEF
 
#include "ttd.h"
tunnelbridge_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 
#include "command.h"
unmovable_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "command.h"
 
#include "viewport.h"
 
#include "player.h"
variables.h
Show inline comments
 
@@ -384,13 +384,6 @@ static inline uint32 GetDParam(uint n)
 

	
 
/* landscape.c */
 
extern const byte _tileh_to_sprite[32];
 
extern byte _map_type_and_height[TILES_X * TILES_Y];
 
extern byte _map5[TILES_X * TILES_Y];
 
extern byte _map3_lo[TILES_X * TILES_Y];
 
extern byte _map3_hi[TILES_X * TILES_Y];
 
extern byte _map_owner[TILES_X * TILES_Y];
 
extern byte _map2[TILES_X * TILES_Y];
 
extern byte _map_extra_bits[TILES_X * TILES_Y/4];
 

	
 
static const byte _inclined_tileh[] = {
 
	3,9,3,6,12,6,12,9,
vehicle.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "gfx.h"
 
//#include "station.h"
viewport.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "viewport.h"
 
#include "window.h"
 
#include "vehicle.h"
water_cmd.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 
#include "command.h"
window.c
Show inline comments
 
#include "stdafx.h"
 
#include "ttd.h"
 
#include "map.h"
 
#include "window.h"
 
#include "gfx.h"
 
#include "viewport.h"
0 comments (0 inline, 0 general)