summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b6c503)
raw | patch | inline | side by side (parent: 4b6c503)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 23 Jun 2018 08:14:49 +0000 (11:14 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 23 Jun 2018 22:29:31 +0000 (01:29 +0300) |
index 2b86f9d82433a1fda94ff6449c349caf84705b54..7cedece869ad86196a84b09b7356cedbd0b9078d 100644 (file)
--- a/README
+++ b/README
If you want SDL_mixer instead of FMOD, add -dUSE_SDLMIXER.
If you want the server to be able to forward ports via UPNP, add -dUSE_MINIUPNPC.
+If you want to debug game with Holmes, add -dENABLE_HOLMES.
To build a headless (no video/audio, for dedicated servers) executable, add -dHEADLESS.
Replace -O3 with -g -gl to enable debugging features. Run the game with --gdb when using a debugger to
prevent it from eating exceptions.
diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index 0b62430ad3d7c369f4dcf485b6f4fbb65f8e1f67..91fd3a6276cf4a7778f5322d5616a1107ea3124a 100644 (file)
--- a/src/game/Doom2DF.lpr
+++ b/src/game/Doom2DF.lpr
g_triggers in 'g_triggers.pas',
g_weapons in 'g_weapons.pas',
g_window in 'g_window.pas',
- g_holmes in 'g_holmes.pas',
SysUtils,
{$IFDEF USE_FMOD}
fmod in '../lib/FMOD/fmod.pas',
g_panel in 'g_panel.pas',
g_language in 'g_language.pas',
+{$IFDEF ENABLE_HOLMES}
+ g_holmes in 'g_holmes.pas',
+
sdlcarcass in '../flexui/sdlcarcass.pas',
//sdlstandalone in '../flexui/sdlstandalone.pas',
fui_style in '../flexui/fui_style.pas',
fui_flexlay in '../flexui/fui_flexlay.pas',
fui_ctls in '../flexui/fui_ctls.pas',
+{$ENDIF}
ImagingTypes,
Imaging,
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 4414740e5ddc0f1345ca5eb9703932dd3071a634..83da6868652f16de51be42ce2b2026d4e117e383 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
nanoGL,
{$ELSE}
GL, GLExt,
+{$ENDIF}
+{$IFDEF ENABLE_HOLMES}
+ g_holmes,
{$ENDIF}
e_texture, g_textures, g_main, g_window, g_menu,
e_input, e_log, g_console, g_items, g_map, g_panel,
g_triggers, g_monsters, e_sound, CONFIG,
g_language, g_net,
ENet, e_msg, g_netmsg, g_netmaster,
- sfs, wadreader, g_holmes;
+ sfs, wadreader;
var
p.viewPortW := sWidth;
p.viewPortH := sHeight;
+{$IFDEF ENABLE_HOLMES}
if (p = gPlayer1) then
begin
g_Holmes_plrViewPos(sX, sY);
g_Holmes_plrViewSize(sWidth, sHeight);
end;
+{$ENDIF}
renderMapInternal(-c, -d, true);
e_DrawLine(2, 0, gScreenHeight div 2, gScreenWidth, gScreenHeight div 2, 0, 0, 0);
end;
+{$IFDEF ENABLE_HOLMES}
// draw inspector
if (g_holmes_enabled) then g_Holmes_Draw();
+{$ENDIF}
if MessageText <> '' then
begin
if gGameOn then drawProfilers();
+{$IFDEF ENABLE_HOLMES}
g_Holmes_DrawUI();
+{$ENDIF}
g_Touch_Draw;
end;
conRegVar('los_enabled', @gmon_dbg_los_enabled, 'enable/disable monster LOS calculations', 'monster LOS', true);
conRegVar('mon_think', @gmon_debug_think, 'enable/disable monster thinking', 'monster thinking', true);
+{$IFDEF ENABLE_HOLMES}
conRegVar('dbg_holmes', @g_holmes_enabled, 'enable/disable Holmes', 'Holmes', true);
+{$ENDIF}
conRegVar('dbg_ignore_level_bounds', @g_dbg_ignore_bounds, 'ignore level bounds', '', false);
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index b564911086e54da4c1b0ad284666578146efd1e2..874907ed63c9598bfe9a9b214617787588b3cb8e 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
nanoGL,
{$ELSE}
GL, GLExt,
+{$ENDIF}
+{$IFDEF ENABLE_HOLMES}
+ g_holmes, fui_wadread, fui_style, fui_gfx_gl,
{$ENDIF}
SDL2, wadreader, e_log, g_window,
e_graphics, e_input, g_game, g_console, g_gui,
e_sound, g_options, g_sound, g_player, g_basic,
g_weapons, SysUtils, g_triggers, MAPDEF, g_map,
- g_menu, g_language, g_net, g_holmes, g_touch,
- utils, conbuf, envvars, fui_wadread, fui_style,
- fui_gfx_gl, xparser;
+ g_menu, g_language, g_net, g_touch,
+ utils, conbuf, envvars,
+ xparser;
var
{$ENDIF}
{$ENDIF}
-{$IFNDEF HEADLESS}
+{$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
flexloaded := true;
if not fuiAddWad('flexui.wad') then
begin
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 8c64fd0423ce66f9c7717fd1353abef54bd233a9..8c626569dfe2dd1e25476321c64567ea7333f5ff 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
nanoGL,
{$ELSE}
GL,
+{$ENDIF}
+{$IFDEF ENABLE_HOLMES}
+ g_holmes,
{$ENDIF}
e_log, g_map, g_items, g_console, g_gfx, Math,
g_options, g_triggers, g_menu, g_game, g_grid,
wadreader, g_main, g_monsters, CONFIG, g_language,
- g_net, g_netmsg, g_window, g_holmes,
+ g_net, g_netmsg, g_window,
utils, xstreams;
const PLR_SAVE_VERSION = 0;
var
ex, ey: Integer;
begin
+
+{$IFDEF ENABLE_HOLMES}
if isValidViewPort and (self = gPlayer1) then
begin
g_Holmes_plrLaser(ax0, ay0, ax1, ay1);
end;
+{$ENDIF}
e_DrawLine(sz, ax0, ay0, ax1, ay1, 255, 0, 0, 96);
if (g_Map_traceToNearestWall(ax0, ay0, ax1, ay1, @ex, @ey) <> nil) then
diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index ac21148efe9c6f1b24acdb0df77cca1cba3b4fee..7f542509b7b9febaf98200f072db129d08de578d 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
nanoGL,
{$ELSE}
GL, GLExt,
+{$ENDIF}
+{$IFDEF ENABLE_HOLMES}
+ g_holmes, sdlcarcass, fui_ctls,
{$ENDIF}
SysUtils, Classes, MAPDEF,
SDL2, e_graphics, e_log, e_texture, g_main,
g_console, e_input, g_options, g_game,
g_basic, g_textures, e_sound, g_sound, g_menu, ENet, g_net,
- g_map, g_gfx, g_monsters, g_holmes, xprofiler,
- sdlcarcass, fui_ctls,
+ g_map, g_gfx, g_monsters, xprofiler,
g_touch;
procedure KillGLWindow (preserveGL: Boolean);
begin
+{$IFDEF ENABLE_HOLMES}
if (h_GL <> nil) and (not preserveGL) then begin if (assigned(oglDeinitCB)) then oglDeinitCB(); end;
+{$ENDIF}
if (h_Wnd <> nil) then SDL_DestroyWindow(h_Wnd);
if (h_GL <> nil) and (not preserveGL) then
begin
e_WriteLog('SDL: fullscreen window got invalid size: '+IntToStr(nw)+'x'+IntToStr(nh), TMsgType.Notify);
end;
end;
- fuiScrWdt := gScreenWidth;
- fuiScrHgt := gScreenHeight;
- if (h_GL <> nil) and (not preserveGL) then begin if (assigned(oglInitCB)) then oglInitCB(); end;
+
+ {$IFDEF ENABLE_HOLMES}
+ fuiScrWdt := gScreenWidth;
+ fuiScrHgt := gScreenHeight;
+ if (h_GL <> nil) and (not preserveGL) then begin if (assigned(oglInitCB)) then oglInitCB(); end;
+ {$ENDIF}
{$ENDIF}
result := true;
gWinSizeX := gScreenWidth;
gWinSizeY := gScreenHeight;
{$IF not DEFINED(HEADLESS)}
- fuiScrWdt := gScreenWidth;
- fuiScrHgt := gScreenHeight;
+ {$IFDEF ENABLE_HOLMES}
+ fuiScrWdt := gScreenWidth;
+ fuiScrHgt := gScreenHeight;
+ {$ENDIF}
e_ResizeWindow(gScreenWidth, gScreenHeight);
g_Game_SetupScreenSize();
g_Menu_Reset();
gWinActive := false;
- if assigned(winBlurCB) then winBlurCB();
+ {$IFDEF ENABLE_HOLMES}
+ if assigned(winBlurCB) then winBlurCB();
+ {$ENDIF}
end;
end
else if wActivate then
end;
gWinActive := true;
- if assigned(winFocusCB) then winFocusCB();
+
+ {$IFDEF ENABLE_HOLMES}
+ if assigned(winFocusCB) then winFocusCB();
+ {$ENDIF}
end;
end;
end;
if key = SDL_SCANCODE_AC_BACK then
key := SDL_SCANCODE_ESCAPE;
down := (ev.type_ = SDL_KEYDOWN);
- {$IF not DEFINED(HEADLESS)}
+ {$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
if fuiOnSDLEvent(ev) then
begin
// event eaten, but...
if down then KeyPress(key);
end;
- {$IF not DEFINED(HEADLESS)}
+ {$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP, SDL_MOUSEWHEEL, SDL_MOUSEMOTION:
fuiOnSDLEvent(ev);
{$ENDIF}
{$IF not DEFINED(HEADLESS)}
h_GL := SDL_GL_CreateContext(h_Wnd);
if (h_GL = nil) then exit;
- fuiScrWdt := gScreenWidth;
- fuiScrHgt := gScreenHeight;
+ {$IFDEF ENABLE_HOLMES}
+ fuiScrWdt := gScreenWidth;
+ fuiScrHgt := gScreenHeight;
+ {$ENDIF}
SDL_GL_MakeCurrent(h_Wnd, h_GL);
{$IFDEF USE_NANOGL}
if nanoGL_Init() = 0 then
exit;
end;
{$ENDIF}
- if (assigned(oglInitCB)) then oglInitCB();
+ {$IFDEF ENABLE_HOLMES}
+ if (assigned(oglInitCB)) then oglInitCB();
+ {$ENDIF}
if (h_GL <> nil) then g_SetVSync(gVSync);
{$ENDIF}
{$IFDEF HEADLESS}
e_NoGraphics := true;
{$ELSE}
- if (not g_holmes_imfunctional) then
- begin
- uiInitialize();
- uiContext.font := 'win14';
- end;
+ {$IFDEF ENABLE_HOLMES}
+ if (not g_holmes_imfunctional) then
+ begin
+ uiInitialize();
+ uiContext.font := 'win14';
+ end;
+ {$ENDIF}
{$ENDIF}
idx := 1;
if arg = '--aimline' then g_dbg_aimline_on := true;
{.$ENDIF}
+{$IFDEF ENABLE_HOLMES}
if arg = '--holmes' then begin g_holmes_enabled := true; g_Game_SetDebugMode(); end;
if (arg = '--holmes-ui-scale') or (arg = '-holmes-ui-scale') then
Inc(idx);
end;
end;
+{$ENDIF}
if (arg = '--game-scale') or (arg = '-game-scale') then
begin