Skip to content

Commit

Permalink
Merge pull request #113 from cbeck88/blindfold_minimap
Browse files Browse the repository at this point in the history
Blindfold minimap
  • Loading branch information
cbeck88 committed Mar 1, 2014
2 parents d3efb49 + b0023b7 commit 41ee069
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/minimap.cpp
Expand Up @@ -27,6 +27,8 @@
#include "wml_exception.hpp"
#include "formula_string_utils.hpp"

#include "game_display.hpp"

#include "boost/foreach.hpp"

#include "preferences.hpp"
Expand Down Expand Up @@ -68,7 +70,7 @@ surface getMinimap(int w, int h, const gamemap &map, const team *vw, const std::

const bool highlighted = reach_map && reach_map->count(loc) != 0;

const bool shrouded = (vw != NULL && vw->shrouded(loc));
const bool shrouded = (resources::screen != NULL && resources::screen->is_blindfolded()) || (vw != NULL && vw->shrouded(loc));
// shrouded hex are not considered fogged (no need to fog a black image)
const bool fogged = (vw != NULL && !shrouded && vw->fogged(loc));

Expand Down
6 changes: 4 additions & 2 deletions src/playmp_controller.cpp
Expand Up @@ -45,14 +45,15 @@ playmp_controller::playmp_controller(const config& level,
turn_data_(NULL),
beep_warning_time_(0),
network_processing_stopped_(false),
blindfold_(*resources::screen,blindfold_replay_)
blindfold_(*resources::screen,blindfold_replay_),
skip_replays_blindfold_(*resources::screen,skip_replay)
{
is_host_ = is_host;
// We stop quick replay if play isn't yet past turn 1
if ( replay_last_turn_ <= 1)
{
skip_replay_ = false;
blindfold_.unblind();
skip_replays_blindfold_.unblind();
} else if (blindfold_replay_) {
//blindfold_ = resources::screen->video().lock_updates(true);
LOG_NG << " *** Putting on the blindfold now " << std::endl;
Expand Down Expand Up @@ -458,6 +459,7 @@ void playmp_controller::play_network_turn(){
if (skip_replay_) {
skip_replay_ = false;
}
skip_replays_blindfold_.unblind();
}
const turn_info::PROCESS_DATA_RESULT result = turn_data.process_network_data(cfg, from, data_backlog_, skip_replay_);
if (result == turn_info::PROCESS_RESTART_TURN) {
Expand Down
1 change: 1 addition & 0 deletions src/playmp_controller.hpp
Expand Up @@ -66,6 +66,7 @@ class playmp_controller : public playsingle_controller, public events::pump_moni
int beep_warning_time_;
mutable bool network_processing_stopped_;
blindfold blindfold_;
blindfold skip_replays_blindfold_;
private:
void set_end_scenario_button();
void reset_end_scenario_button();
Expand Down

0 comments on commit 41ee069

Please sign in to comment.