NeilJed / VTFLib

VTFLib is a LGPL open source programming library that provides a C and C++ API for reading and writing Valve VTF and VMT format image files.
GNU Lesser General Public License v2.1
159 stars 52 forks source link

Support for .xtf #9

Open jokubasver opened 3 years ago

jokubasver commented 3 years ago

It would be nice to have support for .xtf (.vtf equivalent used in the Original Xbox port of HL2) with VTFLib.

I'm providing some info of .xtf:

Discussion on the format: https://forum.xentax.com/viewtopic.php?t=2101

Some header files from ancient Source SDK code, that include .xtf file header information and various other info on .xtf (check _XBOX defines, and also XTF lines):

vtf.h: https://pastebin.com/4mtE8zdj imageformat.h: https://pastebin.com/VHjfxc3f swizzler.h: https://pastebin.com/Km8Dc4fj

Example .xtf file: https://anonfiles.com/NfG7Ie5cpd/alyx_sheet_xtf

Currently I am able to to convert .xtf to .dds using gssmt (linked in the xentax forum, it's the last post), and then I am able to convert .dds to .xtf by hex editing the .dds, replacing the first bytes from an original .xtf file. This obviously has issues, as there's no room for any changes (like resolution and such)

NeilJed commented 3 years ago

I remember when we first started VTFLib we made the decision not to support the XBox format as no modders were developing for XBox and we had no access to any Xbox format files to test with.

It probably could be added back in but it won't be a quick job. The general "fixing" of the libary and tools needs to happen first.

jokubasver commented 3 years ago

Thanks for responding.

I started modding the Xbox port quite heavily, there's some other people involved, so after years it's starting to happen lol.

If you do decide to add support for XTF, it would be great!