summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7fe9b42)
raw | patch | inline | side by side (parent: 7fe9b42)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 15 Apr 2016 12:14:47 +0000 (15:14 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 15 Apr 2016 12:15:15 +0000 (15:15 +0300) |
src/game/g_game.pas | patch | blob | history | |
src/game/g_window.pas | patch | blob | history |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index c5e144c7c0dfaad252644494be24bf65de0e092e..b6f747401cf1a180bbb20fb3178138ec9089de1e 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
gWinPosX, gWinPosY: Integer;
gWinSizeX, gWinSizeY: Integer;
gWinFrameX, gWinFrameY, gWinCaption: Integer;
- gWinActive: Boolean = False;
+ gWinActive: Boolean = True; // by default window is active, lol
gResolutionChange: Boolean = False;
gRC_Width, gRC_Height: Word;
gRC_FullScreen, gRC_Maximized: Boolean;
diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index 081c3b2c36a992b1e203d25298004a1897089b3f..ef1d362bd77362b5d5045ea3ffcea44b9ed24da7 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