diff --git a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp index d828c8c5ec..65cecf1b20 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp @@ -1004,11 +1004,11 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons // update FPS counter static int fpscount = 0; - static unsigned long lasttime = Common::Timer::GetTimeMs(); + static unsigned long lasttime = 0; if (Common::Timer::GetTimeMs() - lasttime >= 1000) { lasttime = Common::Timer::GetTimeMs(); - s_fps = fpscount-1; + s_fps = fpscount; fpscount = 0; } if (XFBWrited) ++fpscount; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index 4c941c9768..b05aed85ce 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -1271,16 +1271,16 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons // --------------------------------------------------------------------- // Count FPS. // ------------- - static int fpscount = 1; - static unsigned long lasttime; - if (XFBWrited) - ++fpscount; - if (Common::Timer::GetTimeMs() - lasttime > 1000) + static int fpscount = 0; + static unsigned long lasttime = 0; + if (Common::Timer::GetTimeMs() - lasttime >= 1000) { lasttime = Common::Timer::GetTimeMs(); - s_fps = fpscount - 1; - fpscount = 1; + s_fps = fpscount; + fpscount = 0; } + if (XFBWrited) + ++fpscount; // Begin new frame // Set default viewport and scissor, for the clear to work correctly diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 30bf77ca30..616e4f3806 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -571,7 +571,6 @@ TargetRectangle Renderer::ConvertEFBRectangle(const EFBRectangle& rc) return g_framebufferManager.ConvertEFBRectangle(rc); } - void Renderer::ResetAPIState() { // Gets us to a reasonably sane state where it's possible to do things like @@ -1202,14 +1201,14 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons // Count FPS. // ------------- static int fpscount = 0; - static unsigned long lasttime; - ++fpscount; - if (Common::Timer::GetTimeMs() - lasttime > 1000) + static unsigned long lasttime = 0; + if (Common::Timer::GetTimeMs() - lasttime >= 1000) { lasttime = Common::Timer::GetTimeMs(); - s_fps = fpscount - 1; + s_fps = fpscount; fpscount = 0; } + ++fpscount; // --------------------------------------------------------------------- GL_REPORT_ERRORD();