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

Function AS_GetLoopedWave

code/client/snd_ambient.cpp:371–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369*/
370
371static void AS_GetLoopedWave( ambientSet_t &set )
372{
373 char waveBuffer[256], waveName[1024];
374
375 //Get the looped wave name
376 sscanf( parseBuffer+parsePos, "%s %s", tempBuffer, waveBuffer );
377
378 //Construct the wave name
379 Com_sprintf( waveName, sizeof(waveName), "sound/%s.wav", waveBuffer );
380
381 //Precache the file at this point and store off the ID instead of the name
382 if ( ( set.loopedWave = S_RegisterSound( waveName ) ) <= 0 )
383 {
384 #ifndef FINAL_BUILD
385 Com_Printf(S_COLOR_RED"ERROR: Unable to load ambient sound \"%s\"\n", waveName);
386 #endif
387 }
388
389 AS_SkipLine();
390}
391
392/*
393-------------------------

Callers 2

AS_GetGeneralSetFunction · 0.70
AS_GetLocalSetFunction · 0.70

Calls 5

sscanfFunction · 0.85
S_RegisterSoundFunction · 0.70
AS_SkipLineFunction · 0.70
Com_sprintfFunction · 0.50
Com_PrintfFunction · 0.50

Tested by

no test coverage detected