diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index 222002baa53a1a312be411a51bcc1a3f6253431a..45432615c04762ff01a513553de4f9b7822043af 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
uses
{$INCLUDE ../nogl/noGLuses.inc}
{$IFDEF ENABLE_HOLMES}
uses
{$INCLUDE ../nogl/noGLuses.inc}
{$IFDEF ENABLE_HOLMES}
- g_holmes, fui_wadread, fui_style, fui_gfx_gl,
+ g_holmes, sdlcarcass, fui_ctls, fui_wadread, fui_style, fui_gfx_gl,
{$ENDIF}
wadreader, e_log, g_window,
e_graphics, e_input, g_game, g_console, g_gui,
{$ENDIF}
wadreader, e_log, g_window,
e_graphics, e_input, g_game, g_console, g_gui,
charbuff: packed array [0..15] of AnsiChar;
procedure Main();
charbuff: packed array [0..15] of AnsiChar;
procedure Main();
-var
- sdlflags: LongWord;
-{$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
- flexloaded: Boolean;
+{$IFDEF ENABLE_HOLMES}
+ var flexloaded: Boolean;
{$ENDIF}
begin
e_InitWritelnDriver();
{$ENDIF}
begin
e_InitWritelnDriver();
{$ENDIF}
e_WriteToStdOut := False; //{$IFDEF HEADLESS}True;{$ELSE}False;{$ENDIF}
{$ENDIF}
e_WriteToStdOut := False; //{$IFDEF HEADLESS}True;{$ELSE}False;{$ENDIF}
- e_WriteLog('Init Input', TMsgType.Notify);
e_InitInput;
e_InitInput;
- e_WriteLog('Read config file', TMsgType.Notify);
+ sys_Init;
g_Options_Read(GameDir + '/' + CONFIG_FILENAME);
g_Options_Read(GameDir + '/' + CONFIG_FILENAME);
- g_Console_SysInit;
-
- //GetSystemDefaultLCID()
+ if sys_SetDisplayMode(gScreenWidth, gScreenHeight, gBPP, gFullScreen) = False then
+ raise Exception.Create('Failed to set videomode on startup.');
- //e_WriteLog('Read language file', MSG_NOTIFY);
- //g_Language_Load(DataDir + gLanguage + '.txt');
+ g_Console_SysInit;
e_WriteLog(gLanguage, TMsgType.Notify);
g_Language_Set(gLanguage);
e_WriteLog(gLanguage, TMsgType.Notify);
g_Language_Set(gLanguage);
- sys_Init;
-
{$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
flexloaded := true;
if not fuiAddWad('flexui.wad') then
{$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
flexloaded := true;
if not fuiAddWad('flexui.wad') then
end;
end;
g_holmes_imfunctional := not flexloaded;
end;
end;
g_holmes_imfunctional := not flexloaded;
+
+ if (not g_holmes_imfunctional) then
+ begin
+ uiInitialize();
+ uiContext.font := 'win14';
+ end;
+
+ if assigned(oglInitCB) then oglInitCB;
{$ENDIF}
//g_Res_CreateDatabases(); // it will be done before connecting to the server for the first time
e_WriteLog('Entering SDLMain', TMsgType.Notify);
{$ENDIF}
//g_Res_CreateDatabases(); // it will be done before connecting to the server for the first time
e_WriteLog('Entering SDLMain', TMsgType.Notify);
-{$WARNINGS OFF}
- SDLMain();
-{$WARNINGS ON}
+ {$WARNINGS OFF}
+ SDLMain();
+ {$WARNINGS ON}
+
+ {$IFDEF ENABLE_HOLMES}
+ if assigned(oglDeinitCB) then oglDeinitCB;
+ {$ENDIF}
sys_Final;
end;
sys_Final;
end;
e_WriteLog('Releasing engine', TMsgType.Notify);
e_ReleaseEngine();
e_WriteLog('Releasing engine', TMsgType.Notify);
e_ReleaseEngine();
- e_WriteLog('Releasing Input', TMsgType.Notify);
+ e_WriteLog('Releasing input', TMsgType.Notify);
e_ReleaseInput();
if not gNoSound then
begin
e_ReleaseInput();
if not gNoSound then
begin
- e_WriteLog('Releasing FMOD', TMsgType.Notify);
+ e_WriteLog('Releasing sound', TMsgType.Notify);
e_ReleaseSoundSystem();
end;
end;
e_ReleaseSoundSystem();
end;
end;