summaryrefslogtreecommitdiff
path: root/docs/otr_format/light.md
blob: f487b2e43eacbcb7768073dcfad98d2c380cb134 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@page otr_light Light Resource
# Light Resource (LGTS)

If the Resource Type is `LGTS` (`0x46669697`), the header is immediately followed by the light definition.

## Light Header

| Offset | Size | Type | Description |
| :--- | :--- | :--- | :--- |
| 0x40 | 24 | Lights1 | The Lights1 structure containing ambient and diffuse light data. |

### Lights1 Structure

The `Lights1` structure (24 bytes) consists of:

1.  **Ambient (8 bytes)**
    *   `col[3]` (u8): Ambient RGB color.
    *   `pad1` (i8): Padding.
    *   `colc[3]` (u8): Copy of ambient RGB color.
    *   `pad2` (i8): Padding.

2.  **Diffuse (16 bytes)**
    *   `col[3]` (u8): Diffuse RGB color.
    *   `pad1` (i8): Padding.
    *   `colc[3]` (u8): Copy of diffuse RGB color.
    *   `pad2` (i8): Padding.
    *   `dir[3]` (i8): Light direction (normalized).
    *   `pad3` (i8): Padding.

## YAML Configuration

To define a light asset in the configuration, use the `LIGHTS` type.

| Field | Type | Description |
| :--- | :--- | :--- |
| `type` | String | Must be `LIGHTS`. |
| `offset` | Integer | The offset of the light structure in the ROM/binary. |
| `symbol` | String | (Optional) The symbol name for the asset. |

Example:
```yaml
- type: LIGHTS
  offset: 0x4000
  symbol: my_light
```