summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tiletex.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/tiletex.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/tiletex.h')
-rw-r--r--crawl-ref/source/tiletex.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/crawl-ref/source/tiletex.h b/crawl-ref/source/tiletex.h
index ece4100591..c8b3865276 100644
--- a/crawl-ref/source/tiletex.h
+++ b/crawl-ref/source/tiletex.h
@@ -28,10 +28,10 @@ enum MipMapOptions
struct tile_def
{
- tile_def(int _tile, TextureID _tex, int _ymax = TILE_Y)
+ tile_def(tileidx_t _tile, TextureID _tex, int _ymax = TILE_Y)
: tile(_tile), tex(_tex), ymax(_ymax){}
- int tile;
+ tileidx_t tile;
TextureID tex;
int ymax;
};
@@ -75,8 +75,8 @@ public:
TilesTexture();
void set_info(int max, tile_info_func *info);
- inline const tile_info &get_info(int idx) const;
- inline bool get_coords(int idx, int ofs_x, int ofs_y,
+ inline const tile_info &get_info(tileidx_t idx) const;
+ inline bool get_coords(tileidx_t idx, int ofs_x, int ofs_y,
float &pos_sx, float &pos_sy,
float &pos_ex, float &pos_ey,
float &tex_sx, float &tex_sy,
@@ -89,13 +89,13 @@ protected:
tile_info_func *m_info_func;
};
-inline const tile_info &TilesTexture::get_info(int idx) const
+inline const tile_info &TilesTexture::get_info(tileidx_t idx) const
{
ASSERT(m_info_func);
return m_info_func(idx);
}
-inline bool TilesTexture::get_coords(int idx, int ofs_x, int ofs_y,
+inline bool TilesTexture::get_coords(tileidx_t idx, int ofs_x, int ofs_y,
float &pos_sx, float &pos_sy,
float &pos_ex, float &pos_ey,
float &tex_sx, float &tex_sy,