X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_playermodel.pas;h=7a55bf758b8b9744c5a7883c43fbcb0659d23351;hb=b4e158834e92ec5c007a8af5a116855b8062c82d;hp=e4915607eb882625944cf28f9074865894b91726;hpb=ce2ed7fe6da727952c2820ec13fba793620eac4c;p=d2df-sdl.git diff --git a/src/game/g_playermodel.pas b/src/game/g_playermodel.pas index e491560..7a55bf7 100644 --- a/src/game/g_playermodel.pas +++ b/src/game/g_playermodel.pas @@ -18,7 +18,7 @@ unit g_playermodel; interface - uses MAPDEF, g_textures, g_base, g_basic, g_weapons, utils; + uses MAPDEF, g_animations, g_base, g_basic, g_weapons, utils; const A_STAND = 0; @@ -56,17 +56,17 @@ const W_POS_NORMAL = 0; W_POS_UP = 1; W_POS_DOWN = 2; + W_POS_LAST = W_POS_DOWN; W_ACT_NORMAL = 0; W_ACT_FIRE = 1; + W_ACT_LAST = W_ACT_FIRE; FLAG_BASEPOINT: TDFPoint = (X:16; Y:43); 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 TAnimState; - TModelTextures = Array [TDirection.D_LEFT..TDirection.D_RIGHT, A_STAND..A_LAST] of record Resource: String; Mask: String; @@ -659,16 +659,16 @@ end; { TPlayerModel } procedure TPlayerModel.ChangeAnimation (Animation: Byte; Force: Boolean = False); - var once: Boolean; speed, count: Integer; + var loop: Boolean; speed, count: Integer; begin if not Force then if FCurrentAnimation = Animation then Exit; FCurrentAnimation := Animation; - once := FCurrentAnimation in [A_STAND, A_WALK]; + loop := FCurrentAnimation in [A_STAND, A_WALK]; speed := PlayerModelsArray[FID].ModelSpeed[FCurrentAnimation]; count := PlayerModelsArray[FID].Anim[FDirection, FCurrentAnimation].Frames; - FAnimState := TAnimState.Create(once, speed, count); + FAnimState := TAnimState.Create(loop, speed, count); end; destructor TPlayerModel.Destroy();