X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=db438329dd146c0de2d43eb20ec662bc99002c09;hb=23a883f6c44413c380997e61b00a756bda95bc03;hp=7d25ca5f126a47e57b4d9a147c4469636d61fa65;hpb=d581025b391fdf3b429d362f4b1a94e1f6e53413;p=d2df-sdl.git diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 7d25ca5..db43832 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -627,10 +627,16 @@ uses {$IFDEF ENABLE_HOLMES} g_holmes, {$ENDIF} + {$IFDEF ENABLE_MENU} + g_menu, + {$ENDIF} {$IFNDEF HEADLESS} - r_render, g_menu, + r_render, + {$ENDIF} + {$IFDEF ENABLE_GFX} + g_gfx, {$ENDIF} - e_log, g_map, g_items, g_console, g_gfx, Math, + e_log, g_map, g_items, g_console, Math, g_options, g_triggers, g_game, g_grid, e_res, wadreader, g_monsters, CONFIG, g_language, g_net, g_netmsg, @@ -1616,7 +1622,9 @@ procedure g_Player_CreateGibs (fX, fY, mid: Integer; fColor: TRGB); var a: Integer; GibsArray: TGibsArray; - Blood: TModelBlood; + {$IFDEF ENABLE_GFX} + Blood: TModelBlood; + {$ENDIF} begin if mid = -1 then Exit; @@ -1624,7 +1632,10 @@ begin Exit; if not g_PlayerModel_GetGibs(mid, GibsArray) then Exit; - Blood := PlayerModelsArray[mid].Blood; + + {$IFDEF ENABLE_GFX} + Blood := PlayerModelsArray[mid].Blood; + {$ENDIF} for a := 0 to High(GibsArray) do with gGibs[CurrentGib] do @@ -1648,9 +1659,24 @@ begin positionChanged(); // this updates spatial accelerators RAngle := Random(360); - if gBloodCount > 0 then - g_GFX_Blood(fX, fY, 16*gBloodCount+Random(5*gBloodCount), -16+Random(33), -16+Random(33), - Random(48), Random(48), Blood.R, Blood.G, Blood.B, Blood.Kind); + {$IFDEF ENABLE_GFX} + if gBloodCount > 0 then + begin + g_GFX_Blood( + fX, + fY, + 16 * gBloodCount + Random(5 * gBloodCount), + -16 + Random(33), + -16 + Random(33), + Random(48), + Random(48), + Blood.R, + Blood.G, + Blood.B, + Blood.Kind + ); + end; + {$ENDIF} if CurrentGib >= High(gGibs) then CurrentGib := 0 @@ -2195,9 +2221,13 @@ begin HIT_BFG, HIT_ROCKET, HIT_SOME: MakeBloodVector(c, vx, vy); end; - if t = HIT_WATER then - g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2), - FObj.Y+PLAYER_RECT.Y-4, value div 2, 8, 4); + {$IFDEF ENABLE_GFX} + if t = HIT_WATER then + begin + g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2), + FObj.Y+PLAYER_RECT.Y-4, value div 2, 8, 4); + end; + {$ENDIF} end; // Буфер урона: @@ -2992,27 +3022,35 @@ begin end; procedure TPlayer.MakeBloodSimple(Count: Word); - var Blood: TModelBlood; + {$IFDEF ENABLE_GFX} + var Blood: TModelBlood; + {$ENDIF} begin - Blood := SELF.FModel.GetBlood(); - g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)+8, - FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2), - Count div 2, 3, -1, 16, (PLAYER_RECT.Height*2 div 3), - Blood.R, Blood.G, Blood.B, Blood.Kind); - g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-8, - FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2), - Count div 2, -3, -1, 16, (PLAYER_RECT.Height*2) div 3, - Blood.R, Blood.G, Blood.B, Blood.Kind); + {$IFDEF ENABLE_GFX} + Blood := SELF.FModel.GetBlood(); + g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)+8, + FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2), + Count div 2, 3, -1, 16, (PLAYER_RECT.Height*2 div 3), + Blood.R, Blood.G, Blood.B, Blood.Kind); + g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-8, + FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2), + Count div 2, -3, -1, 16, (PLAYER_RECT.Height*2) div 3, + Blood.R, Blood.G, Blood.B, Blood.Kind); + {$ENDIF} end; procedure TPlayer.MakeBloodVector(Count: Word; VelX, VelY: Integer); - var Blood: TModelBlood; + {$IFDEF ENABLE_GFX} + var Blood: TModelBlood; + {$ENDIF} begin - Blood := SELF.FModel.GetBlood(); - g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2), - FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2), - Count, VelX, VelY, 16, (PLAYER_RECT.Height*2) div 3, - Blood.R, Blood.G, Blood.B, Blood.Kind); + {$IFDEF ENABLE_GFX} + Blood := SELF.FModel.GetBlood(); + g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2), + FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2), + Count, VelX, VelY, 16, (PLAYER_RECT.Height*2) div 3, + Blood.R, Blood.G, Blood.B, Blood.Kind); + {$ENDIF} end; procedure TPlayer.QueueWeaponSwitch(Weapon: Byte); @@ -3917,13 +3955,17 @@ begin FFirePainTime := 0; FFireAttacker := 0; -// Анимация возрождения: - if (not gLoadGameMode) and (not Silent) then - 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 - ); + {$IFDEF ENABLE_GFX} + // Анимация возрождения: + if (not gLoadGameMode) and (not Silent) then + begin + 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 + ); + end; + {$ENDIF} FSpectator := False; FGhost := False; @@ -4119,11 +4161,13 @@ begin if not silent then begin g_Sound_PlayExAt('SOUND_GAME_TELEPORT', FObj.X, FObj.Y); - 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 - ); + {$IFDEF ENABLE_GFX} + 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 + ); + {$ENDIF} if g_Game_IsServer and g_Game_IsNet then MH_SEND_Effect(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32, FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32, 1, @@ -4171,11 +4215,13 @@ begin if not silent then begin - 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 - ); + {$IFDEF ENABLE_GFX} + 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 + ); + {$ENDIF} if g_Game_IsServer and g_Game_IsNet then MH_SEND_Effect(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-32, FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2)-32, 0, @@ -4570,7 +4616,9 @@ begin end else if (FAir mod 31 = 0) and not blockmon then begin - g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2), FObj.Y+PLAYER_RECT.Y-4, 5+Random(6), 8, 4); + {$IFDEF ENABLE_GFX} + g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2), FObj.Y+PLAYER_RECT.Y-4, 5+Random(6), 8, 4); + {$ENDIF} if Random(2) = 0 then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y) else @@ -5661,8 +5709,10 @@ begin if BodyInLiquid(0, 0) then begin - g_GFX_Bubbles(Obj.X+Obj.Rect.X+(Obj.Rect.Width div 2)+Random(3)-1, - Obj.Y+Obj.Rect.Height+8, 1, 8, 4); + {$IFDEF ENABLE_GFX} + g_GFX_Bubbles(Obj.X+Obj.Rect.X+(Obj.Rect.Width div 2)+Random(3)-1, + Obj.Y+Obj.Rect.Height+8, 1, 8, 4); + {$ENDIF} if Random(2) = 0 then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y) else @@ -5672,11 +5722,13 @@ begin for i := 1 to Times do begin - 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) - ); + {$IFDEF ENABLE_GFX} + 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) + ); + {$ENDIF} end; end; @@ -5688,11 +5740,13 @@ begin for i := 1 to Times do begin - 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) - ); + {$IFDEF ENABLE_GFX} + 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) + ); + {$ENDIF} end; end; @@ -5764,7 +5818,9 @@ end; procedure TCorpse.Damage(Value: Word; SpawnerUID: Word; vx, vy: Integer); - var Blood: TModelBlood; + {$IFDEF ENABLE_GFX} + var Blood: TModelBlood; + {$ENDIF} begin if FState = CORPSE_STATE_REMOVEME then Exit; @@ -5798,13 +5854,15 @@ begin end else begin - Blood := FModel.GetBlood(); FObj.Vel.X := FObj.Vel.X + vx; FObj.Vel.Y := FObj.Vel.Y + vy; - g_GFX_Blood(FObj.X+PLAYER_CORPSERECT.X+(PLAYER_CORPSERECT.Width div 2), - FObj.Y+PLAYER_CORPSERECT.Y+(PLAYER_CORPSERECT.Height div 2), - Value, vx, vy, 16, (PLAYER_CORPSERECT.Height*2) div 3, - Blood.R, Blood.G, Blood.B, Blood.Kind); + {$IFDEF ENABLE_GFX} + Blood := FModel.GetBlood(); + g_GFX_Blood(FObj.X+PLAYER_CORPSERECT.X+(PLAYER_CORPSERECT.Width div 2), + FObj.Y+PLAYER_CORPSERECT.Y+(PLAYER_CORPSERECT.Height div 2), + Value, vx, vy, 16, (PLAYER_CORPSERECT.Height*2) div 3, + Blood.R, Blood.G, Blood.B, Blood.Kind); + {$ENDIF} end; end;