From 007ba24a2c0e0c07941679f415561c3cdf43cef2 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Thu, 29 Dec 2022 15:09:32 +0300 Subject: [PATCH] gl: allow holmes (works partially) --- src/game/renders/opengl/r_render.pas | 19 +++++++++++++++++-- src/nogl/noGLuses.inc | 2 +- src/shared/a_modes.inc | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/game/renders/opengl/r_render.pas b/src/game/renders/opengl/r_render.pas index 7f52d9d..18b1420 100644 --- a/src/game/renders/opengl/r_render.pas +++ b/src/game/renders/opengl/r_render.pas @@ -87,6 +87,9 @@ implementation {$IFDEF ENABLE_SYSTEM} g_system, {$ENDIF} + {$IFDEF ENABLE_HOLMES} + g_holmes, + {$ENDIF} SysUtils, Classes, Math, g_basic, e_log, utils, wadreader, mapdef, @@ -391,6 +394,13 @@ implementation r_Common_GetCameraPos(p, true, xx, yy); if p <> nil then begin + {$IFDEF ENABLE_HOLMES} + if p = gPlayer1 then + begin + g_Holmes_plrViewPos(x, y); + g_Holmes_plrViewSize(w, h); + end; + {$ENDIF} r_Map_Draw(x, y, w, h, xx, yy, p); r_Render_DrawStatsView(x, y, w, h, p); if p.Spectator and p.NoRespawn then @@ -1107,7 +1117,10 @@ implementation if gShowMap then r_Render_DrawMiniMap(0, 0, 160); - // TODO draw holmes inspector + {$IFDEF ENABLE_HOLMES} + if g_holmes_enabled then + g_Holmes_Draw; + {$ENDIF} if MessageText <> '' then r_Common_DrawFormatText(MessageText, (gScreenWidth - 196) div 2, gScreenHeight div 2, 255, menufont, TBasePoint.BP_CENTER); @@ -1215,7 +1228,9 @@ implementation // TODO draw profilers - // TODO draw holmes interface + {$IFDEF ENABLE_HOLMES} + g_Holmes_DrawUI; + {$ENDIF} // TODO draw touch screen controls diff --git a/src/nogl/noGLuses.inc b/src/nogl/noGLuses.inc index acfe89e..1d5f2a4 100644 --- a/src/nogl/noGLuses.inc +++ b/src/nogl/noGLuses.inc @@ -3,7 +3,7 @@ {$DEFINE NOGL_INIT} noGL in '../nogl/noGL.pas', {$ENDIF} -{$IFDEF USE_OPENGL} +{$IF DEFINED(USE_OPENGL) OR DEFINED(USE_NEWGL)} {$DEFINE NOGL_LISTS} GL, GLExt, {$ENDIF} diff --git a/src/shared/a_modes.inc b/src/shared/a_modes.inc index 9f7caa4..831214a 100644 --- a/src/shared/a_modes.inc +++ b/src/shared/a_modes.inc @@ -318,7 +318,7 @@ {$IFNDEF USE_SDL2} {$FATAL SDL2 required for current Holmes implementation} {$ENDIF} - {$IFNDEF USE_OPENGL} + {$IF NOT DEFINED(USE_OPENGL) AND NOT DEFINED(USE_NEWGL)} {$FATAL Desktop OpenGL required for current Holmes implementation} {$ENDIF} {$ENDIF} -- 2.29.2