Skip to content

Instantly share code, notes, and snippets.

@zturtleman
zturtleman / SeriousTexture.md
Last active May 29, 2021 06:48
Serious Engine 2 .tex file structure.

Serious Engine 2 .tex file structure. | Zack Middleton (zturtleman), April 2021

The beginning of the file is the serialized form of a C++ class, which seems to be the same in most (all?) images.

There is compressed pixel data in a zlib compressed stream (begining with 78 9C). For image type 0, 2, and 6 the pixel data is BGR888. For image type 1, 3, 4, and 5 the pixel data is BGRA8888. For image type 7, 8, and 9 the pixel data is DXT1, DXT3, and DXT5 image data respectfully with a full mipmap pryamid and possibly 6 images for a cubemap (see image flags? and image type? below).

"(marker)" "(string)" are non-null terminated plain text. Markers are typically 4 bytes but start and end markers are 8 and 7 bytes. For strings, the string length proceeds it but it's listed here as well.

"(int32)" and "(uint32)" are signed and unsigned little endian 32-bit integers. Though uint32 is just used here for lengths or counts that negative values wouldn't make sense.

@zturtleman
zturtleman / build-sdl-libs.sh
Last active October 30, 2023 07:24
Scripts for building SDL 2 libraries for Windows (MinGW, MSVC) and macOS.
#!/bin/bash
# Run in SDL 2 source directory on Linux.
# Built libraries will be copied to ./ztm-libs/{win32,win64,macos-ub1,macos-ub2}
#
# Set up:
# 1. Windows libaries:
# Install mingw-w64 for i686 and x86_64
#
# 2. macOS libraries:
# Follow osxcross directions to set up macOS (11.3) SDK to build a Universal 2 (arm64/x86_64) dylib.