1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix Worms Armageddon

Rewrite
https://github.com/gonetz/GLideN64/commit/feb0e53034d54095464687dbae1785
4c9dc3caa6 to fix Worms Armageddon. If upper left value is zero lower
right value is scaled width minus one scaled texel.

Example:
Width = 10.0f, scale is 1.0f
urx = 0.0f;
lrx = 0.0f + 10.0f/1.0f - 1.0f/1.0f = 9.0f
Resulting range is 0-9 for a 10 texel width texture.
This commit is contained in:
gizmo98 2018-07-31 19:18:45 +02:00 committed by Sergey Lipskiy
parent e9becd4b8a
commit c76daedfc0

View File

@ -2072,8 +2072,9 @@ struct ObjCoordinates
ulx = frameX;
uly = frameY;
lrx = frameX + min(imageW/scaleW, frameW);
lry = frameY + min(imageH/scaleH, frameH);
// Lower right X position is 'X + widthX / scaleW - one_scaled_texelW'
lrx = frameX + min(imageW/scaleW, frameW) - 1.0f/scaleW;
lry = frameY + min(imageH/scaleH, frameH) - 1.0f/scaleH;
uls = imageX;
ult = imageY;