src/entity.c file

Classes

struct Temp
struct UpdateContext

Typedefs

using Getter = void*(*)(void)
using Deleter = void(*)(void*)

Functions

void UpdatePlayerInput(void)
void ClearHitboxList(void)
void sub_0805EE88(void)
void ClearAllDeletedEntities(void)
void DeleteAllEntities(void)
void sub_0805E98C(void)
void UnloadOBJPalette2(Entity* ent)
void sub_08017744(Entity* this)
void EnemyDetachFX(Entity* entity)
void ClearDeletedEntity(Entity*)
void ram_ClearAndUpdateEntities(void)
void ram_UpdateEntities(u32)
static void UpdatePriorityTimer(void)
static void ReleaseTransitionManager(void*)
static void UnlinkEntity(Entity*)
void sub_0805E248(void)
void InitDefaultPriority(Entity* e)
void SetEntityPriority(Entity* entity, u32 prio)
Set the default priority for entity.
auto EntityDisabled(Entity* entity) -> bool32
Check if entity is disabled.
auto AnyPrioritySet(void) -> bool32
Check if system or entity is blocking updates.
static void UpdatePriority(void)
auto SetMinPriority(u32 prio) -> s32
Set the minimum Entity priority.
void ResetEntityPriority(void)
Reset a priority event requested by an Entity.
void RequestPriority(Entity* entity)
Request indefinite priority for an Entity.
void RequestPriorityOverPlayer(Entity* entity)
Request priority over player update.
void RevokePriorityOverPlayer(Entity* entity)
Revoke priority over player update.
void RequestPriorityDuration(Entity* entity, u32 time)
Request update priority over other Entity's for a period of time.
void SetPriorityTimer(u32 time)
Set the remaining frames of Entity priority.
void SetPlayerEventPriority(void)
Set entity and system priority to PRIO_PLAYER_EVENT.
void ResetPlayerEventPriority(void)
Reset entity and system priority to defaults.
void RevokePriority(Entity* entity)
Revoke priority from an Entity.
void SetRoomReloadPriority(void)
Set system priority to PRIO_PLAYER_EVENT.
void SetInitializationPriority(void)
Set system priority to PRIO_HIGHEST.
void ClearEventPriority(void)
Reset the system update priority.
void UpdateEntities(void)
Iteratively execute every Entity.
void UpdateManagers(void)
Iteratively execute every Manager.
void EraseAllEntities(void)
Erase all Entity's.
auto GetEmptyEntity(void) -> Entity*
Allocate a new Entity.
auto CreateAuxPlayerEntity(void) -> Entity*
auto GetEmptyEntityByKind(u32 kind) -> void*
void DeleteThisEntity(void)
Delete the Entity currently in execution.
void DeleteEntityAny(Entity* entity)
Delete Manager or Entity.
void DeleteEntity(Entity* entity)
Delete an Entity.
auto GetEmptyManager(void) -> Manager*
void DeleteManager(void* manager)
Delete a manager.
void sub_0805E958(void)
void sub_0805E974(void)
void RecycleEntities(void)
void DeleteSleepingEntities(void)
void AppendEntityToList(Entity* entity, u32 listIndex)
Add an Entity to the end of a LinkedList.
void PrependEntityToList(Entity* entity, u32 listIndex)
Add an Entity to the start of a LinkedList.
auto EntityHasDuplicateID(Entity* entity) -> bool32
Search all lists for Entity of same kind and id.
auto FindEntityByID(u32 kind, u32 id, u32 listIndex) -> Entity*
Find an Entity for a given kind and id, and LinkedList.
auto FindEntity(u32 kind, u32 id, u32 listIndex, u32 type, u32 type2) -> Entity*
Find an Entity with full identifiers.
auto FindNextDuplicateID(Entity* entity, int listIndex) -> Entity*
Find an Entity of same kind and id in LinkedList.
auto DeepFindEntityByID(u32 kind, u32 id) -> Entity*
Search all lists for an Entity of same kind and id.
void DeleteAllEnemies(void)

Variables

u8 gUpdateVisibleTiles
Manager gUnk_02033290
UpdateContext gUpdateContext
const u8 gEntityListLUT
const u8 gPrioritiesDefault
const u8 gPrioritiesKinstoneMenu
LinkedList gEntityListsBackup

Function documentation

void ClearAllDeletedEntities(void)

void SetEntityPriority(Entity* entity, u32 prio)

Set the default priority for entity.

Parameters
entity Entity to set the priority of.
prio Priority level.

bool32 EntityDisabled(Entity* entity)

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).

s32 SetMinPriority(u32 prio)

Set the minimum Entity priority.

Parameters
prio Minimum Priority.
Returns Success.

void RequestPriority(Entity* entity)

Request indefinite priority for an Entity.

Parameters
entity Entity requesting priority.

void RequestPriorityOverPlayer(Entity* entity)

Request priority over player update.

Parameters
entity Entity requesting priority.

void RevokePriorityOverPlayer(Entity* entity)

Revoke priority over player update.

Parameters
entity Entity which requested priority.

void RequestPriorityDuration(Entity* entity, u32 time)

Request update priority over other Entity's for a period of time.

Parameters
entity Entity requesting priority.
time Number of frames.

void SetPriorityTimer(u32 time)

Set the remaining frames of Entity priority.

Parameters
time Number of frames.

void RevokePriority(Entity* entity)

Revoke priority from an Entity.

Parameters
entity Entity which requested priority.

void UpdateEntities(void)

Iteratively execute every Entity.

Call once per frame.

void UpdateManagers(void)

Iteratively execute every Manager.

Call once per frame.

Entity* GetEmptyEntity(void)

Allocate a new Entity.

Returns Allocated Entity or NULL if failed.

void DeleteThisEntity(void)

Delete the Entity currently in execution.

void DeleteEntityAny(Entity* entity)

Delete Manager or Entity.

Parameters
entity Entity or Manager to be deleted.

void DeleteEntity(Entity* entity)

Delete an Entity.

Parameters
entity Entity to delete.

void DeleteManager(void* manager)

Delete a manager.

Parameters
manager Manager to delete.

void AppendEntityToList(Entity* entity, u32 listIndex)

Add an Entity to the end of a LinkedList.

Parameters
entity Entity to add.
listIndex Target LinkedList.

void PrependEntityToList(Entity* entity, u32 listIndex)

Add an Entity to the start of a LinkedList.

Parameters
entity Entity to add.
listIndex Target LinkedList.

bool32 EntityHasDuplicateID(Entity* entity)

Search all lists for Entity of same kind and id.

Returns bool32 Duplicate was found.

Entity* FindEntityByID(u32 kind, u32 id, u32 listIndex)

Find an Entity for a given kind and id, and LinkedList.

Returns Entity* First result or NULL if none found.

Entity* FindEntity(u32 kind, u32 id, u32 listIndex, u32 type, u32 type2)

Find an Entity with full identifiers.

Returns Entity* First result or NULL if none found.

Entity* FindNextDuplicateID(Entity* entity, int listIndex)

Find an Entity of same kind and id in LinkedList.

Returns Entity* First result or NULL if none found.

Entity* DeepFindEntityByID(u32 kind, u32 id)

Search all lists for an Entity of same kind and id.

Returns Entity* First result or NULL if none found.