map.c
author tron
Wed, 05 Jan 2005 13:32:03 +0000
changeset 900 feed1801fd35
parent 863 8d09f9331a80
child 909 81bc9ef93f50
permissions -rw-r--r--
(svn r1386) Move TileIndexDiff to map.h
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
679
e959706a3e4d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
diff changeset
     1
#include "stdafx.h"
e959706a3e4d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
diff changeset
     2
#include "ttd.h"
e959706a3e4d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
diff changeset
     3
#include "map.h"
e959706a3e4d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
diff changeset
     4
689
1412bc834a8d (svn r1130) Add helper functions to query map size
tron
parents: 679
diff changeset
     5
uint _map_log_x = TILE_X_BITS;
1412bc834a8d (svn r1130) Add helper functions to query map size
tron
parents: 679
diff changeset
     6
uint _map_log_y = TILE_Y_BITS;
1412bc834a8d (svn r1130) Add helper functions to query map size
tron
parents: 679
diff changeset
     7
863
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 817
diff changeset
     8
#define MAP_SIZE ((1 << TILE_X_BITS) * (1 << TILE_Y_BITS))
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 817
diff changeset
     9
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 817
diff changeset
    10
byte   _map_type_and_height [MAP_SIZE];
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 817
diff changeset
    11
byte   _map5                [MAP_SIZE];
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 817
diff changeset
    12
byte   _map3_lo             [MAP_SIZE];
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 817
diff changeset
    13
byte   _map3_hi             [MAP_SIZE];
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 817
diff changeset
    14
byte   _map_owner           [MAP_SIZE];
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 817
diff changeset
    15
uint16 _map2                [MAP_SIZE];
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 817
diff changeset
    16
byte   _map_extra_bits      [MAP_SIZE / 4];
900
feed1801fd35 (svn r1386) Move TileIndexDiff to map.h
tron
parents: 863
diff changeset
    17
feed1801fd35 (svn r1386) Move TileIndexDiff to map.h
tron
parents: 863
diff changeset
    18
const TileIndexDiff _tileoffs_by_dir[4] = {
feed1801fd35 (svn r1386) Move TileIndexDiff to map.h
tron
parents: 863
diff changeset
    19
	TILE_XY(-1, 0),
feed1801fd35 (svn r1386) Move TileIndexDiff to map.h
tron
parents: 863
diff changeset
    20
	TILE_XY(0, 1),
feed1801fd35 (svn r1386) Move TileIndexDiff to map.h
tron
parents: 863
diff changeset
    21
	TILE_XY(1, 0),
feed1801fd35 (svn r1386) Move TileIndexDiff to map.h
tron
parents: 863
diff changeset
    22
	TILE_XY(0, -1),
feed1801fd35 (svn r1386) Move TileIndexDiff to map.h
tron
parents: 863
diff changeset
    23
};