Skip to content

Commit

Permalink
Merge pull request #302 from roblabla/itemmanager-removeallitems
Browse files Browse the repository at this point in the history
Implement ItemManager::RemoveAllItems
  • Loading branch information
roblabla authored Nov 4, 2024
2 parents a867b86 + e8decca commit 7501de5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/implemented.csv
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,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
Expand Down
1 change: 0 additions & 1 deletion config/stubbed.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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
Expand Down
17 changes: 17 additions & 0 deletions src/ItemManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit 7501de5

Please sign in to comment.