summaryrefslogtreecommitdiff
path: root/src/tileset.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-01 22:22:33 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-03 20:29:10 +0100
commit66850d2dbc9798619159688dcba0cc912247ac02 (patch)
tree84f3e15620bf0f60725c10495deeaefbe1824d10 /src/tileset.h
parent024088d76569ef07be7f166f22f3f5e22592a586 (diff)
downloadmana-client-66850d2dbc9798619159688dcba0cc912247ac02.tar.gz
mana-client-66850d2dbc9798619159688dcba0cc912247ac02.tar.bz2
mana-client-66850d2dbc9798619159688dcba0cc912247ac02.tar.xz
mana-client-66850d2dbc9798619159688dcba0cc912247ac02.zip
Clear tile flags from the gid before further processing
Better to show non-rotated/flipped tiles than no tile at all. This also fixes interpretation of collision tiles that happen to be flipped. Also interpret the gid as an unsigned number, since that's how they are written in the TMX file since the introduction of these flags. Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/tileset.h')
-rw-r--r--src/tileset.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tileset.h b/src/tileset.h
index 9e0bf936..4ba9f016 100644
--- a/src/tileset.h
+++ b/src/tileset.h
@@ -30,7 +30,8 @@
class Tileset : public ImageSet
{
public:
- Tileset(Image *img, int w, int h, int firstGid, int margin, int spacing):
+ Tileset(Image *img, int w, int h, unsigned firstGid,
+ int margin, int spacing):
ImageSet(img, w, h, margin, spacing),
mFirstGid(firstGid)
{
@@ -39,13 +40,13 @@ class Tileset : public ImageSet
/**
* Returns the first gid.
*/
- int getFirstGid() const
+ unsigned getFirstGid() const
{
return mFirstGid;
}
private:
- int mFirstGid;
+ unsigned mFirstGid;
};
#endif // TILESET_H