summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 86c4f7d)
raw | patch | inline | side by side (parent: 86c4f7d)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 17 Apr 2016 15:14:43 +0000 (18:14 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 17 Apr 2016 15:15:01 +0000 (18:15 +0300) |
src/game/g_window.pas | patch | blob | history |
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