diff --git a/control.cpp b/control.cpp index c9045692..98318f6c 100644 --- a/control.cpp +++ b/control.cpp @@ -697,6 +697,7 @@ EX void mainloopiter() { frames++; if(!outoffocus) { drawscreen(); + need_refresh = false; } lastframe = ticks; } @@ -779,7 +780,9 @@ EX void mainloopiter() { if(joydir.d != -1) checkjoy(); #endif } - + +EX bool need_refresh; + EX void handle_event(SDL_Event& ev) { bool normal = cmode & sm::NORMAL; DEBB(DF_GRAPH, ("got event type #%d\n", ev.type)); @@ -1011,6 +1014,15 @@ EX void handle_event(SDL_Event& ev) { nofps = !nofps; sym = 0; } + + if(sym || uni) { + if(need_refresh) { + just_refreshing = true; + screens.back()(); + just_refreshing = false; + } + need_refresh = true; + } handlekey(sym, uni); } diff --git a/graph.cpp b/graph.cpp index e54a1a10..bfa1cbe7 100644 --- a/graph.cpp +++ b/graph.cpp @@ -4938,8 +4938,12 @@ EX void drawfullmap() { extern bool wclick; #endif +EX bool just_refreshing; + EX void gamescreen(int _darken) { + if(just_refreshing) return; + if(subscreens::split([=] () { calcparam(); compute_graphical_distance();