diff options
-rw-r--r-- | crawl-ref/source/acr.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/arena.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/files.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/rltiles/dc-dngn.txt | 2 | ||||
-rw-r--r-- | crawl-ref/source/rltiles/dc-player.txt | 1 | ||||
-rw-r--r-- | crawl-ref/source/tilepick.cc | 20 | ||||
-rw-r--r-- | crawl-ref/source/tilereg.cc | 9 | ||||
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 21 | ||||
-rw-r--r-- | crawl-ref/source/tilesdl.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/tiletex.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 14 |
11 files changed, 48 insertions, 36 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 44fa192e5c..4f8ee05493 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3883,6 +3883,10 @@ static bool _initialise(void) if (crawl_state.arena) { +#ifdef USE_TILE + tiles.initialise_items(); +#endif + run_arena(); end(0, false); } diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc index e6134dca51..4342815ebe 100644 --- a/crawl-ref/source/arena.cc +++ b/crawl-ref/source/arena.cc @@ -206,6 +206,12 @@ namespace arena env.rock_colour = CYAN; if (!env.floor_colour) env.floor_colour = LIGHTGREY; + +#ifdef USE_TILE + tile_init_default_flavour(); + tile_clear_flavour(); + TileNewLevel(true); +#endif } std::string find_monster_spec() diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 24a9299791..bf29bea20a 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -1123,7 +1123,7 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, if (make_changes) { tiles.clear_minimap(); - tiles.load_dungeon(NULL, you.pos().x, you.pos().y); + tiles.load_dungeon(NULL, crawl_view.vgrdc); } #endif diff --git a/crawl-ref/source/rltiles/dc-dngn.txt b/crawl-ref/source/rltiles/dc-dngn.txt index 1fc9b95cd3..2136410a22 100644 --- a/crawl-ref/source/rltiles/dc-dngn.txt +++ b/crawl-ref/source/rltiles/dc-dngn.txt @@ -433,3 +433,5 @@ dc-misc/travel_exclusion TRAVEL_EXCLUSION_BG dc-misc/travel_exclusion_centre TRAVEL_EXCLUSION_CENTRE_BG dc-misc/slot ITEM_SLOT effect/sanctuary SANCTUARY + +dc-misc/error DNGN_ERROR diff --git a/crawl-ref/source/rltiles/dc-player.txt b/crawl-ref/source/rltiles/dc-player.txt index 69835fa9b5..3ab5f6f00a 100644 --- a/crawl-ref/source/rltiles/dc-player.txt +++ b/crawl-ref/source/rltiles/dc-player.txt @@ -865,3 +865,4 @@ drchead_red RED drchead_white WHITE
%end
+dc-misc/error ERROR
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; diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 53946df599..d185c2be4b 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -1939,7 +1939,7 @@ int MapRegion::handle_mouse(MouseEvent &event) if (m_far_view) { m_far_view = false; - tiles.load_dungeon(you.pos().x, you.pos().y); + tiles.load_dungeon(crawl_view.vgrdc); return 0; } return 0; @@ -1953,7 +1953,7 @@ int MapRegion::handle_mouse(MouseEvent &event) { case MouseEvent::MOVE: if (m_far_view) - tiles.load_dungeon(gc.x, gc.y); + tiles.load_dungeon(gc); return 0; case MouseEvent::PRESS: if (event.button == MouseEvent::LEFT) @@ -1966,13 +1966,14 @@ int MapRegion::handle_mouse(MouseEvent &event) else if (event.button == MouseEvent::RIGHT) { m_far_view = true; - tiles.load_dungeon(gc.x, gc.y); + tiles.load_dungeon(gc); } return CK_MOUSE_CMD; case MouseEvent::RELEASE: if ((event.button == MouseEvent::RIGHT) && m_far_view) { - tiles.load_dungeon(you.pos().x, you.pos().y); + m_far_view = false; + tiles.load_dungeon(crawl_view.vgrdc); } return 0; default: diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 64f7e8d5b0..1d16ea1cd6 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -5,6 +5,7 @@ #include "mon-util.h" #include "player.h" #include "randart.h" +#include "state.h" #include "stuff.h" #include "tiles.h" #include "tilesdl.h" @@ -315,21 +316,21 @@ int TilesFramework::load_font(const char *font_file, int font_size, return (m_fonts.size() - 1); } -void TilesFramework::load_dungeon(unsigned int *tileb, int gx, int gy) +void TilesFramework::load_dungeon(unsigned int *tileb, const coord_def &gc) { m_active_layer = LAYER_NORMAL; unsigned int ox = m_region_tile->mx/2; unsigned int oy = m_region_tile->my/2; - m_region_tile->load_dungeon(tileb, gx - ox, gy - oy); + m_region_tile->load_dungeon(tileb, gc.x - ox, gc.y - oy); - coord_def win_start(gx - ox, gy - oy); - coord_def win_end(gx + ox + 1, gy + oy + 1); + coord_def win_start(gc.x - ox, gc.y - oy); + coord_def win_end(gc.x + ox + 1, gc.y + oy + 1); m_region_map->set_window(win_start, win_end); } -void TilesFramework::load_dungeon(int cx, int cy) +void TilesFramework::load_dungeon(const coord_def &cen) { int wx = m_region_tile->mx; int wy = m_region_tile->my; @@ -344,8 +345,8 @@ void TilesFramework::load_dungeon(int cx, int cy) unsigned int fg; unsigned int bg; - const coord_def gc(cx + x - wx/2, - cy + y - wy/2); + const coord_def gc(cen.x + x - wx/2, + cen.y + y - wy/2); const coord_def ep = view2show(grid2view(gc)); // mini "viewwindow" routine @@ -368,7 +369,7 @@ void TilesFramework::load_dungeon(int cx, int cy) bg = env.tile_bg[ep.x-1][ep.y-1]; } - if (gc.x == cx && gc.y == cy) + if (gc.x == cen.x && gc.y == cen.y) bg |= TILE_FLAG_CURSOR1; tb[count++] = fg; @@ -376,7 +377,7 @@ void TilesFramework::load_dungeon(int cx, int cy) } } - load_dungeon(tb, cx, cy); + load_dungeon(tb, cen); tiles.redraw(); } @@ -1173,7 +1174,7 @@ void TilesFramework::update_inventory() { std::vector<InventoryTile> inv; - if (!Options.tile_show_items) + if (!Options.tile_show_items || crawl_state.arena) return; // item.base_type <-> char conversion table diff --git a/crawl-ref/source/tilesdl.h b/crawl-ref/source/tilesdl.h index 37fc599061..0720e48663 100644 --- a/crawl-ref/source/tilesdl.h +++ b/crawl-ref/source/tilesdl.h @@ -88,8 +88,8 @@ public: bool initialise(); void shutdown(); - void load_dungeon(unsigned int *tileb, int gx, int gy); - void load_dungeon(int gx, int gy); + void load_dungeon(unsigned int *tileb, const coord_def &gc); + void load_dungeon(const coord_def &gc); int getch_ck(); void resize(); void clrscr(); diff --git a/crawl-ref/source/tiletex.h b/crawl-ref/source/tiletex.h index 63abf4d2f4..5158ea6411 100644 --- a/crawl-ref/source/tiletex.h +++ b/crawl-ref/source/tiletex.h @@ -72,6 +72,7 @@ protected: inline const tile_info &TilesTexture::get_info(int idx) { + ASSERT(m_info_func); return m_info_func(idx); } diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index bf46e7af64..72fa0016c2 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -1185,7 +1185,7 @@ void force_monster_shout(monsters* monster) inline static bool _update_monster_grid(const monsters *monster) { - const coord_def e = monster->pos() - crawl_view.glosc() + coord_def(9,9); + const coord_def e = grid2show(monster->pos()); if (!player_monster_visible( monster )) { @@ -1511,8 +1511,7 @@ void get_mons_glyph( const monsters *mons, unsigned *glych, inline static void _update_cloud_grid(int cloudno) { int which_colour = LIGHTGREY; - const coord_def e = env.cloud[cloudno].pos - crawl_view.glosc() - + coord_def(9,9); + const coord_def e = grid2show(env.cloud[cloudno].pos); switch (env.cloud[cloudno].type) { @@ -3443,9 +3442,8 @@ void show_map( coord_def &spec_place, bool travel_mode ) // Note: Tile versions just center on the current cursor // location. It silently ignores everything else going // on in this function. --Enne - unsigned int cx = start_x + curs_x - 1; - unsigned int cy = start_y + curs_y - 1; - tiles.load_dungeon(cx, cy); + coord_def cen(start_x + curs_x - 1, start_y + curs_y - 1); + tiles.load_dungeon(cen); #else _draw_level_map(start_x, start_y, travel_mode); @@ -3936,7 +3934,7 @@ bool mons_near(const monsters *monster, unsigned short foe) if ( grid_distance(monster->pos(), you.pos()) <= LOS_RADIUS ) { - const coord_def diff = monster->pos() - you.pos() + coord_def(9,9); + const coord_def diff = grid2show(monster->pos()); if (env.show(diff)) return (true); } @@ -5395,7 +5393,7 @@ void viewwindow(bool draw_it, bool do_updates) { #ifdef USE_TILE tiles.set_need_redraw(); - tiles.load_dungeon(&tileb[0], you.pos().x, you.pos().y); + tiles.load_dungeon(&tileb[0], crawl_view.vgrdc); tiles.update_inventory(); #else you.last_view_update = you.num_turns; |