145 if (abs(Y) > H) and ((abs(Y + OffsetY - (0.5 * cScreenHeight)) - W / 2) * cScaleFactor > cScreenHeight) then |
145 if (abs(Y) > H) and ((abs(Y + OffsetY - (0.5 * cScreenHeight)) - W / 2) * cScaleFactor > cScreenHeight) then |
146 exit; |
146 exit; |
147 |
147 |
148 glPushMatrix; |
148 glPushMatrix; |
149 glTranslatef(X, Y, 0); |
149 glTranslatef(X, Y, 0); |
150 |
150 if Dir = 0 then Dir:= 1; |
151 if Dir < 0 then |
151 |
152 glRotatef(Angle, 0, 0, -1) |
152 glRotatef(Angle, 0, 0, Dir); |
153 else |
|
154 glRotatef(Angle, 0, 0, 1); |
|
155 |
153 |
156 glTranslatef(Dir*OffsetX, OffsetY, 0); |
154 glTranslatef(Dir*OffsetX, OffsetY, 0); |
157 glScalef(Scale, Scale, 1); |
155 glScalef(Scale, Scale, 1); |
158 |
156 |
159 // Any reason for this call? And why only in t direction, not s? |
157 // Any reason for this call? And why only in t direction, not s? |
160 //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
158 //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
161 |
159 |
162 if Dir < 0 then |
160 hw:= w div (2 div Dir); |
163 hw:= w div -2 |
|
164 else |
|
165 hw:= w div 2; |
|
166 |
161 |
167 nx:= round(Texture^.w / w); // number of horizontal frames |
162 nx:= round(Texture^.w / w); // number of horizontal frames |
168 ny:= round(Texture^.h / h); // number of vertical frames |
163 ny:= round(Texture^.h / h); // number of vertical frames |
169 |
164 |
170 ft:= (Frame mod ny) * Texture^.ry / ny; |
165 ft:= (Frame mod ny) * Texture^.ry / ny; |