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

Function AS_GetLocalSet

code/client/snd_ambient.cpp:503–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501*/
502
503static void AS_GetLocalSet( ambientSet_t &set )
504{
505 int keywordID;
506
507 //The other parameters of the set come in a specific order
508 while ( parsePos <= parseSize )
509 {
510 int iFieldsScanned = sscanf( parseBuffer+parsePos, "%s", tempBuffer );
511 if (iFieldsScanned <= 0)
512 return;
513
514 keywordID = AS_GetKeywordIDForString( (const char *) &tempBuffer );
515
516 //Find and parse the keyword info
517 switch ( keywordID )
518 {
519 case SET_KEYWORD_TIMEBETWEENWAVES:
520 AS_GetTimeBetweenWaves( set );
521 break;
522
523 case SET_KEYWORD_SUBWAVES:
524 AS_GetSubWaves( set );
525 break;
526
527 case SET_KEYWORD_LOOPEDWAVE:
528 AS_GetLoopedWave( set );
529 break;
530
531 case SET_KEYWORD_VOLRANGE:
532 AS_GetVolumeRange( set );
533 break;
534
535 case SET_KEYWORD_RADIUS:
536 AS_GetRadius( set );
537 break;
538
539 default:
540
541 //Check to see if we've finished this group
542 if ( AS_GetSetNameIDForString( (const char *) &tempBuffer ) == -1 )
543 {
544 //Ignore comments
545 if ( tempBuffer[0] == ';' )
546 return;
547
548 //This wasn't a set name, so it's an error
549 #ifndef FINAL_BUILD
550 Com_Printf( S_COLOR_YELLOW"WARNING: Unknown ambient set keyword \"%s\"\n", tempBuffer );
551 #endif
552 }
553
554 return;
555 break;
556 }
557 }
558}
559
560/*

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected