hedgewars/uStore.pas
changeset 806 d397c502a5dd
parent 785 ac538f1a629e
child 809 b33c2def1576
--- 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;