diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index c159ddd236d40221480036aa03394f51e41b51f9..0429b77368be262a7b3d8e08c997e6653926e5fc 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
implementation
uses
+{$IFDEF WIN32}Windows,{$ENDIF}
SDL2, GL, GLExt, e_graphics, e_log, g_main,
g_console, SysUtils, e_input, g_options, g_game,
g_basic, g_textures, e_sound, g_sound, g_menu, ENet, g_net;
Result := True;
end;
+{$IFDEF WIN32}
+// windoze sux; in headless mode `GetTickCount()` (and SDL) returns shit
+function GetTimer(): Int64;
+var
+ F, C: Int64;
+begin
+ QueryPerformanceFrequency(F);
+ QueryPerformanceCounter(C);
+ Result := Round(C/F*1000{000});
+end;
+{$ELSE}
function GetTimer(): Int64;
var
t: Uint32;
lastTicks := t;
result := ticksOverflow+Int64(t);
end;
+{$ENDIF}
procedure ResetTimer();
begin