Added an option to compile a binary that will use the original music.

We can't distribute the original music, but adding support for it in
as a compile-time option will enable modding the game to look and
feel like the original without having to edit the source code.
This commit is contained in:
Layla Marchant 2020-12-26 13:33:15 -05:00
parent 5b29033700
commit 69430b7a2a
No known key found for this signature in database
GPG Key ID: 52FB5C20A8336782
7 changed files with 71 additions and 3 deletions

View File

@ -62,6 +62,7 @@ AC_ARG_VAR([SF_WARN], [Set to 1 to enable compiler warnings])
AC_ARG_VAR([SF_SCREEN_WIDTH], [The width of the game window in pixels])
AC_ARG_VAR([SF_SCREEN_HEIGHT], [The height of the game window in pixels])
AC_ARG_VAR([SF_NOFONT], [Set to 1 to manually force the compiler not to include font/Unicode support])
AC_ARG_VAR([SF_OLD_MUSIC], [Set to 1 to compile for use with the MOD-based music originally packaged with the game by Parallel Realities (note: you must supply said music if you use this option; all files must have the same name and format as distributed with Project: Starfighter 1.1)])
AC_ARG_VAR([SF_RUN_IN_PLACE], [Set to 1 to compile Starfighter to run in-place (instead of installing)])
AS_IF([test -n "$SF_WARN"], [
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -Wall -Wformat-truncation=0"
@ -84,6 +85,11 @@ AS_IF([test -n "$SF_NOFONT"], [
echo "Font/Unicode support manually disabled"
])
AS_IF([test -n "$SF_OLD_MUSIC"], [
STARFIGHTER_CPPFLAGS="$STARFIGHTER_CPPFLAGS -DOLD_MUSIC"
echo "Building for use with old music"
])
AS_IF([test -n "$SF_RUN_IN_PLACE"], [
echo "Preparing a run-in-place build"
])

View File

@ -17,4 +17,3 @@ nobase_dist_music_DATA = \
space_dimensions.ogg \
through_space.ogg \
walking_among_androids.ogg

View File

@ -188,25 +188,60 @@ void audio_playRandomTrack()
if ((!engine.useMusic) || (!engine.useAudio))
return;
#ifdef OLD_MUSIC
int tracks = 0;
char track[][PATH_MAX] = {
"music/Frantic.mod", "music/Artificial.mod", "music/Lunatic.mod",
"music/ToxicFriend.mod", "music/DigitalInferno.mod",
"music/TempoTrance.mod", "music/IntoTheMachine.mod"
};
switch (game.system)
{
case SYSTEM_SPIRIT:
tracks = 3;
break;
case SYSTEM_EYANANTH:
tracks = 5;
break;
case SYSTEM_MORDOR:
case SYSTEM_SOL:
tracks = 7;
break;
default:
tracks = 3;
}
#else
int tracks = 4;
char track[][64] = {
char track[][PATH_MAX] = {
"music/railjet_short.ogg", "music/space_dimensions.ogg",
"music/frozen_jam.ogg", "music/sound_and_silence.ogg"
};
#endif
switch (game.area)
{
#ifndef OLD_MUSIC
case MISN_START:
audio_playMusic("music/railjet_short.ogg", -1);
break;
#endif
case MISN_MOEBO:
case MISN_ELAMALE:
case MISN_ELLESH:
case MISN_EARTH:
#ifdef OLD_MUSIC
audio_playMusic("music/HardTranceDub.mod", -1);
#else
audio_playMusic("music/orbital_colossus.ogg", -1);
#endif
break;
case MISN_VENUS:
#ifdef OLD_MUSIC
audio_playMusic("music/LoopsAndTings.mod", -1);
#else
audio_playMusic("music/RE.ogg", -1);
#endif
break;
default:
audio_playMusic(track[rand() % tracks], -1);

View File

@ -2448,7 +2448,11 @@ static void game_showGameOver()
screen_clear(black);
SDL_Delay(1000);
#ifdef OLD_MUSIC
audio_playMusic("music/Wybierak.mod", -1);
#else
audio_playMusic("music/death.ogg", -1);
#endif
int x = (screen->w - gameover->w) / 2;
int y = (screen->h - gameover->h) / 2;

View File

@ -1318,7 +1318,11 @@ static void intermission_doOptions(SDL_Surface *optionsSurface, int x, int y)
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x + 187, y + 92, 45, 22))
{
engine.useMusic = 1;
#ifdef OLD_MUSIC
audio_playMusic("music/3DParadise.mod", -1);
#else
audio_playMusic("music/through_space.ogg", -1);
#endif
}
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x + 248, y + 92, 45, 22))
@ -1500,7 +1504,11 @@ int intermission()
}
if ((engine.useAudio) && (engine.useMusic))
#ifdef OLD_MUSIC
audio_playMusic("music/3DParadise.mod", -1);
#else
audio_playMusic("music/through_space.ogg", -1);
#endif
/// Retain "%s" as-is. It is replaced with the current system name.
snprintf(string, STRMAX_SHORT, _("System : %s"), game_systemNames[game.system]);

View File

@ -924,7 +924,11 @@ static int mission_revealObjectives()
aliens[ALIEN_KLINE].y = player.y;
aliens[ALIEN_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE;
player_setTarget(ALIEN_KLINE);
#ifdef OLD_MUSIC
audio_playMusic("music/TranceGeneration.mod", -1);
#else
audio_playMusic("music/last_cyber_dance.ogg", -1);
#endif
}
}

View File

@ -313,7 +313,11 @@ int title_show()
player_flushInput();
engine.keyState[KEY_FIRE] = engine.keyState[KEY_ALTFIRE] = 0;
#ifdef OLD_MUSIC
audio_playMusic("music/Platinum.mod", 1);
#else
audio_playMusic("music/walking_among_androids.ogg", 1);
#endif
while (!engine.done)
{
@ -510,7 +514,11 @@ int title_show()
if (engine.useMusic)
{
#ifdef OLD_MUSIC
audio_playMusic("music/Platinum.mod", 1);
#else
audio_playMusic("music/walking_among_androids.ogg", 1);
#endif
}
else
{
@ -643,7 +651,11 @@ void title_showCredits()
screen_drawBackground();
#ifdef OLD_MUSIC
audio_playMusic("music/Solace.s3m", 1);
#else
audio_playMusic("music/rise_of_spirit.ogg", 1);
#endif
fp = fopen("data/credits.txt", "rb");