From 4fc7187a1496ae7ca51faa11f8bf46e536e1a10c Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Tue, 10 Oct 2017 12:20:20 +0200 Subject: [PATCH] adjust sprite texture coordinates to respect texel offset --- src/game/client/render.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/client/render.cpp b/src/game/client/render.cpp index 12e71deef..0ee25e732 100644 --- a/src/game/client/render.cpp +++ b/src/game/client/render.cpp @@ -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)