proper calculation of maxlod & mipmapenabled

This commit is contained in:
MelonSpeedruns
2026-05-29 14:38:03 -04:00
parent c0429110db
commit e641044535
+6 -10
View File
@@ -477,12 +477,10 @@ void registerHdTexturesForArc(std::vector<u8>& arcBytes,
const u32 newImgOff = 0x20 + i * 0x20;
timg->imageOffset = static_cast<s32>(newImgOff);
const u8 hdMips = static_cast<u8>(std::clamp<u32>(s.mipCount, 1u, 13u));
if (timg->mipmapEnabled) {
timg->mipmapCount = hdMips;
timg->maxLOD = static_cast<s8>((hdMips - 1) * 8);
}
timg->mipmapEnabled = 1;
timg->mipmapCount = hdMips;
timg->maxLOD = static_cast<s8>((hdMips * 8) - 1);
timg->maxAnisotropy = GX_ANISO_4;
//timg->LODBias = -50;
registerHdSurface(*m, s,
arcBytes.data() + f.dataOffset + btiAbs + newImgOff,
gtx->name, i);
@@ -515,12 +513,10 @@ void registerHdTexturesForArc(std::vector<u8>& arcBytes,
auto* timg = reinterpret_cast<ResTIMG*>(arcBytes.data() + f.dataOffset);
timg->imageOffset = 0x20;
const u8 hdMips = static_cast<u8>(std::clamp<u32>(s.mipCount, 1u, 13u));
if (timg->mipmapEnabled) {
timg->mipmapCount = hdMips;
timg->maxLOD = static_cast<s8>((hdMips - 1) * 8);
}
timg->mipmapEnabled = 1;
timg->mipmapCount = hdMips;
timg->maxLOD = static_cast<s8>((hdMips * 8) - 1);
timg->maxAnisotropy = GX_ANISO_4;
//timg->LODBias = -50;
registerHdSurface(*m, s, arcBytes.data() + f.dataOffset + 0x20,
gtx->name, 0);
++btiReg;