diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 593fc4eaf..95130d309 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -827,7 +827,7 @@ static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyO FVector3 pos, vel; FRolloffInfo *rolloff; - if (sound_id <= 0 || volume <= 0 || nosfx) + if (sound_id <= 0 || volume <= 0 || nosfx || nosound ) return NULL; int type; @@ -2582,38 +2582,41 @@ CCMD (idmus) FString map; int l; - if (argv.argc() > 1) + if (!nomusic) { - if (gameinfo.flags & GI_MAPxx) + if (argv.argc() > 1) { - l = atoi (argv[1]); - if (l <= 99) + if (gameinfo.flags & GI_MAPxx) { - map = CalcMapName (0, l); + l = atoi (argv[1]); + if (l <= 99) + { + map = CalcMapName (0, l); + } + else + { + Printf ("%s\n", GStrings("STSTR_NOMUS")); + return; + } + } + else + { + map = CalcMapName (argv[1][0] - '0', argv[1][1] - '0'); + } + + if ( (info = FindLevelInfo (map)) ) + { + if (info->Music.IsNotEmpty()) + { + S_ChangeMusic (info->Music, info->musicorder); + Printf ("%s\n", GStrings("STSTR_MUS")); + } } else { Printf ("%s\n", GStrings("STSTR_NOMUS")); - return; } } - else - { - map = CalcMapName (argv[1][0] - '0', argv[1][1] - '0'); - } - - if ( (info = FindLevelInfo (map)) ) - { - if (info->Music.IsNotEmpty()) - { - S_ChangeMusic (info->Music, info->musicorder); - Printf ("%s\n", GStrings("STSTR_MUS")); - } - } - else - { - Printf ("%s\n", GStrings("STSTR_NOMUS")); - } } } @@ -2625,27 +2628,30 @@ CCMD (idmus) CCMD (changemus) { - if (argv.argc() > 1) - { - if (PlayList) - { - delete PlayList; - PlayList = NULL; - } - S_ChangeMusic (argv[1], argv.argc() > 2 ? atoi (argv[2]) : 0); - } - else - { - const char *currentmus = mus_playing.name.GetChars(); - if(currentmus != NULL && *currentmus != 0) - { - Printf ("currently playing %s\n", currentmus); - } - else - { - Printf ("no music playing\n"); - } - } + if (!nomusic) + { + if (argv.argc() > 1) + { + if (PlayList) + { + delete PlayList; + PlayList = NULL; + } + S_ChangeMusic (argv[1], argv.argc() > 2 ? atoi (argv[2]) : 0); + } + else + { + const char *currentmus = mus_playing.name.GetChars(); + if(currentmus != NULL && *currentmus != 0) + { + Printf ("currently playing %s\n", currentmus); + } + else + { + Printf ("no music playing\n"); + } + } + } } //========================================================================== diff --git a/src/sound/i_music.h b/src/sound/i_music.h index 17775ebe0..d587d3129 100644 --- a/src/sound/i_music.h +++ b/src/sound/i_music.h @@ -93,6 +93,6 @@ public: bool m_Looping; bool m_NotStartedYet; // Song has been created but not yet played }; - +extern int nomusic; #endif //__I_MUSIC_H__ diff --git a/src/sound/i_musicinterns.h b/src/sound/i_musicinterns.h index 62a9f3710..29b655d11 100644 --- a/src/sound/i_musicinterns.h +++ b/src/sound/i_musicinterns.h @@ -593,6 +593,7 @@ protected: void SetupForHMI(int len); void SetupForHMP(int len); void CheckCaps(int tech); + void DoInitialSetup(); void DoRestart(); bool CheckDone(); @@ -749,6 +750,5 @@ MusInfo *GME_OpenSong(FILE *file, BYTE *musiccache, int len, const char *fmt); // -------------------------------------------------------------------------- extern MusInfo *currSong; -extern int nomusic; EXTERN_CVAR (Float, snd_musicvolume) diff --git a/src/sound/i_sound.cpp b/src/sound/i_sound.cpp index 8f62d3e69..27c00e93f 100644 --- a/src/sound/i_sound.cpp +++ b/src/sound/i_sound.cpp @@ -81,6 +81,7 @@ CVAR (String, snd_output, "default", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, snd_pitched, false, CVAR_ARCHIVE) SoundRenderer *GSnd; +bool nosound; bool nosfx; void I_CloseSound (); @@ -235,7 +236,7 @@ public: void I_InitSound () { /* Get command line options: */ - bool nosound = !!Args->CheckParm ("-nosound"); + nosound = !!Args->CheckParm ("-nosound"); nosfx = !!Args->CheckParm ("-nosfx"); if (nosound) diff --git a/src/sound/i_sound.h b/src/sound/i_sound.h index 9aea1b525..660e47166 100644 --- a/src/sound/i_sound.h +++ b/src/sound/i_sound.h @@ -145,6 +145,7 @@ public: extern SoundRenderer *GSnd; extern bool nosfx; +extern bool nosound; void I_InitSound (); void I_ShutdownSound ();