mirror of https://github.com/AxioDL/metaforce.git
CModel destructor & frame list fixes
This commit is contained in:
parent
8d83afa102
commit
d62336b813
|
@ -2099,7 +2099,10 @@ void CStateManager::UpdateAreaSounds() {
|
|||
CSfxManager::SetActiveAreas(areas);
|
||||
}
|
||||
|
||||
void CStateManager::FrameEnd() { g_SimplePool->Flush(); }
|
||||
void CStateManager::FrameEnd() {
|
||||
CModel::FrameDone();
|
||||
g_SimplePool->Flush();
|
||||
}
|
||||
|
||||
void CStateManager::ProcessPlayerInput() {
|
||||
if (x84c_player) {
|
||||
|
|
|
@ -102,6 +102,8 @@ IObj* CToken::GetObj() {
|
|||
return x0_objRef->GetObject();
|
||||
}
|
||||
CToken& CToken::operator=(const CToken& other) {
|
||||
if (this == &other)
|
||||
return *this;
|
||||
Unlock();
|
||||
RemoveRef();
|
||||
x0_objRef = other.x0_objRef;
|
||||
|
|
|
@ -133,6 +133,11 @@ CModel::CModel(std::unique_ptr<u8[]> in, u32 dataLen, IObjectStore* store)
|
|||
// DCFlushRange(x0_data, dataLen);
|
||||
}
|
||||
|
||||
CModel::~CModel() {
|
||||
RemoveFromList();
|
||||
sTotalMemory -= x4_dataLen;
|
||||
}
|
||||
|
||||
void CModel::UpdateLastFrame() { x38_lastFrame = CGraphics::GetFrameCounter(); }
|
||||
|
||||
void CModel::MoveToThisFrameList() {
|
||||
|
|
|
@ -92,6 +92,7 @@ private:
|
|||
|
||||
public:
|
||||
CModel(std::unique_ptr<u8[]> in, u32 dataLen, IObjectStore* store);
|
||||
~CModel();
|
||||
|
||||
void UpdateLastFrame();
|
||||
void MoveToThisFrameList();
|
||||
|
|
|
@ -168,7 +168,10 @@ void CInGameGuiManager::DoStateTransition(CStateManager& stateMgr) {
|
|||
}
|
||||
}
|
||||
|
||||
void CInGameGuiManager::DestroyAreaTextures(CStateManager& stateMgr) {}
|
||||
void CInGameGuiManager::DestroyAreaTextures(CStateManager& stateMgr) {
|
||||
// TODO
|
||||
CModel::DisableTextureTimeout();
|
||||
}
|
||||
|
||||
void CInGameGuiManager::TryReloadAreaTextures() {}
|
||||
|
||||
|
@ -270,6 +273,7 @@ void CInGameGuiManager::OnNewPauseScreenState(CArchitectureQueue& archQueue) {
|
|||
if (x1c0_nextState >= EInGameGuiState::Zero && x1c0_nextState <= EInGameGuiState::InGame) {
|
||||
if (x44_messageScreen)
|
||||
x44_messageScreen.reset();
|
||||
CModel::EnableTextureTimeout();
|
||||
RefreshHudOptions();
|
||||
}
|
||||
x1bc_prevState = x1c0_nextState;
|
||||
|
|
|
@ -255,6 +255,7 @@ void CMFGame::EnterMapScreen() {
|
|||
}
|
||||
|
||||
CMFGameLoader::CMFGameLoader() : CMFGameLoaderBase("CMFGameLoader") {
|
||||
CModel::DisableTextureTimeout();
|
||||
auto* m = static_cast<CMain*>(g_Main);
|
||||
switch (m->GetFlowState()) {
|
||||
case EClientFlowStates::Default:
|
||||
|
@ -357,6 +358,7 @@ CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg,
|
|||
if (x2c_25_transitionFinished) {
|
||||
queue.Push(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 10, 1000,
|
||||
std::make_shared<CMFGame>(x14_stateMgr, x18_guiMgr, queue)));
|
||||
CModel::EnableTextureTimeout();
|
||||
return EMessageReturn::RemoveIOWinAndExit;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue