Game clock counter overflow fix (#668)

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1435 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2005-01-07 22:32:48 +00:00
parent 3ca9dc5344
commit 2581032bf9
+6 -2
View File
@@ -21,6 +21,10 @@
#include "libs/timelib.h"
Uint32
SDLWrapper_GetTimeCounter (void) {
return (Uint32)(SDL_GetTicks () * ONE_SECOND / 1000.0);
SDLWrapper_GetTimeCounter (void)
{
Uint32 ticks = SDL_GetTicks ();
return (ticks / 1000) * ONE_SECOND + ((ticks % 1000) * ONE_SECOND / 1000);
// Use the following instead when confirming "random" lockup bugs (see #668)
//return ticks * ONE_SECOND / 1000;
}