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:
@@ -4,8 +4,6 @@
|
||||
#include "romBrowser/views/IconButton3DView.h"
|
||||
#include "CustomAppBarView.h"
|
||||
|
||||
#define BLOCK_VTX_PACK(x, y, z) (((x)&0x3FF) | ((((y) >> 3) & 0x3FF) << 10) | ((z) << 20))
|
||||
|
||||
CustomAppBarView::CustomAppBarView(int x, int y, Orientation orientation,
|
||||
int startButtonCount, int endButtonCount, const MaterialColorScheme* materialColorScheme,
|
||||
u32 scrimTexVramOffset, u32 scrimPlttVramOffset)
|
||||
@@ -14,12 +12,12 @@ CustomAppBarView::CustomAppBarView(int x, int y, Orientation orientation,
|
||||
{
|
||||
for (int i = 0; i < _startButtonCount + _endButtonCount; i++)
|
||||
{
|
||||
_buttons[i] = new IconButton3DView(
|
||||
_buttons[i] = SharedPtr<IconButton3DView>::MakeShared(
|
||||
IconButtonView::Type::Tonal,
|
||||
IconButtonView::State::NoToggle,
|
||||
md::sys::color::inverseOnSurface,
|
||||
materialColorScheme);
|
||||
AddChildTail(_buttons[i]);
|
||||
AddChildTail(_buttons[i].GetPointer());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,15 @@ public:
|
||||
const IFontRepository* fontRepository)
|
||||
: _customThemeInfo(customThemeInfo), _materialColorScheme(materialColorScheme), _fontRepository(fontRepository) { }
|
||||
|
||||
IconGridItemView* CreateIconGridItemView() const override
|
||||
SharedPtr<IconGridItemView> CreateIconGridItemView() const override
|
||||
{
|
||||
return new CustomIconGridItemView(_customThemeInfo, _gridCellTexVramOffset, _gridCellPlttVramOffset,
|
||||
return SharedPtr<CustomIconGridItemView>::MakeShared(_customThemeInfo, _gridCellTexVramOffset, _gridCellPlttVramOffset,
|
||||
_gridCellSelectedTexVramOffset, _gridCellSelectedPlttVramOffset);
|
||||
}
|
||||
|
||||
BannerListItemView* CreateBannerListItemView(VBlankTextureLoader* vblankTextureLoader) const override
|
||||
SharedPtr<BannerListItemView> CreateBannerListItemView(VBlankTextureLoader* vblankTextureLoader) const override
|
||||
{
|
||||
return new CustomBannerListItemView(_customThemeInfo, _materialColorScheme, _fontRepository,
|
||||
return SharedPtr<CustomBannerListItemView>::MakeShared(_customThemeInfo, _materialColorScheme, _fontRepository,
|
||||
_bannerListCellTexVramOffset, _bannerListCellPlttVramOffset,
|
||||
_bannerListCellSelectedTexVramOffset, _bannerListCellSelectedPlttVramOffset, vblankTextureLoader);
|
||||
}
|
||||
@@ -51,16 +51,16 @@ public:
|
||||
return std::make_unique<CustomFileInfoView>(_customThemeInfo, _fontRepository);
|
||||
}
|
||||
|
||||
std::unique_ptr<RecyclerViewBase> CreateCoverFlowRecyclerView() const override
|
||||
SharedPtr<RecyclerViewBase> CreateCoverFlowRecyclerView() const override
|
||||
{
|
||||
return std::make_unique<CoverFlowRecyclerView>();
|
||||
return CoverFlowRecyclerView::CreateShared();
|
||||
}
|
||||
|
||||
FileRecyclerAdapter* CreateCoverFlowRecyclerAdapter(
|
||||
SharedPtr<FileRecyclerAdapter> CreateCoverFlowRecyclerAdapter(
|
||||
RomBrowserViewModel* viewModel, const IThemeFileIconFactory* themeFileIconFactory,
|
||||
VBlankTextureLoader* vblankTextureLoader) const override
|
||||
{
|
||||
return new CoverFlowFileRecyclerAdapter(
|
||||
return SharedPtr<CoverFlowFileRecyclerAdapter>::MakeShared(
|
||||
&viewModel->GetFileInfoManager(), viewModel->GetIoTaskQueue(),
|
||||
themeFileIconFactory, this, vblankTextureLoader, &viewModel->GetCoverRepository());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user