Skip to content

Commit

Permalink
make whiteboard a shared_pointer in resources
Browse files Browse the repository at this point in the history
This makes subsequent commit easier, because lua wants to be able
to make reports, and therefore needs a report_context
  • Loading branch information
cbeck88 committed Jun 12, 2014
1 parent f475449 commit 2a2a50a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/play_controller.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/resources.cpp
Expand Up @@ -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;
}
3 changes: 2 additions & 1 deletion src/resources.hpp
Expand Up @@ -16,6 +16,7 @@
#define RESOURCES_H_

#include <vector>
#include <boost/shared_ptr.hpp>

class game_board;
class game_config_manager;
Expand Down Expand Up @@ -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

0 comments on commit 2a2a50a

Please sign in to comment.