hedgewars/uStore.pas
changeset 2910 d5051cc8a313
parent 2905 f3c79f7193a9
child 2948 3f21a9dc93d0
equal deleted inserted replaced
2909:f982208e7f21 2910:d5051cc8a313
   540 if Dir < 0 then
   540 if Dir < 0 then
   541 	hw:= w div -2
   541 	hw:= w div -2
   542 else
   542 else
   543 	hw:= w div 2;
   543 	hw:= w div 2;
   544 
   544 
   545 nx:= round(Texture^.w * Texture^.rx / w);
   545 nx:= round(Texture^.w / w); // number of horizontal frames
   546 ny:= round(Texture^.h * Texture^.ry / h);
   546 ny:= round(Texture^.h / h); // number of vertical frames
   547 
   547 
   548 ft:= ((Frame mod ny) / ny);
   548 ft:= (Frame mod ny) * Texture^.ry / ny;
   549 fb:= (((Frame mod ny) + 1) / ny);
   549 fb:= ((Frame mod ny) + 1) * Texture^.ry / ny;
   550 fl:= ((Frame div ny) / nx) * Texture^.rx;
   550 fl:= (Frame div ny) * Texture^.rx / nx;
   551 fr:= (((Frame div ny) + 1) / nx);
   551 fr:= ((Frame div ny) + 1) * Texture^.rx / nx;
   552 
   552 
   553 glBindTexture(GL_TEXTURE_2D, Texture^.id);
   553 glBindTexture(GL_TEXTURE_2D, Texture^.id);
   554 
   554 
   555 VertexBuffer[0].X:= -hw;
   555 VertexBuffer[0].X:= -hw;
   556 VertexBuffer[0].Y:= w / -2;
   556 VertexBuffer[0].Y:= w / -2;