# HG changeset patch # User sheepluva # Date 1406940132 -7200 # Node ID 5e83d029e918f0de104fa37abab970566fdb8999 # Parent e49b76a12800f2457725aaed4989d43c8d964cf2 fix flake angles diff -r e49b76a12800 -r 5e83d029e918 hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Sat Aug 02 02:20:48 2014 +0200 +++ b/hedgewars/uVisualGears.pas Sat Aug 02 02:42:12 2014 +0200 @@ -132,12 +132,17 @@ procedure DrawVisualGears(Layer: LongWord); var Gear: PVisualGear; - tinted: boolean; + tinted, speedlessFlakes: boolean; tmp: real; i: LongInt; sprite: TSprite; spriteData: PSpriteData; begin +if SuddenDeathDmg then + speedlessFlakes:= (vobSDVelocity = 0) +else + speedlessFlakes:= (vobVelocity = 0); + case Layer of // this layer is very distant in the background when stereo 0: begin @@ -154,14 +159,14 @@ sprite:= GetSprite(sprFlake, sprSDFlake); if cFlattenFlakes then begin - if vobSDVelocity = 0 then + if speedlessFlakes then DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); end else begin - if vobSDVelocity = 0 then + if speedlessFlakes then DrawTextureF(SpritesData[sprite].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height) else DrawTextureRotatedF(SpritesData[sprite].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle); @@ -184,7 +189,7 @@ case Gear^.Kind of vgtFlake: begin sprite:= GetSprite(sprFlake, sprSDFlake); - if vobSDVelocity = 0 then + if speedlessFlakes then DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); @@ -246,7 +251,7 @@ (* vgtFlake: begin sprite:= GetSprite(sprFlake, sprSDFlake); - if vobSDVelocity = 0 then + if speedlessFlakes then DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle) @@ -356,7 +361,7 @@ case Gear^.Kind of vgtFlake: begin spriteData:= GetSpriteData(sprFlake, sprSDFlake); - if vobSDVelocity = 0 then + if speedlessFlakes then DrawTextureF(spriteData^.Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, spriteData^.Width, spriteData^.Height) else DrawTextureRotatedF(spriteData^.Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, spriteData^.Width, spriteData^.Height, Gear^.Angle); @@ -388,7 +393,7 @@ end; vgtFlake: begin spriteData:= GetSpriteData(sprFlake, sprSDFlake); - if vobSDVelocity = 0 then + if speedlessFlakes then DrawTextureF(spriteData^.Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, spriteData^.Width, spriteData^.Height) else DrawTextureRotatedF(spriteData^.Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, spriteData^.Width, spriteData^.Height, Gear^.Angle); @@ -413,7 +418,7 @@ end; vgtFlake: begin sprite:= GetSprite(sprFlake, sprSDFlake); - if vobSDVelocity = 0 then + if speedlessFlakes then DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle); @@ -434,7 +439,7 @@ case Gear^.Kind of vgtFlake: begin sprite:= GetSprite(sprFlake, sprSDFlake); - if vobSDVelocity = 0 then + if speedlessFlakes then DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame) else DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)