summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilebuf.h
diff options
context:
space:
mode:
authorEnne Walker <enne.walker@gmail.com>2010-05-29 16:24:10 -0400
committerEnne Walker <enne.walker@gmail.com>2010-05-30 08:50:37 -0400
commitca6e3ae38efee3e21d22494140094d71344cdac4 (patch)
tree2f40b5085806fbf3c765f705071f69a8221e76ae /crawl-ref/source/tilebuf.h
parent575cfb8db1e87084ae13b9799f74a3b6be75c0c8 (diff)
downloadcrawl-ref-ca6e3ae38efee3e21d22494140094d71344cdac4.tar.gz
crawl-ref-ca6e3ae38efee3e21d22494140094d71344cdac4.zip
Use tileidx_t for tile indices. Also, cleanup.
This new type defines to unsigned int, but it cleans up a lot of the int/unsigned int/short confusion all over the codebase for tile indices. This commit also cleans up tiles code to use coord_def more and to change function signatures to pass const refs and non-const pointers.
Diffstat (limited to 'crawl-ref/source/tilebuf.h')
-rw-r--r--crawl-ref/source/tilebuf.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/crawl-ref/source/tilebuf.h b/crawl-ref/source/tilebuf.h
index a771a65fe8..73cfd80fd3 100644
--- a/crawl-ref/source/tilebuf.h
+++ b/crawl-ref/source/tilebuf.h
@@ -68,8 +68,9 @@ class TileBuffer : public VertBuffer
public:
TileBuffer(const TilesTexture *tex = NULL);
- void add_unscaled(int idx, float x, float y, int ymax = TILE_Y);
- void add(int idx, int x, int y, int ox = 0, int oy = 0, bool centre = true, int ymax = -1);
+ void add_unscaled(tileidx_t idx, float x, float y, int ymax = TILE_Y);
+ void add(tileidx_t idx, int x, int y,
+ int ox = 0, int oy = 0, bool centre = true, int ymax = -1);
};
class ColouredTileBuffer : public VertBuffer
@@ -77,7 +78,7 @@ class ColouredTileBuffer : public VertBuffer
public:
ColouredTileBuffer(const TilesTexture *tex = NULL);
- void add(int idx, int x, int y, int z,
+ void add(tileidx_t idx, int x, int y, int z,
int ox, int oy, int ymin, int ymax,
int alpha_top, int alpha_bottom);
};
@@ -88,7 +89,7 @@ class SubmergedTileBuffer
public:
SubmergedTileBuffer(const TilesTexture *tex, int water_level);
- void add(int idx, int x, int y, int z = 0, bool submerged = false,
+ void add(tileidx_t idx, int x, int y, int z = 0, bool submerged = false,
bool ghost = false, int ox = 0, int oy = 0, int ymax = -1);
void draw() const;