fix fps sleep

This commit is contained in:
Nishi 2026-01-13 01:04:11 +09:00
commit 5c041e0320
Signed by: nishi
GPG key ID: 27EF69B208EB9343
2 changed files with 4 additions and 11 deletions

View file

@ -101,7 +101,6 @@ void GSEngineParamInit(GSEngineParam* param) {
void GSEngineLoop(GSEngine engine) {
long t = 0;
int wait_actually = 0;
int more = 0;
long wait = 1000 / 50.0;
if(engine->param->sleep == NULL || engine->param->get_tick == NULL) {
@ -120,16 +119,10 @@ void GSEngineLoop(GSEngine engine) {
if(engine->param->tick != NULL) engine->param->tick();
if(wait_actually) {
int diff = (wait - more) - (engine->param->get_tick() - t);
int diff = (engine->param->get_tick() - t);
if(diff > 0) {
engine->param->sleep(diff);
}
more -= diff;
if(more < 0) more = 0;
if(more > (wait * 10)) more = 0;
if ( wait > diff )
engine->param->sleep(wait-diff);
t = engine->param->get_tick();
}

@ -1 +1 @@
Subproject commit a0d1bada8ff03aacca93dfc393e7838c703a60b6
Subproject commit eb50af2b815f7241d79233cd38c8a0186b3d2a6b