1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-08-31 01:37:57 +00:00

more fixes to currently_scrolling; also use SDL_WaitEventTimeout in SDL2

This commit is contained in:
Zeno Rogue
2025-03-08 12:51:00 +01:00
parent b7d50896ec
commit 7830e45109
2 changed files with 14 additions and 2 deletions

View File

@@ -859,8 +859,11 @@ EX void mainloopiter() {
timetowait = 0;
#endif
if(timetowait > 0)
if(timetowait > 0) {
#if !CAP_SDL2
SDL_Delay(timetowait);
#endif
}
else {
ors::check_orientation();
if(cmode & sm::CENTER) {
@@ -931,6 +934,7 @@ EX void mainloopiter() {
forcetarget = anyshiftclick;
didsomething = false;
currently_scrolling = false;
if(vid.shifttarget&1) {
#if ISPANDORA
@@ -1067,6 +1071,14 @@ EX void mainloopiter() {
if((cmode & (sm::DRAW | sm::MAP)) && holdmouse && anims::ma && mouseover)
handlekey(getcstat, getcstat);
if(((SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_MMASK)) && !mouseout2())
currently_scrolling = true;
#if CAP_SDL2
if(timetowait > 0) {
if(SDL_WaitEventTimeout(&ev, timetowait)) handle_event(ev);
}
#endif
while(SDL_PollEvent(&ev)) handle_event(ev);
fix_mouseh();