Alchemy
Loading...
Searching...
No Matches

palqueue.h

Go to the documentation of this file.
1#ifndef ALCHEMY_PALQUEUE_H
2#define ALCHEMY_PALQUEUE_H
3
4/// @file
5/// Palette snapshots and their work.
6
7#include "edition.h"
8#include "types.h"
9#include "static_assert.h"
10
11/// A palette cycle: a run of up to 16 background palette colours, saved and
12/// rotated by one colour every delay + 1 frames.
14 u16 *source; ///< the first colour of the run, in BG palette RAM
15 u16 position; ///< colours rotated so far, 0 to count - 1
16 u16 timer; ///< frames until the next rotation
17 s16 delay; ///< frames; the timer restarts from it
18 u16 count; ///< colours in the run
19 u16 colors[16]; ///< the run's colours as saved when the cycle was added
20};
21
22/// The palette cycling queue (heap slot 28): four cycles and how many are in
23/// use.
26 /// Cycles in use, 0 to 4; PaletteQueue_StepCycles masks four to none.
28};
29
30STATIC_ASSERT(sizeof(struct PaletteSnapshot) == 0x2c);
35STATIC_ASSERT(sizeof(struct PaletteSnapshotWork) == 0xb4);
37
38#endif
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
Definition stddef.h:19
The palette cycling queue (heap slot 28): four cycles and how many are in use.
Definition palqueue.h:24
struct PaletteSnapshot entries[4]
Definition palqueue.h:25
u16 count
Cycles in use, 0 to 4; PaletteQueue_StepCycles masks four to none.
Definition palqueue.h:27
A palette cycle: a run of up to 16 background palette colours, saved and rotated by one colour every ...
Definition palqueue.h:13
s16 delay
frames; the timer restarts from it
Definition palqueue.h:17
u16 count
colours in the run
Definition palqueue.h:18
u16 colors[16]
the run's colours as saved when the cycle was added
Definition palqueue.h:19
u16 * source
the first colour of the run, in BG palette RAM
Definition palqueue.h:14
u16 position
colours rotated so far, 0 to count - 1
Definition palqueue.h:15
u16 timer
frames until the next rotation
Definition palqueue.h:16
The integer types, TRUE, UNUSED and the fixed-address macros.
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13