Skip to content

Commit

Permalink
add display_context pointer to resources
Browse files Browse the repository at this point in the history
This should be removed soon, it is just a short term corrective
measure for an editor segfault introduced in prior commits. The
plan is to correct the segfaults, then refactor this away.
  • Loading branch information
cbeck88 committed Jun 11, 2014
1 parent 1ef59a3 commit 126358f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/display.cpp
Expand Up @@ -206,6 +206,7 @@ display::display(const display_context * dc, CVideo& video, const config& theme_
#endif
{
singleton_ = this;
resources::disp_context = dc_;

blindfold_ctr_ = 0;

Expand Down Expand Up @@ -565,6 +566,7 @@ void display::change_display_context(const display_context * dc)
{
dc_ = dc;
builder_->change_map(&dc_->map()); //TODO: Should display_context own and initalize the builder object?
resources::disp_context = dc_;
}

void display::blindfold(bool value)
Expand Down
1 change: 1 addition & 0 deletions src/resources.cpp
Expand Up @@ -24,6 +24,7 @@ namespace resources
LuaKernel *lua_kernel = NULL;
persist_manager *persist = NULL;
game_display *screen = NULL;
const display_context *disp_context = NULL;
soundsource::manager *soundsources = NULL;
std::vector<team> *teams = NULL;
::tod_manager *tod_manager = NULL;
Expand Down
2 changes: 2 additions & 0 deletions src/resources.hpp
Expand Up @@ -20,6 +20,7 @@
class game_board;
class game_config_manager;
class game_display;
class display_context;
class gamemap;
class game_data;
class LuaKernel;
Expand Down Expand Up @@ -48,6 +49,7 @@ namespace resources
extern persist_manager *persist;
extern game_classification *classification;
extern game_display *screen;
extern const display_context *disp_context;
extern const mp_game_settings *mp_settings;
extern soundsource::manager *soundsources;
extern std::vector<team> *teams;
Expand Down

0 comments on commit 126358f

Please sign in to comment.