Skip to content

Commit

Permalink
Get theme music going in splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
jorio committed Feb 11, 2023
1 parent d6986d5 commit ae730c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "grays.h"
#include "level.h"
#include "keyselect.h"
#include "music.h"


SDL_Surface* backdropSurface = NULL;
Expand Down Expand Up @@ -169,7 +170,6 @@ void ShowTitle( void )

RetrieveResources( );

MTicks time = MTickCount() + 120;
SDLU_AcquireSurface( g_frontSurface );
DrawPICTInSurface( g_frontSurface, picTitle );

Expand All @@ -183,6 +183,11 @@ void ShowTitle( void )
}
SDLU_ReleaseSurface( g_frontSurface );

ChooseMusic( 13 );

QuickFadeIn( NULL );

MTicks time = MTickCount() + 150;
while( time > MTickCount() && !SDLU_Button() )
{
SDLU_Present();
Expand Down
3 changes: 2 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ int main(int argc, char *argv[])
ReserveMonitor( );
ShowTitle( );

ChooseMusic( 13 );
if ( GetCurrentMusic() != 13 )
ChooseMusic( 13 );

while (!finished)
{
Expand Down
5 changes: 5 additions & 0 deletions src/music.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ void ResumeMusic( void )
}
}

int GetCurrentMusic( void )
{
return musicSelection;
}

void ChooseMusic( short which )
{
// Kill existing song first, if any
Expand Down
1 change: 1 addition & 0 deletions src/music.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ void PauseMusic( void );
void ResumeMusic( void );
void FastMusic( void );
void SlowMusic( void );
int GetCurrentMusic( void );
void ChooseMusic( short which );
void ShutdownMusic();

Expand Down

0 comments on commit ae730c8

Please sign in to comment.