summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4f2245f)
raw | patch | inline | side by side (parent: 4f2245f)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 31 Jan 2022 19:44:53 +0000 (22:44 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 31 Jan 2022 19:44:53 +0000 (22:44 +0300) |
src/game/g_gui.pas | patch | blob | history | |
src/game/g_holmes.pas | patch | blob | history | |
src/game/opengl/r_gui.pas | patch | blob | history | |
src/game/opengl/r_render.pas | patch | blob | history |
diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index 734251a6afce93b4c7a95ed2834cb8dd402104f8..e18b60dd89e837125fbd2bbbaf48d32babf001cd 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
interface
-uses
- {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
- g_base, e_input, e_log, g_playermodel, g_basic, MAPDEF, utils;
+ uses
+ {$IFDEF USE_MEMPOOL}
+ mempool,
+ {$ENDIF}
+ g_base, g_playermodel, MAPDEF, utils
+ ;
const
- MAINMENU_HEADER_COLOR: TRGB = (R:255; G:255; B:255);
+
MAINMENU_ITEMS_COLOR: TRGB = (R:255; G:255; B:255);
MAINMENU_UNACTIVEITEMS_COLOR: TRGB = (R:192; G:192; B:192);
- MAINMENU_CLICKSOUND = 'MENU_SELECT';
- MAINMENU_CHANGESOUND = 'MENU_CHANGE';
+ MAINMENU_HEADER_COLOR: TRGB = (R:255; G:255; B:255);
MAINMENU_SPACE = 4;
- MAINMENU_MARKER1 = 'MAINMENU_MARKER1';
- MAINMENU_MARKER2 = 'MAINMENU_MARKER2';
MAINMENU_MARKERDELAY = 24;
- WINDOW_CLOSESOUND = 'MENU_CLOSE';
- MENU_HEADERCOLOR: TRGB = (R:255; G:255; B:255);
+
MENU_ITEMSTEXT_COLOR: TRGB = (R:255; G:255; B:255);
MENU_UNACTIVEITEMS_COLOR: TRGB = (R:128; G:128; B:128);
MENU_ITEMSCTRL_COLOR: TRGB = (R:255; G:0; B:0);
MENU_VSPACE = 2;
MENU_HSPACE = 32;
+ MENU_MARKERDELAY = 24;
+
+ MAPPREVIEW_WIDTH = 8;
+ MAPPREVIEW_HEIGHT = 8;
+
+ KEYREAD_QUERY = '<...>';
+ KEYREAD_CLEAR = '???';
+
+ WINDOW_CLOSESOUND = 'MENU_CLOSE';
+ MAINMENU_CLICKSOUND = 'MENU_SELECT';
+ MAINMENU_CHANGESOUND = 'MENU_CHANGE';
MENU_CLICKSOUND = 'MENU_SELECT';
MENU_CHANGESOUND = 'MENU_CHANGE';
- MENU_MARKERDELAY = 24;
- SCROLL_LEFT = 'SCROLL_LEFT';
- SCROLL_RIGHT = 'SCROLL_RIGHT';
- SCROLL_MIDDLE = 'SCROLL_MIDDLE';
- SCROLL_MARKER = 'SCROLL_MARKER';
SCROLL_ADDSOUND = 'SCROLL_ADD';
SCROLL_SUBSOUND = 'SCROLL_SUB';
- EDIT_LEFT = 'EDIT_LEFT';
- EDIT_RIGHT = 'EDIT_RIGHT';
- EDIT_MIDDLE = 'EDIT_MIDDLE';
- EDIT_CURSORCOLOR: TRGB = (R:200; G:0; B:0);
- EDIT_CURSORLEN = 10;
- KEYREAD_QUERY = '<...>';
- KEYREAD_CLEAR = '???';
- KEYREAD_TIMEOUT = 24;
- MAPPREVIEW_WIDTH = 8;
- MAPPREVIEW_HEIGHT = 8;
- BSCROLL_UPA = 'BSCROLL_UP_A';
- BSCROLL_UPU = 'BSCROLL_UP_U';
- BSCROLL_DOWNA = 'BSCROLL_DOWN_A';
- BSCROLL_DOWNU = 'BSCROLL_DOWN_U';
- BSCROLL_MIDDLE = 'BSCROLL_MIDDLE';
+
WM_KEYDOWN = 101;
WM_CHAR = 102;
WM_USER = 110;
g_system,
{$ENDIF}
{$IFDEF ENABLE_RENDER}
- r_gui,
+ r_render,
{$ENDIF}
+ e_input, e_log,
g_sound, SysUtils, e_res,
g_game, Math, StrUtils, g_player, g_options,
g_map, g_weapons, xdynrec, wadreader;
{$ENDIF}
begin
{$IFDEF ENABLE_RENDER}
- r_GUI_GetStringSize(BigFont, GetLine(j, i), w, h);
+ r_Render_GetStringSize(BigFont, GetLine(j, i), w, h);
Result := w;
{$ELSE}
Result := 0;
{$ENDIF}
begin
{$IFDEF ENABLE_RENDER}
- r_GUI_GetSize(Self, Result, h);
+ r_Render_GetControlSize(Self, Result, h);
{$ELSE}
Result := 0;
{$ENDIF}
{$ENDIF}
begin
{$IFDEF ENABLE_RENDER}
- r_GUI_GetSize(Self, w, Result);
+ r_Render_GetControlSize(Self, w, Result);
{$ELSE}
Result := 0;
{$ENDIF}
function TGUIMainMenu.AddButton(fProc: Pointer; Caption: string; ShowWindow: string = ''): TGUITextButton;
var
{$IFDEF ENABLE_RENDER}
- lw: Word = 0;
+ lw: Integer;
{$ENDIF}
a, _x: Integer;
h, hh: Word;
- lh: Word = 0;
+ lh: Integer;
begin
FIndex := 0;
if FButtons[a] <> nil then
_x := Min(_x, (gScreenWidth div 2)-(FButtons[a].GetWidth div 2));
+ lw := 0;
+ lh := 0;
{$IFDEF ENABLE_RENDER}
if FHeader = nil then
- r_GUI_GetLogoSize(lw, lh);
+ r_Render_GetLogoSize(lw, lh);
{$ENDIF}
hh := FButtons[High(FButtons)].GetHeight;
else
begin
{$IFDEF ENABLE_RENDER}
- r_GUI_GetMaxFontSize(FBigFont, fw, fh);
+ r_Render_GetMaxFontSize(FBigFont, fw, fh);
h := h + fh;
{$ENDIF}
end;
else
begin
{$IFDEF ENABLE_RENDER}
- r_GUI_GetMaxFontSize(FBigFont, fw, fh);
+ r_Render_GetMaxFontSize(FBigFont, fw, fh);
h := h + fh + MENU_VSPACE;
{$ELSE}
h := h + MENU_VSPACE;
{$IFDEF ENABLE_RENDER}
for a := 0 to 255 do
begin
- r_GUI_GetStringSize(BigFont, e_KeyNames[a], w, h);
+ r_Render_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);
+ r_Render_GetStringSize(BigFont, KEYREAD_QUERY, w, h);
if w > FMaxKeyNameWdt then FMaxKeyNameWdt := w;
- r_GUI_GetStringSize(BigFont, KEYREAD_CLEAR, w, h);
+ r_Render_GetStringSize(BigFont, KEYREAD_CLEAR, w, h);
if w > FMaxKeyNameWdt then FMaxKeyNameWdt := w;
{$ENDIF}
end;
diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas
index 2c1544723acf5ed8cd070dfb6cdacdc20fea6907..414a30fe1ba40f1049230fe614de323a78fa3ea2 100644 (file)
--- a/src/game/g_holmes.pas
+++ b/src/game/g_holmes.pas
uses
mempool, geom,
e_log, e_input,
- g_textures, g_basic, r_graphics, g_phys, g_grid, g_player, g_monsters,
+ g_basic, g_phys, g_grid, g_player, g_monsters,
g_map, g_triggers, g_items, g_game, g_panel, g_console,
xprofiler,
sdlcarcass,
index 8df2b400683901d1f7ff64fedf827beeed961cd6..00fb568b7511e2e74ae01315f3b054acde145321 100644 (file)
procedure r_GUI_Free;
procedure r_GUI_GetSize (ctrl: TGUIControl; out w, h: Integer);
- procedure r_GUI_GetLogoSize (out w, h: WORD);
+ procedure r_GUI_GetLogoSize (out w, h: Integer);
procedure r_GUI_GetMaxFontSize (BigFont: Boolean; out w, h: Integer);
procedure r_GUI_GetStringSize (BigFont: Boolean; str: String; out w, h: Integer);
BOX8 = 'BOX8';
BOX9 = 'BOX9';
+ MAINMENU_MARKER1 = 'MAINMENU_MARKER1';
+ MAINMENU_MARKER2 = 'MAINMENU_MARKER2';
+ SCROLL_LEFT = 'SCROLL_LEFT';
+ SCROLL_RIGHT = 'SCROLL_RIGHT';
+ SCROLL_MIDDLE = 'SCROLL_MIDDLE';
+ SCROLL_MARKER = 'SCROLL_MARKER';
+ EDIT_LEFT = 'EDIT_LEFT';
+ EDIT_RIGHT = 'EDIT_RIGHT';
+ EDIT_MIDDLE = 'EDIT_MIDDLE';
+ EDIT_CURSORCOLOR: TRGB = (R:200; G:0; B:0);
+ EDIT_CURSORLEN = 10;
+ BSCROLL_UPA = 'BSCROLL_UP_A';
+ BSCROLL_UPU = 'BSCROLL_UP_U';
+ BSCROLL_DOWNA = 'BSCROLL_DOWN_A';
+ BSCROLL_DOWNU = 'BSCROLL_DOWN_U';
+ BSCROLL_MIDDLE = 'BSCROLL_MIDDLE';
+
type
TFontType = (Texture, Character);
h := hh;
end;
- procedure r_GUI_GetLogoSize (out w, h: WORD);
+ procedure r_GUI_GetLogoSize (out w, h: Integer);
+ var ww, hh: WORD;
begin
- w := 0;
- h := 0;
+ ww := 0;
+ hh := 0;
if LogoTex <> 0 then
- e_GetTextureSize(LogoTex, @w, @h);
+ e_GetTextureSize(LogoTex, @ww, @hh);
+ w := ww;
+ h := hh;
end;
procedure r_GUI_Load;
index 869b27ff25f9b645d5e5c0a43e506c9aa2ea2dca..e5ed3486c9916192ffbfd443bd64b345dd45f0bc 100644 (file)
interface
- uses g_base; // TRectWH
+ uses
+ {$IFDEF ENABLE_MENU}
+ g_gui,
+ {$ENDIF}
+ g_base // TRectWH
+ ;
procedure r_Render_Initialize;
procedure r_Render_Finalize;
procedure r_Render_GetKeyRect (key: Integer; out x, y, w, h: Integer; out founded: Boolean);
{$ENDIF}
+ {$IFDEF ENABLE_MENU}
+ procedure r_Render_GetControlSize (ctrl: TGUIControl; out w, h: Integer);
+ procedure r_Render_GetLogoSize (out w, h: Integer);
+ procedure r_Render_GetMaxFontSize (BigFont: Boolean; out w, h: Integer);
+ procedure r_Render_GetStringSize (BigFont: Boolean; str: String; out w, h: Integer);
+ {$ENDIF}
+
procedure r_Render_DrawLoading (force: Boolean); // !!! remove it
implementation
end;
{$ENDIF}
+{$IFDEF ENABLE_MENU}
+ procedure r_Render_GetControlSize (ctrl: TGUIControl; out w, h: Integer);
+ begin
+ r_GUI_GetSize(ctrl, w, h)
+ end;
+
+ procedure r_Render_GetLogoSize (out w, h: Integer);
+ begin
+ r_GUI_GetLogoSize(w, h)
+ end;
+
+ procedure r_Render_GetMaxFontSize (BigFont: Boolean; out w, h: Integer);
+ begin
+ r_GUI_GetMaxFontSize(BigFont, w, h)
+ end;
+
+ procedure r_Render_GetStringSize (BigFont: Boolean; str: String; out w, h: Integer);
+ begin
+ r_GUI_GetStringSize(BigFont, str, w, h)
+ end;
+{$ENDIF}
+
procedure r_Render_DrawLoading (force: Boolean);
begin
r_Window_DrawLoading(force)