diff options
author | Paul Gilbert | 2010-08-06 10:50:16 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 22:28:21 +0000 |
commit | 87553862d92d462534cb7a050bf481d9cd1d0d59 (patch) | |
tree | 65cd08fa6a58888b98d95c5cb240e9515f936727 /engines/sword25/gfx | |
parent | bf53914c2aedbe340be8fb920a5023020d64c101 (diff) | |
download | scummvm-rg350-87553862d92d462534cb7a050bf481d9cd1d0d59.tar.gz scummvm-rg350-87553862d92d462534cb7a050bf481d9cd1d0d59.tar.bz2 scummvm-rg350-87553862d92d462534cb7a050bf481d9cd1d0d59.zip |
SWORD25: Converted remainder of Kernel/ folder
svn-id: r53216
Diffstat (limited to 'engines/sword25/gfx')
-rw-r--r-- | engines/sword25/gfx/framecounter.cpp | 17 | ||||
-rw-r--r-- | engines/sword25/gfx/framecounter.h | 2 |
2 files changed, 8 insertions, 11 deletions
diff --git a/engines/sword25/gfx/framecounter.cpp b/engines/sword25/gfx/framecounter.cpp index 65a0c9f053..c2e6ab772d 100644 --- a/engines/sword25/gfx/framecounter.cpp +++ b/engines/sword25/gfx/framecounter.cpp @@ -32,36 +32,33 @@ * */ +#include "common/system.h" #include "sword25/gfx/framecounter.h" -#include "sword25/kernel/timer.h" namespace Sword25 { BS_Framecounter::BS_Framecounter(int UpdateFrequency) : - m_FPS(0), - m_FPSCount(0), - m_LastUpdateTime(-1) -{ + m_FPS(0), + m_FPSCount(0), + m_LastUpdateTime(-1) { SetUpdateFrequency(UpdateFrequency); } void BS_Framecounter::Update() { // Aktuellen Systemtimerstand auslesen - uint64_t Timer = BS_Timer::GetMicroTicks(); + uint64_t Timer = g_system->getMillis() * 1000; // Falls m_LastUpdateTime == -1 ist, wird der Frame-Counter zum ersten Mal aufgerufen und der aktuelle Systemtimer als erster // Messzeitpunkt genommen. if (m_LastUpdateTime == -1) m_LastUpdateTime = Timer; - else - { + else { // Die Anzahl der Frames im aktuellen Messzeitraum wird erh�ht. m_FPSCount++; // Falls der Messzeitraum verstrichen ist, wird die durchschnittliche Framerate berechnet und ein neuer Messzeitraum begonnen. - if (Timer - m_LastUpdateTime >= m_UpdateDelay) - { + if (Timer - m_LastUpdateTime >= m_UpdateDelay) { m_FPS = static_cast<int>((1000000 * (uint64_t)m_FPSCount) / (Timer - m_LastUpdateTime)); m_LastUpdateTime = Timer; m_FPSCount = 0; diff --git a/engines/sword25/gfx/framecounter.h b/engines/sword25/gfx/framecounter.h index ebdc78ce65..89612f94be 100644 --- a/engines/sword25/gfx/framecounter.h +++ b/engines/sword25/gfx/framecounter.h @@ -77,7 +77,7 @@ public: private: int m_FPS; int m_FPSCount; - uint64_t m_LastUpdateTime; + int64_t m_LastUpdateTime; uint64_t m_UpdateDelay; }; |