notscuffed / repkg

Wallpaper engine PKG extractor/TEX to image converter
MIT License
2.01k stars 219 forks source link

Support for TEXS0001 and mipmaps with rotated frames #27

Closed vitalline closed 3 years ago

vitalline commented 3 years ago

Support for TEXS0001 headers ported from Wallpaper Engine plugin for KDE. Basically the same as TEXS0002, except using Int32 in most places.

More on the rotated frames: When unpacking a wallpaper, I found a texture file that had the two "unknown" variables used for the last 4 frames. Upon closer inspection, it turned out those variables are used to denote the height and width of the mipmap part used for the frame if (and only if) the frame is rotated in the mipmap. Namely, Unk0 is the distance on the Y axis corresponding to the width of the original frame (hence WidthY), and Unk1 is the distance on the X axis corresponding to the height of the original frame (hence HeightX). Both have signs corresponding to the relative direction of the frame (WidthY being negative and HeightX being positive means that the frame is drawn bottom-to-top and left-to-right, respectively). Attached is the texture file (packed to .zip because GitHub does not allow .tex files) and the corresponding mipmap.

11999c71119c2b1495b54f6c2cf75d18.zip 11999c71119c2b1495b54f6c2cf75d18.png