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:
@@ -21,6 +21,10 @@
|
|||||||
#include "libs/timelib.h"
|
#include "libs/timelib.h"
|
||||||
|
|
||||||
Uint32
|
Uint32
|
||||||
SDLWrapper_GetTimeCounter (void) {
|
SDLWrapper_GetTimeCounter (void)
|
||||||
return (Uint32)(SDL_GetTicks () * ONE_SECOND / 1000.0);
|
{
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user