本文整理汇总了C++中CHash::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ CHash::insert方法的具体用法?C++ CHash::insert怎么用?C++ CHash::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHash
的用法示例。
在下文中一共展示了CHash::insert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
CCMShader *CM_GetShaderInfo( const char *name )
{
CCMShader *out;
const char *def;
out = cmShaderTable[name];
if(out)
{
return(out);
}
// Create a new CCMShader class
out = (CCMShader *)Hunk_Alloc( sizeof( CCMShader ), h_high );
// Set defaults
Q_strncpyz(out->shader, name, MAX_QPATH);
out->contentFlags = CONTENTS_SOLID | CONTENTS_OPAQUE;
// Parse in any text if it exists
def = CM_GetShaderText(name);
if(def)
{
CM_ParseShader(out, &def);
}
cmShaderTable.insert(out);
return(out);
}
示例2: CM_SetupShaderProperties
void CM_SetupShaderProperties(void)
{
int i;
const char *def;
CCMShader *shader;
// Add all basic shaders to the cmShaderTable
for(i = 0; i < cmg.numShaders; i++)
{
cmShaderTable.insert(CM_GetShaderInfo(i));
}
// Go through and parse evaluate shader names to shadernums
for(i = 0; i < cmg.numShaders; i++)
{
shader = CM_GetShaderInfo(i);
def = CM_GetShaderText(shader->shader);
if(def)
{
CM_ParseShader(shader, &def);
}
}
}
示例3: CM_CreateShaderTextHash
/*
====================
CM_CreateShaderTextHash
=====================
*/
void CM_CreateShaderTextHash(void)
{
const char *p;
qboolean hasNewLines;
char *token;
CCMShaderText *shader;
p = shaderText;
// look for label
while (p)
{
p = SkipWhitespace(p, &hasNewLines);
token = COM_ParseExt( &p, qtrue );
if ( !token[0] )
{
break;
}
shader = new CCMShaderText(token, p);
shaderTextTable.insert(shader);
SkipBracedSection(&p);
}
}