X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=db438329dd146c0de2d43eb20ec662bc99002c09;hp=ea7cb7d1a11d50e8b4e0d9ad9e57663fb3cfd424;hb=23a883f6c44413c380997e61b00a756bda95bc03;hpb=e93442c2367bd3658f31ceb2156a0b4809b21e38 diff --git a/src/game/g_player.pas b/src/game/g_player.pas index ea7cb7d..db43832 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -633,7 +633,10 @@ uses {$IFNDEF HEADLESS} r_render, {$ENDIF} - e_log, g_map, g_items, g_console, g_gfx, Math, + {$IFDEF ENABLE_GFX} + g_gfx, + {$ENDIF} + 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, @@ -1619,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; @@ -1627,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 @@ -1651,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 @@ -2198,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; // Буфер урона: @@ -2995,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); @@ -3920,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; @@ -4122,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, @@ -4174,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, @@ -4573,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 @@ -5664,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 @@ -5675,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; @@ -5691,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; @@ -5767,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; @@ -5801,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;