|
| 1 | +meta: |
| 2 | + id: tex |
| 3 | + title: Texture Data File |
| 4 | + application: LEGO Island |
| 5 | + file-extension: tex |
| 6 | + license: CC0-1.0 |
| 7 | + endian: le |
| 8 | + |
| 9 | +doc: | |
| 10 | + Texture data format for LEGO Island (1997). Contains one or more named |
| 11 | + textures with 8-bit indexed color image data. |
| 12 | +
|
| 13 | + Texture data is embedded in SI (Interleaf) container files and parsed by |
| 14 | + LegoTexturePresenter::Read(). Each texture consists of a length-prefixed |
| 15 | + name followed by image data with a color palette and pixel indices. |
| 16 | +
|
| 17 | + The image format is shared with the world database (world.wdb) texture |
| 18 | + data, using the same LegoImage and LegoPaletteEntry serialization. |
| 19 | +
|
| 20 | + File structure: |
| 21 | + 1. Texture count |
| 22 | + 2. Named texture entries - name + palette + pixel data |
| 23 | +
|
| 24 | +seq: |
| 25 | + - id: num_textures |
| 26 | + type: u4 |
| 27 | + doc: Number of textures in this file. |
| 28 | + - id: textures |
| 29 | + type: named_texture |
| 30 | + repeat: expr |
| 31 | + repeat-expr: num_textures |
| 32 | + doc: Array of named textures. |
| 33 | + |
| 34 | +types: |
| 35 | + named_texture: |
| 36 | + doc: | |
| 37 | + A named texture with 8-bit indexed color image data. |
| 38 | + seq: |
| 39 | + - id: name_length |
| 40 | + type: u4 |
| 41 | + doc: Length of the texture name buffer in bytes. |
| 42 | + - id: name |
| 43 | + type: str |
| 44 | + size: name_length |
| 45 | + encoding: ASCII |
| 46 | + terminator: 0 |
| 47 | + doc: | |
| 48 | + Texture name (e.g., "dbfrfn.gif"). The name is a null-terminated |
| 49 | + C string within the allocated buffer. Bytes after the null |
| 50 | + terminator are unused padding and consumed but not included |
| 51 | + in the string value. |
| 52 | + - id: image |
| 53 | + type: image |
| 54 | + doc: The texture image data. |
| 55 | + |
| 56 | + image: |
| 57 | + doc: | |
| 58 | + An 8-bit indexed color image with palette. Parsed by LegoImage::Read(). |
| 59 | + seq: |
| 60 | + - id: width |
| 61 | + type: u4 |
| 62 | + doc: Image width in pixels. |
| 63 | + - id: height |
| 64 | + type: u4 |
| 65 | + doc: Image height in pixels. |
| 66 | + - id: palette_size |
| 67 | + type: u4 |
| 68 | + doc: Number of entries in the color palette (max 256). |
| 69 | + - id: palette |
| 70 | + type: palette_entry |
| 71 | + repeat: expr |
| 72 | + repeat-expr: palette_size |
| 73 | + doc: Color palette entries. |
| 74 | + - id: pixels |
| 75 | + size: width * height |
| 76 | + doc: | |
| 77 | + Pixel data as palette indices. Each byte is an index into |
| 78 | + the palette array. |
| 79 | +
|
| 80 | + palette_entry: |
| 81 | + doc: RGB color palette entry. Parsed by LegoPaletteEntry::Read(). |
| 82 | + seq: |
| 83 | + - id: red |
| 84 | + type: u1 |
| 85 | + doc: Red component (0-255). |
| 86 | + - id: green |
| 87 | + type: u1 |
| 88 | + doc: Green component (0-255). |
| 89 | + - id: blue |
| 90 | + type: u1 |
| 91 | + doc: Blue component (0-255). |
0 commit comments