DEADSOFTWARE

render: hide gib textures within render
[d2df-sdl.git] / src / game / opengl / r_player.pas
index bb25f29eebfb6c6eec199fd8e812c5072d910c06..28eaf3d8af3810ce0d6961110b4fe87d2e9aae6c 100644 (file)
@@ -42,11 +42,11 @@ implementation
   uses
     SysUtils, Classes, Math,
     MAPDEF, utils,
-    g_basic, g_game, g_phys, g_map, g_textures, g_menu, g_language, g_weapons, g_items, g_net, g_options,
+    g_basic, g_game, g_phys, g_map, g_menu, g_language, g_weapons, g_items, g_net, g_options,
 {$IFDEF ENABLE_HOLMES}
     g_holmes,
 {$ENDIF}
-    r_playermodel, r_graphics
+    r_playermodel, r_graphics, r_animations, r_textures, r_items
   ;
 
   procedure r_Player_DrawAll;
@@ -97,38 +97,14 @@ begin
     end;
 end;
 
-procedure r_Player_DrawCorpses;
-var
-  i, fX, fY: Integer;
-  a: TDFPoint;
-begin
-  if gGibs <> nil then
-    for i := 0 to High(gGibs) do
-      if gGibs[i].alive then
-        with gGibs[i] do
-        begin
-          if not g_Obj_Collide(sX, sY, sWidth, sHeight, @Obj) then
-            Continue;
-
-          Obj.lerp(gLerpFactor, fX, fY);
-
-          a.X := Obj.Rect.X+(Obj.Rect.Width div 2);
-          a.y := Obj.Rect.Y+(Obj.Rect.Height div 2);
-
-          e_DrawAdv(ID, fX, fY, 0, True, False, RAngle, @a, TMirrorType.None);
-
-          e_Colors := Color;
-          e_DrawAdv(MaskID, fX, fY, 0, True, False, RAngle, @a, TMirrorType.None);
-          e_Colors.R := 255;
-          e_Colors.G := 255;
-          e_Colors.B := 255;
-        end;
-
-  if gCorpses <> nil then
-    for i := 0 to High(gCorpses) do
-      if gCorpses[i] <> nil then
-        r_Player_DrawCorpse(gCorpses[i])
-end;
+  procedure r_Player_DrawCorpses;
+    var i: Integer;
+  begin
+    if gCorpses <> nil then
+      for i := 0 to High(gCorpses) do
+        if gCorpses[i] <> nil then
+          r_Player_DrawCorpse(gCorpses[i])
+  end;
 
 procedure r_Player_DrawShells;
 var
@@ -331,7 +307,7 @@ begin
 
     if p.PunchAnim <> nil then
     begin
-      p.PunchAnim.Draw(fX + IfThen(p.Direction = TDirection.D_LEFT, 15 - p.Obj.Rect.X, p.Obj.Rect.X - 15), fY + fSlope + p.Obj.Rect.Y - 11, Mirror);
+      r_Animation_Draw(p.PunchAnim, fX + IfThen(p.Direction = TDirection.D_LEFT, 15 - p.Obj.Rect.X, p.Obj.Rect.X - 15), fY + fSlope + p.Obj.Rect.Y - 11, Mirror);
       if p.PunchAnim.played then
       begin
         p.PunchAnim.Free;
@@ -795,12 +771,12 @@ begin
   p.Obj.lerp(gLerpFactor, fX, fY);
 
   if p.Animation <> nil then
-    p.Animation.Draw(fX, fY, TMirrorType.None);
+    r_Animation_Draw(p.Animation, fX, fY, TMirrorType.None);
 
   if p.AnimationMask <> nil then
   begin
     e_Colors := p.Color;
-    p.AnimationMask.Draw(fX, fY, TMirrorType.None);
+    r_Animation_Draw(p.AnimationMask, fX, fY, TMirrorType.None);
     e_Colors.R := 255;
     e_Colors.G := 255;
     e_Colors.B := 255;