49#ifndef OPENSNES_OBJECT_H
50#define OPENSNES_OBJECT_H
119_Static_assert(
sizeof(
t_objs) == 64,
"t_objs must be 64 bytes");
120_Static_assert(__builtin_offsetof(
t_objs,
xpos) == 16,
"xpos offset mismatch");
121_Static_assert(__builtin_offsetof(
t_objs, ypos) == 19,
"ypos offset mismatch");
122_Static_assert(__builtin_offsetof(
t_objs, xvel) == 34,
"xvel offset mismatch");
123_Static_assert(__builtin_offsetof(
t_objs, yvel) == 36,
"yvel offset mismatch");
124_Static_assert(__builtin_offsetof(
t_objs, action) == 46,
"action offset mismatch");
125_Static_assert(__builtin_offsetof(
t_objs, type) == 4,
"type offset mismatch");
126_Static_assert(__builtin_offsetof(
t_objs, width) == 26,
"width offset mismatch");
127_Static_assert(__builtin_offsetof(
t_objs, height) == 28,
"height offset mismatch");
128_Static_assert(__builtin_offsetof(
t_objs, status) == 48,
"status offset mismatch");
129_Static_assert(__builtin_offsetof(
t_objs, onscreen) == 56,
"onscreen offset mismatch");
static const s16 xpos[4]
X positions for the four sprites displayed in a horizontal row.
Definition main.c:54
signed short s16
16-bit signed integer (-32768 to 32767)
Definition types.h:49
unsigned short u16
16-bit unsigned integer (0 to 65535)
Definition types.h:52
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition types.h:46
void objKillAll(void)
Kill all active objects.
void objCollidMapWithSlopes(u16 objhandle)
Check object collision with map tiles including slopes.
void objKill(u16 objhandle)
Kill an object.
u16 objNew(u8 objtype, u16 x, u16 y)
Create a new object.
void objCollidMap1D(u16 objhandle)
Check object collision with map (no gravity)
void objCollidMap(u16 objhandle)
Check object collision with map tiles.
void objInitEngine(void)
Initialize the object engine.
void objLoadObjects(u8 *sourceO)
Load objects from a data table.
void objGetPointer(u16 objhandle)
Get pointer to an object from its handle.
u16 objptr
Current object pointer (byte offset, for internal use)
void objInitGravity(u16 objgravity, u16 objfriction)
Set gravity and friction values.
u16 objgetid
Handle of the last object created by objNew()
u8 objtokill
Set to 1 inside a callback to kill the current object.
void objInitFunctions(u8 objtype, void *initfct, void *updfct, void *reffct)
Register callback functions for an object type.
void objUpdateAll(void)
Update all active objects.
u16 objCollidObj(u16 objhandle1, u16 objhandle2)
Test collision between two objects.
void objRefreshAll(void)
Refresh sprites for all on-screen objects.
void objUpdateXY(u16 objindex)
Update object position from velocity.
t_objs objWorkspace
Object workspace (Bank $00)
Game object data structure.
Definition object.h:77
u8 type
Definition object.h:80
u16 parentID
Definition object.h:107
u16 sprframe
Definition object.h:87
u8 sprflip
Definition object.h:85
u8 onscreen
Definition object.h:110
u8 tempo
Definition object.h:104
u8 sprrefresh
Definition object.h:109
s16 xvel
Definition object.h:96
u16 height
Definition object.h:93
s16 yvel
Definition object.h:97
u16 width
Definition object.h:92
u16 sprblk3216
Definition object.h:84
u16 tilebprop
Definition object.h:101
u16 yofs
Definition object.h:91
u8 hitpoints
Definition object.h:108
u16 tilesprop
Definition object.h:100
u8 nID
Definition object.h:81
u8 count
Definition object.h:105
u16 prev
Definition object.h:78
u8 status
Definition object.h:103
u8 sprpal
Definition object.h:86
u16 sprid3216
Definition object.h:83
u16 xmax
Definition object.h:95
u16 xofs
Definition object.h:90
u8 dir
Definition object.h:106
u16 tileabove
Definition object.h:99
u16 sprnum
Definition object.h:82
u16 tilestand
Definition object.h:98
u16 action
Definition object.h:102
u16 next
Definition object.h:79
u16 xmin
Definition object.h:94