DEADSOFTWARE

gl: move holmes drawing code into render
[d2df-sdl.git] / src / game / renders / opengl / r_render.pas
index 7f52d9d74567f573656870c6f1a955114e214f24..9fa586aee5beb8782268231b0d02be8bc1996352 100644 (file)
@@ -73,6 +73,12 @@ interface
   procedure r_Render_StepLoading (incval: Integer);
   procedure r_Render_DrawLoading (force: Boolean);
 
+  {$IFDEF ENABLE_HOLMES}
+    function pmsCurMapX (): Integer;
+    function pmsCurMapY (): Integer;
+    function r_Render_HolmesViewIsSet (): Boolean;
+  {$ENDIF}
+
 implementation
 
   uses
@@ -87,6 +93,9 @@ implementation
     {$IFDEF ENABLE_SYSTEM}
       g_system,
     {$ENDIF}
+    {$IFDEF ENABLE_HOLMES}
+      r_holmes,
+    {$ENDIF}
     SysUtils, Classes, Math,
     g_basic,
     e_log, utils, wadreader, mapdef,
@@ -391,6 +400,13 @@ implementation
     r_Common_GetCameraPos(p, true, xx, yy);
     if p <> nil then
     begin
+      {$IFDEF ENABLE_HOLMES}
+        if p = gPlayer1 then
+        begin
+          r_Holmes_plrViewPos(x, y);
+          r_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 +1123,9 @@ implementation
       if gShowMap then
         r_Render_DrawMiniMap(0, 0, 160);
 
-      // TODO draw holmes inspector
+      {$IFDEF ENABLE_HOLMES}
+        r_Holmes_Draw;
+      {$ENDIF}
 
       if MessageText <> '' then
         r_Common_DrawFormatText(MessageText, (gScreenWidth - 196) div 2, gScreenHeight div 2, 255, menufont, TBasePoint.BP_CENTER);
@@ -1215,7 +1233,9 @@ implementation
 
     // TODO draw profilers
 
-    // TODO draw holmes interface
+    {$IFDEF ENABLE_HOLMES}
+      r_Holmes_DrawUI;
+    {$ENDIF}
 
     // TODO draw touch screen controls
 
@@ -1318,4 +1338,21 @@ implementation
     r_Common_DrawLoading(force);
   end;
 
+{$IFDEF ENABLE_HOLMES}
+  function pmsCurMapX (): Integer;
+  begin
+    result := r_holmes.pmsCurMapX();
+  end;
+
+  function pmsCurMapY (): Integer;
+  begin
+    result := r_holmes.pmsCurMapY();
+  end;
+
+  function r_Render_HolmesViewIsSet (): Boolean;
+  begin
+    result := vpSet;
+  end;
+{$ENDIF}
+
 end.