sgdk
object.h
Go to the documentation of this file.
00001 
00024 #ifndef _OBJECT_H_
00025 #define _OBJECT_H_
00026 
00027 #include "pool.h"
00028 
00029 
00033 #define OBJ_ALLOCATED       0x8000
00034 
00035 
00036 
00037 // forward
00038 typedef struct Object_ Object;
00039 
00047 typedef void ObjectCallback(Object* obj);
00048 
00064 typedef struct Object_
00065 {
00066     u16 internalState;
00067     u16 type;
00068     ObjectCallback* init;
00069     ObjectCallback* update;
00070     ObjectCallback* end;
00071 } Object;
00072 
00073 
00087 Pool* OBJ_createObjectPool(u16 size, u16 objectSize);
00088 
00101 Object* OBJ_create(Pool* pool);
00117 void OBJ_release(Pool* pool, Object* object, bool maintainCoherency);
00118 
00128 void OBJ_updateAll(Pool* pool);
00129 
00142 void OBJ_setInitMethod(Object* object, ObjectCallback* initMethod);
00155 void OBJ_setUpdateMethod(Object* object, ObjectCallback* updateMethod);
00168 void OBJ_setEndMethod(Object* object, ObjectCallback* endMethod);
00169 
00170 
00171 #endif // _OBJECT_H_
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines