mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
adjust sprite texture coordinates to respect texel offset
This commit is contained in:
parent
966b388b0e
commit
4fc7187a14
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue