[Fix] Corrected small desciation on all sprites.

This commit is contained in:
Allanis 2013-06-04 17:02:42 +01:00
parent fb326610f6
commit 7fc15f650c

View File

@ -318,7 +318,16 @@ int gl_isTrans(const glTexture* t, const int x, const int y) {
void gl_getSpriteFromDir(int* x, int* y, const glTexture* t, const double dir) {
int s, sx, sy;
s = (int)(dir / (2.0*M_PI / (t->sy*t->sx)));
double shard, rdir;
// What each image represents in angle.
shard = 2.0*M_PI / (t->sy*t->sx);
rdir = dir + shard/2.;
if(rdir < 0.) rdir = 0.;
// Now calculate the sprite we need.
s = (int)(rdir / shard);
sx = t->sx;
sy = t->sy;