7 void UpdateBlockStates(void);
8 int CountType(int objtype
);
11 void PhysicsSim(void);
13 int IsRearTopAttack(Object
*o
);
15 void CullDeleted(void);
16 void DestroyAll(bool delete_player
);
18 Object
*FindByType(int type
);
22 #define CountObjectsOfType Objects::CountType
23 #define FOREACH_OBJECT(O) for(O=firstobject; O; O=O->next)
25 // max expected objects to exist at once (for buffer allocation)
26 #define MAX_OBJECTS 1024
28 enum CreateObjectFlags
30 CF_NO_SPAWN_EVENT
= 0x01, // inhibit calling OnSpawn
35 Object
*CreateObject(int x
, int y
, int type
);
36 Object
*CreateObject(int x
, int y
, int type
, int xinertia
, int yinertia
, \
37 int dir
=0, Object
*linkedobject
=NULL
, uint32_t createflags
=CF_DEFAULT
);
40 // ObjProp definitions
45 int shaketime
; // how long it shakes for when hit
47 uint32_t defaultnxflags
;
53 int hurt_sound
, death_sound
;
56 uint32_t defaultflags
;
61 // executed every tick
62 void (*ontick
)(Object
*o
);
63 // executed after physics sim has been done
64 void (*aftermove
)(Object
*o
);
65 // if present, then when damage to the object causes it's hp to <= 0,
66 // this is executed instead of destroying the object or following the
67 // normal boom/spawn powerups routine.
68 void (*ondeath
)(Object
*o
);
69 // executed when the object is first created or it's type is changed.
70 // intended for static objects which only require a small amount of
71 // initilization. This is NOT guaranteed to be only called exactly once
72 // for a given object.
73 void (*onspawn
)(Object
*o
);
78 extern ObjProp objprop
[OBJ_LAST
];
79 extern Object
*firstobject
, *lastobject
;
80 extern Object
*lowestobject
, *highestobject
;