From cd0b8b31725650d79dc7a88807de511cc8246e6a Mon Sep 17 00:00:00 2001 From: Lurs <2795933+Lurs@users.noreply.github.com> Date: Sun, 17 May 2026 09:15:53 +0200 Subject: [PATCH] fix mimapping (hopefully). update aurora --- extern/aurora | 2 +- src/dusk/tphd/HdAssetLayer.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extern/aurora b/extern/aurora index 5e0504567d..28a40a812a 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit 5e0504567d85b556ab3eef7665679e7cf44c4960 +Subproject commit 28a40a812acea0dfb3e1a3e51b5c327fbcad2b63 diff --git a/src/dusk/tphd/HdAssetLayer.cpp b/src/dusk/tphd/HdAssetLayer.cpp index 8e19403e00..f3a9283535 100644 --- a/src/dusk/tphd/HdAssetLayer.cpp +++ b/src/dusk/tphd/HdAssetLayer.cpp @@ -316,7 +316,7 @@ void registerHdSurface(const Gx2FormatMapping& m, const GtxSurface& s, r.width = s.width; r.height = s.height; r.gxFormat = m.newGxFormat; - r.mipCount = 0; // r.mipCount = std::max(decoded.mipCount, 1u); + r.mipCount = std::max(decoded.mipCount, 1u); aurora::gfx::hd_register_replacement(pixelPtr, std::move(r)); } @@ -467,6 +467,9 @@ void registerHdTexturesForArc(std::vector& arcBytes, const u32 newImgOff = 0x20 + i * 0x20; timg->imageOffset = static_cast(newImgOff); + const u8 hdMips = static_cast(std::clamp(s.mipCount, 1u, 11u)); + timg->mipmapCount = hdMips; + timg->maxLOD = static_cast((hdMips - 1) * 8); registerHdSurface(*m, s, arcBytes.data() + f.dataOffset + btiAbs + newImgOff, gtx->name, i); @@ -498,6 +501,9 @@ void registerHdTexturesForArc(std::vector& arcBytes, // i_img + 0x20, matching where we register below. auto* timg = reinterpret_cast(arcBytes.data() + f.dataOffset); timg->imageOffset = 0x20; + const u8 hdMips = static_cast(std::clamp(s.mipCount, 1u, 11u)); + timg->mipmapCount = hdMips; + timg->maxLOD = static_cast((hdMips - 1) * 8); registerHdSurface(*m, s, arcBytes.data() + f.dataOffset + 0x20, gtx->name, 0); ++btiReg;