mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-27 05:03:15 +00:00
correct key buffering
This commit is contained in:
parent
45ff7a4e10
commit
b90df0d37b
14
control.cpp
14
control.cpp
@ -697,6 +697,7 @@ EX void mainloopiter() {
|
|||||||
frames++;
|
frames++;
|
||||||
if(!outoffocus) {
|
if(!outoffocus) {
|
||||||
drawscreen();
|
drawscreen();
|
||||||
|
need_refresh = false;
|
||||||
}
|
}
|
||||||
lastframe = ticks;
|
lastframe = ticks;
|
||||||
}
|
}
|
||||||
@ -779,7 +780,9 @@ EX void mainloopiter() {
|
|||||||
if(joydir.d != -1) checkjoy();
|
if(joydir.d != -1) checkjoy();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX bool need_refresh;
|
||||||
|
|
||||||
EX void handle_event(SDL_Event& ev) {
|
EX void handle_event(SDL_Event& ev) {
|
||||||
bool normal = cmode & sm::NORMAL;
|
bool normal = cmode & sm::NORMAL;
|
||||||
DEBB(DF_GRAPH, ("got event type #%d\n", ev.type));
|
DEBB(DF_GRAPH, ("got event type #%d\n", ev.type));
|
||||||
@ -1011,6 +1014,15 @@ EX void handle_event(SDL_Event& ev) {
|
|||||||
nofps = !nofps;
|
nofps = !nofps;
|
||||||
sym = 0;
|
sym = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sym || uni) {
|
||||||
|
if(need_refresh) {
|
||||||
|
just_refreshing = true;
|
||||||
|
screens.back()();
|
||||||
|
just_refreshing = false;
|
||||||
|
}
|
||||||
|
need_refresh = true;
|
||||||
|
}
|
||||||
|
|
||||||
handlekey(sym, uni);
|
handlekey(sym, uni);
|
||||||
}
|
}
|
||||||
|
@ -4938,8 +4938,12 @@ EX void drawfullmap() {
|
|||||||
extern bool wclick;
|
extern bool wclick;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
EX bool just_refreshing;
|
||||||
|
|
||||||
EX void gamescreen(int _darken) {
|
EX void gamescreen(int _darken) {
|
||||||
|
|
||||||
|
if(just_refreshing) return;
|
||||||
|
|
||||||
if(subscreens::split([=] () {
|
if(subscreens::split([=] () {
|
||||||
calcparam();
|
calcparam();
|
||||||
compute_graphical_distance();
|
compute_graphical_distance();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user