Initialize the framebuffers within the constructor (#1901)
This commit is contained in:
parent
bb42c8b639
commit
2e8cca9ca1
|
@ -75,7 +75,7 @@ GPU::GPU(melonDS::NDS& nds, std::unique_ptr<Renderer3D>&& renderer3d, std::uniqu
|
||||||
NDS.RegisterEventFunc(Event_LCD, LCD_FinishFrame, MemberEventFunc(GPU, FinishFrame));
|
NDS.RegisterEventFunc(Event_LCD, LCD_FinishFrame, MemberEventFunc(GPU, FinishFrame));
|
||||||
NDS.RegisterEventFunc(Event_DisplayFIFO, 0, MemberEventFunc(GPU, DisplayFIFO));
|
NDS.RegisterEventFunc(Event_DisplayFIFO, 0, MemberEventFunc(GPU, DisplayFIFO));
|
||||||
|
|
||||||
FrontBuffer = 0;
|
InitFramebuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
GPU::~GPU() noexcept
|
GPU::~GPU() noexcept
|
||||||
|
@ -298,6 +298,11 @@ void GPU::SetRenderer3D(std::unique_ptr<Renderer3D>&& renderer) noexcept
|
||||||
else
|
else
|
||||||
GPU3D.SetCurrentRenderer(std::move(renderer));
|
GPU3D.SetCurrentRenderer(std::move(renderer));
|
||||||
|
|
||||||
|
InitFramebuffers();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GPU::InitFramebuffers() noexcept
|
||||||
|
{
|
||||||
int fbsize;
|
int fbsize;
|
||||||
if (GPU3D.IsRendererAccelerated())
|
if (GPU3D.IsRendererAccelerated())
|
||||||
fbsize = (256*3 + 1) * 192;
|
fbsize = (256*3 + 1) * 192;
|
||||||
|
|
|
@ -607,6 +607,7 @@ public:
|
||||||
private:
|
private:
|
||||||
void ResetVRAMCache() noexcept;
|
void ResetVRAMCache() noexcept;
|
||||||
void AssignFramebuffers() noexcept;
|
void AssignFramebuffers() noexcept;
|
||||||
|
void InitFramebuffers() noexcept;
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T ReadVRAM_ABGExtPal(u32 addr) const noexcept
|
T ReadVRAM_ABGExtPal(u32 addr) const noexcept
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue