summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilepick.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-02 05:21:54 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-02 05:21:54 +0000
commit469f183e63813560350b6a409356e11107893947 (patch)
treed23d787b0318c54c58dbb2db45d0b17039c54f09 /crawl-ref/source/tilepick.cc
parentea12034397dd2aa7118cae28194de688fa25d8d0 (diff)
downloadcrawl-ref-469f183e63813560350b6a409356e11107893947.tar.gz
crawl-ref-469f183e63813560350b6a409356e11107893947.zip
Fixes for arena mode in tiles mode. It runs now, but there are still some visual issues (error tiles) because env.show gets updated weirdly in arena mode.
Tangentially related to fixing this, also cleaning up logic in view.cc to use grid2show, adding a number of asserts for tiles-related problems, adding error tiles for all textures, and fixing some incorrect logic about centering on the player instead of vgrdc. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8104 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilepick.cc')
-rw-r--r--crawl-ref/source/tilepick.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index ff9ff40bf8..21796d393f 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -983,7 +983,7 @@ static int _tileidx_monster_base(const monsters *mon, bool detected)
return TILEP_MONS_ERESHKIGAL;
}
- return TILE_ERROR;
+ return TILEP_ERROR;
}
int tileidx_monster(const monsters *mons, bool detected)
@@ -2239,7 +2239,7 @@ static int _tileidx_trap(trap_type type)
case TRAP_SHAFT:
return TILE_DNGN_TRAP_SHAFT;
default:
- return TILE_ERROR;
+ return TILE_DNGN_ERROR;
}
}
@@ -2247,7 +2247,7 @@ static int _tileidx_shop(coord_def where)
{
const shop_struct *shop = get_shop(where);
if (!shop)
- return TILE_ERROR;
+ return TILE_DNGN_ERROR;
switch (shop->type)
{
@@ -2273,7 +2273,7 @@ static int _tileidx_shop(coord_def where)
case SHOP_GENERAL_ANTIQUE:
return TILE_SHOP_GENERAL;
default:
- return TILE_ERROR;
+ return TILE_DNGN_ERROR;
}
}
@@ -2463,7 +2463,7 @@ int tileidx_feature(int object, int gx, int gy)
return TILE_DNGN_DRY_FOUNTAIN;
}
- return TILE_ERROR;
+ return TILE_DNGN_ERROR;
}
static int _tileidx_cloud(int type, int decay)
@@ -4241,9 +4241,8 @@ void tile_floor_halo(dungeon_feature_type target, int tile)
// Called from view.cc.
void tile_draw_floor()
{
- int cx, cy;
- for (cy = 0; cy < env.tile_fg.height(); cy++)
- for (cx = 0; cx < env.tile_fg.width(); cx++)
+ for (int cy = 0; cy < env.tile_fg.height(); cy++)
+ for (int cx = 0; cx < env.tile_fg.width(); cx++)
{
const coord_def ep(cx+1, cy+1);
const coord_def gc = view2grid(show2view(ep));
@@ -4428,9 +4427,8 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy)
for (y = 0; y < crawl_view.viewsz.y; y++)
for (x = 0; x < crawl_view.viewsz.x; x++)
{
- // View coords are not centered on you, but on (cx,cy)
- const int gx = view2gridX(x + 1) + cx - you.pos().x;
- const int gy = view2gridY(y + 1) + cy - you.pos().y;
+ const int gx = view2gridX(x + crawl_view.viewp.x);
+ const int gy = view2gridY(y + crawl_view.viewp.y);
unsigned char wall_flv = 0;
unsigned char floor_flv = 0;