From 3328e147eb989e28bbd240eea9cbfa9a583939b6 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 22 Nov 2023 22:19:54 +0100 Subject: [PATCH] port: hackfix some more RGBA32 textures --- port/fast3d/gfx_pc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/port/fast3d/gfx_pc.cpp b/port/fast3d/gfx_pc.cpp index 7ba7974a3..de208322b 100644 --- a/port/fast3d/gfx_pc.cpp +++ b/port/fast3d/gfx_pc.cpp @@ -860,12 +860,17 @@ static void import_texture(int i, int tile, bool importReplacement) { if (rdp.tex_lod || !loaded_texture.addr) { // set up miplevel 0; also acts as a catch-all for when .addr is NULL because my texture loader sucks + loaded_texture.addr = rdp.texture_to_load.addr; loaded_texture.line_size_bytes = rdp.texture_tile[tile].line_size_bytes; loaded_texture.full_image_line_size_bytes = rdp.texture_tile[tile].line_size_bytes; loaded_texture.full_size_bytes = loaded_texture.full_image_line_size_bytes * rdp.texture_tile[tile].height; loaded_texture.size_bytes = loaded_texture.line_size_bytes * rdp.texture_tile[tile].height; + if (siz == G_IM_SIZ_32b) { + // HACK: fixup 32-bit LODed texture height + loaded_texture.size_bytes <<= 1; + loaded_texture.full_size_bytes <<= 1; + } loaded_texture.orig_size_bytes = loaded_texture.size_bytes; - loaded_texture.addr = rdp.texture_to_load.addr; } const RawTexMetadata* metadata = &loaded_texture.raw_tex_metadata;