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

Fix TextureCache::_updateBackground():

Load texture image with its actual size, not cast to power of two sizes.
This allows to wrap it easily.
This commit is contained in:
Sergey Lipskiy 2014-10-22 20:49:48 +07:00
parent a849fb81e5
commit 799638c29b

View File

@ -673,17 +673,17 @@ void TextureCache::_updateBackground()
pCurrent->palette = gSP.bgImage.palette; pCurrent->palette = gSP.bgImage.palette;
pCurrent->maskS = 0; pCurrent->maskS = 0;
pCurrent->maskT = 0; pCurrent->maskT = 0;
pCurrent->mirrorS = 0; pCurrent->mirrorS = 1;
pCurrent->mirrorT = 0; pCurrent->mirrorT = 1;
pCurrent->clampS = 1; pCurrent->clampS = 0;
pCurrent->clampT = 1; pCurrent->clampT = 0;
pCurrent->line = 0; pCurrent->line = 0;
pCurrent->tMem = 0; pCurrent->tMem = 0;
pCurrent->lastDList = RSP.DList; pCurrent->lastDList = RSP.DList;
pCurrent->frameBufferTexture = FALSE; pCurrent->frameBufferTexture = FALSE;
pCurrent->realWidth = pow2( gSP.bgImage.width ); pCurrent->realWidth = gSP.bgImage.width;
pCurrent->realHeight = pow2( gSP.bgImage.height ); pCurrent->realHeight = gSP.bgImage.height;
pCurrent->scaleS = 1.0f / (f32)(pCurrent->realWidth); pCurrent->scaleS = 1.0f / (f32)(pCurrent->realWidth);
pCurrent->scaleT = 1.0f / (f32)(pCurrent->realHeight); pCurrent->scaleT = 1.0f / (f32)(pCurrent->realHeight);
@ -691,6 +691,9 @@ void TextureCache::_updateBackground()
pCurrent->shiftScaleS = 1.0f; pCurrent->shiftScaleS = 1.0f;
pCurrent->shiftScaleT = 1.0f; pCurrent->shiftScaleT = 1.0f;
pCurrent->offsetS = 0.5f;
pCurrent->offsetT = 0.5f;
_loadBackground(pCurrent); _loadBackground(pCurrent);
activateTexture(0, pCurrent); activateTexture(0, pCurrent);