Alchemy
Loading...
Searching...
No Matches

glyph.h

Go to the documentation of this file.
1#ifndef ALCHEMY_GLYPH_H
2#define ALCHEMY_GLYPH_H
3
4/// @file
5/// Font glyphs and their palettes.
6
7#include "types.h"
8#include "edition.h"
9#include "static_assert.h"
10
11#if LANGUAGE == LANGUAGE_JAPANESE
12enum { FONT_GLYPH_ROWS = 12 };
13#else
14enum { FONT_GLYPH_ROWS = 15 };
15#endif
16
17/// A compact palette shared by a selection's command icons: the slot each
18/// icon colour was given, or 255 for none yet, and how many slots are taken.
20 u8 slot[256];
22};
23
24STATIC_ASSERT(sizeof(struct GlyphPalette) == 0x104);
25STATIC_ASSERT(offsetof(struct GlyphPalette, count) == 0x100);
26
27/// A character of the text font: its width and its rows of pixels.
28struct FontGlyph {
29 u16 width; ///< pixels
31} __attribute__((packed, aligned(2)));
32
33STATIC_ASSERT(offsetof(struct FontGlyph, rows) == 2);
34STATIC_ASSERT(sizeof(struct FontGlyph) == (2 + FONT_GLYPH_ROWS * 2));
35
36extern const struct FontGlyph gUiText_Glyphs[];
37
38typedef struct {
39 u8 input[0x400];
40 u8 tiles[0x200];
45
46STATIC_ASSERT(sizeof(GlyphTransfer) == 0x608);
50
51#endif
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
@ FONT_GLYPH_ROWS
Definition glyph.h:14
const struct FontGlyph gUiText_Glyphs[]
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
A character of the text font: its width and its rows of pixels.
Definition glyph.h:28
u16 width
pixels
Definition glyph.h:29
u16 rows[FONT_GLYPH_ROWS]
Definition glyph.h:30
A compact palette shared by a selection's command icons: the slot each icon colour was given,...
Definition glyph.h:19
s32 count
Definition glyph.h:21
u8 slot[256]
Definition glyph.h:20
u8 input[0x400]
Definition glyph.h:39
s16 width
Definition glyph.h:41
u8 tiles[0x200]
Definition glyph.h:40
s16 height
Definition glyph.h:42
u8 * encoded
Definition glyph.h:43
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11