From 1341679b8c0e57a350b769bf37a08197279fa4c3 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sun, 1 Dec 2024 13:54:47 -0600 Subject: [PATCH 1/2] Added path into texture metadata --- src/graphic/Fast3D/gfx_pc.cpp | 5 +++++ src/graphic/Fast3D/gfx_pc.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/graphic/Fast3D/gfx_pc.cpp b/src/graphic/Fast3D/gfx_pc.cpp index 52f9041aa..8705b7c16 100644 --- a/src/graphic/Fast3D/gfx_pc.cpp +++ b/src/graphic/Fast3D/gfx_pc.cpp @@ -2565,6 +2565,7 @@ static void gfx_s2dex_bg_copy(F3DuObjBg* bg) { rawTexMetadata.v_pixel_scale = tex->VPixelScale; rawTexMetadata.type = tex->Type; rawTexMetadata.resource = tex; + rawTexMetadata.path = std::string((char*) data); data = (uintptr_t) reinterpret_cast(tex->ImageData); } @@ -2604,6 +2605,7 @@ static void gfx_s2dex_bg_1cyc(F3DuObjBg* bg) { rawTexMetadata.v_pixel_scale = tex->VPixelScale; rawTexMetadata.type = tex->Type; rawTexMetadata.resource = tex; + rawTexMetadata.path = std::string((char*) data); data = (uintptr_t) reinterpret_cast(tex->ImageData); } @@ -3314,6 +3316,7 @@ bool gfx_set_timg_handler_rdp(F3DGfx** cmd0) { rawTexMetdata.v_pixel_scale = tex->VPixelScale; rawTexMetdata.type = tex->Type; rawTexMetdata.resource = tex; + rawTexMetdata.path = std::string((char*) imgData); } } @@ -3346,6 +3349,7 @@ bool gfx_set_timg_otr_hash_handler_custom(F3DGfx** cmd0) { rawTexMetadata.v_pixel_scale = texture->VPixelScale; rawTexMetadata.type = texture->Type; rawTexMetadata.resource = texture; + rawTexMetadata.path = std::string(fileName); // #if _DEBUG && 0 // tex = reinterpret_cast(texture->imageData); @@ -3409,6 +3413,7 @@ bool gfx_set_timg_otr_filepath_handler_custom(F3DGfx** cmd0) { rawTexMetadata.v_pixel_scale = texture->VPixelScale; rawTexMetadata.type = texture->Type; rawTexMetadata.resource = texture; + rawTexMetadata.path = std::string(fileName); uint32_t fmt = C0(21, 3); uint32_t size = C0(19, 2); diff --git a/src/graphic/Fast3D/gfx_pc.h b/src/graphic/Fast3D/gfx_pc.h index 0f1f73850..d943926d2 100644 --- a/src/graphic/Fast3D/gfx_pc.h +++ b/src/graphic/Fast3D/gfx_pc.h @@ -115,6 +115,7 @@ struct RawTexMetadata { float h_byte_scale = 1, v_pixel_scale = 1; std::shared_ptr resource; LUS::TextureType type; + std::string path; }; #define MAX_BUFFERED 256 From 8e11e4e44e45068dee34e9446c07255d335ba55a Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sun, 1 Dec 2024 13:57:49 -0600 Subject: [PATCH 2/2] Fixed tidy --- src/graphic/Fast3D/gfx_pc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphic/Fast3D/gfx_pc.cpp b/src/graphic/Fast3D/gfx_pc.cpp index 8705b7c16..34fb6d32c 100644 --- a/src/graphic/Fast3D/gfx_pc.cpp +++ b/src/graphic/Fast3D/gfx_pc.cpp @@ -2565,7 +2565,7 @@ static void gfx_s2dex_bg_copy(F3DuObjBg* bg) { rawTexMetadata.v_pixel_scale = tex->VPixelScale; rawTexMetadata.type = tex->Type; rawTexMetadata.resource = tex; - rawTexMetadata.path = std::string((char*) data); + rawTexMetadata.path = std::string((char*)data); data = (uintptr_t) reinterpret_cast(tex->ImageData); } @@ -2605,7 +2605,7 @@ static void gfx_s2dex_bg_1cyc(F3DuObjBg* bg) { rawTexMetadata.v_pixel_scale = tex->VPixelScale; rawTexMetadata.type = tex->Type; rawTexMetadata.resource = tex; - rawTexMetadata.path = std::string((char*) data); + rawTexMetadata.path = std::string((char*)data); data = (uintptr_t) reinterpret_cast(tex->ImageData); } @@ -3316,7 +3316,7 @@ bool gfx_set_timg_handler_rdp(F3DGfx** cmd0) { rawTexMetdata.v_pixel_scale = tex->VPixelScale; rawTexMetdata.type = tex->Type; rawTexMetdata.resource = tex; - rawTexMetdata.path = std::string((char*) imgData); + rawTexMetdata.path = std::string((char*)imgData); } }