mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-27 08:53:23 -04:00
proper calculation of maxlod & mipmapenabled
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user