mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Calculate texture size using gDPLoadTileInfo.
This commit is contained in:
parent
e72ac2ed3d
commit
f8da3cb792
23
Textures.cpp
23
Textures.cpp
|
@ -411,6 +411,7 @@ void _calcTileSizes(u32 _t, TileSizes & _sizes, gDPTile * _pLoadTile)
|
||||||
u32 maskHeight = 1 << pTile->maskt;
|
u32 maskHeight = 1 << pTile->maskt;
|
||||||
u32 width, height;
|
u32 width, height;
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (pTile->textureMode == TEXTUREMODE_TEXRECT) {
|
if (pTile->textureMode == TEXTUREMODE_TEXRECT) {
|
||||||
u16 texRectWidth = gDP.texRect.width - pTile->uls;
|
u16 texRectWidth = gDP.texRect.width - pTile->uls;
|
||||||
u16 texRectHeight = gDP.texRect.height - pTile->ult;
|
u16 texRectHeight = gDP.texRect.height - pTile->ult;
|
||||||
|
@ -465,7 +466,29 @@ void _calcTileSizes(u32 _t, TileSizes & _sizes, gDPTile * _pLoadTile)
|
||||||
else
|
else
|
||||||
height = lineHeight;
|
height = lineHeight;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
gDPLoadTileInfo &info = gDP.loadInfo[pTile->tmem];
|
||||||
|
if (info.loadType == LOADTYPE_TILE) {
|
||||||
|
width = min(info.width, info.texWidth);
|
||||||
|
if (info.size > pTile->size)
|
||||||
|
width <<= info.size - pTile->size;
|
||||||
|
height = info.height;
|
||||||
|
} else {
|
||||||
|
if (pTile->masks && ((maskWidth * maskHeight) <= maxTexels))
|
||||||
|
width = maskWidth; // Use mask width if set and valid
|
||||||
|
else if ((tileWidth * tileHeight) <= maxTexels)
|
||||||
|
width = tileWidth; // else use tile width if valid
|
||||||
|
else
|
||||||
|
width = lineWidth; // else use line-based width
|
||||||
|
|
||||||
|
if (pTile->maskt && ((maskWidth * maskHeight) <= maxTexels))
|
||||||
|
height = maskHeight;
|
||||||
|
else if ((tileWidth * tileHeight) <= maxTexels)
|
||||||
|
height = tileHeight;
|
||||||
|
else
|
||||||
|
height = lineHeight;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
_sizes.clampWidth = (pTile->clamps && gDP.otherMode.cycleType != G_CYC_COPY) ? tileWidth : width;
|
_sizes.clampWidth = (pTile->clamps && gDP.otherMode.cycleType != G_CYC_COPY) ? tileWidth : width;
|
||||||
_sizes.clampHeight = (pTile->clampt && gDP.otherMode.cycleType != G_CYC_COPY) ? tileHeight : height;
|
_sizes.clampHeight = (pTile->clampt && gDP.otherMode.cycleType != G_CYC_COPY) ? tileHeight : height;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user