static void orxFASTCALL Exit() { // Has font name? if(sstFontGen.zFontName) { // Frees its string orxString_Delete(sstFontGen.zFontName); sstFontGen.zFontName = orxNULL; } // Deletes character table orxHashTable_Delete(sstFontGen.pstCharacterTable); // Deletes glyph bank orxBank_Delete(sstFontGen.pstGlyphBank); // Has face? if(sstFontGen.pstFontFace) { // Deletes it FT_Done_Face(sstFontGen.pstFontFace); } // Has library? if(sstFontGen.pstFontLibrary) { // Exits from it FT_Done_FreeType(sstFontGen.pstFontLibrary); } }
/** Exits from Camera module */ void orxFASTCALL orxCamera_Exit() { /* Initialized? */ if(sstCamera.u32Flags & orxCAMERA_KU32_STATIC_FLAG_READY) { /* Deletes camera list */ orxCamera_DeleteAll(); /* Unregisters structure type */ orxStructure_Unregister(orxSTRUCTURE_ID_CAMERA); /* Deletes reference table */ orxHashTable_Delete(sstCamera.pstReferenceTable); /* Updates flags */ sstCamera.u32Flags &= ~orxCAMERA_KU32_STATIC_FLAG_READY; } else { /* Logs message */ orxDEBUG_PRINT(orxDEBUG_LEVEL_RENDER, "Tried to exit camera module when it wasn't initialized."); } return; }
/** Inits the TimeLine module * @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE */ orxSTATUS orxFASTCALL orxTimeLine_Init() { orxSTATUS eResult = orxSTATUS_FAILURE; /* Not already Initialized? */ if(!(sstTimeLine.u32Flags & orxTIMELINE_KU32_STATIC_FLAG_READY)) { /* Cleans static controller */ orxMemory_Zero(&sstTimeLine, sizeof(orxTIMELINE_STATIC)); /* Creates track table */ sstTimeLine.pstTrackTable = orxHashTable_Create(orxTIMELINE_KU32_TRACK_TABLE_SIZE, orxHASHTABLE_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN); /* Valid? */ if(sstTimeLine.pstTrackTable != orxNULL) { /* Registers structure type */ eResult = orxSTRUCTURE_REGISTER(TIMELINE, orxSTRUCTURE_STORAGE_TYPE_LINKLIST, orxMEMORY_TYPE_MAIN, orxTIMELINE_KU32_BANK_SIZE, &orxTimeLine_Update); } else { /* Logs message */ orxDEBUG_PRINT(orxDEBUG_LEVEL_OBJECT, "Failed to create TimeLine track table."); } } else { /* Logs message */ orxDEBUG_PRINT(orxDEBUG_LEVEL_OBJECT, "Tried to initialize the TimeLine module when it was already initialized."); /* Already initialized */ eResult = orxSTATUS_SUCCESS; } /* Initialized? */ if(eResult != orxSTATUS_FAILURE) { /* Inits Flags */ orxFLAG_SET(sstTimeLine.u32Flags, orxTIMELINE_KU32_STATIC_FLAG_READY, orxTIMELINE_KU32_STATIC_FLAG_NONE); /* Adds event handler */ orxEvent_AddHandler(orxEVENT_TYPE_RESOURCE, orxTimeLine_EventHandler); } else { /* Deletes track table if needed */ if(sstTimeLine.pstTrackTable != orxNULL) { orxHashTable_Delete(sstTimeLine.pstTrackTable); } } /* Done! */ return eResult; }
/** Deletes a plugin info * @param[in] _pstPluginInfo Concerned plugin info */ static void orxFASTCALL orxPlugin_DeletePluginInfo(orxPLUGIN_INFO *_pstPluginInfo) { orxPLUGIN_FUNCTION_INFO *pstFunctionInfo; /* Checks */ orxASSERT(_pstPluginInfo != orxNULL); /* Deletes all function info */ for(pstFunctionInfo = (orxPLUGIN_FUNCTION_INFO *)orxBank_GetNext(_pstPluginInfo->pstFunctionBank, orxNULL); pstFunctionInfo != orxNULL; pstFunctionInfo = (orxPLUGIN_FUNCTION_INFO *)orxBank_GetNext(_pstPluginInfo->pstFunctionBank, orxNULL)) { /* Is it a core function? */ if(pstFunctionInfo->eFunctionID & orxPLUGIN_KU32_FLAG_CORE_ID) { /* Registers core function */ orxPlugin_UnregisterCoreFunction(pstFunctionInfo); } /* Deletes it */ orxPlugin_DeleteFunctionInfo(_pstPluginInfo, pstFunctionInfo); } /* Updates all modules */ orxPlugin_UpdateAllModule(); /* Deletes function hash table */ orxHashTable_Delete(_pstPluginInfo->pstFunctionTable); /* Deletes function bank */ orxBank_Delete(_pstPluginInfo->pstFunctionBank); /* Deletes plugin info */ orxBank_Free(sstPlugin.pstPluginBank, _pstPluginInfo); #ifdef __orxPLUGIN_DYNAMIC__ /* Linked to system plugin? */ if(_pstPluginInfo->pstSysPlugin != orxNULL) { /* Closes it */ orxPLUGIN_CLOSE(_pstPluginInfo->pstSysPlugin); _pstPluginInfo->pstSysPlugin = orxNULL; } #endif /* __orxPLUGIN_DYNAMIC__ */ /* Done */ return; }
/** Exits from the event module */ void orxFASTCALL orxEvent_Exit() { /* Initialized? */ if(orxFLAG_TEST(sstEvent.u32Flags, orxEVENT_KU32_STATIC_FLAG_READY)) { /* Deletes hashtable */ orxHashTable_Delete(sstEvent.pstHandlerStorageTable); /* Deletes bank */ orxBank_Delete(sstEvent.pstHandlerStorageBank); /* Updates flags */ orxFLAG_SET(sstEvent.u32Flags, orxEVENT_KU32_STATIC_FLAG_NONE, orxEVENT_KU32_STATIC_MASK_ALL); } return; }
/** Exits from the TimeLine module */ void orxFASTCALL orxTimeLine_Exit() { /* Initialized? */ if(sstTimeLine.u32Flags & orxTIMELINE_KU32_STATIC_FLAG_READY) { orxTIMELINE_TRACK *pstTrack; /* Removes event handler */ orxEvent_RemoveHandler(orxEVENT_TYPE_RESOURCE, orxTimeLine_EventHandler); /* Deletes TimeLine list */ orxTimeLine_DeleteAll(); /* Unregisters structure type */ orxStructure_Unregister(orxSTRUCTURE_ID_TIMELINE); /* For all remaining tracks */ while(orxHashTable_GetNext(sstTimeLine.pstTrackTable, orxNULL, orxNULL, (void **)&pstTrack) != orxHANDLE_UNDEFINED) { /* Deletes it */ orxTimeLine_DeleteTrack(pstTrack); } /* Deletes track table */ orxHashTable_Delete(sstTimeLine.pstTrackTable); /* Updates flags */ sstTimeLine.u32Flags &= ~orxTIMELINE_KU32_STATIC_FLAG_READY; } else { /* Logs message */ orxDEBUG_PRINT(orxDEBUG_LEVEL_OBJECT, "Tried to exit from the TimeLine module when it wasn't initialized."); } /* Done! */ return; }
/** Exits from clock module */ void orxFASTCALL orxClock_Exit() { /* Initialized? */ if(sstClock.u32Flags & orxCLOCK_KU32_STATIC_FLAG_READY) { /* Deletes all the clocks */ orxClock_DeleteAll(); /* Deletes timer bank */ orxBank_Delete(sstClock.pstTimerBank); sstClock.pstTimerBank = orxNULL; /* Deletes reference table */ orxHashTable_Delete(sstClock.pstReferenceTable); /* Unregisters structure type */ orxStructure_Unregister(orxSTRUCTURE_ID_CLOCK); /* Updates flags */ sstClock.u32Flags &= ~orxCLOCK_KU32_STATIC_FLAG_READY; } return; }
/** Inits the event module * @return orxSTATUS_SUCCESS / orxSTATUS_FAILURE */ orxSTATUS orxFASTCALL orxEvent_Init() { orxSTATUS eResult = orxSTATUS_FAILURE; /* Not already Initialized? */ if(!orxFLAG_TEST(sstEvent.u32Flags, orxEVENT_KU32_STATIC_FLAG_READY)) { /* Cleans control structure */ orxMemory_Zero(&sstEvent, sizeof(orxEVENT_STATIC)); /* Creates handler storage table */ sstEvent.pstHandlerStorageTable = orxHashTable_Create(orxEVENT_KU32_HANDLER_TABLE_SIZE, orxHASHTABLE_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN); /* Success? */ if(sstEvent.pstHandlerStorageTable != orxNULL) { /* Creates handler storage bank */ sstEvent.pstHandlerStorageBank = orxBank_Create(orxEVENT_KU32_STORAGE_BANK_SIZE, sizeof(orxEVENT_HANDLER_STORAGE), orxBANK_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN); /* Success? */ if(sstEvent.pstHandlerStorageBank != orxNULL) { /* Inits Flags */ orxFLAG_SET(sstEvent.u32Flags, orxEVENT_KU32_STATIC_FLAG_READY, orxEVENT_KU32_STATIC_MASK_ALL); /* Success */ eResult = orxSTATUS_SUCCESS; } else { /* Deletes table */ orxHashTable_Delete(sstEvent.pstHandlerStorageTable); /* Logs message */ orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Event module failed to create bank."); /* Updates result */ eResult = orxSTATUS_FAILURE; } } else { /* Logs message */ orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Event module failed to create hash table."); /* Updates result */ eResult = orxSTATUS_FAILURE; } } else { /* Logs message */ orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Event module already loaded."); /* Already initialized */ eResult = orxSTATUS_SUCCESS; } /* Done! */ return eResult; }
static void orxFASTCALL Exit() { /* Deletes texture table */ orxHashTable_Delete(pstTextureTable); }