本文整理汇总了C++中MFPtrList类的典型用法代码示例。如果您正苦于以下问题:C++ MFPtrList类的具体用法?C++ MFPtrList怎么用?C++ MFPtrList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MFPtrList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MFMaterial_DeinitModule
void MFMaterial_DeinitModule()
{
MFCALLSTACK;
// destroy stock materials
MFMaterial_Destroy(pNoneMaterial);
MFMaterial_Destroy(pWhiteMaterial);
MFMaterial_Destroy(pSysLogoLarge);
MFMaterial_Destroy(pSysLogoSmall);
#if defined(_PSP)
// destroy PSP specific stock materials
MFMaterial_Destroy(pConnected);
MFMaterial_Destroy(pDisconnected);
MFMaterial_Destroy(pPower);
MFMaterial_Destroy(pCharging);
MFMaterial_Destroy(pUSB);
#endif
MaterialDefinition *pDef = pDefinitionRegistry;
while(pDef)
{
MaterialDefinition *pNext = pDef->pNextDefinition;
MFMaterial_DestroyDefinition(pDef);
pDef = pNext;
}
// list all non-freed materials...
MFMaterial **ppI = gMaterialList.Begin();
bool bShowHeader = true;
while(*ppI)
{
if(bShowHeader)
{
bShowHeader = false;
MFDebug_Message("\nUn-freed materials:\n----------------------------------------------------------");
}
MFDebug_Message(MFStr("'%s' - x%d", (*ppI)->pName, (*ppI)->refCount));
(*ppI)->refCount = 1;
MFMaterial_Destroy(*ppI);
ppI++;
}
MFMaterial_UnregisterMaterialType("Standard");
MFMaterial_UnregisterMaterialType("Effect");
gMaterialList.Deinit();
gMaterialDefList.Deinit();
gMaterialRegistry.Deinit();
}
示例2: MFCollision_InitModule
MFInitStatus MFCollision_InitModule()
{
gItemList.Init("Collision Items", 256);
DebugMenu_AddItem("Show Collision", "Fuji Options", &gShowCollision, NULL, NULL);
return MFAIC_Succeeded;
}
示例3: MFMaterial_DeinitModule
void MFMaterial_DeinitModule()
{
MFCALLSTACK;
// destroy stock materials
MFMaterial_Release(pNoneMaterial);
MFMaterial_Release(pWhiteMaterial);
MFMaterial_Release(pSysLogoLarge);
MFMaterial_Release(pSysLogoSmall);
#if defined(_PSP)
// destroy PSP specific stock materials
MFMaterial_Release(pConnected);
MFMaterial_Release(pDisconnected);
MFMaterial_Release(pPower);
MFMaterial_Release(pCharging);
MFMaterial_Release(pUSB);
#endif
MaterialDefinition *pDef = pDefinitionRegistry;
while(pDef)
{
MaterialDefinition *pNext = pDef->pNextDefinition;
MFMaterial_DestroyDefinition(pDef);
pDef = pNext;
}
bool bShowHeader = true;
// list all non-freed materials...
MFResourceIterator *pI = MFResource_EnumerateFirst(MFRT_Material);
while(pI)
{
if(bShowHeader)
{
bShowHeader = false;
MFDebug_Message("\nUn-freed materials:\n----------------------------------------------------------");
}
MFMaterial *pMat = (MFMaterial*)MFResource_Get(pI);
MFDebug_Message(MFStr("'%s' - x%d", pMat->pName, pMat->refCount));
pMat->refCount = 1;
MFMaterial_Release(pMat);
pI = MFResource_EnumerateNext(pI, MFRT_Material);
}
MFMaterial_UnregisterMaterialType("Standard");
MFMaterial_UnregisterMaterialType("Effect");
gMaterialDefList.Deinit();
gMaterialRegistry.Deinit();
}
示例4: MFMaterial_Update
void MFMaterial_Update()
{
MFCALLSTACK;
MFMaterial **ppMatIterator = gMaterialList.Begin();
while(ppMatIterator && *ppMatIterator)
{
if((*ppMatIterator)->pType->materialCallbacks.pUpdate)
(*ppMatIterator)->pType->materialCallbacks.pUpdate(*ppMatIterator);
ppMatIterator++;
}
}
示例5: MFCollision_DebugDraw
MF_API void MFCollision_DebugDraw()
{
if(!gShowCollision)
return;
// draw each item..
MFCollisionItem **ppIterator = gItemList.Begin();
while(*ppIterator)
{
MFCollision_DrawItem(*ppIterator);
ppIterator++;
}
}
示例6: MFMaterial_Find
MF_API MFMaterial* MFMaterial_Find(const char *pName)
{
MFCALLSTACK;
MFMaterial **ppIterator = gMaterialList.Begin();
while(*ppIterator)
{
if(!MFString_CaseCmp(pName, (*ppIterator)->pName)) return *ppIterator;
ppIterator++;
}
return NULL;
}
示例7:
MFMaterialType *MaterialInternal_GetMaterialType(const char *pTypeName)
{
MFCALLSTACK;
MFMaterialType **ppIterator = gMaterialRegistry.Begin();
while(*ppIterator)
{
if(!MFString_CaseCmp(pTypeName, (*ppIterator)->pTypeName)) return *ppIterator;
ppIterator++;
}
return NULL;
}
示例8: MFMaterial_UnregisterMaterialType
MF_API void MFMaterial_UnregisterMaterialType(const char *pName)
{
MFCALLSTACK;
MFMaterialType *pMatType = MaterialInternal_GetMaterialType(pName);
MFDebug_Assert(pMatType, MFStr("Material type '%s' doesn't exist!", pName));
if(pMatType)
{
pMatType->materialCallbacks.pUnregisterMaterial();
gMaterialRegistry.Destroy(pMatType);
MFHeap_Free(pMatType);
}
}
示例9: MFMaterial_Destroy
MF_API int MFMaterial_Destroy(MFMaterial *pMaterial)
{
MFCALLSTACK;
--pMaterial->refCount;
if(!pMaterial->refCount)
{
pMaterial->pType->materialCallbacks.pDestroyInstance(pMaterial);
gMaterialList.Destroy(pMaterial);
return 0;
}
return pMaterial->refCount;
}
示例10: MFMaterial_RegisterMaterialType
MF_API void MFMaterial_RegisterMaterialType(const char *pName, const MFMaterialCallbacks *pCallbacks)
{
MFCALLSTACK;
MFMaterialType *pMatType;
pMatType = (MFMaterialType*)MFHeap_Alloc(sizeof(MFMaterialType) + MFString_Length(pName) + 1);
pMatType->pTypeName = (char*)&pMatType[1];
MFString_Copy(pMatType->pTypeName, pName);
MFDebug_Assert(pCallbacks->pBegin, "Material must supply Begin() callback.");
MFCopyMemory(&pMatType->materialCallbacks, pCallbacks, sizeof(MFMaterialCallbacks));
gMaterialRegistry.Create(pMatType);
pCallbacks->pRegisterMaterial(NULL);
}
示例11: MFMaterial_Create
MF_API MFMaterial* MFMaterial_Create(const char *pName)
{
MFCALLSTACK;
MFMaterial *pMat = MFMaterial_Find(pName);
if(!pMat)
{
pMat = (MFMaterial*)MFHeap_Alloc(sizeof(MFMaterial) + MFString_Length(pName) + 1);
MFZeroMemory(pMat, sizeof(MFMaterial));
pMat->pName = (char*)&pMat[1];
MFString_Copy(pMat->pName, pName);
gMaterialList.Create(pMat);
MaterialDefinition *pDef = pDefinitionRegistry;
while(pDef)
{
MFIniLine *pLine = pDef->pIni->GetFirstLine()->FindEntry("section",pName);
if (pLine)
{
MaterialInternal_InitialiseFromDefinition(pDef->pIni, pMat, pName);
break;
}
pDef = pDef->pNextDefinition;
}
if(!pDef)
{
// assign material type
pMat->pType = MaterialInternal_GetMaterialType("Standard");
pMat->pType->materialCallbacks.pCreateInstance(pMat);
// set diffuse map parameter
MFMaterial_SetParameterS(pMat, MFMatStandard_Texture, MFMatStandard_Tex_DifuseMap, pName);
}
}
pMat->refCount++;
return pMat;
}
示例12: MFCollision_DeinitModule
void MFCollision_DeinitModule()
{
gItemList.Deinit();
}
示例13: MFCollision_DestroyCollisionItem
void MFCollision_DestroyCollisionItem(MFCollisionItem *pItem)
{
gItemList.Destroy(pItem);
MFHeap_Free(pItem);
}
示例14: MFCollision_CreateCollisionItem
MFCollisionItem* MFCollision_CreateCollisionItem()
{
MFCollisionItem *pItem = (MFCollisionItem*)MFHeap_Alloc(sizeof(MFCollisionItem));
gItemList.Create(pItem);
return pItem;
}
示例15: MFMaterial_InitModule
MFInitStatus MFMaterial_InitModule()
{
MFCALLSTACK;
gMaterialRegistry.Init("Material Registry", gDefaults.material.maxMaterialTypes);
gMaterialDefList.Init("Material Definitions List", gDefaults.material.maxMaterialDefs);
gMaterialList.Init("Material List", gDefaults.material.maxMaterials);
DebugMenu_AddItem("Material Browser", "Fuji Options", &matBrowser);
MFMat_Standard_Register();
MFMat_Effect_Register();
if(MFFileSystem_Exists("Materials.ini") && MFMaterial_AddDefinitionsFile("Materials", "Materials"))
{
MFDebug_Warn(3, "Failed to load Materials.ini");
}
#if MF_RENDERER == MF_DRIVER_D3D11 || defined(MF_RENDERPLUGIN_D3D11)
// HACK?
MFTexture *pSysLogoLargeTexture = MFTexture_Create("_None");
MFTexture *pSysLogoSmallTexture = MFTexture_Create("_None");
#else
// create the logo textures from raw data
MFTexture *pSysLogoLargeTexture = MFTexture_CreateFromRawData("SysLogoLarge", SysLogo256_data, SysLogo256_width, SysLogo256_height, (MFImageFormat)SysLogo256_format, SysLogo256_flags);
MFTexture *pSysLogoSmallTexture = MFTexture_CreateFromRawData("SysLogoSmall", SysLogo64_data, SysLogo64_width, SysLogo64_height, (MFImageFormat)SysLogo64_format, SysLogo64_flags);
#endif
// create standard materials
pNoneMaterial = MFMaterial_Create("_None");
pWhiteMaterial = MFMaterial_Create("_White");
pSysLogoLarge = MFMaterial_Create("SysLogoLarge");
pSysLogoSmall = MFMaterial_Create("SysLogoSmall");
// disable backface cullign on the default materials
MFMaterial_SetParameterI(pNoneMaterial, MFMatStandard_CullMode, 0, MFMatStandard_Cull_None);
MFMaterial_SetParameterI(pWhiteMaterial, MFMatStandard_CullMode, 0, MFMatStandard_Cull_None);
// release a reference to the logo textures
MFTexture_Destroy(pSysLogoLargeTexture);
MFTexture_Destroy(pSysLogoSmallTexture);
#if defined(_PSP)
// create PSP specific stock materials
MFTexture *pConnectedTexture = MFTexture_CreateFromRawData("connected", connected_data, connected_width, connected_height, (MFImageFormat)connected_format, connected_flags);
MFTexture *pDisconnectedTexture = MFTexture_CreateFromRawData("disconnected", disconnected_data, disconnected_width, disconnected_height, (MFImageFormat)disconnected_format, disconnected_flags);
MFTexture *pPowerTexture = MFTexture_CreateFromRawData("power", power_data, power_width, power_height, (MFImageFormat)power_format, power_flags);
MFTexture *pChargingTexture = MFTexture_CreateFromRawData("charging", charging_data, charging_width, charging_height, (MFImageFormat)charging_format, charging_flags);
MFTexture *pUSBTexture = MFTexture_CreateFromRawData("usb_icon", usb_icon_data, usb_icon_width, usb_icon_height, (MFImageFormat)usb_icon_format, usb_icon_flags);
pConnected = MFMaterial_Create("connected");
pDisconnected = MFMaterial_Create("disconnected");
pPower = MFMaterial_Create("power");
pCharging = MFMaterial_Create("charging");
pUSB = MFMaterial_Create("usb_icon");
MFTexture_Destroy(pConnectedTexture);
MFTexture_Destroy(pDisconnectedTexture);
MFTexture_Destroy(pPowerTexture);
MFTexture_Destroy(pChargingTexture);
MFTexture_Destroy(pUSBTexture);
#endif
return MFAIC_Succeeded;
}