From 5ad8905427c7468e6bff3a96fb58dfc870f99380 Mon Sep 17 00:00:00 2001 From: VitaSmith Date: Tue, 17 Aug 2021 15:11:57 +0200 Subject: [PATCH] gust_g1t: add type 0x60 support * With thanks to RebootRevival for the required code changes * Closes #45 --- .vs/gust_g1t.vcxproj.user | 8 ++++---- gust_g1t.c | 4 ++-- test_g1t.cmd | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.vs/gust_g1t.vcxproj.user b/.vs/gust_g1t.vcxproj.user index b405099..95e1e59 100644 --- a/.vs/gust_g1t.vcxproj.user +++ b/.vs/gust_g1t.vcxproj.user @@ -3,20 +3,20 @@ $(SolutionDir) WindowsLocalDebugger - ps3\c_bf.g1t + ps4\cnn_battlehelp_image001.g1t $(SolutionDir) WindowsLocalDebugger - ps3\c_bf.g1t + ps4\cnn_battlehelp_image001.g1t - ps3\c_bf.g1t + ps4\cnn_battlehelp_image001.g1t $(SolutionDir) WindowsLocalDebugger - ps3\c_bf.g1t + ps4\cnn_battlehelp_image001.g1t $(SolutionDir) WindowsLocalDebugger diff --git a/gust_g1t.c b/gust_g1t.c index d5f7162..3fa4cfd 100644 --- a/gust_g1t.c +++ b/gust_g1t.c @@ -537,7 +537,7 @@ int main_utf8(int argc, char** argv) // case 0x5D: texture_format = DDS_FORMAT_BC5; bits_per_pixel = ?; break; // case 0x5E: texture_format = DDS_FORMAT_BC6; bits_per_pixel = ?; break; case 0x5F: texture_format = DDS_FORMAT_BC7; bpp = 8; break; - case 0x60: texture_format = DDS_FORMAT_DXT1; bpp = 4; supported = false; break; // UNSUPPORTED!! + case 0x60: texture_format = DDS_FORMAT_DXT1; bpp = 4; swizzled = true; break; case 0x62: texture_format = DDS_FORMAT_DXT5; bpp = 8; swizzled = true; break; default: fprintf(stderr, "ERROR: Unhandled texture type 0x%02x\n", tex.type); @@ -794,7 +794,7 @@ int main_utf8(int argc, char** argv) // case 0x5D: texture_format = DDS_FORMAT_BC5; bits_per_pixel = ?; break; // case 0x5E: texture_format = DDS_FORMAT_BC6; bits_per_pixel = ?; break; case 0x5F: texture_format = DDS_FORMAT_BC7; bpp = 8; break; - case 0x60: texture_format = DDS_FORMAT_DXT1; bpp = 4; supported = false; break; // UNSUPPORTED!! + case 0x60: texture_format = DDS_FORMAT_DXT1; bpp = 4; swizzled = true; break; case 0x62: texture_format = DDS_FORMAT_DXT5; bpp = 8; swizzled = true; break; default: fprintf(stderr, "ERROR: Unsupported texture type (0x%02X)\n", tex->type); diff --git a/test_g1t.cmd b/test_g1t.cmd index 2a94863..bf7e98f 100644 --- a/test_g1t.cmd +++ b/test_g1t.cmd @@ -8,7 +8,9 @@ setlocal EnableDelayedExpansion call build.cmd g1t if %ERRORLEVEL% neq 0 goto err -set list=type_01_sw type_08_ps3 type_09_ps4 type_10_psv type_12_psv type_12_psv_2 type_21_sw type_3c_3ds type_3d_3ds type_45_3ds type_59_win type_59_win_2 type_5b_win type_5f_win type_5f_win_2 type_62_ps4 type_62_ps4_2 +set list=type_01_sw type_08_ps3 type_09_ps4 type_10_psv type_12_psv type_12_psv_2^ + type_21_sw type_3c_3ds type_3d_3ds type_45_3ds type_59_win type_59_win_2^ + type_5b_win type_5f_win type_5f_win_2 type_60_ps4 type_62_ps4 type_62_ps4_2 for %%a in (%list%) do ( if exist %%a.g1t.bak move /y %%a.g1t.bak %%a.g1t >NUL 2>&1