summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_dgntil.cc
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/l_dgntil.cc
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/l_dgntil.cc')
-rw-r--r--crawl-ref/source/l_dgntil.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/l_dgntil.cc b/crawl-ref/source/l_dgntil.cc
index 572a5953be..f738cbedb6 100644
--- a/crawl-ref/source/l_dgntil.cc
+++ b/crawl-ref/source/l_dgntil.cc
@@ -19,7 +19,7 @@
#include "env.h"
-unsigned int get_tile_idx(lua_State *ls, int arg)
+tileidx_t get_tile_idx(lua_State *ls, int arg)
{
if (!lua_isstring(ls, arg))
{
@@ -29,8 +29,8 @@ unsigned int get_tile_idx(lua_State *ls, int arg)
const char *tile_name = luaL_checkstring(ls, arg);
- unsigned int idx;
- if (!tile_dngn_index(tile_name, idx))
+ tileidx_t idx;
+ if (!tile_dngn_index(tile_name, &idx))
{
std::string error = "Couldn't find tile '";
error += tile_name;
@@ -78,7 +78,7 @@ LUAFN(dgn_lrocktile)
MAP(ls, 1, map);
#ifdef USE_TILE
- unsigned short tile = get_tile_idx(ls, 2);
+ tileidx_t tile = get_tile_idx(ls, 2);
map->rock_tile = tile;
const char *tile_name = tile_dngn_name(tile);
@@ -94,7 +94,7 @@ LUAFN(dgn_lfloortile)
MAP(ls, 1, map);
#ifdef USE_TILE
- unsigned short tile = get_tile_idx(ls, 2);
+ tileidx_t tile = get_tile_idx(ls, 2);
map->floor_tile = tile;
const char *tile_name = tile_dngn_name(tile);