MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Music_BuildFileName

Function Music_BuildFileName

code/client/snd_music.cpp:163–177  ·  view source on GitHub ↗

the 2nd param here is pretty kludgy (sigh), and only used for testing for the "boss" type. Unfortunately two of the places that calls this doesn't have much other access to the state other than a string, not an enum, so for those cases they only pass in BOSS or EXPLORE, so don't rely on it totally.

Source from the content-addressed store, hash-verified

161// a string, not an enum, so for those cases they only pass in BOSS or EXPLORE, so don't rely on it totally.
162//
163static const char *Music_BuildFileName(const char *psFileNameBase, MusicState_e eMusicState )
164{
165 static sstring_t sFileName;
166
167 //HACK!
168 if (eMusicState == eBGRNDTRACK_DEATH)
169 {
170 return "music/death_music.mp3";
171 }
172
173 const char *psDirName = (eMusicState == eBGRNDTRACK_BOSS) ? gsLevelNameForBossLoad.c_str() : gsLevelNameForLoad.c_str();
174
175 sFileName = va("music/%s/%s.mp3",psDirName,psFileNameBase);
176 return sFileName.c_str();
177}
178
179// this MUST return NULL for non-base states unless doing debug-query
180const char *Music_BaseStateToString( MusicState_e eMusicState, qboolean bDebugPrintQuery /* = qfalse */ )

Callers 2

Music_ParseLeveldataFunction · 0.70

Calls 2

vaFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected