Alchemy
Loading...
Searching...
No Matches

cursor.h

Go to the documentation of this file.
1#ifndef ALCHEMY_CURSOR_H
2#define ALCHEMY_CURSOR_H
3
4/// @file
5/// The cursor that approaches its target, shared by shops, name entry and
6/// settings.
7
8#include "types.h"
9#include "static_assert.h"
10#include "render_input.h"
11
12/// Cursor that approaches its target, shared by shop, name entry and settings.
13struct ShopCursor {
14 struct RenderOutput *anchor; ///< the cursor's sprite, moved with its OAM
15 u16 x; ///< screen pixels: where the current move started
16 u16 y; ///< screen pixels: where the current move started
17 s16 targetX; ///< screen pixels
18 s16 targetY; ///< screen pixels
19 s8 active; ///< frames of the current move done; reset when it ends
20 s8 kind; ///< frames the move takes; 0 when the cursor is still
21};
22
23STATIC_ASSERT(sizeof(struct ShopCursor) == 0x10);
24STATIC_ASSERT(offsetof(struct ShopCursor, targetX) == 0x08);
26
27/// A menu cursor: its render output, or the cursor that approaches its target.
28// Screens that write only the image pointer use the union to retain store
29// order.
31 struct RenderOutput *output; ///< the image alone; cursor.anchor
33};
34
35#endif
The sprite renderer's inputs and outputs: render inputs, OAM attributes and render output lists.
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 render output: a sprite in a window's output list (a character, an icon or a portrait),...
s8 active
its UI_SPRITE_ motion; 0 while free
Cursor that approaches its target, shared by shop, name entry and settings.
Definition cursor.h:13
s16 targetY
screen pixels
Definition cursor.h:18
u16 x
screen pixels: where the current move started
Definition cursor.h:15
s8 kind
frames the move takes; 0 when the cursor is still
Definition cursor.h:20
u16 y
screen pixels: where the current move started
Definition cursor.h:16
struct RenderOutput * anchor
the cursor's sprite, moved with its OAM
Definition cursor.h:14
s8 active
frames of the current move done; reset when it ends
Definition cursor.h:19
s16 targetX
screen pixels
Definition cursor.h:17
The integer types, TRUE, UNUSED and the fixed-address macros.
signed char s8
Definition types.h:10
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
A menu cursor: its render output, or the cursor that approaches its target.
Definition cursor.h:30
struct ShopCursor cursor
Definition cursor.h:32
struct RenderOutput * output
the image alone; cursor.anchor
Definition cursor.h:31