From 74b9a225eda4a9c8d97da9f374fd444b3823e5c1 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 11 Jun 2007 16:03:25 +0200 Subject: [PATCH] * Limit the Kernel to 20fps. --- ABM2/Engine/Kernel.cpp | 6 +++--- ABM2/porting.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ABM2/Engine/Kernel.cpp b/ABM2/Engine/Kernel.cpp index 7638ab1..06269d3 100755 --- a/ABM2/Engine/Kernel.cpp +++ b/ABM2/Engine/Kernel.cpp @@ -34,7 +34,7 @@ int CKernel::Execute() { PROFILE("Kernel task loop"); - //DWORD starting_point = GetTickCount(); + DWORD starting_point = GetTickCount(); #ifdef WIN32 if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) @@ -66,8 +66,8 @@ int CKernel::Execute() } } IMMObject::CollectGarbage(); - //DWORD end_point = GetTickCount(); -// Sleep(50 - (end_point-starting_point)); + DWORD end_point = GetTickCount(); + Sleep(50 - (end_point-starting_point)); } #ifdef _DEBUG CProfileSample::Output(); diff --git a/ABM2/porting.h b/ABM2/porting.h index 6ee3006..ef28a0d 100644 --- a/ABM2/porting.h +++ b/ABM2/porting.h @@ -14,6 +14,7 @@ #ifdef WITH_SDL #include #define GetTickCount SDL_GetTicks + #define Sleep SDL_Delay #endif // WITH_SDL #endif // !defined(AFX_PORTING_H__90C3FE42_3400_4978_8BC5_7D905F3C8E63__INCLUDED_) -- 2.30.2