From e8decca90b4a5d1f53b24920dd9b8bfd633a53d5 Mon Sep 17 00:00:00 2001 From: roblabla Date: Sat, 2 Nov 2024 23:45:56 +0100 Subject: [PATCH] Implement ItemManager::RemoveAllItems --- config/implemented.csv | 1 + config/stubbed.csv | 1 - src/ItemManager.cpp | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/config/implemented.csv b/config/implemented.csv index 29eef4f7..d6e93775 100644 --- a/config/implemented.csv +++ b/config/implemented.csv @@ -212,6 +212,7 @@ th06::FileSystem::WriteDataToFile th06::ItemManager::SpawnItem th06::ItemManager::OnUpdate th06::ItemManager::OnDraw +th06::ItemManager::RemoveAllItems th06::MainMenu::AddedCallback th06::MainMenu::DeletedCallback th06::MainMenu::ReleaseTitleAnm diff --git a/config/stubbed.csv b/config/stubbed.csv index d6dcb712..9aaa4fd7 100644 --- a/config/stubbed.csv +++ b/config/stubbed.csv @@ -15,7 +15,6 @@ th06::ResultScreen::RegisterChain th06::ResultScreen::ReleaseScoreDat th06::ScreenEffect::RegisterChain th06::MainMenu::SelectRelated -th06::ItemManager::RemoveAllItems th06::ReplayManager::RegisterChain th06::ReplayManager::StopRecording th06::ReplayManager::SaveReplay diff --git a/src/ItemManager.cpp b/src/ItemManager.cpp index b1ab8b2d..e8d97ee4 100644 --- a/src/ItemManager.cpp +++ b/src/ItemManager.cpp @@ -332,6 +332,23 @@ void ItemManager::OnUpdate() return; } +#pragma var_order(idx, cursor) +void ItemManager::RemoveAllItems() +{ + Item *cursor; + i32 idx; + + for (cursor = &this->items[0], idx = 0; idx < ARRAY_SIZE_SIGNED(this->items); idx += 1, cursor += 1) + { + if (!cursor->isInUse) + { + continue; + } + cursor->state = 1; + } + return; +} + #pragma var_order(itemAlpha, idx, curItem) void ItemManager::OnDraw() {