From 14bfaca7e0b40811a7e7a3bb5ebe1ac952dbbbb7 Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Sat, 12 Dec 2009 15:47:21 -0800 Subject: tiles: only include tiledef-*.h in files where they're needed This eliminates the annoying full rebuild that happens when the tiledefs are modified. Signed-off-by: Steven Noonan --- crawl-ref/source/files.cc | 3 +++ crawl-ref/source/invent.cc | 4 ++++ crawl-ref/source/l_dgn.cc | 3 +++ crawl-ref/source/l_dgntil.cc | 2 ++ crawl-ref/source/libgui.cc | 1 + crawl-ref/source/mapdef.cc | 4 ++++ crawl-ref/source/menu.cc | 3 +++ crawl-ref/source/player.cc | 18 +++++++++++++++++- crawl-ref/source/player.h | 10 +++------- crawl-ref/source/spells2.cc | 3 +++ crawl-ref/source/tile2.cc | 2 ++ crawl-ref/source/tilemcache.cc | 2 ++ crawl-ref/source/tilereg.cc | 3 +++ crawl-ref/source/tiles.h | 4 +--- crawl-ref/source/tilesdl.cc | 1 + crawl-ref/source/view.cc | 4 ++++ 16 files changed, 56 insertions(+), 11 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 87f3984fb5..b05bbde518 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -75,7 +75,10 @@ #include "state.h" #include "stuff.h" #include "tags.h" +#ifdef USE_TILE #include "tiles.h" +#include "tiledef-player.h" +#endif #include "terrain.h" #include "travel.h" #include "tutorial.h" diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 699b15059b..047a502467 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -38,7 +38,11 @@ #include "mon-util.h" #include "state.h" +#ifdef USE_TILE #include "tiles.h" +#include "tiledef-main.h" +#include "tiledef-dngn.h" +#endif /////////////////////////////////////////////////////////////////////////////// // Inventory menu shenanigans diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc index b7891b2c7f..4ef1cae954 100644 --- a/crawl-ref/source/l_dgn.cc +++ b/crawl-ref/source/l_dgn.cc @@ -19,6 +19,9 @@ #include "random.h" #include "spl-util.h" #include "state.h" +#ifdef USE_TILE +#include "tiledef-dngn.h" +#endif #include "view.h" /////////////////////////////////////////////////////////////////////////// diff --git a/crawl-ref/source/l_dgntil.cc b/crawl-ref/source/l_dgntil.cc index 6939b98aea..4e68e8d782 100644 --- a/crawl-ref/source/l_dgntil.cc +++ b/crawl-ref/source/l_dgntil.cc @@ -13,6 +13,8 @@ #ifdef USE_TILE +#include "tiledef-dngn.h" + #include "env.h" unsigned int get_tile_idx(lua_State *ls, int arg) diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc index eb63694c25..51fe4aeb0b 100644 --- a/crawl-ref/source/libgui.cc +++ b/crawl-ref/source/libgui.cc @@ -27,6 +27,7 @@ #include "terrain.h" #include "tiles.h" #include "tilesdl.h" +#include "tiledef-main.h" #include "travel.h" #include "viewgeom.h" diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 6ef5088e02..e548cf3389 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -43,6 +43,10 @@ #include "stuff.h" #include "env.h" #include "tags.h" +#ifdef USE_TILE +#include "tiledef-dngn.h" +#include "tiledef-player.h" +#endif static const char *map_section_names[] = { "", diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 10f865adc5..6741d16f08 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -25,6 +25,9 @@ #include "newgame.h" #include "terrain.h" #include "tiles.h" + #include "tiledef-dngn.h" + #include "tiledef-main.h" + #include "tiledef-player.h" #include "travel.h" #endif diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 3f01f0b354..cc1b2f1fd7 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -68,9 +68,25 @@ #include "view.h" #include "shout.h" #include "viewgeom.h" -#include "tiles.h" #include "xom.h" +#ifdef USE_TILE +#include "tiles.h" +#include "tiledef-player.h" + +dolls_data::dolls_data() +{ + parts = new int[TILEP_PART_MAX]; + memset(parts, 0, TILEP_PART_MAX * sizeof(int)); +} + +dolls_data::~dolls_data() +{ + delete [] parts; + parts = NULL; +} +#endif + std::string pronoun_you(description_level_type desc) { switch (desc) diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 8acd5577fb..78c867b272 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -15,16 +15,12 @@ #include #ifdef USE_TILE -// This used to be in tiles.h. (jpeg) -#include "tiledef-main.h" -#include "tiledef-dngn.h" -#include "tiledef-player.h" - struct dolls_data { - dolls_data() { memset(parts, 0, sizeof(parts)); } + dolls_data(); + ~dolls_data(); - int parts[TILEP_PART_MAX]; + int *parts; }; #endif diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 7287a9694c..66d30c6629 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -48,7 +48,10 @@ #include "religion.h" #include "stuff.h" #include "teleport.h" +#ifdef USE_TILE #include "tiles.h" +#include "tiledef-main.h" +#endif #include "terrain.h" #include "traps.h" #include "view.h" diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc index 801cba1437..62f6955812 100644 --- a/crawl-ref/source/tile2.cc +++ b/crawl-ref/source/tile2.cc @@ -16,6 +16,8 @@ #include "player.h" #include "stuff.h" #include "tiles.h" +#include "tiledef-dngn.h" +#include "tiledef-player.h" void tile_default_flv(level_area_type lev, branch_type br, tile_flavour &flv) { diff --git a/crawl-ref/source/tilemcache.cc b/crawl-ref/source/tilemcache.cc index c7b9a7421d..aab46530fd 100644 --- a/crawl-ref/source/tilemcache.cc +++ b/crawl-ref/source/tilemcache.cc @@ -8,6 +8,8 @@ #include "ghost.h" #include "mon-util.h" +#include "tiledef-player.h" + mcache_manager mcache; // Used internally for streaming. diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index c908bc2d06..753ea5be30 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -51,7 +51,10 @@ #include "tilefont.h" #include "tilesdl.h" #include "tilemcache.h" +#include "tiledef-dngn.h" #include "tiledef-gui.h" +#include "tiledef-main.h" +#include "tiledef-player.h" #include #include diff --git a/crawl-ref/source/tiles.h b/crawl-ref/source/tiles.h index 20f5a5f8a3..d938715e55 100644 --- a/crawl-ref/source/tiles.h +++ b/crawl-ref/source/tiles.h @@ -8,9 +8,7 @@ #ifdef USE_TILE -#include "tiledef-main.h" -#include "tiledef-dngn.h" -#include "tiledef-player.h" +#include "tiledef_defines.h" #include "beam.h" #include "enum.h" diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 83ce8e8724..1a1099ba6d 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -27,6 +27,7 @@ #include "viewgeom.h" #include "tiledef-dngn.h" +#include "tiledef-main.h" #include "tilefont.h" #include diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index b78f09e760..b8e6447a89 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -70,6 +70,10 @@ #include "tutorial.h" #include "xom.h" +#ifdef USE_TILE +#include "tiledef-dngn.h" +#endif + #define DEBUG_PANE_BOUNDS 0 crawl_view_geometry crawl_view; -- cgit v1.2.3-54-g00ecf