Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blindfold minimap #113

Merged
merged 2 commits into from
Mar 1, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/minimap.cpp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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