Coder Social home page Coder Social logo

neiljed / vtflib Goto Github PK

View Code? Open in Web Editor NEW
154.0 10.0 45.0 176 KB

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.

License: GNU Lesser General Public License v2.1

C 8.49% C++ 91.45% Batchfile 0.06%
vtf vtflib valve steam image-processing dxt

vtflib's People

Contributors

jaroslucky avatar neiljed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vtflib's Issues

Support for .xtf

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)

Unhandled exception on Import

Error report:
See the end of this message for details on invoking \njust-in-time (JIT) debugging instead of this dialog box.\n\n************** Exception Text *************\nSystem.PlatformNotSupportedException: Operation is not supported on this platform.
at VTFEdit.CVTFEdit.SetVTFFile (VTFLib.CVTFFile
VTFFile) [0x006d8] in <5171360439d041378fa6d6fbba48e202>:0
at VTFEdit.CVTFEdit.Import (System.String[] sFileNames) [0x00291] in <5171360439d041378fa6d6fbba48e202>:0
at VTFEdit.CVTFEdit.btnImport_Click (System.Object sender, System.EventArgs e) [0x0001a] in <5171360439d041378fa6d6fbba48e202>:0
at System.Windows.Forms.MenuItem.OnClick (System.EventArgs e) [0x00078] in :0
at System.Windows.Forms.MenuItem+MenuItemData.Execute () [0x0000b] in :0
at System.Windows.Forms.Command.Invoke () [0x0001c] in :0
at System.Windows.Forms.Command.DispatchID (System.Int32 id) [0x00014] in :0
at System.Windows.Forms.Control.WmCommand (System.Windows.Forms.Message& m) [0x00021] in :0
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00357] in :0
at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message& m) [0x00043] in :0
at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message& m) [0x0001a] in :0
at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message& m) [0x00318] in :0
at VTFEdit.CVTFEdit.WndProc (System.Windows.Forms.Message& e) [0x00032] in <5171360439d041378fa6d6fbba48e202>:0
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage (System.Windows.Forms.Message& m) [0x00001] in :0
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x000b3] in :0
at System.Windows.Forms.NativeWindow.Callback (System.Windows.Forms.Message& m) [0x00025] in :0

\n************** Loaded Assemblies \nmscorlib\n Assembly Version: 4.0.0.0\n Win32 Version: 4.6.57.0\n CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/4.5/mscorlib.dll\n----------------------------------------\nVTFEdit\n Assembly Version: 0.0.0.0\n Win32 Version: 1.3.3\n CodeBase: file:///Z:/home/REDACTED/Documents/source/tools/vtfedit/VTFEdit.exe\n----------------------------------------\nmsvcm80\n Assembly Version: 8.0.50727.6195\n Win32 Version: 8.00.50727.6195\n CodeBase: file:///C:/windows/winsxs/amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_deadbeef/msvcm80.dll\n----------------------------------------\nSystem.Windows.Forms\n Assembly Version: 4.0.0.0\n Win32 Version: 4.6.57.0\n CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/System.Windows.Forms/4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll\n----------------------------------------\nSystem\n Assembly Version: 4.0.0.0\n Win32 Version: 4.6.57.0\n CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll\n----------------------------------------\nSystem.Drawing\n Assembly Version: 4.0.0.0\n Win32 Version: 4.6.57.0\n CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll\n----------------------------------------\nAccessibility\n Assembly Version: 4.0.0.0\n Win32 Version: \n CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/Accessibility/4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll\n----------------------------------------\nSystem.Configuration\n Assembly Version: 4.0.0.0\n Win32 Version: 4.6.57.0\n CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll\n----------------------------------------\nI18N\n Assembly Version: 4.0.0.0\n Win32 Version: 4.0.0.0\n CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/I18N/4.0.0.0__0738eb9f132ed756/I18N.dll\n----------------------------------------\nI18N.West\n Assembly Version: 4.0.0.0\n Win32 Version: 4.0.0.0\n CodeBase: file:///C:/windows/mono/mono-2.0/lib/mono/gac/I18N.West/4.0.0.0__0738eb9f132ed756/I18N.West.dll\n----------------------------------------\n\n JIT Debugging **************\n

Errors compiling with nvDXT

nvDXT is a legacy library compiled with an older version of Visual Studio. Due to "breaking changes" introduced in Visual Studio 2015 there are a large number of errors that occur when trying to link it.

These needs to be fixed or, more practically, the legacy nvDXT library needs to be replaced.

Visual Studio solution is out of date.

The Visual Studio Solution in VTFLIb 1.3.2 is out of date for current editions of Visual Studio.

A new version needs to be created with the relevant settings.

[Feature request] Conversion between DDS and VTF, without reencoding

The DDS file format supports all of the same image formats as VTF (plus more), so there should be an option when importing a DDS file to retain source format or something along those lines (as long as the source DDS uses a compatible format and is a power of 2). Such an option would copy the image data and any mipmaps over to a VTF file (and create thumbnails, info resources, etc. if the user requests), while avoiding introducing green tint to DXTn or BGR565 textures and other lossy conversion issues.

Additionally, there could be an option to export as DDS, using the same image format as the source VTF.

I'm pretty sure this would be possible; while I am not familiar with the nitty gritty, I'd imagine that the image data itself can just be copied over, since both file formats encode the image using little endian with the same image formats designed for the GPU.

Can't open it

For some reason, The app won't open for me I tried to re-install it twice and it still won't launch.

Its not my first time using it but after my last format for the PC I'm trying to open it and it won't launch.
Please help.

Fix Memory Leak

https://github.com/NeilJed/VTFLib/blob/master/VTFLib/VTFFile.cpp#L659-L679

If the result is successful, then the allocated memory is not cleared. This adds deallocate memory if the result is successful.

VTFEdit does not open

I try to open the program and it does not open, I use x86 architecture and I installed what is necessary for x86 and it still does not open

i use exagear emulator :v

DevIL library is out of date.

VTFEdit and VTFCmd expect an old version of DevIL which is no longer available. Newer versions have vastly changed codewise and don't work as a direct drop-in replacement.

VTFEdit and VTFCmd need to be updated to either use a newer version of DevIL or switch to a different image input/output library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.