TODO
Textures are stored in the /data/textures
directory. These are roughly sorted out by level, similar to how .glo files are stored. The /data/textures/generic
folder is used for shared textures common to multiple levels. Textures are specified in a variety of common formats: .bmp, .gif, .png, and .tga.
Each face and sprite has a corresponding 16-character textureName
that identifies a texture somewhere within /data/textures/…
. These names can be duplicated across multiple faces/sprites. These correspond to just the name of the corresponding texture; directory names in the path are omitted. To find the matching texture, it is necessary to search through all directories that match /data/textures/[level directory]/…
and /data/textures/generic/…
.
Since textures generally only use a 1-bit alpha channel, transparent pixels in .bmp textures are encoded as the color #FF00FF, i.e. magenta.
type Glo {
char[4] magic = "GLO\0";
u16 version;
u16 objectCount;
GloObject[objectCount] objects;
}
type Object {
u16 animSegCount;
AnimSeg[animSegCount] animSegs;
u16 meshCount;
Mesh[meshCount] meshes;
}
// TODO: Figure this out
enum AnimSegFlags : u32 {
}
type AnimSeg {
char[24] name;
u32 startFrame;
u32 endFrame;
AnimSegFlags flags;
f32 speed;
}
// TODO: Figure this out
enum MeshFlags : u16 {
}
type Mesh {
char[24] name;
# Animation Data
u16 moveKeyCount;
XyzKey[moveKeyCount] moveKeys;
u16 scaleKeyCount;
XyzKey[scaleKeyCount] scaleKeys;
u16 rotateKeyCount;
QuaternionKey [rotateKeyCount] rotateKeys;
u16 vertexCount;
Xyz[vertexCount] vertices;
u16 faceCount;
Face[faceCount] faces;
u16 spriteCount;
Sprite[spriteCount] sprites;
u16 translucency;
MeshFlags flags;
u16 hasChild;
Mesh? child;
u16 hasNext;
Mesh? next;
}
type XyzKey {
u32 time;
Xyz xyz;
}
type QuaternionKey {
u32 time;
Quaternion quaternion;
}
// TODO: Figure this out
enum FaceFlags : u16 {,
ENABLE_BACKFACE_CULLING = 0x4,
}
type Face {
char[16] textureFilename;
Color color;
FaceFlags flags;
VertexRef[3] vertexRefs;
}
type VertexRef {
u16 index;
// UV coords
f32 u;
f32 v;
}
// TODO: Figure this out
enum SpriteFlags : u16 {
}
type Sprite {
char[16] textureFilename;
Color color;
Xyz position;
Xy size;
SpriteFlags flags;
}
type Xy {
f32 x;
f32 y;
}
type Xyz {
f32 x;
f32 y;
f32 z;
}
type Quaternion {
f32 x;
f32 y;
f32 z;
f32 w;
}
type Color {
u8 r;
u8 g;
u8 b;
u8 a;
}