From bc6cd8627b8499c33f3e0614764d8e43fa2a9fee Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 29 Aug 2022 12:44:31 -0400 Subject: [PATCH] CTexture: Fixes for LoadMipLevel --- Runtime/Graphics/CTexture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/Graphics/CTexture.cpp b/Runtime/Graphics/CTexture.cpp index e47b9cf62..cea30657c 100644 --- a/Runtime/Graphics/CTexture.cpp +++ b/Runtime/Graphics/CTexture.cpp @@ -114,7 +114,7 @@ void CTexture::LoadMipLevel(s32 mip, GXTexMapID id, EClampMode clamp) { u32 offset = 0; if (mip > 0) { for (u32 i = 0; i < mip; ++i) { - offset += ROUND_UP_32(x9_bitsPerPixel * (ROUND_UP_4(width) * ROUND_UP_4(height))); + offset += ROUND_UP_32((x9_bitsPerPixel * (ROUND_UP_4(width) * ROUND_UP_4(height))) / 8); width /= 2; height /= 2; } @@ -123,7 +123,7 @@ void CTexture::LoadMipLevel(s32 mip, GXTexMapID id, EClampMode clamp) { GXTexObj texObj; const auto wrap = static_cast(clamp); GXInitTexObj(&texObj, image_ptr + offset, width, height, x18_gxFormat, wrap, wrap, false); - GXInitTexObjLOD(&texObj, GX_LINEAR, GX_LINEAR, 0.f, 1.f, 0.f, false, false, GX_ANISO_1); + GXInitTexObjLOD(&texObj, GX_LINEAR, GX_LINEAR, 0.f, 0.f, 0.f, false, false, GX_ANISO_1); if (HasPalette()) { x10_graphicsPalette->Load(); xa_25_canLoadPalette = false;