From fa971e3d6333f2c638b18279c279b20d4bd0f08e Mon Sep 17 00:00:00 2001 From: rogerman Date: Fri, 23 Dec 2016 09:56:55 -0800 Subject: [PATCH] GPU: Make updating the 3D renderer FPS into its own method. --- desmume/src/GPU.cpp | 19 ++++++++++++------- desmume/src/GPU.h | 1 + 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index 4defbf787..f9aa51216 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -6900,6 +6900,17 @@ void GPUSubsystem::FinalizeAndDeallocate() free_aligned(this); } +void GPUSubsystem::_UpdateFPSRender3D() +{ + this->_videoFrameCount++; + if (this->_videoFrameCount == 60) + { + this->_render3DFrameCount = gfx3d.render3DFrameCount; + gfx3d.render3DFrameCount = 0; + this->_videoFrameCount = 0; + } +} + void GPUSubsystem::SetEventHandler(GPUEventHandler *eventHandler) { this->_event = eventHandler; @@ -7471,13 +7482,7 @@ void GPUSubsystem::RenderLine(const size_t l, bool isFrameSkipRequested) this->_engineMain->FramebufferPostprocess(); this->_engineSub->FramebufferPostprocess(); - this->_videoFrameCount++; - if (this->_videoFrameCount == 60) - { - this->_render3DFrameCount = gfx3d.render3DFrameCount; - gfx3d.render3DFrameCount = 0; - this->_videoFrameCount = 0; - } + this->_UpdateFPSRender3D(); if (!isFrameSkipRequested) { diff --git a/desmume/src/GPU.h b/desmume/src/GPU.h index 8712c1050..72f03f17c 100644 --- a/desmume/src/GPU.h +++ b/desmume/src/GPU.h @@ -1648,6 +1648,7 @@ private: NDSDisplayInfo _displayInfo; + void _UpdateFPSRender3D(); void _AllocateFramebuffers(NDSColorFormat outputFormat, size_t w, size_t h, void *clientNativeBuffer, void *clientCustomBuffer); public: