Object Cleanup (#1410)

* object cleanup

* namefixer

* objectPtr

* PR Review

* PR Review

* more uses of macro

* missed another one
This commit is contained in:
engineer124
2023-10-05 17:37:52 -03:00
committed by GitHub
parent ac8d49ea6f
commit e810559391
117 changed files with 600 additions and 592 deletions
+3 -3
View File
@@ -203,8 +203,8 @@ void EffectSsGFire_Spawn(PlayState* play, Vec3f* pos);
// void EffectSsLightning_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Color_RGBA8* pzParm3, Color_RGBA8* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8);
void EffectSsDtBubble_SpawnColorProfile(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 life, s16 colorProfile, s16 randXZ);
void EffectSsDtBubble_SpawnCustomColor(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* primColor, Color_RGBA8* envColor, s16 scale, s16 life, s16 randXZ);
void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 flags, s16 scale, s16 objId, s16 life, Gfx* dList);
void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 flags, s16 scale, s16 randScaleRange, s16 count, s16 objId, s16 life, Gfx* dList);
void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 flags, s16 scale, s16 objectId, s16 life, Gfx* dList);
void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 flags, s16 scale, s16 randScaleRange, s16 count, s16 objectId, s16 life, Gfx* dList);
// void func_800B2364(void);
void EffectSsStick_Spawn(PlayState* play, Vec3f* pos, s16 yaw);
// void EffectSsSibuki_Spawn(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7);
@@ -215,7 +215,7 @@ void EffectSsHitmark_SpawnCustomScale(PlayState* play, s32 type, s16 scale, Vec3
void EffectSsFhgFlash_SpawnShock(PlayState* play, Actor* actor, Vec3f* pos, s16 scale, u8 params);
void EffectSsKFire_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scaleMax, u8 type);
void EffectSsSolderSrchBall_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16* playerDetected, s16 flags);
void EffectSsKakera_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* arg3, s16 gravity, s16 arg5, s16 arg6, s16 arg7, s16 arg8, s16 scale, s16 arg10, s16 arg11, s32 life, s16 colorIdx, s16 objId, Gfx* dList);
void EffectSsKakera_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* arg3, s16 gravity, s16 arg5, s16 arg6, s16 arg7, s16 arg8, s16 scale, s16 arg10, s16 arg11, s32 life, s16 colorIdx, s16 objectId, Gfx* dList);
// void EffectSsIcePiece_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, UNK_TYPE4 uParm3, Vec3f* pzParm4, Vec3f* param_5, UNK_TYPE4 param_6);
void EffectSsIcePiece_SpawnBurst(PlayState* play, Vec3f* refPos, f32 scale);
void func_800B2B44(PlayState* play, Actor* actor, Vec3f* pos, f32 scale);
+1 -1
View File
@@ -180,7 +180,7 @@ extern s16 gItemPrices[];
extern u16 gSceneIdsPerRegion[11][27];
extern u8 gPlayerFormItemRestrictions[PLAYER_FORM_MAX][114];
extern s16 gPlayerFormObjectIndices[PLAYER_FORM_MAX];
extern s16 gPlayerFormObjectIds[PLAYER_FORM_MAX];
extern ObjectId gObjectTableSize;
extern RomFile gObjectTable[OBJECT_ID_MAX];
+1 -1
View File
@@ -118,7 +118,7 @@ typedef struct Actor {
/* 0x004 */ u32 flags; // Flags used for various purposes
/* 0x008 */ PosRot home; // Initial position/rotation when spawned. Can be used for other purposes
/* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data"
/* 0x01E */ s8 objBankIndex; // Object bank index of the actor's object dependency; original name: "bank"
/* 0x01E */ s8 objectSlot; // Object slot (in ObjectContext) corresponding to the actor's object; original name: "bank"
/* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on
/* 0x020 */ s16 halfDaysBits; // Bitmask indicating which half-days this actor is allowed to not be killed(?) (TODO: not sure how to word this). If the current halfDayBit is not part of this mask then the actor is killed when spawning the setup actors
/* 0x024 */ PosRot world; // Position/rotation in the world
+1 -1
View File
@@ -9,7 +9,7 @@ typedef struct KnobDoorActor {
/* 0x15C */ SkelAnime skelAnime;
/* 0x1A0 */ u8 animIndex;
/* 0x1A1 */ u8 playOpenAnim;
/* 0x1A2 */ s8 requiredObjBankIndex;
/* 0x1A2 */ s8 objectSlot;
/* 0x1A3 */ s8 dlIndex;
} KnobDoorActor; // size = 0x1A4
+1 -1
View File
@@ -33,7 +33,7 @@ struct CollisionPoly;
#define rgEnvColorG regs[8]
#define rgEnvColorB regs[9]
#define rgEnvColorA regs[10]
#define rgObjBankIndex regs[11]
#define rgObjectSlot regs[11]
typedef struct {
/* 0x0 */ u8 active;
+2
View File
@@ -472,6 +472,8 @@ typedef struct {
typedef RoomShapeCullableEntry PolygonDlist2;
typedef RoomShapeCullable PolygonType2;
#define OBJECT_SLOT_NONE -1
typedef struct {
/* 0x000 */ void* spaceStart;
/* 0x004 */ void* spaceEnd;
+2 -2
View File
@@ -147,8 +147,8 @@ s16 SubS_GetDistSqAndOrientPoints(Vec3f* vecA, Vec3f* vecB, f32* distSq);
s32 SubS_MoveActorToPoint(Actor* actor, Vec3f* point, s16 rotStep);
s16 SubS_GetDistSqAndOrientPath(Path* path, s32 pointIndex, Vec3f* pos, f32* distSq);
s8 SubS_IsObjectLoaded(s8 index, struct PlayState* play);
s8 SubS_GetObjectIndex(s16 id, struct PlayState* play);
s8 SubS_IsObjectLoaded(s8 objectSlot, struct PlayState* play);
s8 SubS_GetObjectSlot(s16 objectId, struct PlayState* play);
Actor* SubS_FindActor(struct PlayState* play, Actor* actorListStart, u8 actorCategory, s16 actorId);
+4 -4
View File
@@ -81,10 +81,10 @@ typedef struct EnHy {
/* 0x144 */ EnHyActionFunc actionFunc;
/* 0x148 */ EnHyActionFunc prevActionFunc;
/* 0x14C */ SkelAnime skelAnime;
/* 0x190 */ s8 headObjIndex; // Limb 15
/* 0x191 */ s8 skelUpperObjIndex; // Limbs 8-14
/* 0x192 */ s8 skelLowerObjIndex; // Limbs 1-7
/* 0x193 */ s8 animObjIndex;
/* 0x190 */ s8 headObjectSlot; // Limb 15
/* 0x191 */ s8 skelUpperObjectSlot; // Limbs 8-14
/* 0x192 */ s8 skelLowerObjectSlot; // Limbs 1-7
/* 0x193 */ s8 animObjectSlot;
/* 0x194 */ ColliderCylinder collider;
/* 0x1E0 */ u16 textId;
/* 0x1E2 */ u8 waitingOnInit;
+1 -1
View File
@@ -1,6 +1,6 @@
#include "global.h"
s16 gPlayerFormObjectIndices[PLAYER_FORM_MAX] = {
s16 gPlayerFormObjectIds[PLAYER_FORM_MAX] = {
OBJECT_LINK_BOY, // PLAYER_FORM_FIERCE_DEITY
OBJECT_LINK_GORON, // PLAYER_FORM_GORON
OBJECT_LINK_ZORA, // PLAYER_FORM_ZORA
+15 -14
View File
@@ -1096,7 +1096,7 @@ void Actor_SetScale(Actor* actor, f32 scale) {
}
void Actor_SetObjectDependency(PlayState* play, Actor* actor) {
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[actor->objBankIndex].segment);
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[actor->objectSlot].segment);
}
void Actor_Init(Actor* actor, PlayState* play) {
@@ -1119,7 +1119,7 @@ void Actor_Init(Actor* actor, PlayState* play) {
actor->floorBgId = BGCHECK_SCENE;
ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f);
if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
if (Object_IsLoaded(&play->objectCtx, actor->objectSlot)) {
Actor_SetObjectDependency(play, actor);
actor->init(actor, play);
actor->init = NULL;
@@ -2486,7 +2486,7 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) {
actor->audioFlags &= ~ACTOR_AUDIO_FLAG_ALL;
if (actor->init != NULL) {
if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
if (Object_IsLoaded(&play->objectCtx, actor->objectSlot)) {
Actor_SetObjectDependency(play, actor);
actor->init(actor, play);
actor->init = NULL;
@@ -2500,7 +2500,7 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) {
nextActor = actor->next;
}
} else {
if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
if (!Object_IsLoaded(&play->objectCtx, actor->objectSlot)) {
Actor_Kill(actor);
} else if ((params->requiredActorFlag && !(actor->flags & params->requiredActorFlag)) ||
(((!params->requiredActorFlag) != 0) &&
@@ -2700,8 +2700,8 @@ void Actor_Draw(PlayState* play, Actor* actor) {
Matrix_Scale(actor->scale.x, actor->scale.y, actor->scale.z, MTXMODE_APPLY);
Actor_SetObjectDependency(play, actor);
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[actor->objBankIndex].segment);
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[actor->objBankIndex].segment);
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[actor->objectSlot].segment);
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[actor->objectSlot].segment);
if (actor->colorFilterTimer != 0) {
s32 colorFlag = COLORFILTER_GET_COLORFLAG(actor->colorFilterParams);
@@ -3055,7 +3055,7 @@ void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx) {
actor = actorCtx->actorLists[i].first;
while (actor != NULL) {
if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
if (!Object_IsLoaded(&play->objectCtx, actor->objectSlot)) {
Actor_Kill(actor);
}
@@ -3287,7 +3287,7 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
s32 pad;
Actor* actor;
ActorInit* actorInit;
s32 objBankIndex;
s32 objectSlot;
ActorOverlay* overlayEntry;
if (actorCtx->totalLoadedActors >= 0xFF) {
@@ -3299,9 +3299,10 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
return NULL;
}
objBankIndex = Object_GetSlot(&play->objectCtx, actorInit->objectId);
if ((objBankIndex < 0) || ((actorInit->type == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num) &&
(actorInit->id != ACTOR_BOSS_05))) {
objectSlot = Object_GetSlot(&play->objectCtx, actorInit->objectId);
if ((objectSlot <= OBJECT_SLOT_NONE) ||
((actorInit->type == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num) &&
(actorInit->id != ACTOR_BOSS_05))) {
Actor_FreeOverlay(&gActorOverlayTable[index]);
return NULL;
}
@@ -3323,10 +3324,10 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
actor->flags = actorInit->flags;
if (actorInit->id == ACTOR_EN_PART) {
actor->objBankIndex = rotZ;
actor->objectSlot = rotZ;
rotZ = 0;
} else {
actor->objBankIndex = objBankIndex;
actor->objectSlot = objectSlot;
}
actor->init = actorInit->init;
@@ -3705,7 +3706,7 @@ void Actor_SpawnBodyParts(Actor* actor, PlayState* play, s32 partParams, Gfx** d
spawnedPart =
Actor_SpawnAsChild(&play->actorCtx, actor, play, ACTOR_EN_PART, currentMatrix->mf[3][0],
currentMatrix->mf[3][1], currentMatrix->mf[3][2], 0, 0, actor->objBankIndex, partParams);
currentMatrix->mf[3][1], currentMatrix->mf[3][2], 0, 0, actor->objectSlot, partParams);
if (spawnedPart != NULL) {
part = (EnPart*)spawnedPart;
+3 -3
View File
@@ -823,13 +823,13 @@ void GetItem_DrawWallet(PlayState* play, s16 drawId) {
void GetItem_DrawRemains(PlayState* play, s16 drawId) {
s32 pad;
s8 objectIndex;
s8 objectSlot;
OPEN_DISPS(play->state.gfxCtx);
objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_BSMASK);
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_BSMASK);
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectIndex].segment);
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
Gfx_SetupDL25_Opa(play->state.gfxCtx);
Matrix_Scale(0.02f, 0.02f, 0.02f, MTXMODE_APPLY);
+9 -9
View File
@@ -41,7 +41,7 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, TexturePtr texture) {
MtxF mfTrans11DA0;
s32 pad1;
Mtx* mtx;
void* object = play->objectCtx.slots[this->rgObjBankIndex].segment;
void* objectPtr = play->objectCtx.slots[this->rgObjectSlot].segment;
OPEN_DISPS(gfxCtx);
@@ -50,8 +50,8 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, TexturePtr texture) {
SkinMatrix_SetScale(&mfScale, scale, scale, scale);
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(object);
gSPSegment(POLY_XLU_DISP++, 0x06, object);
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(objectPtr);
gSPSegment(POLY_XLU_DISP++, 0x06, objectPtr);
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
@@ -542,7 +542,7 @@ void EffectSsDtBubble_SpawnCustomColor(PlayState* play, Vec3f* pos, Vec3f* veloc
* - due to how life is implemented it is capped at 200. Any value over 200 is accepted, but the fragment will
* only live for 200 frames
*/
void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 flags, s16 scale, s16 objId,
void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 flags, s16 scale, s16 objectId,
s16 life, Gfx* dList) {
EffectSsHahenInitParams initParams;
@@ -552,7 +552,7 @@ void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* ac
initParams.dList = dList;
initParams.flags = flags;
initParams.scale = scale;
initParams.objId = objId;
initParams.objectId = objectId;
initParams.life = life;
EffectSs_Spawn(play, EFFECT_SS_HAHEN, 128, &initParams);
@@ -568,7 +568,7 @@ void EffectSsHahen_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* ac
* only live for 200 frames
*/
void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 flags, s16 scale, s16 randScaleRange,
s16 count, s16 objId, s16 life, Gfx* dList) {
s16 count, s16 objectId, s16 life, Gfx* dList) {
s32 i;
Vec3f velocity;
Vec3f accel;
@@ -581,7 +581,7 @@ void EffectSsHahen_SpawnBurst(PlayState* play, Vec3f* pos, f32 burstScale, s16 f
velocity.z = (Rand_ZeroOne() - 0.5f) * burstScale;
velocity.y = ((Rand_ZeroOne() * 0.5f) + 0.5f) * burstScale;
EffectSsHahen_Spawn(play, pos, &velocity, &accel, flags, Rand_S16Offset(scale, randScaleRange), objId, life,
EffectSsHahen_Spawn(play, pos, &velocity, &accel, flags, Rand_S16Offset(scale, randScaleRange), objectId, life,
dList);
}
}
@@ -719,7 +719,7 @@ void EffectSsSolderSrchBall_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity,
// EffectSsKakera Spawn Functions
void EffectSsKakera_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* arg3, s16 gravity, s16 arg5, s16 arg6,
s16 arg7, s16 arg8, s16 scale, s16 arg10, s16 arg11, s32 life, s16 colorIdx, s16 objId,
s16 arg7, s16 arg8, s16 scale, s16 arg10, s16 arg11, s32 life, s16 colorIdx, s16 objectId,
Gfx* dList) {
EffectSsKakeraInitParams initParams;
@@ -736,7 +736,7 @@ void EffectSsKakera_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* a
initParams.unk_32 = arg11;
initParams.life = life;
initParams.colorIdx = colorIdx;
initParams.objId = objId;
initParams.objectId = objectId;
initParams.dList = dList;
EffectSs_Spawn(play, EFFECT_SS_KAKERA, 101, &initParams);
+8 -8
View File
@@ -133,7 +133,7 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) {
}
void EnHy_ChangeObjectAndAnim(EnHy* enHy, PlayState* play, s16 animIndex) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[enHy->animObjIndex].segment);
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[enHy->animObjectSlot].segment);
EnHy_ChangeAnim(&enHy->skelAnime, animIndex);
}
@@ -141,7 +141,7 @@ s32 EnHy_UpdateSkelAnime(EnHy* enHy, PlayState* play) {
s32 isUpdated = false;
if (enHy->actor.draw != NULL) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[enHy->animObjIndex].segment);
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[enHy->animObjectSlot].segment);
SkelAnime_Update(&enHy->skelAnime);
isUpdated = true;
}
@@ -161,14 +161,14 @@ void EnHy_Blink(EnHy* enHy, s32 eyeTexMaxIndex) {
s32 EnHy_Init(EnHy* enHy, PlayState* play, FlexSkeletonHeader* skeletonHeaderSeg, s16 animIndex) {
s32 isInitialized = false;
if ((SubS_IsObjectLoaded(enHy->animObjIndex, play) == true) &&
(SubS_IsObjectLoaded(enHy->headObjIndex, play) == true) &&
(SubS_IsObjectLoaded(enHy->skelUpperObjIndex, play) == true) &&
(SubS_IsObjectLoaded(enHy->skelLowerObjIndex, play) == true)) {
enHy->actor.objBankIndex = enHy->skelLowerObjIndex;
if ((SubS_IsObjectLoaded(enHy->animObjectSlot, play) == true) &&
(SubS_IsObjectLoaded(enHy->headObjectSlot, play) == true) &&
(SubS_IsObjectLoaded(enHy->skelUpperObjectSlot, play) == true) &&
(SubS_IsObjectLoaded(enHy->skelLowerObjectSlot, play) == true)) {
enHy->actor.objectSlot = enHy->skelLowerObjectSlot;
isInitialized = true;
ActorShape_Init(&enHy->actor.shape, 0.0f, NULL, 0.0f);
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[enHy->actor.objBankIndex].segment);
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[enHy->actor.objectSlot].segment);
SkelAnime_InitFlex(play, &enHy->skelAnime, skeletonHeaderSeg, NULL, enHy->jointTable, enHy->morphTable,
ENHY_LIMB_MAX);
EnHy_ChangeObjectAndAnim(enHy, play, animIndex);
+10 -10
View File
@@ -184,17 +184,17 @@ void EnItem00_Init(Actor* thisx, PlayState* play) {
break;
case ITEM00_SHIELD_HERO:
thisx->objBankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_SHIELD_2);
thisx->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_SHIELD_2);
EnItem00_SetObject(this, play, &shadowOffset, &shadowScale);
break;
case ITEM00_MAP:
thisx->objBankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_MAP);
thisx->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_MAP);
EnItem00_SetObject(this, play, &shadowOffset, &shadowScale);
break;
case ITEM00_COMPASS:
thisx->objBankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_COMPASS);
thisx->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_COMPASS);
EnItem00_SetObject(this, play, &shadowOffset, &shadowScale);
break;
@@ -317,10 +317,10 @@ void EnItem00_Destroy(Actor* thisx, PlayState* play) {
}
void EnItem00_WaitForHeartObject(EnItem00* this, PlayState* play) {
s32 objBankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_HEARTS);
s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_HEARTS);
if (Object_IsLoaded(&play->objectCtx, objBankIndex)) {
this->actor.objBankIndex = objBankIndex;
if (Object_IsLoaded(&play->objectCtx, objectSlot)) {
this->actor.objectSlot = objectSlot;
this->actionFunc = func_800A640C;
}
}
@@ -725,10 +725,10 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) {
case ITEM00_RECOVERY_HEART:
if (this->unk152 < 0) {
if (this->unk152 == -1) {
s8 bankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_HEART);
s8 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_HEART);
if (Object_IsLoaded(&play->objectCtx, bankIndex)) {
this->actor.objBankIndex = bankIndex;
if (Object_IsLoaded(&play->objectCtx, objectSlot)) {
this->actor.objectSlot = objectSlot;
Actor_SetObjectDependency(play, &this->actor);
this->unk152 = -2;
}
@@ -852,7 +852,7 @@ void EnItem00_DrawSprite(EnItem00* this, PlayState* play) {
void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) {
s32 pad[2];
if (Object_GetSlot(&play->objectCtx, OBJECT_GI_HEARTS) == this->actor.objBankIndex) {
if (Object_GetSlot(&play->objectCtx, OBJECT_GI_HEARTS) == this->actor.objectSlot) {
OPEN_DISPS(play->state.gfxCtx);
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
+1 -1
View File
@@ -216,7 +216,7 @@ s32 Horse_IsActive(PlayState* play, ActorContext* actorCtx) {
if (bgActor != NULL) {
while (true) {
if ((bgActor->update != NULL) && (bgActor->init == NULL)) {
if (Object_IsLoaded(&play->objectCtx, bgActor->objBankIndex)) {
if (Object_IsLoaded(&play->objectCtx, bgActor->objectSlot)) {
if ((bgActor->id == ACTOR_EN_HORSE) && (((EnHorse*)bgActor)->action != ENHORSE_ACTION_INACTIVE)) {
return true;
}
+7 -7
View File
@@ -392,16 +392,16 @@ void func_8012301C(Actor* thisx, PlayState* play2) {
this->actionVar1++;
if (this->actionVar1 == 2) {
s16 objectId = gPlayerFormObjectIndices[GET_PLAYER_FORM];
s16 objectId = gPlayerFormObjectIds[GET_PLAYER_FORM];
gActorOverlayTable[ACTOR_PLAYER].initInfo->objectId = objectId;
func_8012F73C(&play->objectCtx, this->actor.objBankIndex, objectId);
this->actor.objBankIndex = Object_GetSlot(&play->objectCtx, GAMEPLAY_KEEP);
func_8012F73C(&play->objectCtx, this->actor.objectSlot, objectId);
this->actor.objectSlot = Object_GetSlot(&play->objectCtx, GAMEPLAY_KEEP);
} else if (this->actionVar1 >= 3) {
s32 objBankIndex = Object_GetSlot(&play->objectCtx, gActorOverlayTable[ACTOR_PLAYER].initInfo->objectId);
s32 objectSlot = Object_GetSlot(&play->objectCtx, gActorOverlayTable[ACTOR_PLAYER].initInfo->objectId);
if (Object_IsLoaded(&play->objectCtx, objBankIndex)) {
this->actor.objBankIndex = objBankIndex;
if (Object_IsLoaded(&play->objectCtx, objectSlot)) {
this->actor.objectSlot = objectSlot;
this->actor.shape.rot.z = GET_PLAYER_FORM + 1;
this->actor.init = PlayerCall_Init;
this->actor.update = PlayerCall_Update;
@@ -1869,7 +1869,7 @@ void Player_DrawHookshotReticle(PlayState* play, Player* player, f32 hookshotDis
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.slots[player->actor.objBankIndex].segment);
gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.slots[player->actor.objectSlot].segment);
gSPDisplayList(OVERLAY_DISP++, gHookshotReticleDL);
CLOSE_DISPS(play->state.gfxCtx);
+4 -4
View File
@@ -157,7 +157,7 @@ void* func_8012F73C(ObjectContext* objectCtx, s32 slot, s16 id) {
void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
s32 loadedCount;
s16 playerObjectId;
void* nextObject;
void* objectPtr;
play->linkActorEntry =
(ActorEntry*)Lib_SegmentedToVirtual(cmd->spawnList.segment) + play->setupEntranceList[play->curSpawn].spawn;
@@ -170,14 +170,14 @@ void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
}
loadedCount = Object_SpawnPersistent(&play->objectCtx, OBJECT_LINK_CHILD);
nextObject = play->objectCtx.slots[play->objectCtx.numEntries].segment;
objectPtr = play->objectCtx.slots[play->objectCtx.numEntries].segment;
play->objectCtx.numEntries = loadedCount;
play->objectCtx.numPersistentEntries = loadedCount;
playerObjectId = gPlayerFormObjectIndices[GET_PLAYER_FORM];
playerObjectId = gPlayerFormObjectIds[GET_PLAYER_FORM];
gActorOverlayTable[0].initInfo->objectId = playerObjectId;
Object_SpawnPersistent(&play->objectCtx, playerObjectId);
play->objectCtx.slots[play->objectCtx.numEntries].segment = nextObject;
play->objectCtx.slots[play->objectCtx.numEntries].segment = objectPtr;
}
// SceneTableEntry Header Command 0x01: Actor List
+4 -4
View File
@@ -1169,12 +1169,12 @@ s16 SubS_GetDistSqAndOrientPath(Path* path, s32 pointIndex, Vec3f* pos, f32* dis
return Math_Atan2S(diffX, diffZ);
}
s8 SubS_IsObjectLoaded(s8 index, PlayState* play) {
return !Object_IsLoaded(&play->objectCtx, index) ? false : true;
s8 SubS_IsObjectLoaded(s8 objectSlot, PlayState* play) {
return !Object_IsLoaded(&play->objectCtx, objectSlot) ? false : true;
}
s8 SubS_GetObjectIndex(s16 id, PlayState* play) {
return Object_GetSlot(&play->objectCtx, id);
s8 SubS_GetObjectSlot(s16 objectId, PlayState* play) {
return Object_GetSlot(&play->objectCtx, objectId);
}
/**
@@ -52,7 +52,7 @@ ActorInit Bg_Breakwall_InitVars = {
};
typedef struct {
/* 0x00 */ s16 unk_00;
/* 0x00 */ s16 objectId;
/* 0x04 */ Gfx* unk_04;
/* 0x08 */ Gfx* unk_08;
/* 0x0C */ AnimatedMaterial* unk_0C;
@@ -212,9 +212,9 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) {
BgBreakwallStruct* sp24 = &D_808B8140[BGBREAKWALL_GET_F(&this->dyna.actor)];
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->unk_15C = Object_GetSlot(&play->objectCtx, sp24->unk_00);
this->objectSlot = Object_GetSlot(&play->objectCtx, sp24->objectId);
if ((this->unk_15C < 0) || !sp24->unk_14(this, play)) {
if ((this->objectSlot <= OBJECT_SLOT_NONE) || !sp24->unk_14(this, play)) {
Actor_Kill(&this->dyna.actor);
return;
}
@@ -233,10 +233,10 @@ void BgBreakwall_Destroy(Actor* thisx, PlayState* play) {
}
void func_808B76CC(BgBreakwall* this, PlayState* play) {
if (Object_IsLoaded(&play->objectCtx, this->unk_15C)) {
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
BgBreakwallStruct* temp_s1 = &D_808B8140[BGBREAKWALL_GET_F(&this->dyna.actor)];
this->dyna.actor.objBankIndex = this->unk_15C;
this->dyna.actor.objectSlot = this->objectSlot;
this->dyna.actor.draw = BgBreakwall_Draw;
if (((BGBREAKWALL_GET_F(&this->dyna.actor)) != BGBREAKWALL_F_7) &&
@@ -20,7 +20,7 @@ typedef enum {
typedef struct BgBreakwall {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ s8 unk_15C;
/* 0x15C */ s8 objectSlot;
/* 0x15D */ u8 switchFlag;
/* 0x15E */ u8 unk_15E;
/* 0x160 */ BgBreakwallActionFunc actionFunc;

Some files were not shown because too many files have changed in this diff Show More