summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-06-08 22:31:07 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-06-08 22:31:25 +0200
commit2b2b02df79649beed9a49e37f21db996f053d4ca (patch)
tree248dc30bdcc65caa54de0c259b676986bbfcb123 /src/map.h
parent25875637a2b0b1561e2cf69b94674ee74d8031a3 (diff)
downloadmana-client-2b2b02df79649beed9a49e37f21db996f053d4ca.tar.gz
mana-client-2b2b02df79649beed9a49e37f21db996f053d4ca.tar.bz2
mana-client-2b2b02df79649beed9a49e37f21db996f053d4ca.tar.xz
mana-client-2b2b02df79649beed9a49e37f21db996f053d4ca.zip
Attempt to clear some of the block/walkmask confusion
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/map.h b/src/map.h
index 0432dc34..cb0271b3 100644
--- a/src/map.h
+++ b/src/map.h
@@ -152,6 +152,13 @@ class Map : public Properties
NB_BLOCKTYPES
};
+ enum BlockMask
+ {
+ BLOCKMASK_WALL = 0x80, // = bin 1000 0000
+ BLOCKMASK_CHARACTER = 0x01, // = bin 0000 0001
+ BLOCKMASK_MONSTER = 0x02 // = bin 0000 0010
+ };
+
/**
* Constructor, taking map and tile size as parameters.
*/
@@ -217,7 +224,8 @@ class Map : public Properties
* Gets walkability for a tile with a blocking bitmask. When called
* without walkmask, only blocks against colliding tiles.
*/
- bool getWalk(int x, int y, char walkmask = BLOCKMASK_WALL) const;
+ bool getWalk(int x, int y,
+ unsigned char walkmask = BLOCKMASK_WALL) const;
/**
* Returns the width of this map in tiles.
@@ -294,9 +302,6 @@ class Map : public Properties
/**
* Blockmasks for different entities
*/
- static const unsigned char BLOCKMASK_WALL = 0x80; // = bin 1000 0000
- static const unsigned char BLOCKMASK_CHARACTER = 0x01;// = bin 0000 0001
- static const unsigned char BLOCKMASK_MONSTER = 0x02; // = bin 0000 0010
int *mOccupation[NB_BLOCKTYPES];
int mWidth, mHeight;