* Limit the Kernel to 20fps.
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 14:03:25 +0000 (16:03 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 14:03:25 +0000 (16:03 +0200)
ABM2/Engine/Kernel.cpp
ABM2/porting.h

index 7638ab10c0c725094ccf9c7638b182f0f53904c1..06269d33183bbd209f78b2b1967a317ab654f98b 100755 (executable)
@@ -34,7 +34,7 @@ int CKernel::Execute()
                {\r
                        PROFILE("Kernel task loop");\r
 \r
-                       //DWORD starting_point = GetTickCount();\r
+                       DWORD starting_point = GetTickCount();\r
 \r
 #ifdef WIN32\r
         if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))\r
@@ -66,8 +66,8 @@ int CKernel::Execute()
                                }\r
                        }\r
                        IMMObject::CollectGarbage();\r
-                       //DWORD end_point = GetTickCount();\r
-//                     Sleep(50 - (end_point-starting_point));\r
+                       DWORD end_point = GetTickCount();\r
+                       Sleep(50 - (end_point-starting_point));\r
                }\r
 #ifdef _DEBUG\r
                CProfileSample::Output();\r
index 6ee3006e2ceaf96d45cd1c2a57b49c5641311689..ef28a0d897350c8458749cd131dc92ac972916d0 100644 (file)
@@ -14,6 +14,7 @@
 #ifdef WITH_SDL
        #include <SDL/SDL.h>
        #define GetTickCount SDL_GetTicks
+       #define Sleep SDL_Delay
 #endif // WITH_SDL
 
 #endif // !defined(AFX_PORTING_H__90C3FE42_3400_4978_8BC5_7D905F3C8E63__INCLUDED_)