adjust sprite texture coordinates to respect texel offset

This commit is contained in:
Jupeyy 2017-10-10 12:20:20 +02:00
parent 966b388b0e
commit 4fc7187a14

View file

@ -50,10 +50,10 @@ void CRenderTools::SelectSprite(CDataSprite *pSpr, int Flags, int sx, int sy)
gs_SpriteWScale = w/f;
gs_SpriteHScale = h/f;
float x1 = x/(float)cx;
float x2 = (x+w)/(float)cx;
float y1 = y/(float)cy;
float y2 = (y+h)/(float)cy;
float x1 = x/(float)cx + 0.5f/(float)(cx*32);
float x2 = (x+w)/(float)cx - 0.5f/(float)(cx*32);
float y1 = y/(float)cy + 0.5f/(float)(cy*32);
float y2 = (y+h)/(float)cy - 0.5f/(float)(cy*32);
float Temp = 0;
if(Flags&SPRITE_FLAG_FLIP_Y)