summaryrefslogtreecommitdiffstats
path: root/src/graphics
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2013-03-24 00:03:37 +0100
committerPiotr Dziwinski <piotrdz@gmail.com>2013-03-24 12:00:12 +0100
commit195d6cded05f7ef5bde695ee047b341a0265eab3 (patch)
treeaf6ffa3622ae9bf7f2f5f065e269e86a019af854 /src/graphics
parentc211b001d2a4c9b36034a812650f1a2ac693ee54 (diff)
downloadcolobot-195d6cded05f7ef5bde695ee047b341a0265eab3.tar.gz
colobot-195d6cded05f7ef5bde695ee047b341a0265eab3.tar.bz2
colobot-195d6cded05f7ef5bde695ee047b341a0265eab3.zip
Fixed timer functions on win32
* changed win32 implementation to QueryPerformaceTimer system function * refactored system utils code * proper tests for time utils and update event creation in application * should fix issue #134
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/engine/engine.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index d24a3bd..e2ef569 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -148,8 +148,8 @@ CEngine::CEngine(CApplication *app)
m_mouseType = ENG_MOUSE_NORM;
m_fpsCounter = 0;
- m_lastFrameTime = CreateTimeStamp();
- m_currentFrameTime = CreateTimeStamp();
+ m_lastFrameTime = GetSystemUtils()->CreateTimeStamp();
+ m_currentFrameTime = GetSystemUtils()->CreateTimeStamp();
m_defaultTexParams.format = TEX_IMG_AUTO;
m_defaultTexParams.mipmap = true;
@@ -176,9 +176,9 @@ CEngine::~CEngine()
m_planet = nullptr;
m_terrain = nullptr;
- DestroyTimeStamp(m_lastFrameTime);
+ GetSystemUtils()->DestroyTimeStamp(m_lastFrameTime);
m_lastFrameTime = nullptr;
- DestroyTimeStamp(m_currentFrameTime);
+ GetSystemUtils()->DestroyTimeStamp(m_currentFrameTime);
m_currentFrameTime = nullptr;
}
@@ -279,8 +279,8 @@ bool CEngine::Create()
params.mipmap = false;
m_miceTexture = LoadTexture("mouse.png", params);
- GetCurrentTimeStamp(m_currentFrameTime);
- GetCurrentTimeStamp(m_lastFrameTime);
+ GetSystemUtils()->GetCurrentTimeStamp(m_currentFrameTime);
+ GetSystemUtils()->GetCurrentTimeStamp(m_lastFrameTime);
return true;
}
@@ -336,11 +336,11 @@ void CEngine::FrameUpdate()
{
m_fpsCounter++;
- GetCurrentTimeStamp(m_currentFrameTime);
- float diff = TimeStampDiff(m_lastFrameTime, m_currentFrameTime, STU_SEC);
+ GetSystemUtils()->GetCurrentTimeStamp(m_currentFrameTime);
+ float diff = GetSystemUtils()->TimeStampDiff(m_lastFrameTime, m_currentFrameTime, STU_SEC);
if (diff > 1.0f)
{
- CopyTimeStamp(m_lastFrameTime, m_currentFrameTime);
+ GetSystemUtils()->CopyTimeStamp(m_lastFrameTime, m_currentFrameTime);
m_fps = m_fpsCounter / diff;
m_fpsCounter = 0;