summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b75596f)
raw | patch | inline | side by side (parent: b75596f)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 13 Apr 2022 18:18:48 +0000 (21:18 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:24:22 +0000 (11:24 +0300) |
src/game/g_playermodel.pas | patch | blob | history | |
src/game/opengl/r_playermodel.pas | patch | blob | history |
index c2c7d4eb8557e2aadf0a8eee1c032b245baabcdd..e4915607eb882625944cf28f9074865894b91726 100644 (file)
type
TWeaponPoints = Array [WP_FIRST + 1..WP_LAST, A_STAND..A_LAST, TDirection.D_LEFT..TDirection.D_RIGHT] of Array of TDFPoint;
- TModelMatrix = Array [TDirection.D_LEFT..TDirection.D_RIGHT, A_STAND..A_LAST] of TAnimationState;
+ TModelMatrix = Array [TDirection.D_LEFT..TDirection.D_RIGHT, A_STAND..A_LAST] of TAnimState;
TModelTextures = Array [TDirection.D_LEFT..TDirection.D_RIGHT, A_STAND..A_LAST] of record
Resource: String;
FDirection: TDirection;
FColor: TRGB;
FCurrentAnimation: Byte;
- FAnimState: TAnimationState;
+ FAnimState: TAnimState;
FCurrentWeapon: Byte;
FFlag: Byte;
FFireCounter: Byte;
public
property Color: TRGB read FColor write FColor;
- property AnimState: TAnimationState read FAnimState;
+ property AnimState: TAnimState read FAnimState;
property CurrentAnimation: Byte read FCurrentAnimation;
property CurrentWeapon: Byte read FCurrentWeapon;
property Flag: Byte read FFlag;
once := FCurrentAnimation in [A_STAND, A_WALK];
speed := PlayerModelsArray[FID].ModelSpeed[FCurrentAnimation];
count := PlayerModelsArray[FID].Anim[FDirection, FCurrentAnimation].Frames;
- FAnimState := TAnimationState.Create(once, speed, count);
+ FAnimState := TAnimState.Create(once, speed, count);
end;
destructor TPlayerModel.Destroy();
begin
- FAnimState.Free;
+ FAnimState.Invalidate;
inherited;
end;
procedure TPlayerModel.Update;
begin
- if FAnimState <> nil then
+ if FAnimState.IsValid() then
FAnimState.Update;
if FFireCounter > 0 then
Dec(FFireCounter)
index b62e321ca8c66f740b3b5e7755fe21d6fe4b4a3a..5ab33e9ae2b3d14736634e423325f32508c0530f 100644 (file)
if (pm.Direction = TDirection.D_LEFT) and (Models[pm.id].Frames[TDirection.D_LEFT, pm.CurrentAnimation].base <> 0) then
begin
FramesID := Models[pm.id].Frames[TDirection.D_LEFT, pm.CurrentAnimation].base;
- r_AnimationState_Draw(FramesID, pm.AnimState, X, Y, Alpha, TMirrorType.None, False);
+ r_AnimState_Draw(FramesID, pm.AnimState, X, Y, Alpha, TMirrorType.None, False);
end
else
begin
FramesID := Models[pm.id].Frames[TDirection.D_RIGHT, pm.CurrentAnimation].base;
- r_AnimationState_Draw(FramesID, pm.AnimState, X, Y, Alpha, Mirror, False);
+ r_AnimState_Draw(FramesID, pm.AnimState, X, Y, Alpha, Mirror, False);
end;
// Маска модели:
if (pm.Direction = TDirection.D_LEFT) and (Models[pm.id].Frames[TDirection.D_LEFT, pm.CurrentAnimation].mask <> 0) then
begin
FramesID := Models[pm.id].Frames[TDirection.D_LEFT, pm.CurrentAnimation].mask;
- r_AnimationState_Draw(FramesID, pm.AnimState, X, Y, Alpha, TMirrorType.None, False);
+ r_AnimState_Draw(FramesID, pm.AnimState, X, Y, Alpha, TMirrorType.None, False);
end
else
begin
FramesID := Models[pm.id].Frames[TDirection.D_RIGHT, pm.CurrentAnimation].mask;
- r_AnimationState_Draw(FramesID, pm.AnimState, X, Y, Alpha, Mirror, False);
+ r_AnimState_Draw(FramesID, pm.AnimState, X, Y, Alpha, Mirror, False);
end;
e_Colors.R := 255;