diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index d78c84e12b669971c3928b638ab4e8625f9ecb31..c78c2bf3445b05e611879014aec397b9b80a9336 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
+(* Copyright (C) DooM 2D:Forever Developers
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *)
+{$MODE DELPHI}
unit g_main;
interface
unit g_main;
interface
implementation
uses
implementation
uses
- SDL2, GL, GLExt, WADEDITOR, e_log, g_window,
+ SDL2, GL, GLExt, wadreader, e_log, g_window,
e_graphics, e_input, g_game, g_console, g_gui,
e_sound, g_options, g_sound, g_player,
g_weapons, SysUtils, g_triggers, MAPDEF, g_map,
e_graphics, e_input, g_game, g_console, g_gui,
e_sound, g_options, g_sound, g_player,
g_weapons, SysUtils, g_triggers, MAPDEF, g_map,
- MAPSTRUCT, g_menu, g_language, g_net, sfs;
+ MAPSTRUCT, g_menu, g_language, g_net, utils;
var
charbuff: Array [0..15] of Char;
var
charbuff: Array [0..15] of Char;
var
sdlflags: LongWord;
begin
var
sdlflags: LongWord;
begin
+ e_InitWritelnDriver();
+
GetDir(0, GameDir);
MapsDir := GameDir + '/maps/';
DataDir := GameDir + '/data/';
GetDir(0, GameDir);
MapsDir := GameDir + '/maps/';
DataDir := GameDir + '/data/';
e_WriteLog('Read config file', MSG_NOTIFY);
g_Options_Read(GameDir + '/' + CONFIG_FILENAME);
e_WriteLog('Read config file', MSG_NOTIFY);
g_Options_Read(GameDir + '/' + CONFIG_FILENAME);
-
+
e_WriteToStdOut := {$IFDEF HEADLESS}True;{$ELSE}False;{$ENDIF}
//GetSystemDefaultLCID()
e_WriteToStdOut := {$IFDEF HEADLESS}True;{$ELSE}False;{$ENDIF}
//GetSystemDefaultLCID()
//g_Language_Load(DataDir + gLanguage + '.txt');
e_WriteLog(gLanguage, MSG_NOTIFY);
g_Language_Set(gLanguage);
//g_Language_Load(DataDir + gLanguage + '.txt');
e_WriteLog(gLanguage, MSG_NOTIFY);
g_Language_Set(gLanguage);
-
+
{$IFDEF HEADLESS}
sdlflags := SDL_INIT_TIMER or $00004000;
{$ELSE}
{$IFDEF HEADLESS}
sdlflags := SDL_INIT_TIMER or $00004000;
{$ELSE}
{$ENDIF}
if SDL_Init(sdlflags) < 0 then
raise Exception.Create('SDL: Init failed: ' + SDL_GetError());
{$ENDIF}
if SDL_Init(sdlflags) < 0 then
raise Exception.Create('SDL: Init failed: ' + SDL_GetError());
-
+
{$IFDEF HEADLESS}
SDL_StartTextInput();
{$ENDIF}
{$IFDEF HEADLESS}
SDL_StartTextInput();
{$ENDIF}
else
begin
for a := 0 to 14 do charbuff[a] := charbuff[a+1];
else
begin
for a := 0 to 14 do charbuff[a] := charbuff[a+1];
- charbuff[15] := SFSUpCase(C);
+ charbuff[15] := UpCase1251(C);
Cheat();
end;
end;
Cheat();
end;
end;