summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 09e7681)
raw | patch | inline | side by side (parent: 09e7681)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 31 Jan 2022 19:08:03 +0000 (22:08 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 31 Jan 2022 19:08:03 +0000 (22:08 +0300) |
src/game/Doom2DF.lpr | patch | blob | history | |
src/game/g_gui.pas | patch | blob | history | |
src/game/g_menu.pas | patch | blob | history | |
src/shared/a_modes.inc | patch | blob | history |
diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index 0a361e60769563a5182c1a824522492982b08e2d..24289f852c433ffb4b740f49618da97398b9c707 100644 (file)
--- a/src/game/Doom2DF.lpr
+++ b/src/game/Doom2DF.lpr
{$ENDIF}
{$ENDIF}
+ {$IFDEF ENABLE_MENU}
+ g_gui in 'g_gui.pas',
+ g_menu in 'g_menu.pas',
+ {$ENDIF}
+
{$IFDEF ENABLE_RENDER}
{$I ../shared/vampimg.inc}
r_animations in 'opengl/r_animations.pas',
r_touch in 'opengl/r_touch.pas',
{$ENDIF}
{$IFDEF ENABLE_MENU}
- g_gui in 'g_gui.pas',
- g_menu in 'g_menu.pas',
r_gui in 'opengl/r_gui.pas',
{$ENDIF}
{$ENDIF}
diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index 988d0909fd5afe24c1cc4501824e6855130e11df..734251a6afce93b4c7a95ed2834cb8dd402104f8 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
end;
function GetWidth (j, i: Integer): Integer;
- var w, h: Integer;
+ {$IFDEF ENABLE_RENDER}
+ var w, h: Integer;
+ {$ENDIF}
begin
- r_GUI_GetStringSize(BigFont, GetLine(j, i), w, h);
- result := w
+ {$IFDEF ENABLE_RENDER}
+ r_GUI_GetStringSize(BigFont, GetLine(j, i), w, h);
+ Result := w;
+ {$ELSE}
+ Result := 0;
+ {$ENDIF}
end;
begin
{ TGUIMainMenu }
function TGUIMainMenu.AddButton(fProc: Pointer; Caption: string; ShowWindow: string = ''): TGUITextButton;
-var
- a, _x: Integer;
- h, hh: Word;
- lw: Word = 0;
- lh: Word = 0;
+ var
+ {$IFDEF ENABLE_RENDER}
+ lw: Word = 0;
+ {$ENDIF}
+ a, _x: Integer;
+ h, hh: Word;
+ lh: Word = 0;
begin
FIndex := 0;
if FButtons[a] <> nil then
_x := Min(_x, (gScreenWidth div 2)-(FButtons[a].GetWidth div 2));
- if FHeader = nil then
- r_GUI_GetLogoSize(lw, lh);
+ {$IFDEF ENABLE_RENDER}
+ if FHeader = nil then
+ r_GUI_GetLogoSize(lw, lh);
+ {$ENDIF}
hh := FButtons[High(FButtons)].GetHeight;
if FHeader = nil then h := lh + hh * (1 + Length(FButtons)) + MAINMENU_SPACE * (Length(FButtons) - 1)
end;
procedure TGUIMenu.ReAlign();
-var
- a, tx, cx, w, h, fw, fh: Integer;
- cww: array of Integer; // cached widths
- maxcww: Integer;
+ var
+ {$IFDEF ENABLE_RENDER}
+ fw, fh: Integer;
+ {$ENDIF}
+ a, tx, cx, w, h: Integer;
+ cww: array of Integer; // cached widths
+ maxcww: Integer;
begin
if FItems = nil then Exit;
h := h+(FItems[a].Control as TGUIListBox).GetHeight()
else
begin
- r_GUI_GetMaxFontSize(FBigFont, fw, fh);
- h := h + fh;
+ {$IFDEF ENABLE_RENDER}
+ r_GUI_GetMaxFontSize(FBigFont, fw, fh);
+ h := h + fh;
+ {$ENDIF}
end;
end;
end;
else if ControlType = TGUIMemo then Inc(h, (Control as TGUIMemo).GetHeight+MENU_VSPACE)
else
begin
- r_GUI_GetMaxFontSize(FBigFont, fw, fh);
- h := h + fh + MENU_VSPACE;
+ {$IFDEF ENABLE_RENDER}
+ r_GUI_GetMaxFontSize(FBigFont, fw, fh);
+ h := h + fh + MENU_VSPACE;
+ {$ELSE}
+ h := h + MENU_VSPACE;
+ {$ENDIF}
end;
end;
end;
{ TGUIKeyRead2 }
constructor TGUIKeyRead2.Create(BigFont: Boolean);
- var a: Byte; w, h: Integer;
+ {$IFDEF ENABLE_RENDER}
+ var a: Byte; w, h: Integer;
+ {$ENDIF}
begin
inherited Create();
FMaxKeyNameWdt := 0;
- FMaxKeyNameWdt := 0;
-
- for a := 0 to 255 do
- begin
- r_GUI_GetStringSize(BigFont, e_KeyNames[a], w, h);
- FMaxKeyNameWdt := Max(FMaxKeyNameWdt, w);
- end;
-
- FMaxKeyNameWdt := FMaxKeyNameWdt-(FMaxKeyNameWdt div 3);
-
- r_GUI_GetStringSize(BigFont, KEYREAD_QUERY, w, h);
- if w > FMaxKeyNameWdt then FMaxKeyNameWdt := w;
-
- r_GUI_GetStringSize(BigFont, KEYREAD_CLEAR, w, h);
- if w > FMaxKeyNameWdt then FMaxKeyNameWdt := w;
+ {$IFDEF ENABLE_RENDER}
+ for a := 0 to 255 do
+ begin
+ r_GUI_GetStringSize(BigFont, e_KeyNames[a], w, h);
+ FMaxKeyNameWdt := Max(FMaxKeyNameWdt, w);
+ end;
+ FMaxKeyNameWdt := FMaxKeyNameWdt-(FMaxKeyNameWdt div 3);
+ r_GUI_GetStringSize(BigFont, KEYREAD_QUERY, w, h);
+ if w > FMaxKeyNameWdt then FMaxKeyNameWdt := w;
+ r_GUI_GetStringSize(BigFont, KEYREAD_CLEAR, w, h);
+ if w > FMaxKeyNameWdt then FMaxKeyNameWdt := w;
+ {$ENDIF}
end;
function TGUIKeyRead2.WantActivationKey (key: LongInt): Boolean;
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index 6b68a6a9d04b699fccbe3c37b2250de1fb387a2d..3d731a2d1391b04e9886eb14d7b271bdb7f7b11f 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
with TGUIListBox(menu.GetControl('lsResolution')) do
begin
- list := sys_GetDisplayModes(gBPP);
+ {$IFDEF ENABLE_SYSTEM}
+ list := sys_GetDisplayModes(gBPP);
+ {$ELSE}
+ list := nil;
+ {$ENDIF}
if list <> nil then
begin
Items := list;
diff --git a/src/shared/a_modes.inc b/src/shared/a_modes.inc
index 4ba00072e19a70c49acf7c929bce56f33712aa66..adfbc14f3fad693f636c20eb37827fc2591e9f92 100644 (file)
--- a/src/shared/a_modes.inc
+++ b/src/shared/a_modes.inc
{$ENDIF}
{$ENDIF}
-{$IFDEF ENABLE_MENU}
- {$IFDEF DISABLE_RENDER}
- {$FATAL Render driver required for current menu implementation}
- {$ENDIF}
-{$ENDIF}
-
{$IFDEF ENABLE_TOUCH}
{$IFDEF DISABLE_SYSTEM}
{$FATAL System driver required for current touch implementation}