- play music on the summary screen and check for advancing every frame.

Fixes #203
This commit is contained in:
Christoph Oelckers 2020-08-18 20:26:16 +02:00
parent 5acd7cf5e1
commit 6eba7dc410
2 changed files with 16 additions and 7 deletions

View file

@ -383,17 +383,25 @@ private:
twod->ClearScreen(); twod->ClearScreen();
int totalclock = int(clock * 120 / 1'000'000'000); int totalclock = int(clock * 120 / 1'000'000'000);
while (totalclock > nextclock) if (clock == 0)
{ {
nextclock += synctics; PlaySong(nullptr, ThemeSongs[1], ThemeTrack[1]);
}
if (skiprequest && State >= s_BonusRest && State < &s_BonusRest[countof(s_BonusRest)]) if (skiprequest && State >= s_BonusRest && State < &s_BonusRest[countof(s_BonusRest)])
{
State = s_BonusAnim[STD_RANDOM_RANGE(countof(s_BonusAnim))];
Tics = 0;
skiprequest = false;
nextclock = totalclock;
}
else
{
while (totalclock > nextclock)
{ {
State = s_BonusAnim[STD_RANDOM_RANGE(countof(s_BonusAnim))]; nextclock += synctics;
Tics = 0; gStateControl(&State, &Tics);
skiprequest = false;
} }
gStateControl(&State, &Tics);
} }
twod->ClearScreen(); twod->ClearScreen();
DrawTexture(twod, tileGetTexture(BONUS_SCREEN_PIC, true), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); DrawTexture(twod, tileGetTexture(BONUS_SCREEN_PIC, true), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE);

View file

@ -47,6 +47,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "raze_sound.h" #include "raze_sound.h"
#include "sounds.h" #include "sounds.h"
#include "gamestate.h" #include "gamestate.h"
#include "raze_music.h"
#include "../../glbackend/glbackend.h" #include "../../glbackend/glbackend.h"