本文整理汇总了C++中idStr::Cmp方法的典型用法代码示例。如果您正苦于以下问题:C++ idStr::Cmp方法的具体用法?C++ idStr::Cmp怎么用?C++ idStr::Cmp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idStr
的用法示例。
在下文中一共展示了idStr::Cmp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
/*
============
idInternalCVar::Update
============
*/
void idInternalCVar::Update( const idCVar *cvar )
{
// if this is a statically declared variable
if ( cvar->GetFlags() & CVAR_STATIC )
{
if ( flags & CVAR_STATIC )
{
// the code has more than one static declaration of the same variable, make sure they have the same properties
if ( resetString.Icmp( cvar->GetString() ) != 0 )
{
common->Warning( "CVar '%s' declared multiple times with different initial value", nameString.c_str() );
}
if ( ( flags & (CVAR_BOOL|CVAR_INTEGER|CVAR_FLOAT) ) != ( cvar->GetFlags() & (CVAR_BOOL|CVAR_INTEGER|CVAR_FLOAT) ) )
{
common->Warning( "CVar '%s' declared multiple times with different type", nameString.c_str() );
}
if ( valueMin != cvar->GetMinValue() || valueMax != cvar->GetMaxValue() )
{
common->Warning( "CVar '%s' declared multiple times with different minimum/maximum", nameString.c_str() );
}
}
// the code is now specifying a variable that the user already set a value for, take the new value as the reset value
resetString = cvar->GetString();
descriptionString = cvar->GetDescription();
description = descriptionString.c_str();
valueMin = cvar->GetMinValue();
valueMax = cvar->GetMaxValue();
Mem_Free( valueStrings );
valueStrings = CopyValueStrings( cvar->GetValueStrings() );
valueCompletion = cvar->GetValueCompletion();
UpdateValue();
cvarSystem->SetModifiedFlags( cvar->GetFlags() );
}
flags |= cvar->GetFlags();
UpdateCheat();
// only allow one non-empty reset string without a warning
if ( resetString.Length() == 0 )
{
resetString = cvar->GetString();
}
else if ( cvar->GetString()[0] && resetString.Cmp( cvar->GetString() ) != 0 )
{
common->Warning( "cvar \"%s\" given initial values: \"%s\" and \"%s\"\n", nameString.c_str(), resetString.c_str(), cvar->GetString() );
}
}