DEADSOFTWARE

menu: optionally disable menu in client
[d2df-sdl.git] / src / game / g_player.pas
index 92afc636f73aa29a5a0922fbc8493cb8b8b7bf28..ea7cb7d1a11d50e8b4e0d9ad9e57663fb3cfd424 100644 (file)
@@ -624,11 +624,17 @@ procedure g_Bot_RemoveAll();
 implementation
 
 uses
-{$IFDEF ENABLE_HOLMES}
-  g_holmes,
-{$ENDIF}
-  e_log, g_map, g_items, g_console, g_gfx, Math, r_playermodel, r_gfx,
-  g_options, g_triggers, g_menu, g_game, g_grid, e_res,
+  {$IFDEF ENABLE_HOLMES}
+    g_holmes,
+  {$ENDIF}
+  {$IFDEF ENABLE_MENU}
+    g_menu,
+  {$ENDIF}
+  {$IFNDEF HEADLESS}
+    r_render,
+  {$ENDIF}
+  e_log, g_map, g_items, g_console, g_gfx, Math,
+  g_options, g_triggers, g_game, g_grid, e_res,
   wadreader, g_monsters, CONFIG, g_language,
   g_net, g_netmsg,
   utils, xstreams;
@@ -1631,7 +1637,14 @@ begin
       Color := fColor;
       alive := True;
       g_Obj_Init(@Obj);
-      Obj.Rect := r_PlayerModel_GetGibRect(ModelID, GibID);
+      {$IFNDEF HEADLESS}
+        Obj.Rect := r_Render_GetGibRect(ModelID, GibID);
+      {$ELSE}
+        Obj.Rect.X := 16;
+        Obj.Rect.Y := 16;
+        Obj.Rect.Width := 16;
+        Obj.Rect.Height := 16;
+      {$ENDIF}
       Obj.X := fX - Obj.Rect.X - (Obj.Rect.Width div 2);
       Obj.Y := fY - Obj.Rect.Y - (Obj.Rect.Height div 2);
       g_Obj_PushA(@Obj, 25 + Random(10), Random(361));
@@ -3909,7 +3922,7 @@ begin
 
 // Анимация возрождения:
   if (not gLoadGameMode) and (not Silent) then
-    r_GFX_OnceAnim(
+    g_GFX_QueueEffect(
       R_GFX_TELEPORT_FAST,
       FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32,
       FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32
@@ -4109,7 +4122,7 @@ begin
   if not silent then
   begin
     g_Sound_PlayExAt('SOUND_GAME_TELEPORT', FObj.X, FObj.Y);
-    r_GFX_OnceAnim(
+    g_GFX_QueueEffect(
       R_GFX_TELEPORT_FAST,
       FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32,
       FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32
@@ -4161,7 +4174,7 @@ begin
 
   if not silent then
   begin
-    r_GFX_OnceAnim(
+    g_GFX_QueueEffect(
       R_GFX_TELEPORT_FAST,
       FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32,
       FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32
@@ -5662,7 +5675,7 @@ begin
 
   for i := 1 to Times do
   begin
-    r_GFX_OnceAnim(
+    g_GFX_QueueEffect(
       R_GFX_SMOKE_TRANS,
       Obj.X+Obj.Rect.X+Random(Obj.Rect.Width+Times*2)-(R_GFX_SMOKE_WIDTH div 2),
       Obj.Y+Obj.Rect.Height-4+Random(8+Times*2)
@@ -5678,7 +5691,7 @@ begin
 
   for i := 1 to Times do
   begin
-    r_GFX_OnceAnim(
+    g_GFX_QueueEffect(
       R_GFX_FLAME,
       Obj.X+Obj.Rect.X+Random(Obj.Rect.Width+Times*2)-(R_GFX_FLAME_WIDTH div 2),
       Obj.Y+8+Random(8+Times*2)
@@ -5854,16 +5867,16 @@ begin
   // animation
   anim := (FModel <> nil);
   utils.writeBool(st, anim);
-  if anim then FModel.AnimState.SaveState(st);
+  if anim then FModel.AnimState.SaveState(st, 0, False);
   // animation for mask (same as animation, compat with older saves)
   anim := (FModel <> nil);
   utils.writeBool(st, anim);
-  if anim then FModel.AnimState.SaveState(st);
+  if anim then FModel.AnimState.SaveState(st, 0, False);
 end;
 
 
 procedure TCorpse.LoadState (st: TStream);
-  var anim: Boolean; r, g, b: Byte; stub: TAnimationState;
+  var anim, blending: Boolean; r, g, b, alpha: Byte; stub: TAnimationState;
 begin
   assert(st <> nil);
 
@@ -5887,7 +5900,7 @@ begin
   anim := utils.readBool(st);
   if anim then
   begin
-    stub.LoadState(st);
+    stub.LoadState(st, alpha, blending);
     FModel.AnimState.CurrentFrame := Min(stub.CurrentFrame, FModel.AnimState.Length);
   end
   else
@@ -5897,7 +5910,7 @@ begin
   end;
   // animation for mask (same as animation, compat with older saves)
   anim := utils.readBool(st);
-  if anim then stub.LoadState(st);
+  if anim then stub.LoadState(st, alpha, blending);
   stub.Free;
 end;