mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-27 08:13:01 +00:00
Reduce refresh requests without screen vector
This commit is contained in:
parent
6d95f000b1
commit
b5fa665cdb
1 changed files with 7 additions and 4 deletions
11
src/uxnemu.c
11
src/uxnemu.c
|
@ -445,10 +445,13 @@ run(Uxn *u)
|
||||||
if(uxn_screen.fg.changed || uxn_screen.bg.changed)
|
if(uxn_screen.fg.changed || uxn_screen.bg.changed)
|
||||||
redraw();
|
redraw();
|
||||||
now = SDL_GetPerformanceCounter();
|
now = SDL_GetPerformanceCounter();
|
||||||
if(!BENCH && ((Sint64)(frame_end - now)) > 0) {
|
if(u->dev[0x20]) {
|
||||||
SDL_Delay((frame_end - now) / ms_interval);
|
if(!BENCH && ((Sint64)(frame_end - now)) > 0) {
|
||||||
now = frame_end;
|
SDL_Delay((frame_end - now) / ms_interval);
|
||||||
}
|
now = frame_end;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
SDL_WaitEvent(NULL);
|
||||||
}
|
}
|
||||||
return error("SDL_WaitEvent", SDL_GetError());
|
return error("SDL_WaitEvent", SDL_GetError());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue