From 58d93cb0830476ac26e9b991e474ed3c86a3d144 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Mon, 14 Aug 2023 19:43:05 +0200 Subject: [PATCH] port: hackfix psychosis gun crash --- port/fast3d/gfx_pc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/port/fast3d/gfx_pc.cpp b/port/fast3d/gfx_pc.cpp index c067e7244..85a2b038d 100644 --- a/port/fast3d/gfx_pc.cpp +++ b/port/fast3d/gfx_pc.cpp @@ -838,8 +838,8 @@ static void import_texture(int i, int tile, bool importReplacement) { const uint32_t tmem_index = rdp.texture_tile[tile].tmem_index; const uint8_t palette_index = rdp.texture_tile[tile].palette; - if (rdp.tex_lod && tile == rdp.first_tile_index) { - // set up miplevel 0 + if ((rdp.tex_lod && tile == rdp.first_tile_index) || !rdp.loaded_texture[tmem_index].addr) { + // set up miplevel 0; also acts as a catch-all for when .addr is NULL because my texture loader sucks rdp.loaded_texture[tmem_index].line_size_bytes = rdp.texture_tile[tile].line_size_bytes; rdp.loaded_texture[tmem_index].full_image_line_size_bytes = rdp.texture_tile[tile].line_size_bytes; rdp.loaded_texture[tmem_index].full_size_bytes = rdp.loaded_texture[tmem_index].full_image_line_size_bytes * rdp.texture_tile[tile].height;