Alchemy
Loading...
Searching...
No Matches

field_coordinate.h

Go to the documentation of this file.
1#ifndef ALCHEMY_FIELD_COORDINATE_H
2#define ALCHEMY_FIELD_COORDINATE_H
3
4/// @file
5/// FieldCoordinate, a position on the field.
6
7#include "types.h"
8#include "static_assert.h"
9
10/// A field coordinate, read whole or as its fraction and its whole pixels.
12 s32 fixed; ///< 16.16 fixed-point pixels
13 struct {
14 u16 fraction; ///< 1/65536 pixels
15 s16 pixel; ///< pixels
17};
18
19STATIC_ASSERT(sizeof(union FieldCoordinate) == 4);
20STATIC_ASSERT(offsetof(union FieldCoordinate, part.pixel) == 2);
21
22#endif
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 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
A field coordinate, read whole or as its fraction and its whole pixels.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels