make whiteboard a shared_pointer in resources

This makes subsequent commit easier, because lua wants to be able
to make reports, and therefore needs a report_context
This commit is contained in:
Chris Beck 2014-06-12 17:23:08 -04:00
parent f4754496d3
commit 2a2a50a178
3 changed files with 5 additions and 4 deletions

View file

@ -84,7 +84,7 @@ static void clear_resources()
resources::tunnels = NULL;
resources::undo_stack = NULL;
resources::units = NULL;
resources::whiteboard = NULL;
resources::whiteboard.reset();
resources::classification = NULL;
@ -259,7 +259,7 @@ void play_controller::init(CVideo& video){
pathfind_manager_.reset(new pathfind::manager(level_));
whiteboard_manager_.reset(new wb::manager());
resources::tunnels = pathfind_manager_.get();
resources::whiteboard = whiteboard_manager_.get();
resources::whiteboard = whiteboard_manager_;
LOG_NG << "building terrain rules... " << (SDL_GetTicks() - ticks_) << std::endl;
loadscreen::start_stage("build terrain");

View file

@ -31,7 +31,7 @@ namespace resources
pathfind::manager *tunnels = NULL;
actions::undo_list *undo_stack = NULL;
unit_map *units = NULL;
wb::manager *whiteboard = NULL;
boost::shared_ptr<wb::manager> whiteboard = boost::shared_ptr<wb::manager>();
game_classification *classification = NULL;
const mp_game_settings *mp_settings = NULL;
}

View file

@ -16,6 +16,7 @@
#define RESOURCES_H_
#include <vector>
#include <boost/shared_ptr.hpp>
class game_board;
class game_config_manager;
@ -57,7 +58,7 @@ namespace resources
extern pathfind::manager *tunnels;
extern actions::undo_list *undo_stack;
extern unit_map *units;
extern wb::manager *whiteboard;
extern boost::shared_ptr<wb::manager> whiteboard;
}
#endif