If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler
NEW : You can now close your own issues and reopen them later if needed. You can also comment closed issues.
List of issues#2734 Support DXT Texture Formats
Author:
HOKTempest
HOKTempestDate created:
Type: feature
Visibility: Everybody
Assigned to:
State: new 

All of Bioshock and Bioshock 2 Flash SWF files use DXT5 texture formats for their
spritesheets. Due to FFDEC being unable to properly import these file types in, the
sprites for these Flash Files all show up corrupted and all red-filling. The texture gets
imported into the file with tid: 512.
The main suggestion here that I have is would you be able to add a sort of read-only /
view-only mode for dxt texture files so that the images can be properly loaded into the
decompiler so that the sprites can properly load texture data.
I've included 3 screenshots here showing the red-filling I'm talking about and a
screenshot of the tid: 512 tag.
Here is the sharedlibrary.swf file. The game uses this file to hold all the sprites and
assets for it. This contains the dxt files I mentioned. I had to make a seperate comment
for this cause the site was erroring out when I tried uploading the .swf to the starter
post.
sharedlibrary.swf (74,423 KiB)How can I convert such data into an image?
I tried some DXT5 decoder but the decoded image does not look good (see attachment).
What is the algorithm for this - what is the format of tag type 512 used in this SWF?
The 512 tag seems to be a custom tag BioShock used in its Scaleform GFxTexture system to
embed DXT compressed textures directly into the SWF file.
I took a screenshot of the hex dump.
Heres what I know from the format hex here:
Here is an example from CharacterID 1 from within the .swf I uploaded earlier :
01 00 (Bytes 0-1) = Character ID (1)
40 00 (Bytes 2-3) = Width (64)
40 00 (Bytes 4-5) = Height (64)
04 00 00 00 (Bytes 6-9) = Format ID (4 = DXT5) (0 = DXT1) (These are the only two ids I
know at the moment.)
00 00 00 00 ... (Byte 10 (0xA) onward) = The actual DXT5 pixel data starts here.
I managed to manually export the texture file by stripping that 10-byte image metadata and
just appending a normal 128-byte DDS header in front of the raw pixel data. I've uploaded
the resulting .dds file for Character ID 1, which looks like a texture for a joystick
icon.
hexdump.png (263 KiB)
char_1_exported.dds (4 KiB)