Common file format types

From Arx Libertatis Wiki
Revision as of 06:18, 11 February 2012 by Ds (talk | contribs)
Jump to navigation Jump to search

This page describes types common to various Arx Fatalis file formats.

Numbers

All integers are encoded in little-endian byte order. Types are the same as in platform/Platform.h - s (signed integer) / u (unsigned integer) / f (float), followed by the number of bits.

Example: u32 is an unsigned 32-bit integer.

Arrays

Arrays are denoted by brackets like in c++.

Example: u32[64] is an array of 64 unsigned 32-bit integers.

C Strings

Types described as c string are variably sized strings that are terminated with a null-byte.

The original Arx Fatalis code did not define an encoding for this name and presumably only allowed ASCII characters. Unless noted otherwise, Arx Libertatis interprets c strings as UTF-8.

Fixed-length strings

Fixed length strings used the array syntax with the component type char. All unused bytes of fixed length strings are set to zero.

Unless noted otherwise, Arx Libertatis interprets fixed length strings as UTF-8.

Example: char[128] is a fixed length string of (max) 128 bytes.