(svn r1117) Move map arrays and some related macros into their own files map.c and map.h

This commit is contained in:
tron 2004-12-15 22:18:54 +00:00
parent 736718ef53
commit 765ecfed84
53 changed files with 81 additions and 23 deletions

View File

@ -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

1
ai.c
View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
#include "player.h"
#include "vehicle.h"
#include "engine.h"

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
#include "command.h"
#include "ai.h"
#include "engine.h"

View File

@ -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"

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
#include "command.h"
#include "ai.h"

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
#include "ai.h"
#include "vehicle.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "engine.h"
#include "command.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "vehicle.h"

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
#include "airport.h"
AirportFTAClass *CountryAirport;

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "viewport.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "viewport.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "viewport.h"
#include "command.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "gui.h"
#include "command.h"
#include "player.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "command.h"
#include "news.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "station.h"
#include "gui.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "news.h"
#include "player.h"
#include "station.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "viewport.h"
#include "command.h"
#include "industry.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
//#include "gui.h"
#include "window.h"
#include "gfx.h"

View File

@ -1,19 +1,12 @@
#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,

View File

@ -66,8 +66,6 @@ static inline int64 BIGMULS(int32 a, int32 b) {
//#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);

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "viewport.h"

11
map.c Normal file
View File

@ -0,0 +1,11 @@
#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];

21
map.h Normal file
View File

@ -0,0 +1,21 @@
#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

1
misc.c
View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "gfx.h"
#include "assert.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "viewport.h"

View File

@ -1,4 +1,5 @@
#include "stdafx.h"
#include "map.h"
#include "network_data.h"
#if defined(WITH_REV)

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "town.h"
#include "industry.h"
#include "station.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "gfx.h"

View File

@ -1,5 +1,6 @@
#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.

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "player.h"
#include "town.h"
#include "vehicle.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "viewport.h"
#include "command.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "viewport.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "viewport.h"
#include "command.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "viewport.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "engine.h"
#include "command.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "gfx.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "command.h"
#include "pathfind.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "gfx.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "gui.h"
#include "window.h"
#include "gfx.h"

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
#include "sound.h"
#include "vehicle.h"
#include "window.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "station.h"
#include "gfx.h"
#include "window.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "viewport.h"
#include "town.h"
#include "command.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "command.h"
#include "pathfind.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "window.h"
#include "gui.h"
#include "gfx.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "viewport.h"
#include "command.h"
#include "town.h"

1
ttd.c
View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "table/strings.h"
#include "map.h"
#define VARDEF
#include "ttd.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "viewport.h"
#include "command.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "command.h"
#include "viewport.h"
#include "player.h"

View File

@ -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,

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "gfx.h"
//#include "station.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "viewport.h"
#include "window.h"
#include "vehicle.h"

View File

@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
#include "vehicle.h"
#include "viewport.h"
#include "command.h"

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
#include "window.h"
#include "gfx.h"
#include "viewport.h"