Fixed the freezing issue on Windows - apparently it does not handle type conversions as fluidly as *nix. Changed SDL_GetTicks in getPTime to be assigned to int64_t rather than int. I suspect bugs still exist, but this will likely become a non-issue once a high precision timer(or as close as we can get) is implemented for Windows. Also it is a mystery why fps is capped to 60 - perhaps some Windows-specific OpenGL voodoo.

master
kts 2014-03-03 13:14:23 -08:00
parent 452bdf4a1d
commit 1ebb045fef
3 changed files with 16 additions and 18 deletions

View File

@ -2,10 +2,10 @@
Order=-1
Focused=-1
[Editor_0]
Open=0
Top=0
CursorCol=2
CursorRow=25
Open=1
Top=1
CursorCol=55
CursorRow=20
TopLine=1
LeftChar=1
[Editor_1]
@ -56,11 +56,11 @@ CursorRow=191
TopLine=158
LeftChar=1
[Editor_10]
Open=0
Open=1
Top=0
CursorCol=6
CursorRow=165
TopLine=133
CursorRow=135
TopLine=86
LeftChar=1
[Editor_11]
Open=0
@ -70,15 +70,15 @@ CursorRow=16
TopLine=13
LeftChar=1
[Editor_12]
Open=1
Open=0
Top=0
CursorCol=32
CursorRow=30
TopLine=4
LeftChar=1
[Editor_13]
Open=1
Top=1
Open=0
Top=0
CursorCol=1
CursorRow=1
TopLine=1
@ -106,14 +106,14 @@ Top=0
Open=0
Top=0
[Editor_20]
Open=0
Open=1
Top=0
CursorCol=24
CursorRow=26
CursorCol=17
CursorRow=8
TopLine=1
LeftChar=1
[Editor_21]
Open=0
Open=1
Top=0
CursorCol=1
CursorRow=1

View File

@ -47,9 +47,7 @@ int interfaceInit() {
/* set our video tickrate/refresh vars */
vid_tickrate = (1000.0f / getTablePairValueFloat(g_settings, "v_fps")); // target 60 tickrate
g_cap_framerate = getTablePairValueInt(g_settings, "v_framecap");
tick_time.n = getTablePairValueInt(g_settings, "tickrate");
tick_time.m = tick_time.n/1000000;
tick_time.s = 0;
setPTime(&tick_time, 0, 0, getTablePairValueInt(g_settings, "tickrate"));
g_accumulator = 0;
vid_frames = 0;

View File

@ -14,7 +14,7 @@ int64_t setPTime(struct PTime *time, int64_t seconds, int64_t milliseconds, int6
int64_t getPTime(struct PTime *time) {
#if _WIN32 | _WIN64
int ticks = SDL_GetTicks();
int64_t ticks = SDL_GetTicks();
time->s = ticks/1000;
time->m = ticks;
time->n = ticks*1000000;