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:
parent
f4754496d3
commit
2a2a50a178
3 changed files with 5 additions and 4 deletions
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue