summaryrefslogtreecommitdiff
path: root/include/entity.h
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2023-12-31 02:12:41 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2023-12-31 02:12:41 +0100
commit109b1020dcbfa17e80d28c522b5d792f7b3c6d46 (patch)
treecf23c1134de2891d0eed3b55549e70b29eb1997f /include/entity.h
parent957da774e4c34100e0bd352b1570af02bb7f7521 (diff)
parent9c87bcca8ea4b52199ed908c0ea28ab08b1d0747 (diff)
Merge branch 'master' into tilemap-docs
Diffstat (limited to 'include/entity.h')
-rw-r--r--include/entity.h39
1 files changed, 22 insertions, 17 deletions
diff --git a/include/entity.h b/include/entity.h
index 8ecd0f95..188fa5a8 100644
--- a/include/entity.h
+++ b/include/entity.h
@@ -6,7 +6,9 @@
#include "color.h"
#include "sprite.h"
-#define MAX_ENTITIES 71
+#define MAX_ENTITIES 72
+#define MAX_MANAGERS 32
+#define MAX_AUX_PLAYER_ENTITIES 7
/** Kinds of Entity's supported by the game. */
typedef enum {
@@ -38,6 +40,8 @@ typedef enum {
typedef enum {
ENT_DID_INIT = 0x1, /**< Graphics and other data loaded. */
ENT_SCRIPTED = 0x2, /**< Execute in a scripted environment. */
+ ENT_UNUSED1 = 0x4, /**< Unused delete flag. */
+ ENT_UNUSED2 = 0x8, /**< Unused delete flag. */
ENT_DELETED = 0x10, /**< Queue deletion next frame. */
ENT_PERSIST = 0x20, /**< Persist between rooms. */
ENT_COLLIDE = 0x80, /**< Collide with other Entity's. */
@@ -216,9 +220,6 @@ typedef struct Entity_ {
/*0x62*/ u8 spriteOffsetX;
/*0x63*/ s8 spriteOffsetY;
/*0x64*/ void* myHeap; /**< Heap data allocated with #zMalloc. */
-#ifndef NENT_DEPRECATED
- GENERIC_ENTITY_FIELDS
-#endif
} Entity;
typedef struct {
@@ -238,6 +239,15 @@ typedef struct LinkedList {
Entity* first;
} LinkedList;
+/**
+ * LinkedList's which point to allocate Entities.
+ * These work together with Entity.prev and Entity.next fields
+ * to allow the iteration of all Entity's.
+ */
+extern LinkedList gEntityLists[9];
+extern GenericEntity gAuxPlayerEntities[MAX_AUX_PLAYER_ENTITIES];
+extern GenericEntity gEntities[MAX_ENTITIES];
+
typedef void(EntityAction)(Entity*);
typedef void (*EntityActionPtr)(Entity*);
typedef void (*const* EntityActionArray)(Entity*);
@@ -283,7 +293,7 @@ Entity* CreateEnemy(u32 id, u32 type);
Entity* CreateNPC(u32 id, u32 type, u32 type2);
Entity* CreateObject(u32 id, u32 type, u32 type2);
Entity* CreateObjectWithParent(Entity* parent, u32 id, u32 type, u32 type2);
-Entity* CreateItemGetEntity(void);
+Entity* CreateAuxPlayerEntity(void);
Entity* CreateFx(Entity* parent, u32 type, u32 type2);
/// @}
@@ -386,12 +396,15 @@ Entity* FindEntity(u32 kind, u32 id, u32 listIndex, u32 type, u32 type2);
* @param entity Entity to set the priority of.
* @param prio #Priority level.
*/
-void SetDefaultPriority(Entity* entity, u32 prio);
+void SetEntityPriority(Entity* entity, u32 prio);
/**
- * Check if entity will be deleted next frame.
+ * Check if entity is disabled. Entities are disabled if:
+ * - They are deleted.
+ * - There is an event and the entity doesn't have priority
+ * (n/a if entity is in action 0).
*/
-bool32 EntityIsDeleted(Entity* entity);
+bool32 EntityDisabled(Entity* entity);
/**
* Check if system or entity is blocking updates.
@@ -477,18 +490,10 @@ void SetInitializationPriority(void);
/**
* Reset the system update priority.
*/
-void ResetSystemPriority(void);
+void ClearEventPriority(void);
void sub_0805E958(void);
-/**
- * LinkedList's which point to allocate Entities.
- * These work together with Entity.prev and Entity.next fields
- * to allow the iteration of all Entity's.
- */
-extern LinkedList gEntityLists[9];
-extern Entity gItemGetEntities[7];
-
typedef struct {
u8 unk_0;
u8 unk_1;