本文整理汇总了C++中idLexer::FreeSource方法的典型用法代码示例。如果您正苦于以下问题:C++ idLexer::FreeSource方法的具体用法?C++ idLexer::FreeSource怎么用?C++ idLexer::FreeSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idLexer
的用法示例。
在下文中一共展示了idLexer::FreeSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseShader
/*
===============
idSoundShader::ParseShader
===============
*/
bool idSoundShader::ParseShader( idLexer &src )
{
int i;
idToken token;
parms.minDistance = 1;
parms.maxDistance = 10;
parms.volume = 1;
parms.shakes = 0;
parms.soundShaderFlags = 0;
parms.soundClass = 0;
speakerMask = 0;
altSound = NULL;
for( i = 0; i < SOUND_MAX_LIST_WAVS; i++ )
{
leadins[i] = NULL;
entries[i] = NULL;
}
numEntries = 0;
numLeadins = 0;
int maxSamples = idSoundSystemLocal::s_maxSoundsPerShader.GetInteger();
if ( com_makingBuild.GetBool() || maxSamples <= 0 || maxSamples > SOUND_MAX_LIST_WAVS )
{
maxSamples = SOUND_MAX_LIST_WAVS;
}
while ( 1 )
{
if ( !src.ExpectAnyToken( &token ) )
{
return false;
}
// end of definition
else if ( token == "}" )
{
break;
}
// minimum number of sounds
else if ( !token.Icmp( "minSamples" ) )
{
maxSamples = idMath::ClampInt( src.ParseInt(), SOUND_MAX_LIST_WAVS, maxSamples );
}
// description
else if ( !token.Icmp( "description" ) )
{
src.ReadTokenOnLine( &token );
desc = token.c_str();
}
// mindistance
else if ( !token.Icmp( "mindistance" ) )
{
parms.minDistance = src.ParseFloat();
}
// maxdistance
else if ( !token.Icmp( "maxdistance" ) )
{
parms.maxDistance = src.ParseFloat();
}
// shakes screen
else if ( !token.Icmp( "shakes" ) )
{
src.ExpectAnyToken( &token );
if ( token.type == TT_NUMBER )
{
parms.shakes = token.GetFloatValue();
}
else
{
src.UnreadToken( &token );
parms.shakes = 1.0f;
}
}
// reverb
else if ( !token.Icmp( "reverb" ) )
{
int reg0 = src.ParseFloat();
if ( !src.ExpectTokenString( "," ) )
{
src.FreeSource();
return false;
}
int reg1 = src.ParseFloat();
// no longer supported
}
// volume
else if ( !token.Icmp( "volume" ) )
{
parms.volume = src.ParseFloat();
}
// leadinVolume is used to allow light breaking leadin sounds to be much louder than the broken loop
else if ( !token.Icmp( "leadinVolume" ) )
{
//.........这里部分代码省略.........
示例2: ParseShader
/*
===============
idSoundShader::ParseShader
===============
*/
bool idSoundShader::ParseShader( idLexer &src ) {
idToken token;
parms.minDistance = 1;
parms.maxDistance = 10;
parms.volume = 1;
parms.shakes = 0;
parms.soundShaderFlags = 0;
parms.soundClass = 0;
speakerMask = 0;
altSound = NULL;
entries.Clear();
while ( 1 ) {
if ( !src.ExpectAnyToken( &token ) ) {
return false;
}
// end of definition
else if ( token == "}" ) {
break;
}
// minimum number of sounds
else if ( !token.Icmp( "minSamples" ) ) {
src.ParseInt();
}
// description
else if ( !token.Icmp( "description" ) ) {
src.ReadTokenOnLine( &token );
}
// mindistance
else if ( !token.Icmp( "mindistance" ) ) {
parms.minDistance = src.ParseFloat();
}
// maxdistance
else if ( !token.Icmp( "maxdistance" ) ) {
parms.maxDistance = src.ParseFloat();
}
// shakes screen
else if ( !token.Icmp( "shakes" ) ) {
src.ExpectAnyToken( &token );
if ( token.type == TT_NUMBER ) {
parms.shakes = token.GetFloatValue();
} else {
src.UnreadToken( &token );
parms.shakes = 1.0f;
}
}
// reverb
else if ( !token.Icmp( "reverb" ) ) {
src.ParseFloat();
if ( !src.ExpectTokenString( "," ) ) {
src.FreeSource();
return false;
}
src.ParseFloat();
// no longer supported
}
// volume
else if ( !token.Icmp( "volume" ) ) {
parms.volume = src.ParseFloat();
}
// leadinVolume is used to allow light breaking leadin sounds to be much louder than the broken loop
else if ( !token.Icmp( "leadinVolume" ) ) {
leadinVolume = src.ParseFloat();
leadin = true;
}
// speaker mask
else if ( !token.Icmp( "mask_center" ) ) {
speakerMask |= 1<<SPEAKER_CENTER;
}
// speaker mask
else if ( !token.Icmp( "mask_left" ) ) {
speakerMask |= 1<<SPEAKER_LEFT;
}
// speaker mask
else if ( !token.Icmp( "mask_right" ) ) {
speakerMask |= 1<<SPEAKER_RIGHT;
}
// speaker mask
else if ( !token.Icmp( "mask_backright" ) ) {
speakerMask |= 1<<SPEAKER_BACKRIGHT;
}
// speaker mask
else if ( !token.Icmp( "mask_backleft" ) ) {
speakerMask |= 1<<SPEAKER_BACKLEFT;
}
// speaker mask
else if ( !token.Icmp( "mask_lfe" ) ) {
speakerMask |= 1<<SPEAKER_LFE;
}
// soundClass
else if ( !token.Icmp( "soundClass" ) ) {
parms.soundClass = src.ParseInt();
//.........这里部分代码省略.........