Skip to main content

Module platform

Module platform 

Source
Expand description

Switch GOB layout and Xbox byte pairs, before crunch/decode/crop. The table and GOB order are helpers/TextureSwizzler.py:6-10, :73-103; padding is :106-114, deswizzle :17-41. Converter ordering and RGB promotion: export/Texture2DConverter.py:254-320.

Structs§

SwitchLayout
Checked dimensions and strides for Switch’s 4 by 8 GOBs of 16-byte texels.

Enums§

PlatformError
Platform requests with no reference, or sizes that cannot be processed safely.

Functions§

astc_context_decode
Standalone ASTC context decompression with top-down output, for all legal 2D footprints.
decode_in
Apply platform transforms before crunch/unpacking, then decode, crop and flip as UnityPy does. Ordinary callers keep using crate::decode.
decode_in_as
Apply platform transforms while retaining a selected Crunch fork. Switch RGB24/BGR24 promotion still chooses the four-channel decoder.
deswizzle
Deswizzle mip zero; preserve UnityPy’s output length and zeroed tail. Short padded data is refused before allocating; Python’s resizing slice assignments on truncated data have no bounded texture interpretation.
plan_in
Platform-aware counterpart of crate::plan. Scratch includes the transformed input, padded image, final crop and decoder tables while live.
plan_in_as
Platform-aware planning retaining the decoder chosen by crate::select_in. In particular, Unity and legacy DXT Crunch share a numeric format value.
swap_bytes_for_xbox
Swap every pair, keeping an odd last byte (export/Texture2DConverter.py:323-328).
switch_block
The complete 29-entry 16-byte texel table, independent of linked decoders.
switch_layout
Pad to whole GOB blocks using the blob’s little-endian exponent.
swizzle
Inverse of deswizzle, using the same checked layout and GOB order. UnityPy’s write loop is helpers/TextureSwizzler.py:44-69.
unpack_crunch
Unpacks mip zero before an extension-supplied texture converter is called. The format selects the same Crunch fork as the ordinary decode path.