本文整理汇总了C++中_QERFuncTable_1::m_pfnAllocateSelectedBrushHandles方法的典型用法代码示例。如果您正苦于以下问题:C++ _QERFuncTable_1::m_pfnAllocateSelectedBrushHandles方法的具体用法?C++ _QERFuncTable_1::m_pfnAllocateSelectedBrushHandles怎么用?C++ _QERFuncTable_1::m_pfnAllocateSelectedBrushHandles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_QERFuncTable_1
的用法示例。
在下文中一共展示了_QERFuncTable_1::m_pfnAllocateSelectedBrushHandles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateWadKeyPair
void UpdateWadKeyPair( void )
{
int i,nb;
char wads[2048]; // change to CString usage ?
wads[0] = 0;
char *p1,*p2;
entity_t *pEntity;
epair_t *pEpair;
GSList *wadlist = NULL;
face_t *f;
brush_t *b;
char cleanwadname[QER_MAX_NAMELEN];
const char *actualwad;
pEntity = (entity_t *)g_FuncTable.m_pfnGetEntityHandle(0); // get the worldspawn ent
Sys_Printf("Searching for in-use wad files...\n");
for(pEpair = pEntity->epairs; pEpair != NULL; pEpair = pEpair->next)
{
if (stricmp(pEpair->key,"wad") == 0)
{
strcpy(wads,pEpair->value);
ConvertDOSToUnixName(wads,wads);
// ok, we got the list of ; delimited wads, now split it into a GSList that contains
// just the wad names themselves.
p1 = wads;
do
{
p2 = strchr(p1,';');
if (p2)
*p2 = 0; // swap the ; with a null terminator
if (strchr(p1,'/') || strchr(p1,'\\'))
{
ExtractFileName(p1,cleanwadname);
wadlist = AddToWadList (wadlist, NULL, cleanwadname);
}
else
{
wadlist = AddToWadList (wadlist, NULL, p1);
}
if (p2)
p1 = p2+1; // point back to the remainder of the string
else
p1 = NULL; // make it so we exit the loop.
} while (p1);
// ok, now we have a list of wads in GSList.
// now we need to add any new wadfiles (with their paths) to this list
// so scan all brushes and see what wads are in use
// FIXME: scan brushes only in the region ?
break; // we don't need to process any more key/pairs.
}
}
nb = g_FuncTable.m_pfnAllocateActiveBrushHandles();
for( i = 0; i < nb; i++ )
{
b = (brush_t *)g_FuncTable.m_pfnGetActiveBrushHandle(i);
if (b->patchBrush) // patches in halflife ?
{
wadlist = AddToWadList(wadlist, b->pPatch->pShader->getName(),NULL);
} else
{
for (f=b->brush_faces ; f ; f=f->next)
{
wadlist = AddToWadList(wadlist, f->pShader->getName(),NULL);
}
}
}
g_FuncTable.m_pfnReleaseActiveBrushHandles();
nb = g_FuncTable.m_pfnAllocateSelectedBrushHandles();
for( i = 0; i < nb; i++ )
{
b = (brush_t *)g_FuncTable.m_pfnGetSelectedBrushHandle(i);
if (b->patchBrush) // patches in halflife ?
{
wadlist = AddToWadList(wadlist, b->pPatch->pShader->getName(),NULL);
} else
{
for (f=b->brush_faces ; f ; f=f->next)
{
wadlist = AddToWadList(wadlist, f->pShader->getName(),NULL);
}
}
}
g_FuncTable.m_pfnReleaseSelectedBrushHandles();
// Now we have a complete list of wadnames (without paths) so we just have to turn this
// back to a ; delimited list.
wads[0] = 0;
//.........这里部分代码省略.........