# HG changeset patch # User unc0rr # Date 1204921519 0 # Node ID d397c502a5dd642c0d944354fcb4667d04999c3d # Parent 4d75759b38bd65b4597eafad79ea67423a031650 Finish flakes implementation diff -r 4d75759b38bd -r d397c502a5dd hedgewars/uLandObjects.pas --- a/hedgewars/uLandObjects.pas Fri Mar 07 19:44:00 2008 +0000 +++ b/hedgewars/uLandObjects.pas Fri Mar 07 20:25:19 2008 +0000 @@ -400,7 +400,7 @@ Readln(f, vobFramesCount, vobFrameTicks, vobVelocity, vobFallSpeed); for i:= 0 to Pred(vobCount) do - AddVisualGear( -cScreenWidth + random(cScreenWidth * 2 + 2048), random(1000), vgtFlake); + AddVisualGear( -cScreenWidth + random(cScreenWidth * 2 + 2048), random(1200) - 100, vgtFlake); Close(f); {$I+} diff -r 4d75759b38bd -r d397c502a5dd hedgewars/uStore.pas --- a/hedgewars/uStore.pas Fri Mar 07 19:44:00 2008 +0000 +++ b/hedgewars/uStore.pas Fri Mar 07 20:25:19 2008 +0000 @@ -31,6 +31,7 @@ procedure DrawLand (X, Y: LongInt); procedure DrawTexture(X, Y: LongInt; Texture: PTexture); procedure DrawRotated(Sprite: TSprite; X, Y: LongInt; Angle: real); +procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame: LongInt; Angle: real); procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y: LongInt; Angle: real); procedure DXOutText(X, Y: LongInt; Font: THWFont; s: string; Surface: PSDL_Surface); procedure DrawCentered(X, Top: LongInt; Source: PTexture); @@ -358,7 +359,6 @@ end; procedure DrawRotated(Sprite: TSprite; X, Y: LongInt; Angle: real); -var hw, hh: LongInt; begin DrawRotatedTex(SpritesData[Sprite].Texture, SpritesData[Sprite].Width, @@ -366,6 +366,17 @@ X, Y, Angle) end; +procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame: LongInt; Angle: real); +begin +glPushMatrix; +glTranslatef(X - SpritesData[Sprite].Width div 2, Y - SpritesData[Sprite].Width div 2, 0); +glRotatef(Angle, 0, 0, 1); + +DrawSprite(Sprite, 0, 0, Frame, nil); + +glPopMatrix +end; + procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y: LongInt; Angle: real); begin glPushMatrix; diff -r 4d75759b38bd -r d397c502a5dd hedgewars/uVisualGears.pas --- a/hedgewars/uVisualGears.pas Fri Mar 07 19:44:00 2008 +0000 +++ b/hedgewars/uVisualGears.pas Fri Mar 07 20:25:19 2008 +0000 @@ -69,7 +69,7 @@ if hwRound(Gear^.X) < -cScreenWidth - 64 then Gear^.X:= int2hwFloat(cScreenWidth + 2048) else if hwRound(Gear^.X) > cScreenWidth + 2048 then Gear^.X:= int2hwFloat(-cScreenWidth - 64); -if hwRound(Gear^.Y) > 1024 then Gear^.Y:= - _128 +if hwRound(Gear^.Y) > 1100 then Gear^.Y:= - _128 end; procedure doStepCloud(Gear: PVisualGear; Steps: Longword); @@ -110,7 +110,7 @@ dx.isNegative:= random(2) = 0; dx.QWordValue:= random(100000000); dy.isNegative:= false; - dy.QWordValue:= random(20); + dy.QWordValue:= random(70000000); dAngle:= (random(2) * 2 - 1) * (1 + random) * vobVelocity / 1000 end; vgtCloud: with Result^ do @@ -158,7 +158,7 @@ vgtFlake: if vobVelocity = 0 then DrawSprite(sprFlake, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, nil) else - DrawRotated(sprFlake, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Angle); + DrawRotatedF(sprFlake, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, Gear^.Angle); vgtCloud: DrawSprite(sprCloud, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, nil); end;