From e1c7a44593447bd7889bd2c94df444bbaba1fb7d Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Thu, 16 Nov 2017 18:00:52 +0700 Subject: [PATCH] Force texture wrap/mirror for hires textures when texture size is half of real (load) texture size. Fixed Majora's Mask - custom textures broken on moon #1662 --- src/Textures.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Textures.cpp b/src/Textures.cpp index 2afaf6e1..2869de63 100644 --- a/src/Textures.cpp +++ b/src/Textures.cpp @@ -706,10 +706,16 @@ void _updateCachedTexture(const GHQTexInfo & _info, CachedTexture *_pTexture, f3 _pTexture->textureBytes <<= 2; } + if (_pTexture->realWidth == _pTexture->width * 2) + _pTexture->clampS = 0; // force wrap or mirror s + if (_pTexture->realHeight == _pTexture->height * 2) + _pTexture->clampT = 0; // force wrap or mirror t + _pTexture->realWidth = _info.width; _pTexture->realHeight = _info.height; _pTexture->scaleS = _scale / f32(_info.width); _pTexture->scaleT = _scale / f32(_info.height); + _pTexture->bHDTexture = true; }