本文整理汇总了C++中idLexer::ParseBool方法的典型用法代码示例。如果您正苦于以下问题:C++ idLexer::ParseBool方法的具体用法?C++ idLexer::ParseBool怎么用?C++ idLexer::ParseBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idLexer
的用法示例。
在下文中一共展示了idLexer::ParseBool方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseBool
/*
============
idAASSettings::ParseBool
============
*/
bool idAASSettings::ParseBool( idLexer &src, bool &b ) {
if ( !src.ExpectTokenString( "=" ) ) {
return false;
}
b = src.ParseBool();
return true;
}
示例2: ParseBody
//.........这里部分代码省略.........
!src.ExpectTokenString( "," ) ||
!body->v2.Parse( src ) ||
!src.ExpectTokenString( "," ) ) {
return false;
}
body->numSides = src.ParseInt();
if ( !src.ExpectTokenString( ")" ) ) {
return false;
}
} else if ( !token.Icmp( "bone" ) ) {
body->modelType = TRM_BONE;
if ( !src.ExpectTokenString( "(" ) ||
!body->v1.Parse( src ) ||
!src.ExpectTokenString( "," ) ||
!body->v2.Parse( src ) ||
!src.ExpectTokenString( "," ) ) {
return false;
}
body->width = src.ParseFloat();
if ( !src.ExpectTokenString( ")" ) ) {
return false;
}
} else if ( !token.Icmp( "custom" ) ) {
src.Error( "custom models not yet implemented" );
return false;
} else {
src.Error( "unkown model type %s", token.c_str() );
return false;
}
} else if ( !token.Icmp( "origin" ) ) {
if ( !body->origin.Parse( src ) ) {
return false;
}
} else if ( !token.Icmp( "angles" ) ) {
if ( !angles.Parse( src ) ) {
return false;
}
body->angles = idAngles( angles.ToVec3().x, angles.ToVec3().y, angles.ToVec3().z );
} else if ( !token.Icmp( "joint" ) ) {
if ( !src.ExpectTokenType( TT_STRING, 0, &token ) ) {
return false;
}
body->jointName = token;
hasJoint = true;
} else if ( !token.Icmp( "mod" ) ) {
if ( !src.ExpectAnyToken( &token ) ) {
return false;
}
body->jointMod = JointModFromString( token.c_str() );
} else if ( !token.Icmp( "density" ) ) {
body->density = src.ParseFloat();
} else if ( !token.Icmp( "inertiaScale" ) ) {
src.Parse1DMatrix( 9, body->inertiaScale[0].ToFloatPtr() );
} else if ( !token.Icmp( "friction" ) ) {
body->linearFriction = src.ParseFloat();
src.ExpectTokenString( "," );
body->angularFriction = src.ParseFloat();
src.ExpectTokenString( "," );
body->contactFriction = src.ParseFloat();
} else if ( !token.Icmp( "contents" ) ) {
ParseContents( src, body->contents );
} else if ( !token.Icmp( "clipMask" ) ) {
ParseContents( src, body->clipMask );
} else if ( !token.Icmp( "selfCollision" ) ) {
body->selfCollision = src.ParseBool();
} else if ( !token.Icmp( "containedjoints" ) ) {
if ( !src.ExpectTokenType( TT_STRING, 0, &token ) ) {
return false;
}
body->containedJoints = token;
} else if ( !token.Icmp( "frictionDirection" ) ) {
if ( !body->frictionDirection.Parse( src ) ) {
return false;
}
} else if ( !token.Icmp( "contactMotorDirection" ) ) {
if ( !body->contactMotorDirection.Parse( src ) ) {
return false;
}
} else if ( token == "}" ) {
break;
} else {
src.Error( "unknown token %s in body", token.c_str() );
return false;
}
}
if ( body->modelType == TRM_INVALID ) {
src.Error( "no model set for body" );
return false;
}
if ( !hasJoint ) {
src.Error( "no joint set for body" );
return false;
}
body->clipMask |= CONTENTS_MOVEABLECLIP;
return true;
}
示例3: ParseSettings
/*
================
idDeclAF::ParseSettings
================
*/
bool idDeclAF::ParseSettings( idLexer &src ) {
idToken token;
if ( !src.ExpectTokenString( "{" ) ) {
return false;
}
while( src.ReadToken( &token ) ) {
if ( !token.Icmp( "mesh" ) ) {
if ( !src.ExpectTokenType( TT_STRING, 0, &token ) ) {
return false;
}
} else if ( !token.Icmp( "anim" ) ) {
if ( !src.ExpectTokenType( TT_STRING, 0, &token ) ) {
return false;
}
} else if ( !token.Icmp( "model" ) ) {
if ( !src.ExpectTokenType( TT_STRING, 0, &token ) ) {
return false;
}
model = token;
} else if ( !token.Icmp( "skin" ) ) {
if ( !src.ExpectTokenType( TT_STRING, 0, &token ) ) {
return false;
}
skin = token;
} else if ( !token.Icmp( "friction" ) ) {
defaultLinearFriction = src.ParseFloat();
if ( !src.ExpectTokenString( "," ) ) {
return false;
}
defaultAngularFriction = src.ParseFloat();
if ( !src.ExpectTokenString( "," ) ) {
return false;
}
defaultContactFriction = src.ParseFloat();
if ( src.CheckTokenString( "," ) ) {
defaultConstraintFriction = src.ParseFloat();
}
} else if ( !token.Icmp( "totalMass" ) ) {
totalMass = src.ParseFloat();
} else if ( !token.Icmp( "suspendSpeed" ) ) {
suspendVelocity[0] = src.ParseFloat();
if ( !src.ExpectTokenString( "," ) ) {
return false;
}
suspendVelocity[1] = src.ParseFloat();
if ( !src.ExpectTokenString( "," ) ) {
return false;
}
suspendAcceleration[0] = src.ParseFloat();
if ( !src.ExpectTokenString( "," ) ) {
return false;
}
suspendAcceleration[1] = src.ParseFloat();
} else if ( !token.Icmp( "noMoveTime" ) ) {
noMoveTime = src.ParseFloat();
} else if ( !token.Icmp( "noMoveTranslation" ) ) {
noMoveTranslation = src.ParseFloat();
} else if ( !token.Icmp( "noMoveRotation" ) ) {
noMoveRotation = src.ParseFloat();
} else if ( !token.Icmp( "minMoveTime" ) ) {
minMoveTime = src.ParseFloat();
} else if ( !token.Icmp( "maxMoveTime" ) ) {
maxMoveTime = src.ParseFloat();
} else if ( !token.Icmp( "contents" ) ) {
ParseContents( src, contents );
} else if ( !token.Icmp( "clipMask" ) ) {
ParseContents( src, clipMask );
} else if ( !token.Icmp( "selfCollision" ) ) {
selfCollision = src.ParseBool();
} else if ( token == "}" ) {
break;
} else {
src.Error( "unknown token %s in settings", token.c_str() );
return false;
}
}
return true;
}
示例4: ParseSingleFXAction
/*
================
idDeclFX::ParseSingleFXAction
================
*/
void idDeclFX::ParseSingleFXAction( idLexer &src, idFXSingleAction& FXAction ) {
idToken token;
FXAction.type = -1;
FXAction.sibling = -1;
FXAction.data = "<none>";
FXAction.name = "<none>";
FXAction.fire = "<none>";
FXAction.delay = 0.0f;
FXAction.duration = 0.0f;
FXAction.restart = 0.0f;
FXAction.size = 0.0f;
FXAction.fadeInTime = 0.0f;
FXAction.fadeOutTime = 0.0f;
FXAction.shakeTime = 0.0f;
FXAction.shakeAmplitude = 0.0f;
FXAction.shakeDistance = 0.0f;
FXAction.shakeFalloff = false;
FXAction.shakeImpulse = 0.0f;
FXAction.shakeIgnoreMaster = false;
FXAction.lightRadius = 0.0f;
FXAction.rotate = 0.0f;
FXAction.random1 = 0.0f;
FXAction.random2 = 0.0f;
FXAction.lightColor = vec3_origin;
FXAction.offset = vec3_origin;
FXAction.axis = mat3_identity;
FXAction.bindParticles = false;
FXAction.explicitAxis = false;
FXAction.noshadows = false;
FXAction.particleTrackVelocity = false;
FXAction.trackOrigin = false;
FXAction.soundStarted = false;
while (1) {
if ( !src.ReadToken( &token ) ) {
break;
}
if ( !token.Icmp( "}" ) ) {
break;
}
if ( !token.Icmp( "shake" ) ) {
FXAction.type = FX_SHAKE;
FXAction.shakeTime = src.ParseFloat();
src.ExpectTokenString(",");
FXAction.shakeAmplitude = src.ParseFloat();
src.ExpectTokenString(",");
FXAction.shakeDistance = src.ParseFloat();
src.ExpectTokenString(",");
FXAction.shakeFalloff = src.ParseBool();
src.ExpectTokenString(",");
FXAction.shakeImpulse = src.ParseFloat();
continue;
}
if ( !token.Icmp( "noshadows" ) ) {
FXAction.noshadows = true;
continue;
}
if ( !token.Icmp( "name" ) ) {
src.ReadToken( &token );
FXAction.name = token;
continue;
}
if ( !token.Icmp( "fire") ) {
src.ReadToken( &token );
FXAction.fire = token;
continue;
}
if ( !token.Icmp( "random" ) ) {
FXAction.random1 = src.ParseFloat();
src.ExpectTokenString( "," );
FXAction.random2 = src.ParseFloat();
FXAction.delay = 0.0f; // check random
continue;
}
if ( !token.Icmp( "delay" ) ) {
FXAction.delay = src.ParseFloat();
continue;
}
if ( !token.Icmp( "rotate" ) ) {
FXAction.rotate = src.ParseFloat();
continue;
}
//.........这里部分代码省略.........