# HG changeset patch
# User smxx
# Date 1267542271 0
# Node ID d5051cc8a3132e5aca1588235ece3d3aeeacc132
# Parent  f982208e7f211581191b14707b4f9e529b0eb979
Engine:
* Fixed DrawTextureF und DrawTextureRotatedF for NPOT textures

diff -r f982208e7f21 -r d5051cc8a313 hedgewars/uStore.pas
--- a/hedgewars/uStore.pas	Tue Mar 02 04:04:16 2010 +0000
+++ b/hedgewars/uStore.pas	Tue Mar 02 15:04:31 2010 +0000
@@ -542,13 +542,13 @@
 else
 	hw:= w div 2;
 
-nx:= round(Texture^.w * Texture^.rx / w);
-ny:= round(Texture^.h * Texture^.ry / h);
+nx:= round(Texture^.w / w); // number of horizontal frames
+ny:= round(Texture^.h / h); // number of vertical frames
 
-ft:= ((Frame mod ny) / ny);
-fb:= (((Frame mod ny) + 1) / ny);
-fl:= ((Frame div ny) / nx) * Texture^.rx;
-fr:= (((Frame div ny) + 1) / nx);
+ft:= (Frame mod ny) * Texture^.ry / ny;
+fb:= ((Frame mod ny) + 1) * Texture^.ry / ny;
+fl:= (Frame div ny) * Texture^.rx / nx;
+fr:= ((Frame div ny) + 1) * Texture^.rx / nx;
 
 glBindTexture(GL_TEXTURE_2D, Texture^.id);