hedgewars/uRender.pas
branchhedgeroid
changeset 6328 d14adf1c7721
parent 6323 c1aa6a3c84a7
child 6394 f0a9042e7387
--- a/hedgewars/uRender.pas	Sat Nov 12 15:48:55 2011 +0100
+++ b/hedgewars/uRender.pas	Sat Nov 12 17:06:49 2011 +0100
@@ -147,11 +147,9 @@
 
 glPushMatrix;
 glTranslatef(X, Y, 0);
+if Dir = 0 then Dir:= 1;
 
-if Dir < 0 then
-   glRotatef(Angle, 0, 0, -1)
-else
-   glRotatef(Angle, 0, 0,  1);
+glRotatef(Angle, 0, 0, Dir);
 
 glTranslatef(Dir*OffsetX, OffsetY, 0);
 glScalef(Scale, Scale, 1);
@@ -159,10 +157,7 @@
 // Any reason for this call? And why only in t direction, not s?
 //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
-if Dir < 0 then
-    hw:= w div -2
-else
-    hw:= w div 2;
+hw:= w div (2 div Dir);
 
 nx:= round(Texture^.w / w); // number of horizontal frames
 ny:= round(Texture^.h / h); // number of vertical frames