diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index 95e2c4ddc0844d228cde4ed1397c4bc6cc38c6c2..3adb2b616da1f09af1dfb5c3c7f0b0b09e1689fe 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, version 3 of the License ONLY.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
const
const
- ProgressUpdateMSecs = 1;//100;
+ ProgressUpdateMSecs = 35; //1;//100;
var
h_Wnd: PSDL_Window = nil;
var
h_Wnd: PSDL_Window = nil;
e_KeyUpDown(key, down);
g_Console_ProcessBind(key, down);
end
e_KeyUpDown(key, down);
g_Console_ProcessBind(key, down);
end
- else if gConsoleShow or (g_ActiveWindow <> nil) then
+ else if gConsoleShow or gChatShow or (g_ActiveWindow <> nil) then
begin
// key repeat in menus and shit
KeyPress(key);
begin
// key repeat in menus and shit
KeyPress(key);
end;
end;
+{$IFNDEF HEADLESS}
var
prevLoadingUpdateTime: UInt64 = 0;
var
prevLoadingUpdateTime: UInt64 = 0;
+{$ENDIF}
procedure ProcessLoading (forceUpdate: Boolean=false);
var
ev: TSDL_Event;
procedure ProcessLoading (forceUpdate: Boolean=false);
var
ev: TSDL_Event;
- ID: LongWord;
+{$IFNDEF HEADLESS}
stt: UInt64;
stt: UInt64;
+{$ENDIF}
begin
FillChar(ev, sizeof(ev), 0);
wLoadingProgress := true;
begin
FillChar(ev, sizeof(ev), 0);
wLoadingProgress := true;
exit;
end;
exit;
end;
+{$IFNDEF HEADLESS}
if not wMinimized then
begin
if not wMinimized then
begin
- if forceUpdate then
- begin
- prevLoadingUpdateTime := getTimeMilli();
- end
- else
+ if not forceUpdate then
begin
stt := getTimeMilli();
begin
stt := getTimeMilli();
- if (stt < prevLoadingUpdateTime) or (stt-prevLoadingUpdateTime >= ProgressUpdateMSecs) then
- begin
- prevLoadingUpdateTime := stt;
- forceUpdate := true;
- end;
+ forceUpdate := (stt < prevLoadingUpdateTime) or (stt-prevLoadingUpdateTime >= ProgressUpdateMSecs);
end;
if forceUpdate then
begin
end;
if forceUpdate then
begin
- if g_Texture_Get('INTER', ID) then
- begin
- e_DrawSize(ID, 0, 0, 0, false, false, gScreenWidth, gScreenHeight);
- e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
- end
- else
- begin
- e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);
- end;
+ DrawMenuBackground('INTER');
+ e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
DrawLoadingStat();
DrawLoadingStat();
+ g_Console_Draw(True);
SwapBuffers();
SwapBuffers();
+ prevLoadingUpdateTime := getTimeMilli();
end;
end;
end;
end;
+{$ENDIF}
e_SoundUpdate();
e_SoundUpdate();
else if (NetMode = NET_CLIENT) then g_Net_Client_Update();
end;
else if (NetMode = NET_CLIENT) then g_Net_Client_Update();
end;
+ if NetMode = NET_SERVER then g_Net_Flush();
+
g_Map_ProfilersEnd();
g_Mons_ProfilersEnd();
g_Map_ProfilersEnd();
g_Mons_ProfilersEnd();
{$IFDEF USE_GLES1}
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
{$IFDEF USE_GLES1}
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
{$ELSE}
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
{$ELSE}
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
// Êîìàíäíàÿ ñòðîêà
if (ParamCount > 0) then g_Game_Process_Params();
// Êîìàíäíàÿ ñòðîêà
if (ParamCount > 0) then g_Game_Process_Params();
+{$IFNDEF HEADLESS}
// Çàïðîñ ÿçûêà
if (not gGameOn) and gAskLanguage then g_Menu_AskLanguage();
// Çàïðîñ ÿçûêà
if (not gGameOn) and gAskLanguage then g_Menu_AskLanguage();
+{$ENDIF}
e_WriteLog('Entering the main loop', TMsgType.Notify);
e_WriteLog('Entering the main loop', TMsgType.Notify);