From: Matthijs Kooijman Date: Mon, 11 Jun 2007 14:03:25 +0000 (+0200) Subject: * Limit the Kernel to 20fps. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2FABM2.git;a=commitdiff_plain;h=74b9a225eda4a9c8d97da9f374fd444b3823e5c1 * Limit the Kernel to 20fps. --- 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_)