parent
1a71f4fbde
commit
8a5d0a58e4
@ -41,7 +41,7 @@ ConVarManager g_ConVarManager;
|
||||
|
||||
const ParamType CONVARCHANGE_PARAMS[] = {Param_Cell, Param_String, Param_String};
|
||||
typedef List<const ConVar *> ConVarList;
|
||||
NameHashSet<ConVarInfo *> convar_cache;
|
||||
NameHashSet<ConVarInfo *, ConVarInfo::ConVarPolicy> convar_cache;
|
||||
|
||||
class ConVarReentrancyGuard
|
||||
{
|
||||
|
@ -64,14 +64,26 @@ struct ConVarInfo
|
||||
ConVar *pVar; /**< The actual convar */
|
||||
List<IConVarChangeListener *> changeListeners;
|
||||
|
||||
static inline bool matches(const char *name, const ConVarInfo *info)
|
||||
struct ConVarPolicy
|
||||
{
|
||||
return strcmp(name, info->pVar->GetName()) == 0;
|
||||
}
|
||||
static inline uint32_t hash(const detail::CharsAndLength &key)
|
||||
{
|
||||
return key.hash();
|
||||
}
|
||||
static inline bool matches(const char *name, ConVarInfo *info)
|
||||
{
|
||||
const char *conVarChars = info->pVar->GetName();
|
||||
|
||||
ke::AString convarName = ke::AString(conVarChars).lowercase();
|
||||
ke::AString input = ke::AString(name).lowercase();
|
||||
|
||||
return convarName == input;
|
||||
}
|
||||
|
||||
static inline uint32_t hash(const detail::CharsAndLength &key)
|
||||
{
|
||||
ke::AString original(key.chars());
|
||||
ke::AString lower = original.lowercase();
|
||||
|
||||
return detail::CharsAndLength(lower.chars()).hash();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user