mirror of
https://github.com/rrika/cdcEngineDXHR.git
synced 2024-11-23 05:29:57 +00:00
unload some startup loaded objects
This commit is contained in:
parent
edabc5d72c
commit
81ed2768a7
@ -7,6 +7,7 @@
|
||||
#include "cdcFile/FileSystem.h"
|
||||
#include "cdcGameShell/cdcGameShell.h"
|
||||
#include "rendering/Inspector.h"
|
||||
#include "cdcResource/Resolve.h"
|
||||
#include "cdcResource/ResolveObject.h"
|
||||
|
||||
#if ENABLE_IMGUI
|
||||
@ -254,6 +255,13 @@ void requestObjectNormal(uint32_t id) {
|
||||
requestObject(id, cdc::FileRequest::NORMAL);
|
||||
}
|
||||
|
||||
void releaseObject(uint32_t id) {
|
||||
// HACK
|
||||
if (ObjectTracker *otr = getByObjectListIndex(id))
|
||||
if (otr->resolveObject)
|
||||
Resolve::Release(otr->resolveObject);
|
||||
}
|
||||
|
||||
char *objectName(uint32_t objectListIndex) {
|
||||
return g_objectManager->objectList->entries[objectListIndex-1].name;
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ void readAndParseObjectList();
|
||||
uint32_t objectIdByName(const char *name);
|
||||
void requestObjectHigh(uint32_t id);
|
||||
void requestObjectNormal(uint32_t id);
|
||||
void releaseObject(uint32_t id);
|
||||
char *objectName(uint32_t objectListIndex);
|
||||
|
||||
void buildObjectsUI(UIActions& uiact);
|
||||
|
@ -101,6 +101,19 @@ void loadDatabases() {
|
||||
globalPlayerInfo = (GlobalPlayerInfo*)ort_globalPlayerInfo->objBlob->data;
|
||||
}
|
||||
|
||||
void unloadDatabases() {
|
||||
// TODO
|
||||
|
||||
releaseObject(objectIdByName("GlobalPlayerInfo"));
|
||||
if (true) // TODO
|
||||
releaseObject(objectIdByName("GlobalDLCInfo"));
|
||||
releaseObject(objectIdByName("GlobalScripting"));
|
||||
releaseObject(objectIdByName("GlobalDatabase"));
|
||||
releaseObject(objectIdByName("GlobalSmartScripts"));
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
void Init_NativeScripts();
|
||||
|
||||
void MAIN_DoMainInit() {
|
||||
@ -129,6 +142,7 @@ void MAIN_DoMainInit() {
|
||||
|
||||
// TODO
|
||||
|
||||
// MAIN_LoadGlobalObjects
|
||||
uint32_t generalBankId = objectIdByName("generalbank");
|
||||
uint32_t globalSoundInfoId = objectIdByName("globalsoundinfo");
|
||||
uint32_t globalAnimInfoId = objectIdByName("globalaniminfo");
|
||||
@ -150,6 +164,20 @@ void MAIN_DoMainInit() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void MAIN_DoMainUninit() { // ?
|
||||
// TODO
|
||||
|
||||
unloadDatabases();
|
||||
|
||||
// TODO
|
||||
|
||||
releaseObject(objectIdByName("globalaniminfo"));
|
||||
releaseObject(objectIdByName("globalsoundinfo"));
|
||||
releaseObject(objectIdByName("generalbank"));
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
void MAIN_Init() { // 2312
|
||||
|
||||
const char *prefix;
|
||||
@ -177,6 +205,8 @@ void MAIN_Init() { // 2312
|
||||
|
||||
void MAIN_Uninit() { // 2573
|
||||
|
||||
// TODO
|
||||
MAIN_DoMainUninit();
|
||||
// TODO
|
||||
Resolve::Destroy();
|
||||
}
|
||||
|
@ -1846,6 +1846,12 @@ end:
|
||||
#endif
|
||||
ImGui::DestroyContext();
|
||||
#endif
|
||||
|
||||
// maybe it's bad to bypass ObjectManager
|
||||
obj5->Release();
|
||||
obj4->Release();
|
||||
obj3->Release();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user