Workaround a screen refresh issue with color cursors,

...and storyscreens on scenarios that signal end-of-level during
prestart and cause a save game dialog to pop up
This commit is contained in:
Ignacio R. Morelle 2011-02-20 21:51:31 +00:00
parent 72edb12b42
commit eb0aedace0

View file

@ -340,12 +340,16 @@ LEVEL_RESULT playsingle_controller::play_scenario(
end_level.carryover_percentage = level_["carryover_percentage"].to_int(game_config::gold_carryover_percentage);
end_level.carryover_add = level_["carryover_add"].to_bool();
bool past_prestart = false;
LOG_NG << "entering try... " << (SDL_GetTicks() - ticks_) << "\n";
try {
fire_prestart(!loading_game_);
init_gui();
past_prestart = true;
LOG_NG << "first_time..." << (recorder.is_skipping() ? "skipping" : "no skip") << "\n";
fire_start(!loading_game_);
@ -391,6 +395,14 @@ LEVEL_RESULT playsingle_controller::play_scenario(
}
throw lge;
} catch (end_level_exception &end_level_exn) {
if(!past_prestart) {
draw_solid_tinted_rectangle(
0, 0, gui_->video().getx(), gui_->video().gety(), 0, 0, 0, 1.0,
gui_->video().getSurface()
);
update_rect(0, 0, gui_->video().getx(), gui_->video().gety());
}
game::exception::sticky = NULL;
ai_testing::log_game_end();
LEVEL_RESULT end_level_result = end_level_exn.result;