From 64ad97cf2f1942a21a93888927429ad3d68e6fb2 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 6 Aug 2019 21:03:26 +0200 Subject: [PATCH] shmup:: no longer ignores frame limit (just sets it to 30) --- control.cpp | 9 ++++++--- shmup.cpp | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/control.cpp b/control.cpp index aae6d3f9..994d5061 100644 --- a/control.cpp +++ b/control.cpp @@ -540,6 +540,8 @@ void resize_screen_to(int x, int y) { setvideomode(); } +int lastframe; + void mainloopiter() { DEBB(DF_GRAPH, ("main loop\n")); @@ -553,16 +555,17 @@ void mainloopiter() { conformal::configure(); + lastt = ticks; ticks = SDL_GetTicks(); callhooks(hooks_fixticks); - timetowait = lastt + 1000 / cframelimit - ticks; + timetowait = lastframe + 1000 / cframelimit - ticks; cframelimit = vid.framelimit; if(outoffocus && cframelimit > 10) cframelimit = 10; bool normal = cmode & sm::NORMAL; - + shmup::turn(ticks - lastt); if(!shmup::on && (multi::alwaysuse || multi::players > 1) && normal) @@ -615,7 +618,7 @@ void mainloopiter() { if(!outoffocus) { drawscreen(); } - lastt = ticks; + lastframe = ticks; } Uint8 *keystate = SDL_GetKeyState(NULL); diff --git a/shmup.cpp b/shmup.cpp index e66f129e..85db6313 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -3338,8 +3338,6 @@ void turn(int delta) { return; } - timetowait = 0; - passive_switch = (gold() & 1) ? moSwitch1 : moSwitch2; if(delta > 1000) delta = 1000;