summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tile2.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-15 15:26:57 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-15 15:26:57 +0000
commitcc137f4b229d1763c3ad71fe56605b8611a1067c (patch)
tree601f5b148db6c1d94d593d89a11208ae3fa925ad /crawl-ref/source/tile2.cc
parent8b6107e382417e437cc541dfad85c20234ca3d7c (diff)
downloadcrawl-ref-cc137f4b229d1763c3ad71fe56605b8611a1067c.tar.gz
crawl-ref-cc137f4b229d1763c3ad71fe56605b8611a1067c.zip
Another code cleanup.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4244 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tile2.cc')
-rw-r--r--crawl-ref/source/tile2.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc
index 64d5227eee..75f8f07ddc 100644
--- a/crawl-ref/source/tile2.cc
+++ b/crawl-ref/source/tile2.cc
@@ -93,11 +93,11 @@ int itemlist_idx[MAX_ITEMLIST];
char itemlist_key[MAX_ITEMLIST];
int itemlist_iflag[MAX_ITEMLIST];
int itemlist_flag = -1;
-int itemlist_n=0;
+int itemlist_n = 0;
-static int wall_flavors = 0;
-static int floor_flavors = 0;
-static int special_flavors = 0;
+static int wall_flavors = 0;
+static int floor_flavors = 0;
+static int special_flavors = 0;
static int wall_tile_idx = 0;
static int floor_tile_idx = 0;
static int special_tile_idx = 0;
@@ -444,7 +444,7 @@ static int _tcache_find_id_normal(int kind, int *fg, int *bg, int *is_new)
tile_cache *tc = tcache[kind];
tile_cache *tc0 = &tc[tcache_head[kind_n_hash]];
- *is_new=0;
+ *is_new = 0;
while (true)
{
@@ -529,13 +529,17 @@ void _tcache_overlay_player(img_type img, int dx, int dy, int part, int idx,
int wx = TILE_X/nx;
int wy = TILE_Y/ny;
- if(!idx)return;
- idx--;
+ if (!idx)
+ return;
+ idx--;
tidx += idx/(nx*ny);
- if (oy+wy > ymax) wy -= oy + wy - ymax;
- if (wy<=0) return;
+ if (oy+wy > ymax)
+ wy -= oy + wy - ymax;
+
+ if (wy <= 0)
+ return;
xs = (tidx % TILEP_PER_ROW)*TILE_X;
ys = (tidx / TILEP_PER_ROW)*TILE_Y;
@@ -569,7 +573,7 @@ void _register_tile_mask(int tile, int region, int *copy,
x0 = (tile % TILE_PER_ROW) * TILE_X;
y0 = (tile / TILE_PER_ROW) * TILE_Y;
- if (*copy!=0)
+ if (*copy != 0)
memset(mask, 0, ux*uy);
if (*copy == 2)
@@ -578,13 +582,11 @@ void _register_tile_mask(int tile, int region, int *copy,
ux = wx;
for (x = 0; x < wx; x++)
- {
for (y = 0; y < wy; y++)
{
if (!ImgIsTransparentAt(src, x0+sx+x, y0+sy+y))
mask[(y+oy) * ux + (x+ox)] = 1;
}
- }
}
else
{
@@ -1493,7 +1495,7 @@ static bool _draw_doll(img_type img, dolls_data *doll, bool force_redraw = false
_tcache_overlay_player(img, 0, 0, TILEP_PART_SHADOW,
tile, TILE_Y, &c);
}
- else if(parts2[p] && flags[p])
+ else if (parts2[p] && flags[p])
_tcache_overlay_player(img, 0, 0, p, parts2[p], ymax, &c);
}
return true;