hedgewars/uStore.pas
changeset 2910 d5051cc8a313
parent 2905 f3c79f7193a9
child 2948 3f21a9dc93d0
--- 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);