diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index 081c3b2c36a992b1e203d25298004a1897089b3f..419e135299da48568c51fe8974a8a2389016c0c6 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
e_WriteLog('[DEBUG] WinMsgs: Now restored', MSG_NOTIFY);
end;
end;
-
+
SDL_WINDOWEVENT_FOCUS_GAINED:
+ begin
wActivate := True;
-
+ //e_WriteLog('window gained focus!', MSG_NOTIFY);
+ end;
+
SDL_WINDOWEVENT_FOCUS_LOST:
+ begin
wDeactivate := True;
+ //e_WriteLog('window lost focus!', MSG_NOTIFY);
+ end;
end;
-
+
if wDeactivate then
begin
if gWinActive then
begin
+ e_WriteLog('deactivating window', MSG_NOTIFY);
e_EnableInput := False;
e_ClearInputBuffer();
if gMuteWhenInactive then
+ begin
+ //e_WriteLog('deactivating sounds', MSG_NOTIFY);
e_MuteChannels(True);
+ end;
if g_debug_WinMsgs then
begin
begin
if not gWinActive then
begin
+ //e_WriteLog('activating window', MSG_NOTIFY);
e_EnableInput := True;
if gMuteWhenInactive then
+ begin
+ //e_WriteLog('activating sounds', MSG_NOTIFY);
e_MuteChannels(False);
+ end;
if g_debug_WinMsgs then
begin
function GetTimer(): Int64;
begin
- Result := SDL_GetTicks() * 1000; // TODO: do we really need microseconds here?
+ Result := SDL_GetTicks() {* 1000}; // TODO: do we really need microseconds here? k8: NOPE!
end;
procedure ResetTimer();
if wNeedTimeReset then
begin
- Time_Delta := 27777;
+ Time_Delta := (27777 div 1000);
wNeedTimeReset := False;
end;
- t := Time_Delta div 27777;
+ t := Time_Delta div (27777 div 1000);
if t > 0 then
begin
flag := True;
// Âðåìÿ ïðåäûäóùåãî îáíîâëåíèÿ:
if flag then
begin
- Time_Old := Time - (Time_Delta mod 27777);
+ Time_Old := Time - (Time_Delta mod (27777 div 1000));
if (not wMinimized) then
begin
Draw();