author | tron |
Wed, 05 Jan 2005 13:32:03 +0000 | |
changeset 900 | feed1801fd35 |
parent 863 | 8d09f9331a80 |
child 909 | 81bc9ef93f50 |
permissions | -rw-r--r-- |
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 |
#ifndef 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
|
2 |
#define 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
|
3 |
|
e959706a3e4d
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
diff
changeset
|
4 |
#define TILE_X_BITS 8 |
e959706a3e4d
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
diff
changeset
|
5 |
#define TILE_Y_BITS 8 |
e959706a3e4d
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
diff
changeset
|
6 |
|
817
4f9377b7fd2b
(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
truelight
parents:
695
diff
changeset
|
7 |
extern byte _map_type_and_height[]; |
4f9377b7fd2b
(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
truelight
parents:
695
diff
changeset
|
8 |
extern byte _map5[]; |
4f9377b7fd2b
(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
truelight
parents:
695
diff
changeset
|
9 |
extern byte _map3_lo[]; |
4f9377b7fd2b
(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
truelight
parents:
695
diff
changeset
|
10 |
extern byte _map3_hi[]; |
4f9377b7fd2b
(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
truelight
parents:
695
diff
changeset
|
11 |
extern byte _map_owner[]; |
4f9377b7fd2b
(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
truelight
parents:
695
diff
changeset
|
12 |
extern uint16 _map2[]; |
4f9377b7fd2b
(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
truelight
parents:
695
diff
changeset
|
13 |
extern byte _map_extra_bits[]; |
679
e959706a3e4d
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
diff
changeset
|
14 |
|
689 | 15 |
// binary logarithm of the map size, try to avoid using this one |
16 |
static inline uint MapLogX(void) { extern uint _map_log_x; return _map_log_x; } |
|
17 |
static inline uint MapLogY(void) { extern uint _map_log_y; return _map_log_y; } |
|
18 |
/* The size of the map */ |
|
19 |
static inline uint MapSizeX(void) { return 1 << MapLogX(); } |
|
20 |
static inline uint MapSizeY(void) { return 1 << MapLogY(); } |
|
21 |
/* The maximum coordinates */ |
|
22 |
static inline uint MapMaxX(void) { return MapSizeX() - 1; } |
|
23 |
static inline uint MapMaxY(void) { return MapSizeY() - 1; } |
|
24 |
/* The number of tiles in the map */ |
|
25 |
static inline uint MapSize(void) { return MapSizeX() * MapSizeY(); } |
|
26 |
||
900 | 27 |
typedef int16 TileIndexDiff; |
28 |
||
29 |
||
30 |
static inline TileIndexDiff TileOffsByDir(uint dir) |
|
31 |
{ |
|
32 |
extern const TileIndexDiff _tileoffs_by_dir[4]; |
|
33 |
||
34 |
assert(dir < lengthof(_tileoffs_by_dir)); |
|
35 |
return _tileoffs_by_dir[dir]; |
|
36 |
} |
|
37 |
||
679
e959706a3e4d
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
diff
changeset
|
38 |
#endif |