summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2024-09-27 22:12:20 -0700
committerGitHub <noreply@github.com>2024-09-27 22:12:20 -0700
commitd0cb5d9be4ba15c4426e8f08cdd59777f99a9bc4 (patch)
tree7e5b7c4f2cd00dd54b7fcd577ed599f5d0ef762a /src/code
parentb4d6c3921f4ce8d5847dda195881516a80c453a3 (diff)
InitVars -> Profile (#1697)
* ActorProfile * EffectSsProfile * TransitionProfile * variables.txt
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_actor.c50
-rw-r--r--src/code/z_actor_dlftbls.c14
-rw-r--r--src/code/z_effect_soft_sprite.c18
-rw-r--r--src/code/z_effect_soft_sprite_dlftbls.c10
-rw-r--r--src/code/z_en_a_keep.c2
-rw-r--r--src/code/z_en_item00.c2
-rw-r--r--src/code/z_fbdemo_circle.c2
-rw-r--r--src/code/z_fbdemo_dlftbls.c36
-rw-r--r--src/code/z_fbdemo_fade.c2
-rw-r--r--src/code/z_player_call.c2
-rw-r--r--src/code/z_player_lib.c4
-rw-r--r--src/code/z_scene.c2
12 files changed, 72 insertions, 72 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 3e503664c..8ca728435 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -3273,15 +3273,15 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
CS_ID_NONE, HALFDAYBIT_ALL, NULL);
}
-ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) {
+ActorProfile* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) {
size_t overlaySize;
ActorOverlay* overlayEntry = &gActorOverlayTable[index];
- ActorInit* actorInit;
+ ActorProfile* profile;
overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart;
if (overlayEntry->vramStart == NULL) {
- actorInit = overlayEntry->initInfo;
+ profile = overlayEntry->profile;
} else {
if (overlayEntry->loadedRamAddr == NULL) {
if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) {
@@ -3304,21 +3304,21 @@ ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) {
overlayEntry->numLoaded = 0;
}
- actorInit = (void*)(uintptr_t)((overlayEntry->initInfo != NULL)
- ? (void*)((uintptr_t)overlayEntry->initInfo -
- (intptr_t)((uintptr_t)overlayEntry->vramStart -
- (uintptr_t)overlayEntry->loadedRamAddr))
- : NULL);
+ profile = (void*)(uintptr_t)((overlayEntry->profile != NULL)
+ ? (void*)((uintptr_t)overlayEntry->profile -
+ (intptr_t)((uintptr_t)overlayEntry->vramStart -
+ (uintptr_t)overlayEntry->loadedRamAddr))
+ : NULL);
}
- return actorInit;
+ return profile;
}
Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s16 index, f32 x, f32 y, f32 z, s16 rotX,
s16 rotY, s16 rotZ, s32 params, u32 csId, u32 halfDaysBits, Actor* parent) {
s32 pad;
Actor* actor;
- ActorInit* actorInit;
+ ActorProfile* profile;
s32 objectSlot;
ActorOverlay* overlayEntry;
@@ -3326,20 +3326,20 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
return NULL;
}
- actorInit = Actor_LoadOverlay(actorCtx, index);
- if (actorInit == NULL) {
+ profile = Actor_LoadOverlay(actorCtx, index);
+ if (profile == NULL) {
return NULL;
}
- objectSlot = Object_GetSlot(&play->objectCtx, actorInit->objectId);
+ objectSlot = Object_GetSlot(&play->objectCtx, profile->objectId);
if ((objectSlot <= OBJECT_SLOT_NONE) ||
- ((actorInit->type == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num) &&
- (actorInit->id != ACTOR_BOSS_05))) {
+ ((profile->type == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num) &&
+ (profile->id != ACTOR_BOSS_05))) {
Actor_FreeOverlay(&gActorOverlayTable[index]);
return NULL;
}
- actor = ZeldaArena_Malloc(actorInit->instanceSize);
+ actor = ZeldaArena_Malloc(profile->instanceSize);
if (actor == NULL) {
Actor_FreeOverlay(&gActorOverlayTable[index]);
return NULL;
@@ -3350,22 +3350,22 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
overlayEntry->numLoaded++;
}
- bzero(actor, actorInit->instanceSize);
+ bzero(actor, profile->instanceSize);
actor->overlayEntry = overlayEntry;
- actor->id = actorInit->id;
- actor->flags = actorInit->flags;
+ actor->id = profile->id;
+ actor->flags = profile->flags;
- if (actorInit->id == ACTOR_EN_PART) {
+ if (profile->id == ACTOR_EN_PART) {
actor->objectSlot = rotZ;
rotZ = 0;
} else {
actor->objectSlot = objectSlot;
}
- actor->init = actorInit->init;
- actor->destroy = actorInit->destroy;
- actor->update = actorInit->update;
- actor->draw = actorInit->draw;
+ actor->init = profile->init;
+ actor->destroy = profile->destroy;
+ actor->update = profile->update;
+ actor->draw = profile->draw;
if (parent != NULL) {
actor->room = parent->room;
@@ -3394,7 +3394,7 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
actor->halfDaysBits = HALFDAYBIT_ALL;
}
- Actor_AddToCategory(actorCtx, actor, actorInit->type);
+ Actor_AddToCategory(actorCtx, actor, profile->type);
{
uintptr_t prevSeg = gSegments[0x06];
diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c
index f884de2df..05a1da25d 100644
--- a/src/code/z_actor_dlftbls.c
+++ b/src/code/z_actor_dlftbls.c
@@ -2,11 +2,11 @@
#include "fault.h"
-// Segment and InitVars declarations (also used in the table below)
+// Segment and Profile declarations (also used in the table below)
#define DEFINE_ACTOR(name, _enumValue, _allocType, _debugName) \
- extern struct ActorInit name##_InitVars; \
+ extern struct ActorProfile name##_Profile; \
DECLARE_OVERLAY_SEGMENT(name)
-#define DEFINE_ACTOR_INTERNAL(name, _enumValue, _allocType, _debugName) extern struct ActorInit name##_InitVars;
+#define DEFINE_ACTOR_INTERNAL(name, _enumValue, _allocType, _debugName) extern struct ActorProfile name##_Profile;
#define DEFINE_ACTOR_UNSET(_enumValue)
#include "tables/actor_table.h"
@@ -22,15 +22,15 @@
SEGMENT_START(ovl_##name), \
SEGMENT_END(ovl_##name), \
NULL, \
- &name##_InitVars, \
+ &name##_Profile, \
NULL, \
allocType, \
0, \
},
-#define DEFINE_ACTOR_INTERNAL(name, _enumValue, allocType, _debugName) \
- { \
- ROM_FILE_UNSET, NULL, NULL, NULL, &name##_InitVars, NULL, allocType, 0, \
+#define DEFINE_ACTOR_INTERNAL(name, _enumValue, allocType, _debugName) \
+ { \
+ ROM_FILE_UNSET, NULL, NULL, NULL, &name##_Profile, NULL, allocType, 0, \
},
#define DEFINE_ACTOR_UNSET(_enumValue) { 0 },
diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c
index fda7dc103..e76942d4a 100644
--- a/src/code/z_effect_soft_sprite.c
+++ b/src/code/z_effect_soft_sprite.c
@@ -171,7 +171,7 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initData) {
s32 index;
u32 overlaySize;
EffectSsOverlay* overlayEntry = &gParticleOverlayTable[type];
- EffectSsInit* initInfo;
+ EffectSsProfile* profile;
if (EffectSS_FindFreeSpace(priority, &index) != 0) {
// Abort because we couldn't find a suitable slot to add this effect in
@@ -182,7 +182,7 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initData) {
overlaySize = (uintptr_t)overlayEntry->vramEnd - (uintptr_t)overlayEntry->vramStart;
if (overlayEntry->vramStart == NULL) {
- initInfo = overlayEntry->initInfo;
+ profile = overlayEntry->profile;
} else {
if (overlayEntry->loadedRamAddr == NULL) {
overlayEntry->loadedRamAddr = ZeldaArena_MallocR(overlaySize);
@@ -195,21 +195,21 @@ void EffectSs_Spawn(PlayState* play, s32 type, s32 priority, void* initData) {
overlayEntry->vramEnd, overlayEntry->loadedRamAddr);
}
- initInfo = (void*)(uintptr_t)((overlayEntry->initInfo != NULL)
- ? (void*)((uintptr_t)overlayEntry->initInfo -
- (intptr_t)((uintptr_t)overlayEntry->vramStart -
- (uintptr_t)overlayEntry->loadedRamAddr))
- : NULL);
+ profile = (void*)(uintptr_t)((overlayEntry->profile != NULL)
+ ? (void*)((uintptr_t)overlayEntry->profile -
+ (intptr_t)((uintptr_t)overlayEntry->vramStart -
+ (uintptr_t)overlayEntry->loadedRamAddr))
+ : NULL);
}
- if (initInfo->init != NULL) {
+ if (profile->init != NULL) {
// Delete the previous effect in the slot, in case the slot wasn't free
EffectSS_Delete(&sEffectSsInfo.dataTable[index]);
sEffectSsInfo.dataTable[index].type = type;
sEffectSsInfo.dataTable[index].priority = priority;
- if (initInfo->init(play, index, &sEffectSsInfo.dataTable[index], initData) == 0) {
+ if (profile->init(play, index, &sEffectSsInfo.dataTable[index], initData) == 0) {
EffectSS_ResetEntry(&sEffectSsInfo.dataTable[index]);
}
}
diff --git a/src/code/z_effect_soft_sprite_dlftbls.c b/src/code/z_effect_soft_sprite_dlftbls.c
index 69dab2885..e2f6f25ad 100644
--- a/src/code/z_effect_soft_sprite_dlftbls.c
+++ b/src/code/z_effect_soft_sprite_dlftbls.c
@@ -1,9 +1,9 @@
#include "z64effect_ss.h"
#include "segment_symbols.h"
-// Init Vars and linker symbol declarations (used in the table below)
+// Profile and linker symbol declarations (used in the table below)
#define DEFINE_EFFECT_SS(name, _enumValue) \
- extern EffectSsInit name##_InitVars; \
+ extern EffectSsProfile name##_Profile; \
DECLARE_OVERLAY_SEGMENT(name)
#define DEFINE_EFFECT_SS_UNSET(_enumValue)
@@ -13,9 +13,9 @@
#undef DEFINE_EFFECT_SS
#undef DEFINE_EFFECT_SS_UNSET
-#define DEFINE_EFFECT_SS(name, _enumValue) \
- { \
- ROM_FILE(ovl_##name), SEGMENT_START(ovl_##name), SEGMENT_END(ovl_##name), NULL, &name##_InitVars, 1, \
+#define DEFINE_EFFECT_SS(name, _enumValue) \
+ { \
+ ROM_FILE(ovl_##name), SEGMENT_START(ovl_##name), SEGMENT_END(ovl_##name), NULL, &name##_Profile, 1, \
},
#define DEFINE_EFFECT_SS_UNSET(_enumValue) { 0 },
diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c
index 4279f01fa..d062e0e1f 100644
--- a/src/code/z_en_a_keep.c
+++ b/src/code/z_en_a_keep.c
@@ -13,7 +13,7 @@ void EnAObj_Draw(Actor* thisx, PlayState* play);
void EnAObj_Idle(EnAObj* this, PlayState* play);
void EnAObj_Talk(EnAObj* this, PlayState* play);
-ActorInit En_A_Obj_InitVars = {
+ActorProfile En_A_Obj_Profile = {
/**/ ACTOR_EN_A_OBJ,
/**/ ACTORCAT_PROP,
/**/ FLAGS,
diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c
index 2d841a634..2101ff71f 100644
--- a/src/code/z_en_item00.c
+++ b/src/code/z_en_item00.c
@@ -25,7 +25,7 @@ void EnItem00_DrawSprite(EnItem00* this, PlayState* play);
void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play);
void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play);
-ActorInit En_Item00_InitVars = {
+ActorProfile En_Item00_Profile = {
/**/ ACTOR_EN_ITEM00,
/**/ ACTORCAT_MISC,
/**/ FLAGS,
diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c
index 55c8c7fe8..2bbf7938e 100644
--- a/src/code/z_fbdemo_circle.c
+++ b/src/code/z_fbdemo_circle.c
@@ -31,7 +31,7 @@ void TransitionCircle_SetType(void* thisx, s32 type);
void TransitionCircle_Draw(void* thisx, Gfx** gfxp);
s32 TransitionCircle_IsDone(void* thisx);
-TransitionInit TransitionCircle_InitVars = {
+TransitionProfile TransitionCircle_Profile = {
TransitionCircle_Init, TransitionCircle_Destroy, TransitionCircle_Update, TransitionCircle_Draw,
TransitionCircle_Start, TransitionCircle_SetType, TransitionCircle_SetColor, NULL,
TransitionCircle_IsDone,
diff --git a/src/code/z_fbdemo_dlftbls.c b/src/code/z_fbdemo_dlftbls.c
index 091d02ed6..5fa14a908 100644
--- a/src/code/z_fbdemo_dlftbls.c
+++ b/src/code/z_fbdemo_dlftbls.c
@@ -3,12 +3,12 @@
#include "segment_symbols.h"
#include "z64lib.h"
-// InitVars and Linker symbol declarations (used in the table below)
+// Profile and Linker symbol declarations (used in the table below)
#define DEFINE_TRANSITION(_enumValue, structName, _instanceName, name) \
- extern TransitionInit structName##_InitVars; \
+ extern TransitionProfile structName##_Profile; \
DECLARE_OVERLAY_SEGMENT(name)
-#define DEFINE_TRANSITION_INTERNAL(_enumValue, structName, _instanceName) extern TransitionInit structName##_InitVars;
+#define DEFINE_TRANSITION_INTERNAL(_enumValue, structName, _instanceName) extern TransitionProfile structName##_Profile;
#include "tables/transition_table.h"
@@ -21,12 +21,12 @@
SEGMENT_START(ovl_##name), \
SEGMENT_END(ovl_##name), \
ROM_FILE(ovl_##name), \
- &structName##_InitVars, \
+ &structName##_Profile, \
sizeof(structName), \
},
#define DEFINE_TRANSITION_INTERNAL(_enumValue, structName, _instanceName) \
- { { 0, 0 }, NULL, NULL, 0, 0, &structName##_InitVars, sizeof(structName) },
+ { { 0, 0 }, NULL, NULL, 0, 0, &structName##_Profile, sizeof(structName) },
TransitionOverlay gTransitionOverlayTable[] = {
#include "tables/transition_table.h"
@@ -38,25 +38,25 @@ TransitionOverlay gTransitionOverlayTable[] = {
void Transition_Init(TransitionContext* transitionCtx) {
TransitionOverlay* overlayEntry;
ptrdiff_t relocOffset;
- TransitionInit* initInfo[1];
+ TransitionProfile* profile[1];
overlayEntry = &gTransitionOverlayTable[transitionCtx->fbdemoType];
TransitionOverlay_Load(overlayEntry);
relocOffset = (uintptr_t)Lib_PhysicalToVirtual(overlayEntry->loadInfo.addr) - (uintptr_t)overlayEntry->vramStart;
- initInfo[0] = NULL;
- initInfo[0] = (overlayEntry->initInfo != NULL) ? (TransitionInit*)((uintptr_t)overlayEntry->initInfo + relocOffset)
- : initInfo[0];
+ profile[0] = NULL;
+ profile[0] = (overlayEntry->profile != NULL) ? (TransitionProfile*)((uintptr_t)overlayEntry->profile + relocOffset)
+ : profile[0];
- transitionCtx->init = initInfo[0]->init;
- transitionCtx->destroy = initInfo[0]->destroy;
- transitionCtx->start = initInfo[0]->start;
- transitionCtx->isDone = initInfo[0]->isDone;
- transitionCtx->draw = initInfo[0]->draw;
- transitionCtx->update = initInfo[0]->update;
- transitionCtx->setType = initInfo[0]->setType;
- transitionCtx->setColor = initInfo[0]->setColor;
- transitionCtx->setEnvColor = initInfo[0]->setEnvColor;
+ transitionCtx->init = profile[0]->init;
+ transitionCtx->destroy = profile[0]->destroy;
+ transitionCtx->start = profile[0]->start;
+ transitionCtx->isDone = profile[0]->isDone;
+ transitionCtx->draw = profile[0]->draw;
+ transitionCtx->update = profile[0]->update;
+ transitionCtx->setType = profile[0]->setType;
+ transitionCtx->setColor = profile[0]->setColor;
+ transitionCtx->setEnvColor = profile[0]->setEnvColor;
}
void Transition_Destroy(TransitionContext* transitionCtx) {
diff --git a/src/code/z_fbdemo_fade.c b/src/code/z_fbdemo_fade.c
index 64502a68e..7f27355e3 100644
--- a/src/code/z_fbdemo_fade.c
+++ b/src/code/z_fbdemo_fade.c
@@ -30,7 +30,7 @@ static Gfx sTransFadeSetupDL[] = {
gsSPEndDisplayList(),
};
-TransitionInit TransitionFade_InitVars = {
+TransitionProfile TransitionFade_Profile = {
TransitionFade_Init, TransitionFade_Destroy, TransitionFade_Update, TransitionFade_Draw,
TransitionFade_Start, TransitionFade_SetType, TransitionFade_SetColor, NULL,
TransitionFade_IsDone,
diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c
index da82e88ff..0957a81bc 100644
--- a/src/code/z_player_call.c
+++ b/src/code/z_player_call.c
@@ -10,7 +10,7 @@ ActorFunc sPlayerCallDestroyFunc;
ActorFunc sPlayerCallUpdateFunc;
ActorFunc sPlayerCallDrawFunc;
-ActorInit Player_InitVars = {
+ActorProfile Player_Profile = {
/**/ ACTOR_PLAYER,
/**/ ACTORCAT_PLAYER,
/**/ FLAGS,
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c
index 445d50165..f7f63c09a 100644
--- a/src/code/z_player_lib.c
+++ b/src/code/z_player_lib.c
@@ -393,11 +393,11 @@ void func_8012301C(Actor* thisx, PlayState* play2) {
if (this->av1.actionVar1 == 2) {
s16 objectId = gPlayerFormObjectIds[GET_PLAYER_FORM];
- gActorOverlayTable[ACTOR_PLAYER].initInfo->objectId = objectId;
+ gActorOverlayTable[ACTOR_PLAYER].profile->objectId = objectId;
func_8012F73C(&play->objectCtx, this->actor.objectSlot, objectId);
this->actor.objectSlot = Object_GetSlot(&play->objectCtx, GAMEPLAY_KEEP);
} else if (this->av1.actionVar1 >= 3) {
- s32 objectSlot = Object_GetSlot(&play->objectCtx, gActorOverlayTable[ACTOR_PLAYER].initInfo->objectId);
+ s32 objectSlot = Object_GetSlot(&play->objectCtx, gActorOverlayTable[ACTOR_PLAYER].profile->objectId);
if (Object_IsLoaded(&play->objectCtx, objectSlot)) {
this->actor.objectSlot = objectSlot;
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index e7a2c50db..20d2c528d 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -175,7 +175,7 @@ void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
play->objectCtx.numEntries = loadedCount;
play->objectCtx.numPersistentEntries = loadedCount;
playerObjectId = gPlayerFormObjectIds[GET_PLAYER_FORM];
- gActorOverlayTable[0].initInfo->objectId = playerObjectId;
+ gActorOverlayTable[ACTOR_PLAYER].profile->objectId = playerObjectId;
Object_SpawnPersistent(&play->objectCtx, playerObjectId);
play->objectCtx.slots[play->objectCtx.numEntries].segment = objectPtr;