aboutsummaryrefslogtreecommitdiff
path: root/src/GPU3D.cpp
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2023-12-21 21:43:57 +0100
committerRSDuck <RSDuck@users.noreply.github.com>2023-12-21 21:43:57 +0100
commited650f2b468ab951c7606d232f0a34e97c51eb77 (patch)
treef6b6ee6c7643d78286efd46a38ddddc09d15518f /src/GPU3D.cpp
parentfd3c34973595573d5dea9aeba0a251a37264d30d (diff)
call Reset on 3D renderer object
Diffstat (limited to 'src/GPU3D.cpp')
-rw-r--r--src/GPU3D.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp
index ac29a1e..4787702 100644
--- a/src/GPU3D.cpp
+++ b/src/GPU3D.cpp
@@ -146,6 +146,12 @@ GPU3D::GPU3D(melonDS::NDS& nds, std::unique_ptr<Renderer3D>&& renderer) noexcept
{
}
+void GPU3D::SetCurrentRenderer(std::unique_ptr<Renderer3D>&& renderer) noexcept
+{
+ CurrentRenderer = std::move(renderer);
+ CurrentRenderer->Reset(NDS.GPU);
+}
+
void GPU3D::ResetRenderingState() noexcept
{
RenderNumPolygons = 0;
@@ -282,6 +288,9 @@ void GPU3D::Reset() noexcept
FlushAttributes = 0;
RenderXPos = 0;
+
+ if (CurrentRenderer)
+ CurrentRenderer->Reset(NDS.GPU);
}
void GPU3D::DoSavestate(Savestate* file) noexcept