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

Function AS_GetGeneralSet

code/client/snd_ambient.cpp:444–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442*/
443
444static void AS_GetGeneralSet( ambientSet_t &set )
445{
446 int keywordID;
447
448 //The other parameters of the set come in a specific order
449 while ( parsePos <= parseSize )
450 {
451 int iFieldsScanned = sscanf( parseBuffer+parsePos, "%s", tempBuffer );
452 if (iFieldsScanned <= 0)
453 return;
454
455 keywordID = AS_GetKeywordIDForString( (const char *) &tempBuffer );
456
457 //Find and parse the keyword info
458 switch ( keywordID )
459 {
460 case SET_KEYWORD_TIMEBETWEENWAVES:
461 AS_GetTimeBetweenWaves( set );
462 break;
463
464 case SET_KEYWORD_SUBWAVES:
465 AS_GetSubWaves( set );
466 break;
467
468 case SET_KEYWORD_LOOPEDWAVE:
469 AS_GetLoopedWave( set );
470 break;
471
472 case SET_KEYWORD_VOLRANGE:
473 AS_GetVolumeRange( set );
474 break;
475
476 default:
477
478 //Check to see if we've finished this group
479 if ( AS_GetSetNameIDForString( (const char *) &tempBuffer ) == -1 )
480 {
481 //Ignore comments
482 if ( tempBuffer[0] == ';' )
483 return;
484
485 //This wasn't a set name, so it's an error
486 #ifndef FINAL_BUILD
487 Com_Printf( S_COLOR_YELLOW"WARNING: Unknown ambient set keyword \"%s\"\n", tempBuffer );
488 #endif
489 }
490
491 return;
492 break;
493 }
494 }
495}
496
497/*
498-------------------------

Callers

nothing calls this directly

Calls 8

sscanfFunction · 0.85
AS_GetKeywordIDForStringFunction · 0.70
AS_GetTimeBetweenWavesFunction · 0.70
AS_GetSubWavesFunction · 0.70
AS_GetLoopedWaveFunction · 0.70
AS_GetVolumeRangeFunction · 0.70
AS_GetSetNameIDForStringFunction · 0.70
Com_PrintfFunction · 0.50

Tested by

no test coverage detected