From 55a905fd3e702201d4501f99fcb029b66093a727 Mon Sep 17 00:00:00 2001 From: bgk Date: Fri, 23 Jan 2009 14:40:18 +0000 Subject: [PATCH] GTK : Removed 2 global vars git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@852 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/gtk/system.cpp | 9 --------- src/gtk/window.cpp | 12 ++++++------ src/gtk/window.h | 1 + 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/gtk/system.cpp b/src/gtk/system.cpp index 6160dd42..6c3c98d0 100644 --- a/src/gtk/system.cpp +++ b/src/gtk/system.cpp @@ -39,11 +39,6 @@ u16 systemGbPalette[24]; int emulating; int RGB_LOW_BITS_MASK; -// Extra vars, only used for the GUI -// -int systemRenderedFrames; -int systemFPS; - inline VBA::Window * GUI() { return VBA::Window::poGetInstance(); @@ -62,7 +57,6 @@ void systemMessage(int _iId, const char * _csFormat, ...) void systemDrawScreen() { GUI()->vDrawScreen(); - systemRenderedFrames++; } bool systemReadJoypads() @@ -77,9 +71,6 @@ u32 systemReadJoypad(int joy) void systemShowSpeed(int _iSpeed) { - systemFPS = systemRenderedFrames; - systemRenderedFrames = 0; - GUI()->vShowSpeed(_iSpeed); } diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 2fbe581d..fd60a2cf 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -43,8 +43,6 @@ #include "screenarea-opengl.h" #endif // USE_OPENGL -extern int systemRenderedFrames; -extern int systemFPS; extern int RGB_LOW_BITS_MASK; @@ -556,12 +554,11 @@ void Window::vInitSystem() systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; systemFrameSkip = 2; - systemRenderedFrames = 0; - systemFPS = 0; - emulating = 0; gbFrameSkip = 0; + + m_iFrameCount = 0; soundInit(); } @@ -1149,6 +1146,7 @@ void Window::vPopupErrorV(const char * _csFormat, va_list _args) void Window::vDrawScreen() { m_poScreenArea->vDrawPixels(pix); + m_iFrameCount++; } void Window::vDrawDefaultScreen() @@ -1173,9 +1171,11 @@ void Window::vShowSpeed(int _iSpeed) else if (m_eShowSpeed == ShowDetailed) { snprintf(csTitle, 50, "VBA-M - %d%% (%d, %d fps)", - _iSpeed, systemFrameSkip, systemFPS); + _iSpeed, systemFrameSkip, m_iFrameCount); set_title(csTitle); } + + m_iFrameCount = 0; } void Window::vComputeFrameskip(int _iRate) diff --git a/src/gtk/window.h b/src/gtk/window.h index cf9a3f65..7e6fd05a 100644 --- a/src/gtk/window.h +++ b/src/gtk/window.h @@ -245,6 +245,7 @@ private: int m_bFullscreen; int m_iScreenWidth; int m_iScreenHeight; + int m_iFrameCount; std::string m_sRomFile; ECartridge m_eCartridge;