# HG changeset patch # User unc0rr # Date 1221147004 0 # Node ID 1f545d9a10cad3d7b4bb477cc6cb90c4f6c337d6 # Parent 180b044f09b7d9a07439af7b08ce6951b5cf53dc Hat 'wearing' animation diff -r 180b044f09b7 -r 1f545d9a10ca hedgewars/uGears.pas --- a/hedgewars/uGears.pas Wed Sep 10 14:37:27 2008 +0000 +++ b/hedgewars/uGears.pas Thu Sep 11 15:30:04 2008 +0000 @@ -843,23 +843,34 @@ end; end; - -if defaultPos then +with PHedgehog(Gear^.Hedgehog)^ do begin - DrawRotatedF(sprHHIdle, - hwRound(Gear^.X) + 1 + WorldDx, - hwRound(Gear^.Y) - 3 + WorldDy, - (RealTicks div 128 + Gear^.Pos) mod 19, - hwSign(Gear^.dX), - 0); - DrawTextureF(PHedgehog(Gear^.Hedgehog)^.HatTex, - hwRound(Gear^.X) + 1 + WorldDx, - hwRound(Gear^.Y) - 8 + WorldDy, - (RealTicks div 128 + Gear^.Pos) mod 19, - hwSign(Gear^.dX), - 32); + if defaultPos then + begin + DrawRotatedF(sprHHIdle, + hwRound(Gear^.X) + 1 + WorldDx, + hwRound(Gear^.Y) - 3 + WorldDy, + (RealTicks div 128 + Gear^.Pos) mod 19, + hwSign(Gear^.dX), + 0); + if HatVisibility < 1.0 then + HatVisibility:= HatVisibility + 0.05; + end + else + if HatVisibility > 0.0 then + HatVisibility:= HatVisibility - 0.05; + + if HatVisibility > 0 then + DrawTextureF(HatTex, + HatVisibility, + hwRound(Gear^.X) + 1 + WorldDx, + hwRound(Gear^.Y) - 8 + WorldDy, + (RealTicks div 128 + Gear^.Pos) mod 19, + hwSign(Gear^.dX), + 32); end; + with PHedgehog(Gear^.Hedgehog)^ do begin if ((Gear^.State and not gstWinner) = 0) diff -r 180b044f09b7 -r 1f545d9a10ca hedgewars/uStore.pas --- a/hedgewars/uStore.pas Wed Sep 10 14:37:27 2008 +0000 +++ b/hedgewars/uStore.pas Thu Sep 11 15:30:04 2008 +0000 @@ -30,7 +30,7 @@ procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source: PTexture); procedure DrawLand (X, Y: LongInt); procedure DrawTexture(X, Y: LongInt; Texture: PTexture); -procedure DrawTextureF(Texture: PTexture; X, Y, Frame, Dir, Frames: LongInt); +procedure DrawTextureF(Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, Frames: LongInt); procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real); procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame, Dir: LongInt; Angle: real); procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real); @@ -357,12 +357,13 @@ glEnd() end; -procedure DrawTextureF(Texture: PTexture; X, Y, Frame, Dir, Frames: LongInt); +procedure DrawTextureF(Texture: PTexture; Scale: GLfloat; X, Y, Frame, Dir, Frames: LongInt); var ft, fb: GLfloat; hw: LongInt; begin glPushMatrix; glTranslatef(X, Y, 0); +glScalef(Scale, Scale, 1.0); if Dir < 0 then hw:= - 16 diff -r 180b044f09b7 -r 1f545d9a10ca hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Wed Sep 10 14:37:27 2008 +0000 +++ b/hedgewars/uTeams.pas Thu Sep 11 15:30:04 2008 +0000 @@ -18,7 +18,7 @@ unit uTeams; interface -uses SDLh, uConsts, uKeys, uGears, uRandom, uFloat, uStats; +uses SDLh, uConsts, uKeys, uGears, uRandom, uFloat, uStats, GL; {$INCLUDE options.inc} type PHHAmmo = ^THHAmmo; @@ -40,6 +40,7 @@ AttacksNum: Longword; visStepPos: LongWord; BotLevel : LongWord; // 0 - Human player + HatVisibility: GLfloat; stats: TStatistics; Hat: String; end;