mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Add new shared pointer and make use of it
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user