Add new shared pointer and make use of it

This commit is contained in:
Gericom
2026-03-28 12:03:06 +01:00
parent bec797ffe7
commit 21a8790ebc
66 changed files with 1098 additions and 523 deletions

View File

@@ -25,25 +25,20 @@ public:
height = 24;
}
View* CreateView() const override
SharedPtr<View> CreateView() const override
{
return new CheatListItemView(_vramOffsets, _materialColorScheme, _fontRepository);
return SharedPtr<CheatListItemView>::MakeShared(_vramOffsets, _materialColorScheme, _fontRepository);
}
void DestroyView(View* view) const override
void BindView(SharedPtr<View> view, int index) const override
{
delete (CheatListItemView*)view;
}
void BindView(View* view, int index) const override
{
auto listItemView = static_cast<CheatListItemView*>(view);
auto listItemView = static_cast<CheatListItemView*>(view.GetPointer());
u32 numberOfSubEntries = 0;
auto subEntries = _cheatCategory->GetSubEntries(numberOfSubEntries);
listItemView->SetEntry(&subEntries[index]);
}
void ReleaseView(View* view, int index) const override
void ReleaseView(SharedPtr<View> view, int index) const override
{
// Nothing to do
}