diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-30 10:53:06 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-30 10:53:06 +0000 |
commit | 262b8e18ed8cb58afb40a816ac0fdedfe3a7db5f (patch) | |
tree | 681a9cbb6c22669c6e8b7ab749228a3cd691a903 /crawl-ref/source/tilepick.cc | |
parent | 51d8f1fc9cc8ed4280b9c53b135ccb0521e84889 (diff) | |
download | crawl-ref-262b8e18ed8cb58afb40a816ac0fdedfe3a7db5f.tar.gz crawl-ref-262b8e18ed8cb58afb40a816ac0fdedfe3a7db5f.zip |
Massive overhaul to move towards coord_def().
This might have introduced some bugs: I now get intermittent crashes
on startup (this might have to do with the changes to special_room.)
Sorry about that - committing before I need to do any more big conflict
resolutions. Fixes coming later.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6732 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilepick.cc')
-rw-r--r-- | crawl-ref/source/tilepick.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index f7d1bac148..e359502125 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -157,7 +157,7 @@ int tile_unseen_flag(const coord_def& gc) static int _tileidx_monster_base(int mon_idx, bool detected) { const monsters* mon = &menv[mon_idx]; - int grid = grd[mon->x][mon->y]; + int grid = grd(mon->pos()); bool in_water = (grid == DNGN_SHALLOW_WATER || grid == DNGN_DEEP_WATER); int type = mon->type; @@ -4251,8 +4251,8 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy) 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.x_pos; - const int gy = view2gridY(y + 1) + cy - you.y_pos; + const int gx = view2gridX(x + 1) + cx - you.pos().x; + const int gy = view2gridY(y + 1) + cy - you.pos().y; unsigned char wall_flv = 0; unsigned char floor_flv = 0; @@ -4286,11 +4286,11 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy) if (in_bounds) { bool print_blood = true; - if (inside_halo(gx, gy)) + if (inside_halo(gc)) { - if (see_grid(gx, gy) && mgrd[gx][gy] != NON_MONSTER) + if (see_grid(gc) && mgrd(gc) != NON_MONSTER) { - monsters* m = &menv[mgrd[gx][gy]]; + monsters* m = &menv[mgrd(gc)]; if (!mons_class_flag(m->type, M_NO_EXP_GAIN) && (!mons_is_mimic(m->type) || testbits(m->flags, MF_KNOWN_MIMIC))) @@ -4301,7 +4301,7 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy) } } - if (print_blood && is_bloodcovered(coord_def(gx, gy))) + if (print_blood && is_bloodcovered(gc)) tileb[count+1] |= TILE_FLAG_BLOOD; if (is_sanctuary(coord_def(gx, gy))) |