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;