VgaGames4 - object man-pages

[.. upper level ..]

struct VG_Object

Structure for game objects.

ELEMENTS
char objid[VG_OBJID_SIZE] Object-ID (e.g. name of object)
int subid Arbitrary sub-ID for object-ID, (default: 0 = no sub-ID)
int drawlevel Level-number for drawing order (begins with 1 = lowest level)
unsigned int instanceid Instance-ID for the instance of this object
unsigned int parent_instanceid Instance-ID for the parent-instance of this object, or 0 = not relevant
void *opriv Private struct for this object-instance
void (*f_free)(
void *vgame,
void *opriv
)
free()-function: destroy private struct for this object-instance - parameters: - vgame: private structure of the game, or NULL if not existing - opriv: private struct for this object-instance
VG_BOOL (*f_run)(
void *vgame,
struct VG_Object *objp
)
run()-function: moving object-instance (without drawing) - parameters: - vgame: private structure of the game, or NULL if not existing - objp: object-instance to move - return value: - VG_TRUE = OK - VG_FALSE = user-defined (causes vg4->object->call_run() to return VG_FALSE)
void (*f_draw)(
void *vgame,
struct VG_Object *objp
)
draw()-function: drawing object-instance - parameters: - vgame: private structure of the game, or NULL if not existing - objp: object-instance to draw
int (*f_data)(
void *vgame,
struct VG_Object *objp,
void *vptr
)
data()-function: getting/setting data of this object-instance - parameters: - vgame: private structure of the game, or NULL if not existing - objp: object-instance - vptr: arbitrary parameter for getting/setting - return value: arbitrary value, but should not be -255
void (*f_childexit)(
void *vgame,
struct VG_Object *objp,
struct VG_Object *child_objp
)
childexit()-function: a child of this object-instance is being destroyed - parameters: - vgame: private structure of the game, or NULL if not existing - objp: object-instance - child_objp: child-object-instance which is being destroyed