- added Edward-san's improvements for changemus command.

SVN r2902 (trunk)
This commit is contained in:
Christoph Oelckers 2010-10-05 22:35:59 +00:00
parent 5ff3b3f329
commit 0490c35347
5 changed files with 56 additions and 48 deletions

View file

@ -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,6 +2582,8 @@ CCMD (idmus)
FString map;
int l;
if (!nomusic)
{
if (argv.argc() > 1)
{
if (gameinfo.flags & GI_MAPxx)
@ -2615,6 +2617,7 @@ CCMD (idmus)
Printf ("%s\n", GStrings("STSTR_NOMUS"));
}
}
}
}
//==========================================================================
@ -2625,6 +2628,8 @@ CCMD (idmus)
CCMD (changemus)
{
if (!nomusic)
{
if (argv.argc() > 1)
{
if (PlayList)
@ -2646,6 +2651,7 @@ CCMD (changemus)
Printf ("no music playing\n");
}
}
}
}
//==========================================================================

View file

@ -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__

View file

@ -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)

View file

@ -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)

View file

@ -145,6 +145,7 @@ public:
extern SoundRenderer *GSnd;
extern bool nosfx;
extern bool nosound;
void I_InitSound ();
void I_ShutdownSound ();