summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 442a04f)
raw | patch | inline | side by side (parent: 442a04f)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 13 Apr 2022 18:09:33 +0000 (21:09 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:24:07 +0000 (11:24 +0300) |
src/game/g_weapons.pas | patch | blob | history | |
src/game/opengl/r_weapons.pas | patch | blob | history |
diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 95137cdf456c88c61a4a800f93efae210b53e6b8..cf80f5914848fbb53451aaf3dc3cd1c90285dd14 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
SpawnerUID: Word;
Triggers: DWArray;
Obj: TObj;
- Animation: TAnimationState;
+ Animation: TAnimState;
Timeout: DWORD;
Stopped: Byte;
Obj.Rect.Width := SHOT_ROCKETLAUNCHER_WIDTH;
Obj.Rect.Height := SHOT_ROCKETLAUNCHER_HEIGHT;
- Animation := nil;
Triggers := nil;
ShotType := WEAPON_ROCKETLAUNCHER;
+ Animation.Invalidate;
end;
end;
Triggers := nil;
ShotType := WEAPON_PLASMA;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_BFG;
- Animation := TAnimationState.Create(True, 6, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 6, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_FLAMETHROWER;
- // Animation := TAnimationState.Create(True, 6, 0); // drawed as gfx
+ Animation.Invalidate;
+ // Animation := TAnimState.Create(True, 6, 0); // drawed as gfx
end;
end;
Triggers := nil;
ShotType := WEAPON_IMP_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_CACO_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_MANCUB_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_BARON_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_BSP_FIRE;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
Triggers := nil;
ShotType := WEAPON_SKEL_FIRE;
target := TargetUID;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
end;
end;
end;
procedure g_Weapon_Free();
-var
- i: Integer;
begin
- if Shots <> nil then
- begin
- for i := 0 to High(Shots) do
- if Shots[i].ShotType <> 0 then
- Shots[i].Animation.Free();
-
- Shots := nil;
- end;
-
+ Shots := nil;
WaterMap := nil;
end;
ShotType := WEAPON_ROCKETLAUNCHER;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 12);
- Animation := nil;
+ Animation.Invalidate;
triggers := nil;
end;
triggers := nil;
target := TargetUID;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := nil;
+ Animation.Invalidate;
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
triggers := nil;
- Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- Animation := TAnimationState.Create(True, 6, 2); // !!! put values into table
+ Animation := TAnimState.Create(True, 6, 2); // !!! put values into table
end;
Shots[find_id].SpawnerUID := SpawnerUID;
end;
// Àíèìàöèÿ ñíàðÿäà:
- if Animation <> nil then
+ if Animation.IsValid() then
Animation.Update();
// Äâèæåíèå:
begin
// Íà êëèåíòå ñêîðåå âñåãî è òàê óæå âûïàë.
ShotType := 0;
- Animation.Free();
+ Animation.Invalidate();
Continue;
end;
begin
if gGameSettings.GameType = GT_SERVER then
MH_SEND_DeleteShot(i, Obj.X, Obj.Y, Loud);
- if Animation <> nil then
- begin
- Animation.Free();
- Animation := nil;
- end;
+ Animation.Invalidate;
end
else if (ShotType <> WEAPON_FLAMETHROWER) and ((oldvx <> Obj.Vel.X) or (oldvy <> Obj.Vel.Y)) then
if gGameSettings.GameType = GT_SERVER then
Shots[i].Stopped := utils.readByte(st);
// Óñòàíîâêà òåêñòóðû èëè àíèìàöèè
- Shots[i].Animation := nil;
+ Shots[i].Animation.Invalidate;
case Shots[i].ShotType of
WEAPON_ROCKETLAUNCHER, WEAPON_SKEL_FIRE:
end;
WEAPON_PLASMA:
begin
- Shots[i].Animation := TAnimationState.Create(True, 5, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 5, 2); // !!! put values into table
end;
WEAPON_BFG:
begin
- Shots[i].Animation := TAnimationState.Create(True, 6, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 6, 2); // !!! put values into table
end;
WEAPON_IMP_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
WEAPON_BSP_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
WEAPON_CACO_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
WEAPON_BARON_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
WEAPON_MANCUB_FIRE:
begin
- Shots[i].Animation := TAnimationState.Create(True, 4, 2); // !!! put values into table
+ Shots[i].Animation := TAnimState.Create(True, 4, 2); // !!! put values into table
end;
end;
end;
end; // case ShotType of...
ShotType := 0;
- Animation.Free();
+ Animation.Invalidate;
end;
end;
index fb5e612f1c63e144ce5d9ed0f2ca33edca16ff51..e469cf63596aac661a57a1777c12ce22700c72e9 100644 (file)
p.X := Obj.Rect.Width div 2;
p.Y := Obj.Rect.Height div 2;
- if Animation <> nil then
+ if Animation.IsValid() then
begin
if Shots[i].ShotType in [WEAPON_BARON_FIRE, WEAPON_MANCUB_FIRE, WEAPON_SKEL_FIRE] then
- r_AnimationState_DrawEx(ShotFrames[Shots[i].ShotType], Animation, fX, fY, 0, TMirrorType.None, False, p, a)
+ r_AnimState_DrawEx(ShotFrames[Shots[i].ShotType], Animation, fX, fY, 0, TMirrorType.None, False, p, a)
else
- r_AnimationState_Draw(ShotFrames[Shots[i].ShotType], Animation, fX, fY, 0, TMirrorType.None, False);
+ r_AnimState_Draw(ShotFrames[Shots[i].ShotType], Animation, fX, fY, 0, TMirrorType.None, False);
end
else if ShotTexture[Shots[i].ShotType] <> 0 then
begin