本文整理汇总了C++中FBaseCVar::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ FBaseCVar::GetName方法的具体用法?C++ FBaseCVar::GetName怎么用?C++ FBaseCVar::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FBaseCVar
的用法示例。
在下文中一共展示了FBaseCVar::GetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
FBaseCVar *FindCVar (const char *var_name, FBaseCVar **prev)
{
FBaseCVar *var;
FBaseCVar *dummy;
if (var_name == NULL)
return NULL;
if (prev == NULL)
prev = &dummy;
var = CVars;
*prev = NULL;
while (var)
{
if (stricmp (var->GetName (), var_name) == 0)
break;
*prev = var;
var = var->m_Next;
}
return var;
}
示例2: D_SetupUserInfo
void D_SetupUserInfo ()
{
int i;
userinfo_t *coninfo;
// Reset everybody's userinfo to a default state.
for (i = 0; i < MAXPLAYERS; i++)
{
players[i].userinfo.Reset();
}
// Initialize the console player's user info
coninfo = &players[consoleplayer].userinfo;
for (FBaseCVar *cvar = CVars; cvar != NULL; cvar = cvar->GetNext())
{
if ((cvar->GetFlags() & (CVAR_USERINFO|CVAR_IGNORE)) == CVAR_USERINFO)
{
FBaseCVar **newcvar;
FName cvarname(cvar->GetName());
switch (cvarname.GetIndex())
{
// Some cvars don't copy their original value directly.
case NAME_Team: coninfo->TeamChanged(team); break;
case NAME_Skin: coninfo->SkinChanged(skin); break;
case NAME_Gender: coninfo->GenderChanged(gender); break;
case NAME_PlayerClass: coninfo->PlayerClassChanged(playerclass); break;
// The rest do.
default:
newcvar = coninfo->CheckKey(cvarname);
(*newcvar)->SetGenericRep(cvar->GetGenericRep(CVAR_String), CVAR_String);
break;
}
}
}
R_BuildPlayerTranslation(consoleplayer);
}