diff --git a/data/_main.cfg b/data/_main.cfg index 15c285cd615..48869585e92 100644 --- a/data/_main.cfg +++ b/data/_main.cfg @@ -45,6 +45,13 @@ default=yes [/advanced_preference] +[advanced_preference] + field=animate_map + name=_"Animate Map" + type=boolean + default=yes +[/advanced_preference] + [advanced_preference] field=mouse_scrolling name=_"Mouse Scrolling" diff --git a/src/display.cpp b/src/display.cpp index e143e1dbb6a..463eb93faa3 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -525,7 +525,8 @@ std::vector display::get_terrain_images(const gamemap::location &loc, for(std::vector >::const_iterator it = terrains->begin(); it != terrains->end(); ++it) { - image::locator image = it->get_current_frame(); + image::locator image = preferences::animate_map() ? + it->get_current_frame() : it->get_first_frame(); // We prevent ToD colouring and brightening of off-map tiles, // except if we are not in_game and so in the editor. diff --git a/src/game_display.cpp b/src/game_display.cpp index d405d763c1e..07521a56336 100644 --- a/src/game_display.cpp +++ b/src/game_display.cpp @@ -724,7 +724,9 @@ surface game_display::get_flag(const gamemap::location& loc) (!fogged(loc) || !teams_[currentTeam_].is_enemy(i+1))) { flags_[i].update_last_draw_time(); - return image::get_image(flags_[i].get_current_frame(), image::SCALED_TO_HEX); + image::locator image_flag = preferences::animate_map() ? + flags_[i].get_current_frame() : flags_[i].get_first_frame(); + return image::get_image(image_flag, image::SCALED_TO_HEX); } } @@ -928,6 +930,21 @@ void game_display::invalidate(const gamemap::location& loc) void game_display::invalidate_animations() { new_animation_frame(); + + unit_map::iterator unit; + for(unit=units_.begin() ; unit != units_.end() ; unit++) { + if (unit->second.get_animation() && unit->second.get_animation()->need_update()) + invalidate(unit->first); + unit->second.refresh(*this,unit->first); + } + if (temp_unit_ ) { + if (temp_unit_->get_animation() && temp_unit_->get_animation()->need_update()) + invalidate(temp_unit_loc_); + temp_unit_->refresh(*this, temp_unit_loc_); + } + + if (!preferences::animate_map()) {return;} + gamemap::location topleft; gamemap::location bottomright; get_visible_hex_bounds(topleft, bottomright); @@ -946,19 +963,6 @@ void game_display::invalidate_animations() } } } - unit_map::iterator unit; - for(unit=units_.begin() ; unit != units_.end() ; unit++) { - if (unit->second.get_animation() && unit->second.get_animation()->need_update()) - invalidate(unit->first); - unit->second.refresh(*this,unit->first); - } - if (temp_unit_ ) { - if (temp_unit_->get_animation() && temp_unit_->get_animation()->need_update()) - invalidate(temp_unit_loc_); - temp_unit_->refresh(*this, temp_unit_loc_); - } - - } void game_display::debug_highlight(const gamemap::location& loc, fixed_t amount) diff --git a/src/preferences.cpp b/src/preferences.cpp index c88d689e081..3adbee0cba4 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -425,6 +425,11 @@ void enable_mouse_scroll(bool value) set("mouse_scrolling", value ? "yes" : "no"); } +bool animate_map() +{ + return utils::string_bool(preferences::get("animate_map"), true); +} + bool show_fps() { return fps; diff --git a/src/preferences.hpp b/src/preferences.hpp index b450ce12e59..625c6f7edc1 100644 --- a/src/preferences.hpp +++ b/src/preferences.hpp @@ -113,6 +113,8 @@ namespace preferences { int draw_delay(); void set_draw_delay(int value); + bool animate_map(); + bool show_fps(); void set_show_fps(bool value);