Skip to content

Commit

Permalink
gust_g1t: add type 0x60 support
Browse files Browse the repository at this point in the history
* With thanks to RebootRevival for the required code changes
* Closes #45
  • Loading branch information
VitaSmith committed Aug 17, 2021
1 parent 02fbbf0 commit 5ad8905
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .vs/gust_g1t.vcxproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>ps3\c_bf.g1t</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>ps4\cnn_battlehelp_image001.g1t</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerWorkingDirectory>$(SolutionDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>ps3\c_bf.g1t</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>ps4\cnn_battlehelp_image001.g1t</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommandArguments>ps3\c_bf.g1t</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>ps4\cnn_battlehelp_image001.g1t</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>$(SolutionDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerCommandArguments>ps3\c_bf.g1t</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>ps4\cnn_battlehelp_image001.g1t</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>$(SolutionDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions gust_g1t.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion test_g1t.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ad8905

Please sign in to comment.