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

pull/155/head
tron 20 years ago
parent 664fc4786d
commit a148ff4e0d

@ -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,5 +1,6 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
#include "player.h"
#include "vehicle.h"
#include "engine.h"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -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,5 +1,6 @@
#include "stdafx.h"
#include "table/strings.h"
#include "map.h"
#define VARDEF
#include "ttd.h"

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

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

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

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

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

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

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

Loading…
Cancel
Save