diff --git a/biniax.c b/biniax.c index 886b692..36bbbdf 100755 --- a/biniax.c +++ b/biniax.c @@ -201,7 +201,12 @@ int main( int argc, char *argv[] ) { BNX_INT16 naction; +#ifdef __EMSCRIPTEN__ + /* fredygames.com browser build: biniax_common00.it is not distributed (see snd.c) */ + sndPlayMusic( 1 + sysRand( cSndMaxMusic-2 ) ); +#else sndPlayMusic( sysRand( cSndMaxMusic-1 ) ); +#endif naction = gameSession( &Game ); switch ( naction ) { diff --git a/desktop/snd.c b/desktop/snd.c index 55b1c87..06fd544 100755 --- a/desktop/snd.c +++ b/desktop/snd.c @@ -69,7 +69,13 @@ BNX_BOOL sndInit() _Snd.sounds[ 4 ] = Mix_LoadWAV( "data/sound/sfx4.wav" ); _Snd.sounds[ 5 ] = Mix_LoadWAV( "data/sound/sfx5.wav" ); +#ifdef __EMSCRIPTEN__ + /* fredygames.com browser build: this module's own text credits the song "Spaceships" to another + * musician, so it is left out and the in-game tracks are picked among 1 to 6 */ + _Snd.music[ 0 ] = NULL; +#else _Snd.music[ 0 ] = Mix_LoadMUS( "data/music/biniax_common00.it" ); +#endif _Snd.music[ 1 ] = Mix_LoadMUS( "data/music/biniax_common01.it" ); _Snd.music[ 2 ] = Mix_LoadMUS( "data/music/biniax_common02.it" ); _Snd.music[ 3 ] = Mix_LoadMUS( "data/music/biniax_common03.it" ); @@ -140,7 +146,12 @@ void sndUpdateMusic( BNX_GAME *game, BNX_BOOL change ) { do { +#ifdef __EMSCRIPTEN__ + /* fredygames.com browser build: biniax_common00.it is not distributed (see above) */ + newMusic = 1 + sysRand( cSndMaxMusic-2 ); +#else newMusic = sysRand( cSndMaxMusic-1 ); +#endif } while( _Snd.curMusic == newMusic ); _Snd.curMusic = newMusic; diff --git a/desktop/sys.c b/desktop/sys.c index 20528c0..8f84565 100755 --- a/desktop/sys.c +++ b/desktop/sys.c @@ -61,7 +61,15 @@ BNX_UINT32 sysGetTime() char* sysGetFullFileName( char *file ) { +#ifdef __EMSCRIPTEN__ + /* fredygames.com browser build: the configuration, the hall of fame and the saved game live in + * /home/web_user/biniax2, which the page keeps in the browser's IndexedDB */ + static char path[ 256 ]; + snprintf( path, sizeof( path ), "/home/web_user/biniax2/%s", file ); + return path; +#else return (char *) file; +#endif } void sysUpdate()