From c9a4f17a4389cdcf21e7796b2eed036634e0421f Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Fri, 28 Feb 2014 19:11:31 -0500 Subject: [PATCH 1/2] implement minimap blindfold fixes functionality intended in earlier commit 1176119024fb2352f4c6f98d131409dbd3ed45ab --- src/minimap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/minimap.cpp b/src/minimap.cpp index e2d6e6996c7e..e8654cdeedbd 100644 --- a/src/minimap.cpp +++ b/src/minimap.cpp @@ -27,6 +27,8 @@ #include "wml_exception.hpp" #include "formula_string_utils.hpp" +#include "game_display.hpp" + #include "boost/foreach.hpp" #include "preferences.hpp" @@ -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)); From b0023b7e9c1673d452ba1dad119659df929b7bae Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Fri, 28 Feb 2014 19:58:07 -0500 Subject: [PATCH 2/2] apply a blindfold during skip replays independent of the "enter blindfolded" setting, we apply a blindfold during the skip replays turn, hopefully to speed up the loading. this will be tested for release in 1.13 --- src/playmp_controller.cpp | 6 ++++-- src/playmp_controller.hpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/playmp_controller.cpp b/src/playmp_controller.cpp index 32eb890df5e4..c4b17a9fb62a 100644 --- a/src/playmp_controller.cpp +++ b/src/playmp_controller.cpp @@ -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; @@ -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) { diff --git a/src/playmp_controller.hpp b/src/playmp_controller.hpp index b3a13f054e5c..3b8ab001155d 100644 --- a/src/playmp_controller.hpp +++ b/src/playmp_controller.hpp @@ -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();