projects
/
matthijs
/
ABM2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Add SPR_SUB constants.
[matthijs/ABM2.git]
/
ABM2
/
Engine
/
Kernel.cpp
diff --git
a/ABM2/Engine/Kernel.cpp
b/ABM2/Engine/Kernel.cpp
index 7638ab10c0c725094ccf9c7638b182f0f53904c1..35d4afce603cc425a1fe83b2275477380459315b 100755
(executable)
--- a/
ABM2/Engine/Kernel.cpp
+++ b/
ABM2/Engine/Kernel.cpp
@@
-34,7
+34,7
@@
int CKernel::Execute()
{
\r
PROFILE("Kernel task loop");
\r
\r
{
\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
\r
#ifdef WIN32
\r
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
\r
@@
-66,8
+66,10
@@
int CKernel::Execute()
}
\r
}
\r
IMMObject::CollectGarbage();
\r
}
\r
}
\r
IMMObject::CollectGarbage();
\r
- //DWORD end_point = GetTickCount();
\r
-// Sleep(50 - (end_point-starting_point));
\r
+ DWORD end_point = GetTickCount();
\r
+ /* Sleep if we didn't use up too much time already */
\r
+ if (starting_point + 50 > end_point)
\r
+ Sleep(50 - (end_point-starting_point));
\r
}
\r
#ifdef _DEBUG
\r
CProfileSample::Output();
\r
}
\r
#ifdef _DEBUG
\r
CProfileSample::Output();
\r