44#ifndef _orxSTRUCTURE_H_
45#define _orxSTRUCTURE_H_
57#define orxSTRUCTURE_GET_POINTER(STRUCTURE, TYPE) ((orx##TYPE *)_orxStructure_GetPointer(STRUCTURE, orxSTRUCTURE_ID_##TYPE))
59#define orxSTRUCTURE(STRUCTURE) ((((STRUCTURE) != orxNULL) && (((((orxSTRUCTURE *)STRUCTURE)->u64GUID & orxSTRUCTURE_GUID_MASK_STRUCTURE_ID) >> orxSTRUCTURE_GUID_SHIFT_STRUCTURE_ID) < orxSTRUCTURE_ID_NUMBER)) ? (orxSTRUCTURE *)(STRUCTURE) : (orxSTRUCTURE *)orxNULL)
61#define orxANIM(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, ANIM)
62#define orxANIMPOINTER(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, ANIMPOINTER)
63#define orxANIMSET(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, ANIMSET)
64#define orxBODY(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, BODY)
65#define orxCAMERA(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, CAMERA)
66#define orxCLOCK(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, CLOCK)
67#define orxFONT(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, FONT)
68#define orxFRAME(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, FRAME)
69#define orxFX(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, FX)
70#define orxFXPOINTER(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, FXPOINTER)
71#define orxGRAPHIC(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, GRAPHIC)
72#define orxOBJECT(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, OBJECT)
73#define orxSOUND(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, SOUND)
74#define orxSOUNDPOINTER(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, SOUNDPOINTER)
75#define orxSHADER(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, SHADER)
76#define orxSPAWNER(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, SPAWNER)
77#define orxTEXT(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, TEXT)
78#define orxTEXTURE(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, TEXTURE)
79#define orxTIMELINE(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, TIMELINE)
80#define orxTRIGGER(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, TRIGGER)
81#define orxVIEWPORT(STRUCTURE) orxSTRUCTURE_GET_POINTER(STRUCTURE, VIEWPORT)
85#define orxSTRUCTURE_REGISTER(TYPE, STORAGE_TYPE, MEMORY_TYPE, BANK_SIZE, UPDATE_FUNCTION) \
86 orxStructure_Register(orxSTRUCTURE_ID_##TYPE, STORAGE_TYPE, MEMORY_TYPE, sizeof(orx##TYPE), BANK_SIZE, UPDATE_FUNCTION)
90#define orxSTRUCTURE_ASSERT(STRUCTURE) \
91 orxASSERT((STRUCTURE != orxNULL) && (((((orxSTRUCTURE *)(STRUCTURE))->u64GUID & orxSTRUCTURE_GUID_MASK_STRUCTURE_ID) >> orxSTRUCTURE_GUID_SHIFT_STRUCTURE_ID) < orxSTRUCTURE_ID_NUMBER));
95#define orxSTRUCTURE_GUID_MAGIC_TAG_DELETED 0xDEFACED0DEADC0DEULL
99#define orxSTRUCTURE_GUID_MASK_STRUCTURE_ID 0x00000000000000FFULL
100#define orxSTRUCTURE_GUID_SHIFT_STRUCTURE_ID 0
102#define orxSTRUCTURE_GUID_MASK_ITEM_ID 0x00000000FFFFFF00ULL
103#define orxSTRUCTURE_GUID_SHIFT_ITEM_ID 8
105#define orxSTRUCTURE_GUID_MASK_INSTANCE_ID 0xFFFFFFFF00000000ULL
106#define orxSTRUCTURE_GUID_SHIFT_INSTANCE_ID 32
111typedef enum __orxSTRUCTURE_ID_t
150typedef enum __orxSTRUCTURE_STORAGE_TYPE_t
163typedef struct __orxSTRUCTURE_t
206 const orxSTRING zResult;
208#define orxSTRUCTURE_DECLARE_ID_ENTRY(ID) case orxSTRUCTURE_ID_##ID: zResult = #ID; break
235 default: zResult =
"INVALID STRUCTURE ID";
break;
238#undef orxSTRUCTURE_DECLARE_ID_ENTRY
#define orxASSERT(TEST,...)
#define orxFLAG_TEST(X, F)
#define orxFLAG_TEST_ALL(X, F)
#define orxFLAG_SET(X, A, R)
#define orxFLAG_GET(X, M)
orxSTRUCTURE_STORAGE_TYPE
orxDLLAPI orxSTATUS orxFASTCALL orxStructure_SetParent(void *_pStructure, void *_phParent)
static orxINLINE const orxSTRING orxStructure_GetIDString(orxSTRUCTURE_ID _eID)
orxDLLAPI orxSTATUS orxFASTCALL orxStructure_LogAll(orxBOOL _bPrivate)
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_Create(orxSTRUCTURE_ID _eStructureID)
orxDLLAPI orxSTATUS orxFASTCALL orxStructure_Update(void *_pStructure, const void *_phCaller, const orxCLOCK_INFO *_pstClockInfo)
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_GetOwner(const void *_pStructure)
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_GetSibling(const void *_pStructure)
orxDLLAPI void orxFASTCALL orxStructure_Exit()
orxDLLAPI void orxFASTCALL orxStructure_Setup()
#define orxSTRUCTURE_GUID_SHIFT_STRUCTURE_ID
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_Get(orxU64 _u64GUID)
static orxINLINE orxU64 orxStructure_GetGUID(const void *_pStructure)
#define orxSTRUCTURE_ASSERT(STRUCTURE)
#define orxSTRUCTURE(STRUCTURE)
orxDLLAPI orxSTATUS orxFASTCALL orxStructure_Delete(void *_pStructure)
static orxINLINE orxU32 orxStructure_GetFlags(const void *_pStructure, orxU32 _u32Mask)
#define orxSTRUCTURE_GUID_MASK_STRUCTURE_ID
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_GetPrevious(const void *_pStructure)
orxSTATUS(orxFASTCALL * orxSTRUCTURE_UPDATE_FUNCTION)(orxSTRUCTURE *_pstStructure, const orxSTRUCTURE *_pstCaller, const orxCLOCK_INFO *_pstClockInfo)
static orxINLINE void orxStructure_IncreaseCount(void *_pStructure)
orxDLLAPI orxSTATUS orxFASTCALL orxStructure_Init()
orxDLLAPI orxU32 orxFASTCALL orxStructure_GetCount(orxSTRUCTURE_ID _eStructureID)
orxDLLAPI orxSTRUCTURE_STORAGE_TYPE orxFASTCALL orxStructure_GetStorageType(orxSTRUCTURE_ID _eStructureID)
static orxINLINE void orxStructure_SetFlags(void *_pStructure, orxU32 _u32AddFlags, orxU32 _u32RemoveFlags)
static orxINLINE orxBOOL orxStructure_TestFlags(const void *_pStructure, orxU32 _u32Flags)
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_GetLast(orxSTRUCTURE_ID _eStructureID)
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_GetParent(const void *_pStructure)
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_GetFirst(orxSTRUCTURE_ID _eStructureID)
orxDLLAPI orxSTATUS orxFASTCALL orxStructure_Unregister(orxSTRUCTURE_ID _eStructureID)
orxDLLAPI orxSTATUS orxFASTCALL orxStructure_Register(orxSTRUCTURE_ID _eStructureID, orxSTRUCTURE_STORAGE_TYPE _eStorageType, orxMEMORY_TYPE _eMemoryType, orxU32 _u32Size, orxU32 _u32BankSize, const orxSTRUCTURE_UPDATE_FUNCTION _pfnUpdate)
static orxINLINE orxU32 orxStructure_GetRefCount(const void *_pStructure)
static orxINLINE orxBOOL orxStructure_TestAllFlags(const void *_pStructure, orxU32 _u32Flags)
static orxINLINE void orxStructure_DecreaseCount(void *_pStructure)
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_GetNext(const void *_pStructure)
static orxINLINE orxSTRUCTURE * _orxStructure_GetPointer(const void *_pStructure, orxSTRUCTURE_ID _eStructureID)
orxDLLAPI orxSTATUS orxFASTCALL orxStructure_SetOwner(void *_pStructure, void *_pOwner)
orxDLLAPI orxSTRUCTURE *orxFASTCALL orxStructure_GetChild(const void *_pStructure)
static orxINLINE orxSTRUCTURE_ID orxStructure_GetID(const void *_pStructure)
@ orxSTRUCTURE_STORAGE_TYPE_NONE
@ orxSTRUCTURE_STORAGE_TYPE_TREE
@ orxSTRUCTURE_STORAGE_TYPE_LINKLIST
@ orxSTRUCTURE_STORAGE_TYPE_NUMBER
@ orxSTRUCTURE_ID_FXPOINTER
@ orxSTRUCTURE_ID_SOUNDPOINTER
@ orxSTRUCTURE_ID_ANIMPOINTER
@ orxSTRUCTURE_ID_VIEWPORT
@ orxSTRUCTURE_ID_TEXTURE
@ orxSTRUCTURE_ID_SPAWNER
@ orxSTRUCTURE_ID_ANIMSET
@ orxSTRUCTURE_ID_LINKABLE_NUMBER
@ orxSTRUCTURE_ID_TRIGGER
@ orxSTRUCTURE_ID_TIMELINE
@ orxSTRUCTURE_ID_GRAPHIC
#define orxSTRUCTURE_DECLARE_ID_ENTRY(ID)
orxLINKLIST_NODE stLinkListNode