From d13a3d7890c3bc15fda20db7706e76514477ae27 Mon Sep 17 00:00:00 2001 From: S2S Date: Wed, 15 Jul 2020 18:51:49 +0200 Subject: [PATCH] Perform hdRatio division with floating point precision. Allows non-integer scaled HD textures, but their use is discouraged. --- src/Textures.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Textures.cpp b/src/Textures.cpp index a3c62212..7d1b09e1 100644 --- a/src/Textures.cpp +++ b/src/Textures.cpp @@ -673,8 +673,8 @@ void _updateCachedTexture(const GHQTexInfo & _info, CachedTexture *_pTexture, u1 _pTexture->scaleS = 1.0f / (_pTexture->maskS ? f32(pow2(widthOrg)) : f32(widthOrg)); _pTexture->scaleT = 1.0f / (_pTexture->maskT ? f32(pow2(heightOrg)) : f32(heightOrg)); - _pTexture->hdRatioS = f32(_info.width / _pTexture->width); - _pTexture->hdRatioT = f32(_info.height / _pTexture->height); + _pTexture->hdRatioS = (f32)(_info.width) / (f32)(_pTexture->width); + _pTexture->hdRatioT = (f32)(_info.height) / (f32)(_pTexture->height); _pTexture->bHDTexture = true; }