- transitioned cloudclock.

This timer runs at 60 Hz in the render code, so it needs to take smoothratio into account.
This commit is contained in:
Christoph Oelckers 2020-08-31 19:22:21 +02:00
parent 9a208185d6
commit 71c3441b1e
2 changed files with 6 additions and 4 deletions

View File

@ -23,7 +23,7 @@ void resetlanepics(void);
void moveplayers();
void doanimations();
void movefx();
void moveclouds(void);
void moveclouds(double smoothratio);
void RANDOMSCRAP(spritetype* s, int i);
void ms(short i);

View File

@ -1140,11 +1140,13 @@ void allignwarpelevators(void)
//
//---------------------------------------------------------------------------
void moveclouds(void)
void moveclouds(double smoothratio)
{
if (gameclock > cloudclock || gameclock < (cloudclock - 7))
// The math here is very messy... :(
int myclock = smoothratio < 32768? ud.levelclock-2 : ud.levelclock;
if (myclock > cloudclock || myclock < (cloudclock - 7))
{
cloudclock = gameclock + 6;
cloudclock = myclock + 6;
// cloudx/y were an array, but all entries were always having the same value so a single pair is enough.
cloudx += (sintable[(ps[screenpeek].getang() + 512) & 2047] >> 9);