mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-21 22:10:51 -04:00
Object Cleanup (#1410)
* object cleanup * namefixer * objectPtr * PR Review * PR Review * more uses of macro * missed another one
This commit is contained in:
+3
-3
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
|
||||
@@ -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,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
@@ -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
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
@@ -378,7 +378,7 @@ void BgNumaHana_Draw(Actor* thisx, PlayState* play2) {
|
||||
BgNumaHana* this = THIS;
|
||||
WoodenFlowerPetalPosRot* innerPetalPosRot;
|
||||
WoodenFlowerPetalPosRot* outerPetalPosRot;
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
s32 i;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
@@ -404,13 +404,13 @@ void BgNumaHana_Draw(Actor* thisx, PlayState* play2) {
|
||||
gSPDisplayList(POLY_OPA_DISP++, gWoodenFlowerOuterPetalDL);
|
||||
}
|
||||
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_SYOKUDAI);
|
||||
if ((objectIndex >= 0) && (Object_IsLoaded(&play->objectCtx, objectIndex))) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_SYOKUDAI);
|
||||
if ((objectSlot > OBJECT_SLOT_NONE) && (Object_IsLoaded(&play->objectCtx, objectSlot))) {
|
||||
Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y - 64.5f,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Scale(1.5f, 1.5f, 1.5f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gObjectSyokudaiTypeNoSwitchDL);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,9 +103,9 @@ void BgUmajump_Init(Actor* thisx, PlayState* play) {
|
||||
thisx->update = Actor_Noop;
|
||||
}
|
||||
} else {
|
||||
this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_UMAJUMP);
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_UMAJUMP);
|
||||
|
||||
if (this->objectIndex < 0) {
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(thisx);
|
||||
}
|
||||
|
||||
@@ -126,8 +126,8 @@ void BgUmajump_Destroy(Actor* thisx, PlayState* play) {
|
||||
void BgUmajump_Update(Actor* thisx, PlayState* play) {
|
||||
BgUmajump* this = THIS;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
this->dyna.actor.objBankIndex = this->objectIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->dyna.actor.objectSlot = this->objectSlot;
|
||||
this->dyna.actor.draw = BgUmajump_Draw;
|
||||
|
||||
Actor_SetObjectDependency(play, &this->dyna.actor);
|
||||
|
||||
@@ -23,7 +23,7 @@ typedef struct BgUmajump {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ BgUmajumpActionFunc actionFunc;
|
||||
/* 0x160 */ union {
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
s32 rotationTimer; // y rotation
|
||||
s32 pathIndex;
|
||||
};
|
||||
|
||||
@@ -2152,14 +2152,14 @@ void Boss03_Update(Actor* thisx, PlayState* play2) {
|
||||
/* Start of Gyorg's Draw section */
|
||||
|
||||
void Boss03_SetObject(PlayState* play, s16 objectId) {
|
||||
s32 objectIndex = Object_GetSlot(&play->objectCtx, objectId);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, objectId);
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectIndex].segment);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[objectIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -37,14 +37,14 @@ ActorInit Demo_Effect_InitVars = {
|
||||
};
|
||||
|
||||
void DemoEffect_Init(Actor* thisx, PlayState* play) {
|
||||
static s16 sEffectTypeObjects[] = {
|
||||
static s16 sEffectTypeObjectIds[] = {
|
||||
OBJECT_EFC_TW, OBJECT_EFC_TW, OBJECT_EFC_TW, OBJECT_EFC_TW, GAMEPLAY_KEEP,
|
||||
GAMEPLAY_KEEP, GAMEPLAY_KEEP, GAMEPLAY_KEEP, GAMEPLAY_KEEP,
|
||||
};
|
||||
s32 pad;
|
||||
DemoEffect* this = THIS;
|
||||
s32 type = DEMO_EFFECT_GET_TYPE(&this->actor);
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
s32 pad2;
|
||||
Color_RGB8 lightColors[] = {
|
||||
{ 200, 200, 0 }, // Yellow
|
||||
@@ -54,16 +54,16 @@ void DemoEffect_Init(Actor* thisx, PlayState* play) {
|
||||
{ 255, 255, 80 }, // Light Yellow
|
||||
};
|
||||
|
||||
if (sEffectTypeObjects[type] == GAMEPLAY_KEEP) {
|
||||
objectIndex = 0;
|
||||
if (sEffectTypeObjectIds[type] == GAMEPLAY_KEEP) {
|
||||
objectSlot = 0;
|
||||
} else {
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, sEffectTypeObjects[type]);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, sEffectTypeObjectIds[type]);
|
||||
}
|
||||
|
||||
if (objectIndex < 0) {
|
||||
if (objectSlot <= OBJECT_SLOT_NONE) {
|
||||
// assert on debug
|
||||
} else {
|
||||
this->initObjectIndex = objectIndex;
|
||||
this->initObjectSlot = objectSlot;
|
||||
}
|
||||
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
@@ -123,8 +123,8 @@ void DemoEffect_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void DemoEffect_WaitForObject(DemoEffect* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->initObjectIndex)) {
|
||||
this->actor.objBankIndex = this->initObjectIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->initObjectSlot)) {
|
||||
this->actor.objectSlot = this->initObjectSlot;
|
||||
this->actor.draw = this->initDrawFunc;
|
||||
this->actionFunc = this->initActionFunc;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ typedef enum {
|
||||
typedef struct DemoEffect {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelCurve skelCurve;
|
||||
/* 0x164 */ u8 initObjectIndex;
|
||||
/* 0x164 */ u8 initObjectSlot;
|
||||
/* 0x165 */ u8 primXluColor[3];
|
||||
/* 0x168 */ u8 envXluColor[3];
|
||||
/* 0x16C */ s16 timer;
|
||||
|
||||
@@ -30,7 +30,7 @@ ActorInit Demo_Getitem_InitVars = {
|
||||
(ActorFunc)NULL,
|
||||
};
|
||||
|
||||
static s16 sObjectBankIndices[] = { OBJECT_GI_MASK14, OBJECT_GI_SWORD_4 };
|
||||
static s16 sObjectIds[] = { OBJECT_GI_MASK14, OBJECT_GI_SWORD_4 };
|
||||
|
||||
static s16 sGetItemDraws[] = { GID_MASK_GREAT_FAIRY, GID_SWORD_GREAT_FAIRY };
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef enum GreatFairyRewardItem {
|
||||
|
||||
void DemoGetitem_Init(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
s32 itemIndex;
|
||||
DemoGetitem* this = THIS;
|
||||
|
||||
@@ -57,22 +57,22 @@ void DemoGetitem_Init(Actor* thisx, PlayState* play) {
|
||||
this->getItemDrawId = sGetItemDraws[itemIndex];
|
||||
this->cueType = sCueTypes[itemIndex];
|
||||
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, sObjectBankIndices[itemIndex]);
|
||||
if (objectIndex < 0) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[itemIndex]);
|
||||
if (objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
this->objectIndex = objectIndex;
|
||||
this->objectSlot = objectSlot;
|
||||
}
|
||||
|
||||
void DemoGetitem_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void DemoGetitem_Wait(DemoGetitem* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.draw = NULL;
|
||||
this->actor.objBankIndex = this->objectIndex;
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
this->actionFunc = DemoGetitem_PerformCutsceneActions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ typedef struct DemoGetitem {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ s16 getItemDrawId;
|
||||
/* 0x146 */ u16 cueType;
|
||||
/* 0x148 */ s8 objectIndex;
|
||||
/* 0x148 */ s8 objectSlot;
|
||||
/* 0x14C */ DemoGetitemActionFunc actionFunc;
|
||||
} DemoGetitem; // size = 0x150
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ ActorInit Demo_Kankyo_InitVars = {
|
||||
(ActorFunc)DemoKankyo_Draw,
|
||||
};
|
||||
|
||||
static s32 sObjectBubbleIndex = OBJECT_BUBBLE | 0x10000;
|
||||
static s32 sObjectBubbleId = OBJECT_BUBBLE | 0x10000;
|
||||
|
||||
void DemoKankyo_SetupAction(DemoKankyo* this, DemoKankyoActionFunc actionFunc) {
|
||||
this->actionFunc = actionFunc;
|
||||
@@ -279,9 +279,9 @@ void DemoKakyo_LostWoodsSparkleActionFunc(DemoKankyo* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void DemoKakyo_GiantObjectCheck(DemoKankyo* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectId)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->isSafeToDrawGiants = true;
|
||||
this->actor.objBankIndex = this->objectId;
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
DemoKankyo_SetupAction(this, DemoKakyo_MoonSparklesActionFunc);
|
||||
}
|
||||
}
|
||||
@@ -437,7 +437,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) {
|
||||
DemoKankyo* this = THIS;
|
||||
s32 pad;
|
||||
s32 i;
|
||||
s32 objId;
|
||||
s32 objectSlot;
|
||||
|
||||
// This must be a single line to match, possibly a macro?
|
||||
// clang-format off
|
||||
@@ -449,7 +449,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
switch (this->actor.params) {
|
||||
case DEMO_KANKYO_TYPE_LOSTWOODS:
|
||||
objId = OBJECT_UNSET_0;
|
||||
objectSlot = 0;
|
||||
this->actor.room = -1;
|
||||
if (sLostWoodsSparklesMutex == false) {
|
||||
DemoKankyo_SetupAction(this, DemoKakyo_LostWoodsSparkleActionFunc);
|
||||
@@ -461,24 +461,24 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
case DEMO_KANKYO_TYPE_GIANTS:
|
||||
this->isSafeToDrawGiants = false;
|
||||
objId = Object_GetSlot(&play->objectCtx, sObjectBubbleIndex);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, sObjectBubbleId);
|
||||
DemoKankyo_SetupAction(this, DemoKakyo_GiantObjectCheck);
|
||||
break;
|
||||
|
||||
case DEMO_KANKYO_TYPE_MOON:
|
||||
objId = OBJECT_UNSET_0;
|
||||
objectSlot = 0;
|
||||
this->isSafeToDrawGiants = true;
|
||||
DemoKankyo_SetupAction(this, DemoKakyo_MoonSparklesActionFunc);
|
||||
break;
|
||||
|
||||
default:
|
||||
//! @bug: this causes a crash because the actionfunc is never set
|
||||
objId = -1;
|
||||
objectSlot = OBJECT_SLOT_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (objId > -1) {
|
||||
this->objectId = objId;
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->objectSlot = objectSlot;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ typedef struct DemoKankyo {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x0144 */ DemoKankyoEffect effects[DEMOKANKYO_EFFECT_COUNT];
|
||||
/* 0x1644 */ DemoKankyoActionFunc actionFunc;
|
||||
/* 0x1648 */ s32 objectId;
|
||||
/* 0x1648 */ s32 objectSlot;
|
||||
/* 0x164C */ u8 isSafeToDrawGiants;
|
||||
} DemoKankyo; // size = 0x1650
|
||||
|
||||
|
||||
@@ -70,41 +70,41 @@ static AnimationInfoS sAnimationInfo[DMAN_ANIM_MAX] = {
|
||||
};
|
||||
|
||||
s32 DmAn_UpdateSkelAnime(DmAn* this, PlayState* play) {
|
||||
s8 objectIndex = this->actor.objBankIndex;
|
||||
s8 objectIndex2;
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 objectSlot2;
|
||||
s32 isAnimFinished = false;
|
||||
|
||||
if (this->animIndex <= DMAN_ANIM_1) {
|
||||
objectIndex2 = this->actor.objBankIndex;
|
||||
objectSlot2 = this->actor.objectSlot;
|
||||
} else {
|
||||
objectIndex2 = this->unk_2AC;
|
||||
objectSlot2 = this->an4ObjectSlot;
|
||||
}
|
||||
|
||||
if (objectIndex2 >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment);
|
||||
if (objectSlot2 >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot2].segment);
|
||||
isAnimFinished = SkelAnime_Update(&this->skelAnime);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
}
|
||||
|
||||
return isAnimFinished;
|
||||
}
|
||||
|
||||
s32 DmAn_ChangeAnim(DmAn* this, PlayState* play, s32 animIndex) {
|
||||
s8 objectIndex = this->actor.objBankIndex;
|
||||
s8 objectIndex2;
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 objectSlot2;
|
||||
s32 didAnimChange = false;
|
||||
|
||||
if (animIndex <= DMAN_ANIM_1) {
|
||||
objectIndex2 = this->actor.objBankIndex;
|
||||
objectSlot2 = this->actor.objectSlot;
|
||||
} else {
|
||||
objectIndex2 = this->unk_2AC;
|
||||
objectSlot2 = this->an4ObjectSlot;
|
||||
}
|
||||
|
||||
if ((objectIndex2 >= 0) && (this->animIndex != animIndex)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment);
|
||||
if ((objectSlot2 >= 0) && (this->animIndex != animIndex)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot2].segment);
|
||||
this->animIndex = animIndex;
|
||||
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
}
|
||||
|
||||
return didAnimChange;
|
||||
@@ -191,8 +191,8 @@ Actor* func_80C1C8E8(PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80C1C958(DmAn* this, PlayState* play) {
|
||||
if ((this->unk_2AC >= 0) && SubS_IsObjectLoaded(this->unk_2AC, play) && (this->unk_2AD >= 0) &&
|
||||
SubS_IsObjectLoaded(this->unk_2AD, play)) {
|
||||
if ((this->an4ObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->an4ObjectSlot, play) &&
|
||||
(this->msmoObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->msmoObjectSlot, play)) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &object_an1_Skel_012618, NULL, this->jointTable, this->morphTable,
|
||||
OBJECT_AN1_LIMB_MAX);
|
||||
@@ -273,8 +273,8 @@ void DmAn_DoNothing(DmAn* this, PlayState* play) {
|
||||
void DmAn_Init(Actor* thisx, PlayState* play) {
|
||||
DmAn* this = THIS;
|
||||
|
||||
this->unk_2AC = SubS_GetObjectIndex(OBJECT_AN4, play);
|
||||
this->unk_2AD = SubS_GetObjectIndex(OBJECT_MSMO, play);
|
||||
this->an4ObjectSlot = SubS_GetObjectSlot(OBJECT_AN4, play);
|
||||
this->msmoObjectSlot = SubS_GetObjectSlot(OBJECT_MSMO, play);
|
||||
this->actionFunc = func_80C1C958;
|
||||
}
|
||||
|
||||
@@ -302,8 +302,8 @@ Vec3f D_80C1D2DC = { 1000.0f, 0.0f, 0.0f };
|
||||
void func_80C1CD80(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
s32 pad[2];
|
||||
DmAn* this = THIS;
|
||||
s8 sp2B = this->actor.objBankIndex;
|
||||
s8 sp2A = this->unk_2AD;
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 msmoObjectSlot = this->msmoObjectSlot;
|
||||
|
||||
if ((limbIndex == OBJECT_AN1_LIMB_05) && this->didAnimChangeInCs) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
@@ -312,9 +312,9 @@ void func_80C1CD80(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto
|
||||
Matrix_TranslateRotateZYX(&D_80C1D2C8, &D_80C1D2D4);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2A].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[msmoObjectSlot].segment);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gMoonMaskDL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2B].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ typedef struct DmAn {
|
||||
/* 0x1A4 */ Vec3s unk_1AA;
|
||||
/* 0x1B0 */ Vec3s jointTable[OBJECT_AN1_LIMB_MAX];
|
||||
/* 0x22E */ Vec3s morphTable[OBJECT_AN1_LIMB_MAX];
|
||||
/* 0x2AC */ s8 unk_2AC;
|
||||
/* 0x2AD */ s8 unk_2AD;
|
||||
/* 0x2AC */ s8 an4ObjectSlot;
|
||||
/* 0x2AD */ s8 msmoObjectSlot;
|
||||
/* 0x2AE */ u16 unk_2AE;
|
||||
/* 0x2B0 */ u8 cueId;
|
||||
/* 0x2B4 */ Actor* unk_2B4;
|
||||
|
||||
@@ -72,10 +72,10 @@ void DmChar03_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80AAB5F8(DmChar03* this, PlayState* play) {
|
||||
s32 index = Object_GetSlot(&play->objectCtx, OBJECT_GI_NUTSMASK);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_NUTSMASK);
|
||||
|
||||
if (index >= 0) {
|
||||
this->objectIndex = index;
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->objectSlot = objectSlot;
|
||||
this->actionFunc = func_80AAB644;
|
||||
}
|
||||
}
|
||||
@@ -187,13 +187,13 @@ void DmChar03_Draw(Actor* thisx, PlayState* play) {
|
||||
void func_80AABA84(PlayState* play, DmChar03* this) {
|
||||
s32 pad;
|
||||
|
||||
if (this->actor.objBankIndex == this->objectIndex) {
|
||||
if (this->actor.objectSlot == this->objectSlot) {
|
||||
Matrix_Translate(this->offset.x, this->offset.y, this->offset.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, (play->gameplayFrames * 0x3E8), 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(play, GID_MASK_DEKU);
|
||||
}
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
this->actor.objBankIndex = this->objectIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ typedef struct DmChar03 {
|
||||
/* 0x188 */ DmChar03ActionFunc actionFunc;
|
||||
/* 0x18C */ s16 animIndex;
|
||||
/* 0x18E */ u8 unk_18E;
|
||||
/* 0x18F */ u8 objectIndex;
|
||||
/* 0x18F */ u8 objectSlot;
|
||||
/* 0x190 */ Vec3f offset;
|
||||
} DmChar03; // size = 0x19C
|
||||
|
||||
|
||||
@@ -178,10 +178,10 @@ void DmChar05_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80AAC990(DmChar05* this, PlayState* play) {
|
||||
s32 objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_GI_GOLONMASK);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_GOLONMASK);
|
||||
|
||||
if (objectIdx >= 0) {
|
||||
this->unk_18F = objectIdx;
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->objectSlot = objectSlot;
|
||||
this->actionFunc = func_80AAC9DC;
|
||||
}
|
||||
}
|
||||
@@ -200,10 +200,10 @@ void func_80AAC9DC(DmChar05* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80AACA98(DmChar05* this, PlayState* play) {
|
||||
s32 objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_GI_MASK13);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_MASK13);
|
||||
|
||||
if (objectIdx >= 0) {
|
||||
this->unk_18F = objectIdx;
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->objectSlot = objectSlot;
|
||||
this->actionFunc = func_80AACAE4;
|
||||
}
|
||||
}
|
||||
@@ -227,15 +227,15 @@ void func_80AACAE4(DmChar05* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80AACBE4(DmChar05* this, PlayState* play) {
|
||||
static s16 D_80AAE2F0[] = {
|
||||
static s16 sObjectIds[] = {
|
||||
OBJECT_GI_MASK17, OBJECT_GI_MASK14, OBJECT_GI_MASK10, OBJECT_GI_MASK21,
|
||||
OBJECT_GI_MASK11, OBJECT_GI_MASK20, OBJECT_GI_RABIT_MASK, OBJECT_GI_MASK12,
|
||||
};
|
||||
s32 params = DMCHAR05_GET(&this->actor) - DMCHAR05_5;
|
||||
s32 objectIdx = Object_GetSlot(&play->objectCtx, D_80AAE2F0[params]);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[params]);
|
||||
|
||||
if (objectIdx >= 0) {
|
||||
this->unk_18F = objectIdx;
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->objectSlot = objectSlot;
|
||||
this->actionFunc = func_80AACD0C;
|
||||
}
|
||||
}
|
||||
@@ -278,10 +278,10 @@ void func_80AACD0C(DmChar05* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80AACD1C(DmChar05* this, PlayState* play) {
|
||||
s32 objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_GI_ZORAMASK);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_ZORAMASK);
|
||||
|
||||
if (objectIdx >= 0) {
|
||||
this->unk_18F = objectIdx;
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->objectSlot = objectSlot;
|
||||
this->actionFunc = func_80AACD68;
|
||||
}
|
||||
}
|
||||
@@ -298,10 +298,10 @@ void func_80AACD68(DmChar05* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80AACE10(DmChar05* this, PlayState* play) {
|
||||
s32 objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_GI_MASK15);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_GI_MASK15);
|
||||
|
||||
if (objectIdx >= 0) {
|
||||
this->unk_18F = objectIdx;
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->objectSlot = objectSlot;
|
||||
this->actionFunc = func_80AACE5C;
|
||||
}
|
||||
}
|
||||
@@ -723,55 +723,55 @@ void DmChar05_Draw(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80AADD9C(PlayState* play, DmChar05* this) {
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
if (this->actor.objectSlot == this->objectSlot) {
|
||||
Matrix_Translate(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, play->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(play, GID_MASK_GORON);
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->unk_18F)) {
|
||||
this->actor.objBankIndex = this->unk_18F;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AADE78(PlayState* play, DmChar05* this) {
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
if (this->actor.objectSlot == this->objectSlot) {
|
||||
Matrix_Translate(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, play->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(play, GID_MASK_ZORA);
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->unk_18F)) {
|
||||
this->actor.objBankIndex = this->unk_18F;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AADF54(PlayState* play, DmChar05* this) {
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
if (this->actor.objectSlot == this->objectSlot) {
|
||||
Matrix_Translate(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, play->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(play, GID_MASK_GIBDO);
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->unk_18F)) {
|
||||
this->actor.objBankIndex = this->unk_18F;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AAE030(PlayState* play, DmChar05* this) {
|
||||
if (this->unk_18E != 0) {
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
if (this->actor.objectSlot == this->objectSlot) {
|
||||
Matrix_Translate(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, play->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(play, GID_MASK_COUPLE);
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->unk_18F)) {
|
||||
this->actor.objBankIndex = this->unk_18F;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -784,14 +784,14 @@ void func_80AAE114(PlayState* play, DmChar05* this) {
|
||||
};
|
||||
|
||||
getItemDrawIndex = DMCHAR05_GET(&this->actor) - DMCHAR05_5;
|
||||
if (this->actor.objBankIndex == this->unk_18F) {
|
||||
if (this->actor.objectSlot == this->objectSlot) {
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateZYX(0, play->gameplayFrames * 1000, 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
GetItem_Draw(play, getItemDrawIds[getItemDrawIndex]);
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->unk_18F)) {
|
||||
this->actor.objBankIndex = this->unk_18F;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ typedef struct DmChar05 {
|
||||
/* 0x188 */ DmChar05ActionFunc actionFunc;
|
||||
/* 0x18C */ s16 animIndex;
|
||||
/* 0x18E */ u8 unk_18E;
|
||||
/* 0x18F */ u8 unk_18F;
|
||||
/* 0x18F */ u8 objectSlot;
|
||||
/* 0x190 */ Vec3f unk_190;
|
||||
/* 0x19C */ u32 unk_19C;
|
||||
/* 0x1A0 */ u32 unk_1A0;
|
||||
|
||||
@@ -70,41 +70,41 @@ static AnimationInfoS sAnimationInfo[DMGM_ANIM_MAX] = {
|
||||
};
|
||||
|
||||
s32 DmGm_UpdateSkelAnime(DmGm* this, PlayState* play) {
|
||||
s8 objectIndex = this->actor.objBankIndex;
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 objectIndex2;
|
||||
s32 isAnimFinished = false;
|
||||
|
||||
if (this->animIndex <= DMGM_ANIM_1) {
|
||||
objectIndex2 = this->actor.objBankIndex;
|
||||
objectIndex2 = this->actor.objectSlot;
|
||||
} else {
|
||||
objectIndex2 = this->unk_2AC;
|
||||
objectIndex2 = this->an4ObjectSlot;
|
||||
}
|
||||
|
||||
if (objectIndex2 >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment);
|
||||
isAnimFinished = SkelAnime_Update(&this->skelAnime);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
}
|
||||
|
||||
return isAnimFinished;
|
||||
}
|
||||
|
||||
s32 DmGm_ChangeAnim(DmGm* this, PlayState* play, s32 animIndex) {
|
||||
s8 objectIndex = this->actor.objBankIndex;
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 objectIndex2;
|
||||
s32 didAnimChange = false;
|
||||
|
||||
if (animIndex <= DMGM_ANIM_1) {
|
||||
objectIndex2 = this->actor.objBankIndex;
|
||||
objectIndex2 = this->actor.objectSlot;
|
||||
} else {
|
||||
objectIndex2 = this->unk_2AC;
|
||||
objectIndex2 = this->an4ObjectSlot;
|
||||
}
|
||||
|
||||
if ((objectIndex2 >= 0) && (this->animIndex != animIndex)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment);
|
||||
this->animIndex = animIndex;
|
||||
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
}
|
||||
|
||||
return didAnimChange;
|
||||
@@ -191,8 +191,8 @@ Actor* func_80C24838(PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80C248A8(DmGm* this, PlayState* play) {
|
||||
if ((this->unk_2AC >= 0) && SubS_IsObjectLoaded(this->unk_2AC, play) && (this->unk_2AD >= 0) &&
|
||||
SubS_IsObjectLoaded(this->unk_2AD, play)) {
|
||||
if ((this->an4ObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->an4ObjectSlot, play) &&
|
||||
(this->msmoObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->msmoObjectSlot, play)) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &object_an1_Skel_012618, NULL, this->jointTable, this->morphTable,
|
||||
OBJECT_AN1_LIMB_MAX);
|
||||
@@ -273,8 +273,8 @@ void DmGm_DoNothing(DmGm* this, PlayState* play) {
|
||||
void DmGm_Init(Actor* thisx, PlayState* play) {
|
||||
DmGm* this = THIS;
|
||||
|
||||
this->unk_2AC = SubS_GetObjectIndex(OBJECT_AN4, play);
|
||||
this->unk_2AD = SubS_GetObjectIndex(OBJECT_MSMO, play);
|
||||
this->an4ObjectSlot = SubS_GetObjectSlot(OBJECT_AN4, play);
|
||||
this->msmoObjectSlot = SubS_GetObjectSlot(OBJECT_MSMO, play);
|
||||
this->actionFunc = func_80C248A8;
|
||||
}
|
||||
|
||||
@@ -302,8 +302,8 @@ Vec3f D_80C2522C = { 1000.0f, 0.0f, 0.0f };
|
||||
void DmGm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
s32 pad[2];
|
||||
DmGm* this = THIS;
|
||||
s8 sp2B = this->actor.objBankIndex;
|
||||
s8 sp2A = this->unk_2AD;
|
||||
s8 sp2B = this->actor.objectSlot;
|
||||
s8 sp2A = this->msmoObjectSlot;
|
||||
|
||||
if ((limbIndex == OBJECT_AN1_LIMB_05) && this->didAnimChangeInCs) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
@@ -18,8 +18,8 @@ typedef struct DmGm {
|
||||
/* 0x1A4 */ Vec3s unk_1AA;
|
||||
/* 0x1B0 */ Vec3s jointTable[OBJECT_AN1_LIMB_MAX];
|
||||
/* 0x22E */ Vec3s morphTable[OBJECT_AN1_LIMB_MAX];
|
||||
/* 0x2AC */ s8 unk_2AC;
|
||||
/* 0x2AD */ s8 unk_2AD;
|
||||
/* 0x2AC */ s8 an4ObjectSlot;
|
||||
/* 0x2AD */ s8 msmoObjectSlot;
|
||||
/* 0x2AE */ u16 unk_2AE;
|
||||
/* 0x2B0 */ u8 cueId;
|
||||
/* 0x2B4 */ Actor* unk_2B4;
|
||||
|
||||
@@ -307,20 +307,20 @@ static AnimationInfo sAnimationInfo[SK_ANIM_LAUGH_AFTER_MAX] = {
|
||||
* Ensures the correct object for the current animation is in segment 6.
|
||||
*/
|
||||
void DmStk_LoadObjectForAnimation(DmStk* this, PlayState* play) {
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
|
||||
if (((this->animIndex >= SK_ANIM_SHAKE_HEAD) && (this->animIndex <= SK_ANIM_BENT_OVER_HEAD_TWITCH)) ||
|
||||
(this->animIndex == SK_ANIM_CALL_DOWN_MOON_START) || (this->animIndex == SK_ANIM_CALL_DOWN_MOON_LOOP) ||
|
||||
(this->animIndex == SK_ANIM_TELESCOPE_LOOK_UP_START) || (this->animIndex == SK_ANIM_TELESCOPE_LOOK_UP_LOOP)) {
|
||||
objectIndex = this->objectStkObjectIndex;
|
||||
objectSlot = this->objectStkObjectSlot;
|
||||
} else if (this->animIndex >= SK_ANIM_LOOK_UP_AT_GIANTS) {
|
||||
objectIndex = this->objectStk3ObjectIndex;
|
||||
objectSlot = this->objectStk3ObjectSlot;
|
||||
} else {
|
||||
objectIndex = this->objectStk2ObjectIndex;
|
||||
objectSlot = this->objectStk2ObjectSlot;
|
||||
}
|
||||
|
||||
if (objectIndex >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment);
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1062,10 +1062,10 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
|
||||
this->shouldDraw = true;
|
||||
if (DM_STK_GET_TYPE(&this->actor) != DM_STK_TYPE_MAJORAS_MASK) {
|
||||
this->dekuPipesCutsceneState = SK_DEKU_PIPES_CS_STATE_NOT_READY;
|
||||
this->objectStkObjectIndex = Object_GetSlot(&play->objectCtx, OBJECT_STK);
|
||||
this->objectStk2ObjectIndex = Object_GetSlot(&play->objectCtx, OBJECT_STK2);
|
||||
this->objectStk3ObjectIndex = Object_GetSlot(&play->objectCtx, OBJECT_STK3);
|
||||
if (this->objectStkObjectIndex < 0) {
|
||||
this->objectStkObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_STK);
|
||||
this->objectStk2ObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_STK2);
|
||||
this->objectStk3ObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_STK3);
|
||||
if (this->objectStkObjectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
||||
@@ -1965,18 +1965,18 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
|
||||
|
||||
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_513) &&
|
||||
(play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_513)]->id == 2) &&
|
||||
(this->objectStk2ObjectIndex >= 0)) {
|
||||
(this->objectStk2ObjectSlot > OBJECT_SLOT_NONE)) {
|
||||
Matrix_Push();
|
||||
Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectStk2ObjectIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectStk2ObjectSlot].segment);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectStk2ObjectIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectStk2ObjectSlot].segment);
|
||||
|
||||
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(gSkullKidMajorasMaskCurseOverlayTexAnim));
|
||||
Gfx_DrawDListOpa(play, gSkullKidMajorasMaskCurseOverlayDL);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectStkObjectIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectStkObjectSlot].segment);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectStkObjectIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectStkObjectSlot].segment);
|
||||
|
||||
Matrix_Pop();
|
||||
}
|
||||
@@ -2095,7 +2095,7 @@ void DmStk_Draw(Actor* thisx, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectStkObjectIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectStkObjectSlot].segment);
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ typedef struct DmStk {
|
||||
/* 0x330 */ s32 fadeOutTimer;
|
||||
/* 0x334 */ u8 cueId;
|
||||
/* 0x335 */ u8 hasBeenHit; // set but never used
|
||||
/* 0x336 */ s8 objectStkObjectIndex;
|
||||
/* 0x337 */ s8 objectStk2ObjectIndex;
|
||||
/* 0x338 */ s8 objectStk3ObjectIndex;
|
||||
/* 0x336 */ s8 objectStkObjectSlot;
|
||||
/* 0x337 */ s8 objectStk2ObjectSlot;
|
||||
/* 0x338 */ s8 objectStk3ObjectSlot;
|
||||
/* 0x339 */ u8 deflectCount;
|
||||
/* 0x33A */ u8 dekuPipesCutsceneState;
|
||||
/* 0x33B */ u8 shouldDraw;
|
||||
|
||||
@@ -234,7 +234,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) {
|
||||
this->slidingDoor.dyna.actor.room = -1;
|
||||
}
|
||||
|
||||
if ((this->requiredObjBankIndex = Object_GetSlot(&play->objectCtx, D_808A2180[sp24].objectId)) < 0) {
|
||||
if ((this->objectSlot = Object_GetSlot(&play->objectCtx, D_808A2180[sp24].objectId)) <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->slidingDoor.dyna.actor);
|
||||
return;
|
||||
}
|
||||
@@ -263,9 +263,9 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void DoorShutter_SetupType(DoorShutter* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex) &&
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot) &&
|
||||
(!R_PLAY_FILL_SCREEN_ON || (R_PLAY_FILL_SCREEN_ALPHA == 0))) {
|
||||
this->slidingDoor.dyna.actor.objBankIndex = this->requiredObjBankIndex;
|
||||
this->slidingDoor.dyna.actor.objectSlot = this->objectSlot;
|
||||
this->slidingDoor.dyna.actor.draw = DoorShutter_Draw;
|
||||
DoorShutter_SetupDoor(this, play);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ typedef struct DoorShutter {
|
||||
/* 0x0162 */ u8 doorType;
|
||||
/* 0x0163 */ u8 unk_163;
|
||||
/* 0x0164 */ u8 unk_164;
|
||||
/* 0x0165 */ s8 requiredObjBankIndex;
|
||||
/* 0x0165 */ s8 objectSlot;
|
||||
/* 0x0166 */ s8 unk_166;
|
||||
/* 0x0167 */ s8 unk_167;
|
||||
/* 0x0168 */ f32 unk_168;
|
||||
|
||||
@@ -215,13 +215,13 @@ void EnBba01_Init(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
EnBba01* this = THIS;
|
||||
|
||||
this->enHy.animObjIndex = SubS_GetObjectIndex(OBJECT_BBA, play);
|
||||
this->enHy.headObjIndex = SubS_GetObjectIndex(OBJECT_BBA, play);
|
||||
this->enHy.skelUpperObjIndex = SubS_GetObjectIndex(OBJECT_BBA, play);
|
||||
this->enHy.skelLowerObjIndex = SubS_GetObjectIndex(OBJECT_BBA, play);
|
||||
this->enHy.animObjectSlot = SubS_GetObjectSlot(OBJECT_BBA, play);
|
||||
this->enHy.headObjectSlot = SubS_GetObjectSlot(OBJECT_BBA, play);
|
||||
this->enHy.skelUpperObjectSlot = SubS_GetObjectSlot(OBJECT_BBA, play);
|
||||
this->enHy.skelLowerObjectSlot = SubS_GetObjectSlot(OBJECT_BBA, play);
|
||||
|
||||
if ((this->enHy.animObjIndex < 0) || (this->enHy.headObjIndex < 0) || (this->enHy.skelUpperObjIndex < 0) ||
|
||||
(this->enHy.skelLowerObjIndex < 0)) {
|
||||
if ((this->enHy.animObjectSlot <= OBJECT_SLOT_NONE) || (this->enHy.headObjectSlot <= OBJECT_SLOT_NONE) ||
|
||||
(this->enHy.skelUpperObjectSlot <= OBJECT_SLOT_NONE) || (this->enHy.skelLowerObjectSlot <= OBJECT_SLOT_NONE)) {
|
||||
Actor_Kill(&this->enHy.actor);
|
||||
}
|
||||
this->enHy.actor.draw = NULL;
|
||||
@@ -264,9 +264,9 @@ s32 EnBba01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
if (limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.headObjIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.headObjIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelLowerObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.headObjectSlot].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.headObjectSlot].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelLowerObjectSlot].segment);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
@@ -303,8 +303,8 @@ void EnBba01_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro
|
||||
if (limbIndex == BBA_LIMB_HEAD) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.skelUpperObjIndex].segment);
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelUpperObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.skelUpperObjectSlot].segment);
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelUpperObjectSlot].segment);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -205,13 +205,13 @@ void EnCne01_Init(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
EnCne01* this = THIS;
|
||||
|
||||
this->enHy.animObjIndex = SubS_GetObjectIndex(OBJECT_OS_ANIME, play);
|
||||
this->enHy.headObjIndex = SubS_GetObjectIndex(OBJECT_CNE, play);
|
||||
this->enHy.skelUpperObjIndex = SubS_GetObjectIndex(OBJECT_CNE, play);
|
||||
this->enHy.skelLowerObjIndex = SubS_GetObjectIndex(OBJECT_CNE, play);
|
||||
this->enHy.animObjectSlot = SubS_GetObjectSlot(OBJECT_OS_ANIME, play);
|
||||
this->enHy.headObjectSlot = SubS_GetObjectSlot(OBJECT_CNE, play);
|
||||
this->enHy.skelUpperObjectSlot = SubS_GetObjectSlot(OBJECT_CNE, play);
|
||||
this->enHy.skelLowerObjectSlot = SubS_GetObjectSlot(OBJECT_CNE, play);
|
||||
|
||||
if ((this->enHy.animObjIndex < 0) || (this->enHy.headObjIndex < 0) || (this->enHy.skelUpperObjIndex < 0) ||
|
||||
(this->enHy.skelLowerObjIndex < 0)) {
|
||||
if ((this->enHy.animObjectSlot <= OBJECT_SLOT_NONE) || (this->enHy.headObjectSlot <= OBJECT_SLOT_NONE) ||
|
||||
(this->enHy.skelUpperObjectSlot <= OBJECT_SLOT_NONE) || (this->enHy.skelLowerObjectSlot <= OBJECT_SLOT_NONE)) {
|
||||
Actor_Kill(&this->enHy.actor);
|
||||
}
|
||||
this->enHy.actor.draw = NULL;
|
||||
@@ -254,10 +254,10 @@ s32 EnCne01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
if (limbIndex == CNE_LIMB_HEAD) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.headObjIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.headObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.headObjectSlot].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.headObjectSlot].segment);
|
||||
*dList = gCneHeadBrownHairDL;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelLowerObjIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelLowerObjectSlot].segment);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
@@ -294,8 +294,8 @@ void EnCne01_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro
|
||||
if (limbIndex == CNE_LIMB_RIGHT_FOOT) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.skelUpperObjIndex].segment);
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelUpperObjIndex].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.skelUpperObjectSlot].segment);
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelUpperObjectSlot].segment);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -582,16 +582,16 @@ void func_80BE7718(EnDaiku2* this, PlayState* play) {
|
||||
s32 i;
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
EnDaiku2Effect* effect = this->effects;
|
||||
s32 objectIdx;
|
||||
s32 objectSlot;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
Gfx_SetupDL25_Opa(play->state.gfxCtx);
|
||||
|
||||
objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_BOMBIWA);
|
||||
if ((objectIdx >= 0) && Object_IsLoaded(&play->objectCtx, objectIdx)) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_BOMBIWA);
|
||||
if ((objectSlot > OBJECT_SLOT_NONE) && Object_IsLoaded(&play->objectCtx, objectSlot)) {
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectIdx].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
|
||||
if (effect->isEnabled) {
|
||||
|
||||
@@ -209,10 +209,10 @@ s32 func_80A515C4(EnDnk* this) {
|
||||
}
|
||||
|
||||
void func_80A51648(EnDnk* this, PlayState* play) {
|
||||
if (SubS_IsObjectLoaded(this->unk_28E, play) == true) {
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->unk_28E].segment);
|
||||
if (SubS_IsObjectLoaded(this->objectSlot, play) == true) {
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment);
|
||||
this->actor.draw = func_80A52018;
|
||||
this->actor.objBankIndex = this->unk_28E;
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 18.0f);
|
||||
|
||||
switch (ENDNK_GET_3(&this->actor)) {
|
||||
@@ -263,22 +263,23 @@ void EnDnk_DoNothing(EnDnk* this, PlayState* play) {
|
||||
void EnDnk_Init(Actor* thisx, PlayState* play) {
|
||||
EnDnk* this = THIS;
|
||||
|
||||
this->unk_28E = -1;
|
||||
this->objectSlot = OBJECT_SLOT_NONE;
|
||||
|
||||
switch (ENDNK_GET_3(&this->actor)) {
|
||||
case ENDNK_GET_3_1:
|
||||
this->unk_28E = SubS_GetObjectIndex(OBJECT_HINTNUTS, play);
|
||||
this->objectSlot = SubS_GetObjectSlot(OBJECT_HINTNUTS, play);
|
||||
break;
|
||||
|
||||
case ENDNK_GET_3_0:
|
||||
this->unk_28E = SubS_GetObjectIndex(OBJECT_DNK, play);
|
||||
this->objectSlot = SubS_GetObjectSlot(OBJECT_DNK, play);
|
||||
break;
|
||||
|
||||
case ENDNK_GET_3_2:
|
||||
this->unk_28E = SubS_GetObjectIndex(OBJECT_DEKUNUTS, play);
|
||||
this->objectSlot = SubS_GetObjectSlot(OBJECT_DEKUNUTS, play);
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->unk_28E >= 0) {
|
||||
if (this->objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->actionFunc = func_80A51648;
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
|
||||
@@ -33,7 +33,7 @@ typedef struct EnDnk {
|
||||
/* 0x21E */ Vec3s morphTable[DNK_LIMB_MAX];
|
||||
/* 0x260 */ Gfx* unk_260[DEKU_PALACE_GUARD_LIMB_MAX];
|
||||
/* 0x28C */ u16 unk_28C;
|
||||
/* 0x28E */ s8 unk_28E;
|
||||
/* 0x28E */ s8 objectSlot;
|
||||
/* 0x290 */ s16 unk_290;
|
||||
/* 0x292 */ s16 unk_292;
|
||||
/* 0x294 */ s16 unk_294;
|
||||
|
||||
@@ -294,7 +294,7 @@ typedef struct {
|
||||
/* 0x4 */ s16 objectId;
|
||||
} EnDoorInfo; // size = 0x6
|
||||
|
||||
static EnDoorInfo sObjInfo[] = {
|
||||
static EnDoorInfo sObjectInfo[] = {
|
||||
{ SCENE_MITURIN, 0x01, OBJECT_NUMA_OBJ },
|
||||
{ SCENE_TENMON_DAI, 0x02, OBJECT_DOR01 },
|
||||
{ SCENE_00KEIKOKU, 0x02, OBJECT_DOR01 },
|
||||
@@ -416,8 +416,8 @@ static Gfx* D_808679A4[14][2] = {
|
||||
|
||||
void EnDoor_Init(Actor* thisx, PlayState* play2) {
|
||||
PlayState* play = play2;
|
||||
s32 objectBankIndex;
|
||||
EnDoorInfo* objectInfo = &sObjInfo[0];
|
||||
s32 objectSlot;
|
||||
EnDoorInfo* objectInfo = &sObjectInfo[0];
|
||||
EnDoor* this = THIS;
|
||||
s32 i;
|
||||
|
||||
@@ -433,31 +433,32 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) {
|
||||
SkelAnime_Init(play, &this->knobDoor.skelAnime, &gDoorSkel, &gameplay_keep_Anim_020658, this->limbTable,
|
||||
this->limbTable, DOOR_LIMB_MAX);
|
||||
if (this->doorType == ENDOOR_TYPE_5) {
|
||||
objectInfo = &sObjInfo[17 + this->switchFlag];
|
||||
objectInfo = &sObjectInfo[17 + this->switchFlag];
|
||||
} else {
|
||||
for (i = 0; i < ARRAY_COUNT(sObjInfo) - 34; i++, objectInfo++) {
|
||||
for (i = 0; i < ARRAY_COUNT(sObjectInfo) - 34; i++, objectInfo++) {
|
||||
if (play->sceneId == objectInfo->sceneId) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((i >= ARRAY_COUNT(sObjInfo) - 34) && (Object_GetSlot(&play->objectCtx, GAMEPLAY_FIELD_KEEP) >= 0)) {
|
||||
if ((i >= ARRAY_COUNT(sObjectInfo) - 34) &&
|
||||
(Object_GetSlot(&play->objectCtx, GAMEPLAY_FIELD_KEEP) > OBJECT_SLOT_NONE)) {
|
||||
objectInfo++;
|
||||
}
|
||||
}
|
||||
|
||||
this->knobDoor.dlIndex = objectInfo->dListIndex;
|
||||
objectBankIndex = Object_GetSlot(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectBankIndex < 0) {
|
||||
objectInfo = &sObjInfo[15];
|
||||
objectBankIndex = Object_GetSlot(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectBankIndex != 0) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectSlot <= OBJECT_SLOT_NONE) {
|
||||
objectInfo = &sObjectInfo[15];
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectSlot != 0) {
|
||||
Actor_Kill(&this->knobDoor.dyna.actor);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this->knobDoor.requiredObjBankIndex = objectBankIndex;
|
||||
this->knobDoor.objectSlot = objectSlot;
|
||||
this->knobDoor.dlIndex = objectInfo->dListIndex; // Set twice?
|
||||
if (this->knobDoor.dyna.actor.objBankIndex == this->knobDoor.requiredObjBankIndex) {
|
||||
if (this->knobDoor.dyna.actor.objectSlot == this->knobDoor.objectSlot) {
|
||||
func_80866A5C(this, play);
|
||||
} else {
|
||||
this->actionFunc = func_80866A5C;
|
||||
@@ -480,8 +481,8 @@ void EnDoor_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80866A5C(EnDoor* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->knobDoor.requiredObjBankIndex)) {
|
||||
this->knobDoor.dyna.actor.objBankIndex = this->knobDoor.requiredObjBankIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->knobDoor.objectSlot)) {
|
||||
this->knobDoor.dyna.actor.objectSlot = this->knobDoor.objectSlot;
|
||||
this->actionFunc = func_80866B20;
|
||||
this->knobDoor.dyna.actor.world.rot.y = 0;
|
||||
if (this->doorType == ENDOOR_TYPE_1) {
|
||||
@@ -688,7 +689,7 @@ s32 EnDoor_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
|
||||
void EnDoor_Draw(Actor* thisx, PlayState* play) {
|
||||
EnDoor* this = THIS;
|
||||
|
||||
if (this->knobDoor.dyna.actor.objBankIndex == this->knobDoor.requiredObjBankIndex) {
|
||||
if (this->knobDoor.dyna.actor.objectSlot == this->knobDoor.objectSlot) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
if ((this->doorType == ENDOOR_TYPE_7) && (this->switchFlag == 0)) {
|
||||
|
||||
@@ -58,7 +58,7 @@ typedef struct {
|
||||
/* 0x4 */ s16 objectId;
|
||||
} EnDoorEtcInfo; // size = 0x6
|
||||
|
||||
EnDoorEtcInfo sObjInfo[] = {
|
||||
EnDoorEtcInfo sObjectInfo[] = {
|
||||
{ SCENE_MITURIN, 1, OBJECT_NUMA_OBJ },
|
||||
{ -1, 0, GAMEPLAY_KEEP },
|
||||
{ -1, 13, GAMEPLAY_FIELD_KEEP },
|
||||
@@ -87,8 +87,8 @@ static InitChainEntry sInitChain[] = {
|
||||
|
||||
void EnDoorEtc_Init(Actor* thisx, PlayState* play2) {
|
||||
PlayState* play = play2;
|
||||
s32 objectIndex;
|
||||
EnDoorEtcInfo* objectInfo = sObjInfo;
|
||||
s32 objectSlot;
|
||||
EnDoorEtcInfo* objectInfo = sObjectInfo;
|
||||
s32 i;
|
||||
EnDoorEtc* this = THIS;
|
||||
|
||||
@@ -101,16 +101,16 @@ void EnDoorEtc_Init(Actor* thisx, PlayState* play2) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((i >= 15) && (Object_GetSlot(&play->objectCtx, GAMEPLAY_FIELD_KEEP) >= 0)) {
|
||||
if ((i >= 15) && (Object_GetSlot(&play->objectCtx, GAMEPLAY_FIELD_KEEP) > OBJECT_SLOT_NONE)) {
|
||||
objectInfo++;
|
||||
}
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectIndex < 0) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, objectInfo->objectId);
|
||||
if (objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->knobDoor.dyna.actor);
|
||||
} else {
|
||||
this->knobDoor.requiredObjBankIndex = objectIndex;
|
||||
this->knobDoor.objectSlot = objectSlot;
|
||||
this->knobDoor.dlIndex = objectInfo->dListIndex;
|
||||
if (this->knobDoor.dyna.actor.objBankIndex == this->knobDoor.requiredObjBankIndex) {
|
||||
if (this->knobDoor.dyna.actor.objectSlot == this->knobDoor.objectSlot) {
|
||||
EnDoorEtc_WaitForObject(this, play);
|
||||
} else {
|
||||
this->actionFunc = EnDoorEtc_WaitForObject;
|
||||
@@ -139,9 +139,9 @@ s32 EnDoorEtc_IsDistanceGreater(Vec3f* a, Vec3f* b, f32 c) {
|
||||
}
|
||||
|
||||
void EnDoorEtc_WaitForObject(EnDoorEtc* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->knobDoor.requiredObjBankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->knobDoor.objectSlot)) {
|
||||
this->knobDoor.dyna.actor.flags &= ~ACTOR_FLAG_10;
|
||||
this->knobDoor.dyna.actor.objBankIndex = this->knobDoor.requiredObjBankIndex;
|
||||
this->knobDoor.dyna.actor.objectSlot = this->knobDoor.objectSlot;
|
||||
this->actionFunc = func_80AC2354;
|
||||
this->knobDoor.dyna.actor.draw = EnDoorEtc_Draw;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ void EnDrs_CollisionUpdate(EnDrs* this, PlayState* play) {
|
||||
void EnDrs_Setup(EnDrs* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
|
||||
if ((this->moonMaskObjBankIndex >= 0) && SubS_IsObjectLoaded(this->moonMaskObjBankIndex, play)) {
|
||||
if ((this->moonMaskObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->moonMaskObjectSlot, play)) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gWeddingDressMannequinSkel, NULL, this->jointTable,
|
||||
this->morphTable, WEDDING_DRESS_MANNEQUIN_LIMB_MAX);
|
||||
@@ -87,7 +87,7 @@ void EnDrs_Idle(EnDrs* this, PlayState* play) {
|
||||
void EnDrs_Init(Actor* thisx, PlayState* play) {
|
||||
EnDrs* this = THIS;
|
||||
|
||||
this->moonMaskObjBankIndex = SubS_GetObjectIndex(OBJECT_MSMO, play);
|
||||
this->moonMaskObjectSlot = SubS_GetObjectSlot(OBJECT_MSMO, play);
|
||||
this->actionFunc = EnDrs_Setup;
|
||||
}
|
||||
|
||||
@@ -110,8 +110,8 @@ void EnDrs_Update(Actor* thisx, PlayState* play) {
|
||||
void EnDrs_PostLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
EnDrs* this = THIS;
|
||||
PlayState* play = play2;
|
||||
s8 temp = this->moonMaskObjBankIndex;
|
||||
s8 temp2 = this->actor.objBankIndex;
|
||||
s8 temp = this->moonMaskObjectSlot;
|
||||
s8 temp2 = this->actor.objectSlot;
|
||||
|
||||
// Anju removes the Moon Mask at the start of the Couple's Mask cutscene
|
||||
// after that it will no longer be rendered.
|
||||
|
||||
@@ -16,7 +16,7 @@ typedef struct EnDrs {
|
||||
/* 0x18C */ ColliderCylinder collider;
|
||||
/* 0x1D8 */ Vec3s jointTable[WEDDING_DRESS_MANNEQUIN_LIMB_MAX];
|
||||
/* 0x1F0 */ Vec3s morphTable[WEDDING_DRESS_MANNEQUIN_LIMB_MAX];
|
||||
/* 0x208 */ s8 moonMaskObjBankIndex;
|
||||
/* 0x208 */ s8 moonMaskObjectSlot;
|
||||
} EnDrs; // size = 0x20C */
|
||||
|
||||
#endif // Z_EN_DRS_H
|
||||
|
||||
@@ -171,8 +171,8 @@ void EnEndingHero6_Draw(Actor* thisx, PlayState* play) {
|
||||
Gfx_SetupDL25_Opa(play->state.gfxCtx);
|
||||
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
|
||||
|
||||
if ((this->objectIndex >= 0) && Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectIndex].segment);
|
||||
if ((this->objectSlot > OBJECT_SLOT_NONE) && Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlot].segment);
|
||||
|
||||
switch (this->type) {
|
||||
case ENDING_HERO6_TYPE_DAIKU_RED:
|
||||
|
||||
@@ -27,7 +27,7 @@ typedef struct EnEndingHero6 {
|
||||
/* 0x278 */ EnEndingHero6ActionFunc actionFunc;
|
||||
/* 0x27C */ s32 animIndex;
|
||||
/* 0x280 */ s32 type;
|
||||
/* 0x284 */ s8 objectIndex;
|
||||
/* 0x284 */ s8 objectSlot;
|
||||
/* 0x286 */ s16 timer;
|
||||
/* 0x288 */ s16 blinkTimer;
|
||||
/* 0x28A */ s16 eyeState;
|
||||
|
||||
@@ -132,7 +132,7 @@ void EnFall_RisingDebris_ResetEffects(EnFall* this) {
|
||||
|
||||
void EnFall_Init(Actor* thisx, PlayState* play) {
|
||||
EnFall* this = THIS;
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
|
||||
this->eyeGlowIntensity = 0.0f;
|
||||
this->flags = 0;
|
||||
@@ -165,27 +165,27 @@ void EnFall_Init(Actor* thisx, PlayState* play) {
|
||||
case EN_FALL_TYPE_LODMOON_NO_LERP:
|
||||
case EN_FALL_TYPE_LODMOON:
|
||||
case EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER:
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_LODMOON);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_LODMOON);
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_MOONS_TEAR:
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_MOONSTON);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MOONSTON);
|
||||
break;
|
||||
|
||||
case EN_FALL_TYPE_STOPPED_MOON_OPEN_MOUTH:
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_FALL2);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FALL2);
|
||||
break;
|
||||
|
||||
default:
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_FALL);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FALL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (objectIndex < 0) {
|
||||
if (objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
this->objIndex = objectIndex;
|
||||
this->objectSlot = objectSlot;
|
||||
this->actionFunc = EnFall_Setup;
|
||||
}
|
||||
|
||||
@@ -210,8 +210,8 @@ Actor* EnFall_MoonsTear_GetTerminaFieldMoon(PlayState* play) {
|
||||
void EnFall_Setup(EnFall* this, PlayState* play) {
|
||||
Actor* moon;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
this->actor.objBankIndex = this->objIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
this->actionFunc = EnFall_Moon_PerformDefaultActions;
|
||||
switch (EN_FALL_TYPE(&this->actor)) {
|
||||
case EN_FALL_TYPE_TITLE_SCREEN_MOON:
|
||||
|
||||
@@ -30,7 +30,7 @@ typedef struct EnFall {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ s16 dayStartTime;
|
||||
/* 0x146 */ s16 currentDay;
|
||||
/* 0x148 */ u8 objIndex;
|
||||
/* 0x148 */ u8 objectSlot;
|
||||
/* 0x14C */ f32 scale;
|
||||
/* 0x150 */ union {
|
||||
f32 eyeGlowIntensity;
|
||||
|
||||
@@ -416,12 +416,12 @@ s32 func_80BB1D64(EnGeg* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void EnGeg_UpdateSkelAnime(EnGeg* this, PlayState* play) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->unk_248].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
void EnGeg_ChangeAnim(EnGeg* this, PlayState* play) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->unk_248].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment);
|
||||
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex);
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ s32 func_80BB2088(EnGeg* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80BB217C(EnGeg* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->unk_248)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->animIndex = ENGEG_ANIM_5;
|
||||
EnGeg_ChangeAnim(this, play);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
@@ -550,8 +550,8 @@ void func_80BB2520(EnGeg* this, PlayState* play) {
|
||||
break;
|
||||
|
||||
case 0xD66:
|
||||
this->unk_248 = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
if (this->unk_248 >= 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
if (this->objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->animIndex = ENGEG_ANIM_19;
|
||||
EnGeg_ChangeAnim(this, play);
|
||||
}
|
||||
@@ -568,8 +568,8 @@ void func_80BB2520(EnGeg* this, PlayState* play) {
|
||||
case 0xD72:
|
||||
case 0xD75:
|
||||
case 0xD8B:
|
||||
this->unk_248 = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
if (this->unk_248 >= 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
if (this->objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->animIndex = ENGEG_ANIM_4;
|
||||
EnGeg_ChangeAnim(this, play);
|
||||
}
|
||||
@@ -713,8 +713,8 @@ void func_80BB2B1C(EnGeg* this, PlayState* play) {
|
||||
CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor);
|
||||
this->unk_496 = 0xD68;
|
||||
Message_ContinueTextbox(play, this->unk_496);
|
||||
this->unk_248 = Object_GetSlot(&play->objectCtx, OBJECT_TAISOU);
|
||||
if (this->unk_248 >= 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_TAISOU);
|
||||
if (this->objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->animIndex = ENGEG_ANIM_13;
|
||||
EnGeg_ChangeAnim(this, play);
|
||||
}
|
||||
@@ -926,8 +926,8 @@ void EnGeg_Init(Actor* thisx, PlayState* play) {
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
|
||||
if (this->actor.update != NULL) {
|
||||
this->unk_248 = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
if (this->unk_248 < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ typedef struct EnGeg {
|
||||
/* 0x240 */ s16 unk_240;
|
||||
/* 0x242 */ s16 unk_242;
|
||||
/* 0x244 */ s16 unk_244;
|
||||
/* 0x248 */ s32 unk_248;
|
||||
/* 0x248 */ s32 objectSlot;
|
||||
/* 0x24C */ Vec3s jointTable[GORON_LIMB_MAX];
|
||||
/* 0x2B8 */ Vec3s morphTable[GORON_LIMB_MAX];
|
||||
/* 0x324 */ UNK_TYPE1 unk324[0x144];
|
||||
|
||||
@@ -165,8 +165,8 @@ void EnGirlA_InitObjIndex(EnGirlA* this, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->objIndex = Object_GetSlot(&play->objectCtx, sShopItemEntries[params].objectId);
|
||||
if (this->objIndex < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, sShopItemEntries[params].objectId);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -564,9 +564,9 @@ void EnGirlA_InitalUpdate(EnGirlA* this, PlayState* play) {
|
||||
s16 params = this->actor.params;
|
||||
ShopItemEntry* shopItem = &sShopItemEntries[params];
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_10;
|
||||
this->actor.objBankIndex = this->objIndex;
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
this->actor.textId = shopItem->descriptionTextId;
|
||||
this->choiceTextId = shopItem->choiceTextId;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ typedef struct EnGirlA {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ UNK_TYPE1 unk144[0x44];
|
||||
/* 0x188 */ EnGirlAActionFunc actionFunc;
|
||||
/* 0x18C */ s8 objIndex;
|
||||
/* 0x18C */ s8 objectSlot;
|
||||
/* 0x190 */ EnGirlAActionFunc mainActionFunc;
|
||||
/* 0x194 */ s32 isInitialized;
|
||||
/* 0x198 */ u16 choiceTextId;
|
||||
|
||||
@@ -306,11 +306,11 @@ EnDoor* func_8094DF90(PlayState* play, s32 arg1) {
|
||||
s32 EnGm_UpdateSkelAnime(EnGm* this, PlayState* play) {
|
||||
s32 isAnimFinished = false;
|
||||
|
||||
if (this->unk_262 < 0) {
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this->unk_262 >= 0) {
|
||||
if (this->objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->skelAnime.playSpeed = this->animPlaySpeed;
|
||||
isAnimFinished = SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
@@ -319,7 +319,7 @@ s32 EnGm_UpdateSkelAnime(EnGm* this, PlayState* play) {
|
||||
}
|
||||
|
||||
s32 EnGm_ChangeAnim(EnGm* this, PlayState* play, s32 animIndex) {
|
||||
s8 tmp = this->unk_262;
|
||||
s8 tmp = this->objectSlot;
|
||||
s32 changeAnim = false;
|
||||
s32 didAnimChange = false;
|
||||
|
||||
@@ -347,7 +347,7 @@ s32 func_8094E0F8(EnGm* this, PlayState* play) {
|
||||
|
||||
if ((this->unk_260 != play->roomCtx.curRoom.num) && (play->roomCtx.status == 0)) {
|
||||
this->unk_260 = play->roomCtx.curRoom.num;
|
||||
this->unk_262 = SubS_GetObjectIndex(OBJECT_IN2, play);
|
||||
this->objectSlot = SubS_GetObjectSlot(OBJECT_IN2, play);
|
||||
this->actor.draw = NULL;
|
||||
this->unk_3FC = 1;
|
||||
}
|
||||
@@ -356,7 +356,7 @@ s32 func_8094E0F8(EnGm* this, PlayState* play) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((this->unk_262 < 0) || !SubS_IsObjectLoaded(this->unk_262, play)) {
|
||||
if ((this->objectSlot <= OBJECT_SLOT_NONE) || !SubS_IsObjectLoaded(this->objectSlot, play)) {
|
||||
ret = true;
|
||||
} else {
|
||||
this->actor.draw = EnGm_Draw;
|
||||
@@ -1863,7 +1863,7 @@ void EnGm_Draw(Actor* thisx, PlayState* play) {
|
||||
};
|
||||
EnGm* this = THIS;
|
||||
|
||||
if ((this->unk_258 != 0) && (this->unk_262 >= 0)) {
|
||||
if ((this->unk_258 != 0) && (this->objectSlot > OBJECT_SLOT_NONE)) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
Gfx_SetupDL25_Opa(play->state.gfxCtx);
|
||||
|
||||
@@ -33,7 +33,7 @@ typedef struct EnGm {
|
||||
/* 0x25C */ s32 unk_25C;
|
||||
/* 0x260 */ s8 unk_260;
|
||||
/* 0x261 */ s8 unk_261;
|
||||
/* 0x262 */ s8 unk_262;
|
||||
/* 0x262 */ s8 objectSlot;
|
||||
/* 0x264 */ s32* unk_264;
|
||||
/* 0x268 */ Actor* unk_268;
|
||||
/* 0x26C */ UNK_TYPE1 unk_26C[0xC];
|
||||
|
||||
@@ -978,23 +978,23 @@ s32 EnGo_UpdateSpringArrivalCutscene(EnGo* this, PlayState* play) {
|
||||
* @return True if non-repeating animation has finished
|
||||
*/
|
||||
s32 EnGo_UpdateSkelAnime(EnGo* this, PlayState* play) {
|
||||
s8 objIndex = this->actor.objBankIndex;
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 extraObjIndex = -1;
|
||||
s32 isAnimFinished = false;
|
||||
|
||||
if ((this->animIndex >= ENGO_ANIM_SPRING_MIN) && (this->hakuginDemoObjIndex >= 0)) {
|
||||
extraObjIndex = this->hakuginDemoObjIndex;
|
||||
} else if ((this->animIndex >= ENGO_ANIM_ATHLETICS_MIN) && (this->taisouObjIndex >= 0)) {
|
||||
extraObjIndex = this->taisouObjIndex;
|
||||
if ((this->animIndex >= ENGO_ANIM_SPRING_MIN) && (this->hakuginDemoObjectSlot > OBJECT_SLOT_NONE)) {
|
||||
extraObjIndex = this->hakuginDemoObjectSlot;
|
||||
} else if ((this->animIndex >= ENGO_ANIM_ATHLETICS_MIN) && (this->taisouObjectSlot > OBJECT_SLOT_NONE)) {
|
||||
extraObjIndex = this->taisouObjectSlot;
|
||||
} else if (this->animIndex < ENGO_ANIM_ATHLETICS_MIN) {
|
||||
extraObjIndex = this->actor.objBankIndex;
|
||||
extraObjIndex = this->actor.objectSlot;
|
||||
}
|
||||
|
||||
if (extraObjIndex >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[extraObjIndex].segment);
|
||||
this->skelAnime.playSpeed = this->animPlaySpeed;
|
||||
isAnimFinished = SkelAnime_Update(&this->skelAnime);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
}
|
||||
|
||||
return isAnimFinished;
|
||||
@@ -1038,16 +1038,16 @@ s32 EnGo_UpdateSfx(EnGo* this, PlayState* play) {
|
||||
* @return True if animation was changed
|
||||
*/
|
||||
s32 EnGo_ChangeAnim(EnGo* this, PlayState* play, EnGoAnimation animIndex) {
|
||||
s8 objIndex = this->actor.objBankIndex;
|
||||
s8 objectSlot = this->actor.objectSlot;
|
||||
s8 extraObjIndex = -1;
|
||||
s32 didAnimChange = false;
|
||||
|
||||
if ((animIndex >= ENGO_ANIM_SPRING_MIN) && (this->hakuginDemoObjIndex >= 0)) {
|
||||
extraObjIndex = this->hakuginDemoObjIndex;
|
||||
} else if ((animIndex >= ENGO_ANIM_ATHLETICS_MIN) && (this->taisouObjIndex >= 0)) {
|
||||
extraObjIndex = this->taisouObjIndex;
|
||||
if ((animIndex >= ENGO_ANIM_SPRING_MIN) && (this->hakuginDemoObjectSlot > OBJECT_SLOT_NONE)) {
|
||||
extraObjIndex = this->hakuginDemoObjectSlot;
|
||||
} else if ((animIndex >= ENGO_ANIM_ATHLETICS_MIN) && (this->taisouObjectSlot > OBJECT_SLOT_NONE)) {
|
||||
extraObjIndex = this->taisouObjectSlot;
|
||||
} else if (animIndex < ENGO_ANIM_ATHLETICS_MIN) {
|
||||
extraObjIndex = this->actor.objBankIndex;
|
||||
extraObjIndex = this->actor.objectSlot;
|
||||
}
|
||||
|
||||
if (extraObjIndex >= 0) {
|
||||
@@ -1055,7 +1055,7 @@ s32 EnGo_ChangeAnim(EnGo* this, PlayState* play, EnGoAnimation animIndex) {
|
||||
this->animIndex = animIndex;
|
||||
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
|
||||
this->animPlaySpeed = this->skelAnime.playSpeed;
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment);
|
||||
}
|
||||
|
||||
return didAnimChange;
|
||||
@@ -1893,8 +1893,8 @@ void EnGo_SetupMedigoron(EnGo* this, PlayState* play) {
|
||||
void EnGo_SetupInitialAction(EnGo* this, PlayState* play) {
|
||||
EffectTireMarkInit tireMarkInit = { 0, 62, { 0, 0, 15, 100 } };
|
||||
|
||||
if (((this->taisouObjIndex < 0) || SubS_IsObjectLoaded(this->taisouObjIndex, play)) ||
|
||||
((this->hakuginDemoObjIndex < 0) || SubS_IsObjectLoaded(this->hakuginDemoObjIndex, play))) {
|
||||
if (((this->taisouObjectSlot <= OBJECT_SLOT_NONE) || SubS_IsObjectLoaded(this->taisouObjectSlot, play)) ||
|
||||
((this->hakuginDemoObjectSlot <= OBJECT_SLOT_NONE) || SubS_IsObjectLoaded(this->hakuginDemoObjectSlot, play))) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable,
|
||||
GORON_LIMB_MAX);
|
||||
@@ -2412,8 +2412,8 @@ void EnGo_Talk(EnGo* this, PlayState* play) {
|
||||
void EnGo_Init(Actor* thisx, PlayState* play) {
|
||||
EnGo* this = THIS;
|
||||
|
||||
this->taisouObjIndex = SubS_GetObjectIndex(OBJECT_TAISOU, play);
|
||||
this->hakuginDemoObjIndex = SubS_GetObjectIndex(OBJECT_HAKUGIN_DEMO, play);
|
||||
this->taisouObjectSlot = SubS_GetObjectSlot(OBJECT_TAISOU, play);
|
||||
this->hakuginDemoObjectSlot = SubS_GetObjectSlot(OBJECT_HAKUGIN_DEMO, play);
|
||||
this->actionFunc = EnGo_SetupInitialAction;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ typedef struct EnGo {
|
||||
/* 0x1E0 */ ColliderCylinder unusedCylinder;
|
||||
/* 0x22C */ ColliderSphere colliderSphere;
|
||||
/* 0x284 */ Path* gatekeeperPath;
|
||||
/* 0x288 */ s8 taisouObjIndex;
|
||||
/* 0x289 */ s8 hakuginDemoObjIndex;
|
||||
/* 0x288 */ s8 taisouObjectSlot;
|
||||
/* 0x289 */ s8 hakuginDemoObjectSlot;
|
||||
/* 0x28C */ s32 msgScriptResumePos;
|
||||
/* 0x290 */ Vec3f headPos;
|
||||
/* 0x29C */ Vec3f bodyPos;
|
||||
|
||||
@@ -738,7 +738,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
||||
this->type = HORSE_TYPE_DONKEY;
|
||||
this->unk_528 = 80.0f;
|
||||
this->boostSpeed = 12;
|
||||
if ((this->bankIndex = Object_GetSlot(&play->objectCtx, OBJECT_HA)) < 0) {
|
||||
if ((this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_HA)) <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -748,8 +748,8 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
||||
this->type = HORSE_TYPE_2;
|
||||
this->unk_528 = 64.8f;
|
||||
this->boostSpeed = 15;
|
||||
if ((this->bankIndex = Object_GetSlot(&play->objectCtx, OBJECT_HORSE_LINK_CHILD)) < 0) {
|
||||
thisx->objBankIndex = Object_SpawnPersistent(&play->objectCtx, OBJECT_HORSE_LINK_CHILD);
|
||||
if ((this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_HORSE_LINK_CHILD)) <= OBJECT_SLOT_NONE) {
|
||||
thisx->objectSlot = Object_SpawnPersistent(&play->objectCtx, OBJECT_HORSE_LINK_CHILD);
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
Skin_Init(&play->state, &this->skin, sSkeletonHeaders[this->type], sAnimationHeaders[this->type][0]);
|
||||
Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]);
|
||||
@@ -760,7 +760,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
||||
} else if (ENHORSE_IS_BANDIT_TYPE(&this->actor)) {
|
||||
this->type = HORSE_TYPE_BANDIT;
|
||||
this->boostSpeed = 12;
|
||||
if ((this->bankIndex = Object_GetSlot(&play->objectCtx, OBJECT_HA)) < 0) {
|
||||
if ((this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_HA)) <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -948,8 +948,8 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
||||
void func_8087D540(Actor* thisx, PlayState* play) {
|
||||
EnHorse* this = THIS;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) {
|
||||
this->actor.objBankIndex = this->bankIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
this->actor.update = EnHorse_Update;
|
||||
if (this->unk_1EC & 1) {
|
||||
|
||||
@@ -150,7 +150,7 @@ typedef struct EnHorse {
|
||||
/* 0x148 */ s32 noInputTimer;
|
||||
/* 0x14C */ s32 noInputTimerMax;
|
||||
/* 0x150 */ s32 type;
|
||||
/* 0x154 */ s8 bankIndex;
|
||||
/* 0x154 */ s8 objectSlot;
|
||||
/* 0x158 */ Skin skin;
|
||||
/* 0x1E8 */ s32 stateFlags;
|
||||
/* 0x1EC */ s32 unk_1EC;
|
||||
|
||||
@@ -209,8 +209,8 @@ void EnInvadepohDemo_DoNothing(EnInvadepohDemo* this, PlayState* play) {
|
||||
void EnInvadepohDemo_Alien_Init(EnInvadepohDemo* this, PlayState* play) {
|
||||
Actor_ProcessInitChain(&this->actor, sAlienInitChain);
|
||||
this->actor.flags = ACTOR_FLAG_10 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_80000000;
|
||||
this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_UCH);
|
||||
if (this->objectIndex < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_UCH);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -220,8 +220,8 @@ void EnInvadepohDemo_Alien_Init(EnInvadepohDemo* this, PlayState* play) {
|
||||
|
||||
void EnInvadepohDemo_Romani_Init(EnInvadepohDemo* this, PlayState* play) {
|
||||
Actor_ProcessInitChain(&this->actor, sRomaniInitChain);
|
||||
this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_MA1);
|
||||
if (this->objectIndex < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MA1);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -233,8 +233,8 @@ void EnInvadepohDemo_Cow_Init(EnInvadepohDemo* this, PlayState* play) {
|
||||
Actor_ProcessInitChain(&this->actor, sCowInitChain);
|
||||
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_INVADEPOH_DEMO, 0.0f, 0.0f, 0.0f, 0, 0, 0,
|
||||
EN_INVADEPOH_DEMO_TYPE_COW_TAIL);
|
||||
this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_COW);
|
||||
if (this->objectIndex < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_COW);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -250,8 +250,8 @@ void EnInvadepohDemo_Ufo_Init(EnInvadepohDemo* this, PlayState* play) {
|
||||
|
||||
void EnInvadepohDemo_CowTail_Init(EnInvadepohDemo* this, PlayState* play) {
|
||||
Actor_ProcessInitChain(&this->actor, sCowTailInitChain);
|
||||
this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_COW);
|
||||
if (this->objectIndex < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_COW);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -503,8 +503,8 @@ void EnInvadepohDemo_CowTail_Idle(EnInvadepohDemo* this, PlayState* play) {
|
||||
void EnInvadepohDemo_Alien_WaitForObject(EnInvadepohDemo* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
this->actor.objBankIndex = this->objectIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
this->drawFlags |= DRAW_FLAG_SHOULD_DRAW;
|
||||
this->actionFunc = EnInvadepohDemo_SelectCueAction;
|
||||
@@ -517,8 +517,8 @@ void EnInvadepohDemo_Alien_WaitForObject(EnInvadepohDemo* this, PlayState* play)
|
||||
void EnInvadepohDemo_Romani_WaitForObject(EnInvadepohDemo* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
this->actor.objBankIndex = this->objectIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
this->drawFlags |= DRAW_FLAG_SHOULD_DRAW;
|
||||
this->actionFunc = EnInvadepohDemo_SelectCueAction;
|
||||
@@ -531,8 +531,8 @@ void EnInvadepohDemo_Romani_WaitForObject(EnInvadepohDemo* this, PlayState* play
|
||||
void EnInvadepohDemo_Cow_WaitForObject(EnInvadepohDemo* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
this->actor.objBankIndex = this->objectIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
this->drawFlags |= DRAW_FLAG_SHOULD_DRAW;
|
||||
this->actionFunc = EnInvadepohDemo_SelectCueAction;
|
||||
@@ -545,8 +545,8 @@ void EnInvadepohDemo_Cow_WaitForObject(EnInvadepohDemo* this, PlayState* play) {
|
||||
void EnInvadepohDemo_CowTail_WaitForObject(EnInvadepohDemo* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
this->actor.objBankIndex = this->objectIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
this->drawFlags |= DRAW_FLAG_SHOULD_DRAW;
|
||||
this->actionFunc = EnInvadepohDemo_CowTail_Idle;
|
||||
@@ -786,7 +786,7 @@ void EnInvadepohDemo_Init(Actor* thisx, PlayState* play) {
|
||||
this->ufoRotZ = 0;
|
||||
this->pathIndex = EN_INVADEPOH_DEMO_GET_PATH_INDEX(&this->actor);
|
||||
this->pointIndex = 0;
|
||||
this->objectIndex = -1;
|
||||
this->objectSlot = OBJECT_SLOT_NONE;
|
||||
sInitFuncs[this->type](this, play);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef struct EnInvadepohDemo {
|
||||
/* 0x154 */ s32 cueId; // "demo_mode"
|
||||
/* 0x158 */ s32 pathIndex;
|
||||
/* 0x15C */ s32 pointIndex;
|
||||
/* 0x160 */ s32 objectIndex;
|
||||
/* 0x160 */ s32 objectSlot;
|
||||
/* 0x164 */ s32 drawFlags; // Only has one flag to control whether or not to draw
|
||||
/* 0x168 */ s32 cueIdOffset;
|
||||
/* 0x16C */ s16 ufoRotZ;
|
||||
|
||||
@@ -71,7 +71,7 @@ static EnIshiUnkFunc2 D_8095F6D8[] = { func_8095D804, func_8095DABC };
|
||||
|
||||
static EnIshiUnkFunc D_8095F6E0[] = { func_8095DDA8, func_8095DE9C };
|
||||
|
||||
static s16 D_8095F6E8[] = { GAMEPLAY_FIELD_KEEP, OBJECT_ISHI };
|
||||
static s16 sObjectIds[] = { GAMEPLAY_FIELD_KEEP, OBJECT_ISHI };
|
||||
|
||||
static ColliderCylinderInit sCylinderInit[] = {
|
||||
{
|
||||
@@ -173,7 +173,7 @@ s32 func_8095D758(EnIshi* this, PlayState* play, f32 arg2) {
|
||||
void func_8095D804(Actor* thisx, PlayState* play) {
|
||||
EnIshi* this = THIS;
|
||||
s32 i;
|
||||
s16 temp;
|
||||
s16 objectId;
|
||||
Gfx* phi_s4;
|
||||
Vec3f spC4;
|
||||
Vec3f spB8;
|
||||
@@ -184,7 +184,7 @@ void func_8095D804(Actor* thisx, PlayState* play) {
|
||||
phi_s4 = gSmallRockDL;
|
||||
}
|
||||
|
||||
temp = D_8095F6E8[ENISHI_GET_8(&this->actor)];
|
||||
objectId = sObjectIds[ENISHI_GET_8(&this->actor)];
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_8095F74C); i++) {
|
||||
spB8.x = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.world.pos.x;
|
||||
@@ -207,7 +207,7 @@ void func_8095D804(Actor* thisx, PlayState* play) {
|
||||
spC4.z += (Rand_ZeroOne() - 0.5f) * 11.0f;
|
||||
|
||||
EffectSsKakera_Spawn(play, &spB8, &spC4, &spB8, -420, ((s32)Rand_Next() > 0) ? 65 : 33, 30, 5, 0, D_8095F74C[i],
|
||||
3, 10, 40, -1, temp, phi_s4);
|
||||
3, 10, 40, -1, objectId, phi_s4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,8 +425,8 @@ void EnIshi_Init(Actor* thisx, PlayState* play) {
|
||||
this->unk_197 |= 1;
|
||||
}
|
||||
|
||||
this->unk_196 = Object_GetSlot(&play->objectCtx, D_8095F6E8[ENISHI_GET_8(&this->actor)]);
|
||||
if (this->unk_196 < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[ENISHI_GET_8(&this->actor)]);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -446,8 +446,8 @@ void func_8095E5AC(EnIshi* this) {
|
||||
}
|
||||
|
||||
void func_8095E5C0(EnIshi* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->unk_196)) {
|
||||
this->actor.objBankIndex = this->unk_196;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
this->actor.flags &= ~ACTOR_FLAG_10;
|
||||
if (!ENISHI_GET_8(&this->actor)) {
|
||||
this->actor.draw = func_8095F61C;
|
||||
|
||||
@@ -24,7 +24,7 @@ typedef struct EnIshi {
|
||||
/* 0x190 */ EnIshiActionFunc actionFunc;
|
||||
/* 0x194 */ s8 unk_194;
|
||||
/* 0x195 */ s8 unk_195;
|
||||
/* 0x196 */ s8 unk_196;
|
||||
/* 0x196 */ s8 objectSlot;
|
||||
/* 0x197 */ u8 unk_197;
|
||||
} EnIshi; // size = 0x198
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ ActorInit En_Kusa_InitVars = {
|
||||
(ActorFunc)NULL,
|
||||
};
|
||||
|
||||
static s16 objectIds[] = { GAMEPLAY_FIELD_KEEP, OBJECT_KUSA, OBJECT_KUSA, OBJECT_KUSA };
|
||||
static s16 sObjectIds[] = { GAMEPLAY_FIELD_KEEP, OBJECT_KUSA, OBJECT_KUSA, OBJECT_KUSA };
|
||||
|
||||
static ColliderCylinderInit sCylinderInit = {
|
||||
{
|
||||
@@ -393,8 +393,8 @@ void EnKusa_Init(Actor* thisx, PlayState* play) {
|
||||
this->isInWater |= 1;
|
||||
}
|
||||
|
||||
this->objIndex = Object_GetSlot(&play->objectCtx, objectIds[(KUSA_GET_TYPE(&this->actor))]);
|
||||
if (this->objIndex < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[(KUSA_GET_TYPE(&this->actor))]);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -428,7 +428,7 @@ void EnKusa_SetupWaitObject(EnKusa* this) {
|
||||
void EnKusa_WaitObject(EnKusa* this, PlayState* play) {
|
||||
s32 pad;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
s32 kusaType = KUSA_GET_TYPE(&this->actor);
|
||||
|
||||
if (this->isCut) {
|
||||
@@ -441,7 +441,7 @@ void EnKusa_WaitObject(EnKusa* this, PlayState* play) {
|
||||
} else {
|
||||
this->actor.draw = EnKusa_DrawGrass;
|
||||
}
|
||||
this->actor.objBankIndex = this->objIndex;
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
this->actor.flags &= ~ACTOR_FLAG_10;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ typedef struct EnKusa {
|
||||
/* 0x144 */ EnKusaActionFunc actionFunc;
|
||||
/* 0x148 */ ColliderCylinder collider;
|
||||
/* 0x194 */ u8 timer;
|
||||
/* 0x195 */ s8 objIndex;
|
||||
/* 0x195 */ s8 objectSlot;
|
||||
/* 0x196 */ s8 kusaMtxIdx;
|
||||
/* 0x197 */ u8 isCut;
|
||||
/* 0x198 */ u8 isInWater;
|
||||
|
||||
@@ -707,7 +707,7 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxp) {
|
||||
s16 step;
|
||||
|
||||
// Set segment 6 to the object, since this will be read by OVERLAY_DISP where it is not set by default.
|
||||
gSPSegment(gfx++, 0x06, play->objectCtx.slots[this->actor.objBankIndex].segment);
|
||||
gSPSegment(gfx++, 0x06, play->objectCtx.slots[this->actor.objectSlot].segment);
|
||||
|
||||
Gfx_SetupDL39_Ptr(&gfx);
|
||||
|
||||
|
||||
@@ -58,11 +58,11 @@ Color_RGBA8 sPrimColor = { 255, 255, 255, 255 };
|
||||
Color_RGBA8 sEnvColor = { 80, 80, 80, 255 };
|
||||
|
||||
void EnNwc_Init(Actor* thisx, PlayState* play) {
|
||||
s32 niwObjectIndex;
|
||||
s32 niwObjectSlot;
|
||||
EnNwc* this = THIS;
|
||||
|
||||
niwObjectIndex = Object_GetSlot(&play->objectCtx, OBJECT_NIW);
|
||||
if (niwObjectIndex < 0) {
|
||||
niwObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_NIW);
|
||||
if (niwObjectSlot <= OBJECT_SLOT_NONE) {
|
||||
// niw object does not exist, we need it for tranformation, despawn
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
@@ -75,8 +75,8 @@ void EnNwc_Init(Actor* thisx, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->niwObjectIndex = niwObjectIndex;
|
||||
this->nwcObjectIndex = this->actor.objBankIndex;
|
||||
this->niwObjectSlot = niwObjectSlot;
|
||||
this->nwcObjectIndex = this->actor.objectSlot;
|
||||
this->grog = EnNwc_FindGrog(play);
|
||||
|
||||
this->footRotY = this->footRotZ = 0;
|
||||
@@ -247,8 +247,8 @@ void EnNwc_CheckFound(EnNwc* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void EnNwc_LoadNiwSkeleton(EnNwc* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->niwObjectIndex)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->niwObjectIndex].segment);
|
||||
if (Object_IsLoaded(&play->objectCtx, this->niwObjectSlot)) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->niwObjectSlot].segment);
|
||||
|
||||
SkelAnime_InitFlex(play, &this->niwSkeleton, &gNiwSkel, &gNiwIdleAnim, this->jointTable, this->morphTable,
|
||||
NIW_LIMB_MAX);
|
||||
@@ -468,11 +468,11 @@ void EnNwc_Update(Actor* thisx, PlayState* play) {
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 10.0f, UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4);
|
||||
this->actionFunc(this, play);
|
||||
if (this->hasGrownUp & 1) {
|
||||
this->actor.objBankIndex = this->niwObjectIndex;
|
||||
this->actor.objectSlot = this->niwObjectSlot;
|
||||
this->actor.draw = EnNwc_DrawAdultBody;
|
||||
this->actor.shape.shadowScale = 15.0f;
|
||||
} else {
|
||||
this->actor.objBankIndex = this->nwcObjectIndex;
|
||||
this->actor.objectSlot = this->nwcObjectIndex;
|
||||
this->actor.draw = EnNwc_Draw;
|
||||
this->actor.shape.shadowScale = 6.0f;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ typedef struct EnNwc {
|
||||
/* 0x144 */ SkelAnime niwSkeleton; // this skeleton is for when the chicks grow up into adults during the breman march
|
||||
/* 0x188 */ Vec3s jointTable[NIW_LIMB_MAX];
|
||||
/* 0x1E8 */ Vec3s morphTable[NIW_LIMB_MAX];
|
||||
/* 0x248 */ s8 niwObjectIndex;
|
||||
/* 0x248 */ s8 niwObjectSlot;
|
||||
/* 0x249 */ s8 nwcObjectIndex;
|
||||
/* 0x24A */ s16 blinkState;
|
||||
/* 0x24C */ s16 blinkTimer;
|
||||
|
||||
@@ -267,16 +267,16 @@ void EnOssan_SpawnShopItems(EnOssan* this, PlayState* play, ShopItem* shop) {
|
||||
|
||||
void EnOssan_Init(Actor* thisx, PlayState* play) {
|
||||
EnOssan* this = THIS;
|
||||
s16 id;
|
||||
s16 objectId;
|
||||
|
||||
if ((this->actor.params > ENOSSAN_PART_TIME_WORKER) && (this->actor.params < ENOSSAN_CURIOSITY_SHOP_MAN)) {
|
||||
//! @bug: Impossible to reach, && should be an ||
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
id = sObjectIds[this->actor.params];
|
||||
this->objIndex = Object_GetSlot(&play->objectCtx, id);
|
||||
if (this->objIndex < 0) {
|
||||
objectId = sObjectIds[this->actor.params];
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, objectId);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -1506,9 +1506,9 @@ void EnOssan_InitShop(EnOssan* this, PlayState* play) {
|
||||
static EnOssanActionFunc sInitFuncs[] = { EnOssan_CuriosityShopMan_Init, EnOssan_PartTimer_Init };
|
||||
ShopItem* shopItems;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_10;
|
||||
this->actor.objBankIndex = this->objIndex;
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
shopItems = sShops[this->actor.params];
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
|
||||
|
||||
@@ -21,7 +21,7 @@ typedef struct EnOssan {
|
||||
/* 0x18C */ EnOssanActionFunc prevActionFunc; // Used to restore back to correct browsing function
|
||||
/* 0x190 */ ColliderCylinder collider;
|
||||
/* 0x1DC */ s16 delayTimer;
|
||||
/* 0x1DE */ s8 objIndex;
|
||||
/* 0x1DE */ s8 objectSlot;
|
||||
/* 0x1E0 */ s16 eyeTexIndex;
|
||||
/* 0x1E2 */ s16 blinkTimer;
|
||||
/* 0x1E4 */ EnOssanBlinkFunc blinkFunc;
|
||||
|
||||
@@ -786,18 +786,18 @@ void EnSGoro_UpdateSleeping(EnSGoro* this, PlayState* play) {
|
||||
s32 EnSGoro_UpdateCheerAnimation(EnSGoro* this, PlayState* play) {
|
||||
if (this->animInfoIndex == EN_S_GORO_ANIM_IDLE_STAND) {
|
||||
if (((EnJg*)this->otherGoron)->flags & 1) {
|
||||
this->loadedObjIndex = Object_GetSlot(&play->objectCtx, OBJECT_TAISOU);
|
||||
if (this->loadedObjIndex >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->loadedObjIndex].segment);
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_TAISOU);
|
||||
if (this->objectSlot > OBJECT_SLOT_NONE) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment);
|
||||
this->animInfoIndex = EN_S_GORO_ANIM_TAISOU_CHEER;
|
||||
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if ((this->animInfoIndex == EN_S_GORO_ANIM_TAISOU_CHEER) && !(((EnJg*)this->otherGoron)->flags & 1)) {
|
||||
this->loadedObjIndex = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
if (this->loadedObjIndex >= 0) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->loadedObjIndex].segment);
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
if (this->objectSlot > OBJECT_SLOT_NONE) {
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment);
|
||||
this->animInfoIndex = EN_S_GORO_ANIM_IDLE_STAND;
|
||||
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex);
|
||||
this->skelAnime.curFrame = this->skelAnime.endFrame;
|
||||
@@ -1023,7 +1023,7 @@ s32 EnSGoro_UpdateAttentionTarget(EnSGoro* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void EnSGoro_SetupAction(EnSGoro* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->loadedObjIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actionFlags = 0;
|
||||
if (EN_S_GORO_OFTYPE_WSHRINE) {
|
||||
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CALMED_GORON_ELDERS_SON)) {
|
||||
@@ -1307,10 +1307,10 @@ void EnSGoro_Init(Actor* thisx, PlayState* play) {
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
if (this->actor.update != NULL) {
|
||||
s32 objIndex = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP);
|
||||
|
||||
this->loadedObjIndex = objIndex;
|
||||
if (objIndex < 0) {
|
||||
this->objectSlot = objectSlot;
|
||||
if (objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
@@ -1329,7 +1329,7 @@ void EnSGoro_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->actionFunc(this, play);
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->loadedObjIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->animInfoIndex != EN_S_GORO_ANIM_SLEEPY) {
|
||||
EnSGoro_UpdateAttentionTarget(this, play);
|
||||
|
||||
@@ -23,7 +23,7 @@ typedef struct EnSGoro {
|
||||
/* 0x1EC */ s16 eyeTexIndex;
|
||||
/* 0x1EE */ s16 eyeTimer;
|
||||
/* 0x1F0 */ s16 loseAttentionTimer;
|
||||
/* 0x1F4 */ s32 loadedObjIndex;
|
||||
/* 0x1F4 */ s32 objectSlot;
|
||||
/* 0x1F8 */ Vec3s jointTable[GORON_LIMB_MAX];
|
||||
/* 0x264 */ Vec3s morphTable[GORON_LIMB_MAX];
|
||||
/* 0x2D0 */ f32 scaleFactor;
|
||||
|
||||
@@ -55,7 +55,7 @@ static u16 sTextIds[] = { 0, 0, 0, 0, 0x1018 };
|
||||
void EnSekihi_Init(Actor* thisx, PlayState* play) {
|
||||
EnSekihi* this = THIS;
|
||||
s32 type = ENSIKIHI_GET_TYPE(thisx);
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
s32 pad;
|
||||
|
||||
if (((type < SEKIHI_TYPE_0) || (type >= SEKIHI_TYPE_MAX)) || (sOpaDLists[type] == NULL)) {
|
||||
@@ -69,9 +69,9 @@ void EnSekihi_Init(Actor* thisx, PlayState* play) {
|
||||
SET_WEEKEVENTREG(WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_BUYER_MOVED_IN);
|
||||
}
|
||||
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, sObjectIds[type]);
|
||||
if (objectIndex >= 0) {
|
||||
this->objectIndex = objectIndex;
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[type]);
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->objectSlot = objectSlot;
|
||||
}
|
||||
this->actionFunc = func_80A44DE8;
|
||||
this->opaDList = sOpaDLists[type];
|
||||
@@ -96,8 +96,8 @@ void func_80A44DE8(EnSekihi* this, PlayState* play) {
|
||||
};
|
||||
|
||||
type = ENSIKIHI_GET_TYPE(&this->dyna.actor);
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
|
||||
this->dyna.actor.objBankIndex = this->objectIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->dyna.actor.objectSlot = this->objectSlot;
|
||||
this->dyna.actor.draw = EnSekihi_Draw;
|
||||
if (type == SEKIHI_TYPE_4) {
|
||||
this->actionFunc = func_80A450B0;
|
||||
|
||||
@@ -15,7 +15,7 @@ typedef struct EnSekihi {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ Gfx* opaDList;
|
||||
/* 0x160 */ Gfx* xluDList;
|
||||
/* 0x164 */ s8 objectIndex;
|
||||
/* 0x164 */ s8 objectSlot;
|
||||
/* 0x168 */ EnSekihiActionFunc actionFunc;
|
||||
} EnSekihi; // size = 0x16C
|
||||
|
||||
|
||||
@@ -379,22 +379,22 @@ void EnSob1_SpawnShopItems(EnSob1* this, PlayState* play, ShopItem* shopItem) {
|
||||
}
|
||||
}
|
||||
|
||||
s32 EnSob1_GetObjIndices(EnSob1* this, PlayState* play, s16* objIds) {
|
||||
if (objIds[1] != OBJECT_ID_MAX) {
|
||||
this->unusedObjIndex = Object_GetSlot(&play->objectCtx, objIds[1]);
|
||||
if (this->unusedObjIndex < 0) {
|
||||
s32 EnSob1_GetObjectIndices(EnSob1* this, PlayState* play, s16* objectIds) {
|
||||
if (objectIds[1] != OBJECT_ID_MAX) {
|
||||
this->unusedObjectSlot = Object_GetSlot(&play->objectCtx, objectIds[1]);
|
||||
if (this->unusedObjectSlot <= OBJECT_SLOT_NONE) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
this->unusedObjIndex = -1;
|
||||
this->unusedObjectSlot = OBJECT_SLOT_NONE;
|
||||
}
|
||||
if (objIds[2] != OBJECT_ID_MAX) {
|
||||
this->shopkeeperAnimObjIndex = Object_GetSlot(&play->objectCtx, objIds[2]);
|
||||
if (this->shopkeeperAnimObjIndex < 0) {
|
||||
if (objectIds[2] != OBJECT_ID_MAX) {
|
||||
this->shopkeeperAnimObjectSlot = Object_GetSlot(&play->objectCtx, objectIds[2]);
|
||||
if (this->shopkeeperAnimObjectSlot <= OBJECT_SLOT_NONE) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
this->shopkeeperAnimObjIndex = -1;
|
||||
this->shopkeeperAnimObjectSlot = OBJECT_SLOT_NONE;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -402,7 +402,7 @@ s32 EnSob1_GetObjIndices(EnSob1* this, PlayState* play, s16* objIds) {
|
||||
void EnSob1_Init(Actor* thisx, PlayState* play) {
|
||||
EnSob1* this = THIS;
|
||||
s32 pad;
|
||||
s16* objIds;
|
||||
s16* objectIds;
|
||||
|
||||
switch (ENSOB1_GET_SHOPTYPE(thisx)) {
|
||||
case ZORA_SHOP:
|
||||
@@ -426,13 +426,13 @@ void EnSob1_Init(Actor* thisx, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
objIds = sObjectIds[this->shopType];
|
||||
this->mainObjIndex = Object_GetSlot(&play->objectCtx, objIds[0]);
|
||||
if (this->mainObjIndex < 0) {
|
||||
objectIds = sObjectIds[this->shopType];
|
||||
this->mainObjectSlot = Object_GetSlot(&play->objectCtx, objectIds[0]);
|
||||
if (this->mainObjectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
if (!EnSob1_GetObjIndices(this, play, objIds)) {
|
||||
if (!EnSob1_GetObjectIndices(this, play, objectIds)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -1345,15 +1345,16 @@ void EnSob1_Blink(EnSob1* this) {
|
||||
}
|
||||
|
||||
void EnSob1_ChangeObject(EnSob1* this, PlayState* play) {
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->shopkeeperAnimObjIndex].segment);
|
||||
gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->shopkeeperAnimObjectSlot].segment);
|
||||
}
|
||||
|
||||
s32 EnSob1_AreObjectsLoaded(EnSob1* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->mainObjIndex)) {
|
||||
if ((this->unusedObjIndex >= 0) && !Object_IsLoaded(&play->objectCtx, this->unusedObjIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->mainObjectSlot)) {
|
||||
if ((this->unusedObjectSlot > OBJECT_SLOT_NONE) && !Object_IsLoaded(&play->objectCtx, this->unusedObjectSlot)) {
|
||||
return false;
|
||||
}
|
||||
if ((this->shopkeeperAnimObjIndex >= 0) && !Object_IsLoaded(&play->objectCtx, this->shopkeeperAnimObjIndex)) {
|
||||
if ((this->shopkeeperAnimObjectSlot > OBJECT_SLOT_NONE) &&
|
||||
!Object_IsLoaded(&play->objectCtx, this->shopkeeperAnimObjectSlot)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -1363,7 +1364,7 @@ s32 EnSob1_AreObjectsLoaded(EnSob1* this, PlayState* play) {
|
||||
|
||||
void EnSob1_ZoraShopkeeper_Init(EnSob1* this, PlayState* play) {
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, ZORA_LIMB_MAX);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->shopkeeperAnimObjIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->shopkeeperAnimObjectSlot].segment);
|
||||
Animation_Change(&this->skelAnime, &gZoraShopkeeperAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gZoraShopkeeperAnim),
|
||||
ANIMMODE_LOOP, 0.0f);
|
||||
this->actor.draw = EnSob1_ZoraShopkeeper_Draw;
|
||||
@@ -1372,7 +1373,7 @@ void EnSob1_ZoraShopkeeper_Init(EnSob1* this, PlayState* play) {
|
||||
|
||||
void EnSob1_GoronShopkeeper_Init(EnSob1* this, PlayState* play) {
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, GORON_LIMB_MAX);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->shopkeeperAnimObjIndex].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->shopkeeperAnimObjectSlot].segment);
|
||||
Animation_Change(&this->skelAnime, &gGoronShopkeeperAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGoronShopkeeperAnim),
|
||||
ANIMMODE_LOOP, 0.0f);
|
||||
this->actor.draw = EnSob1_GoronShopkeeper_Draw;
|
||||
@@ -1394,7 +1395,7 @@ void EnSob1_InitShop(EnSob1* this, PlayState* play) {
|
||||
|
||||
if (EnSob1_AreObjectsLoaded(this, play)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_10;
|
||||
this->actor.objBankIndex = this->mainObjIndex;
|
||||
this->actor.objectSlot = this->mainObjectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
posOffset = &sPosOffset[this->shopType];
|
||||
this->actor.world.pos.x += posOffset->x;
|
||||
|
||||
@@ -36,9 +36,9 @@ typedef struct EnSob1 {
|
||||
/* 0x1E0 */ Path* path;
|
||||
/* 0x1E4 */ s32 waypoint;
|
||||
/* 0x1E8 */ s16 delayTimer;
|
||||
/* 0x1EA */ s8 mainObjIndex;
|
||||
/* 0x1EB */ s8 unusedObjIndex;
|
||||
/* 0x1EC */ s8 shopkeeperAnimObjIndex;
|
||||
/* 0x1EA */ s8 mainObjectSlot;
|
||||
/* 0x1EB */ s8 unusedObjectSlot;
|
||||
/* 0x1EC */ s8 shopkeeperAnimObjectSlot;
|
||||
/* 0x1EE */ s16 headRot;
|
||||
/* 0x1F0 */ s16 headRotTarget;
|
||||
/* 0x1F2 */ Vec3s jointTable[ENSOB1_LIMB_MAX];
|
||||
|
||||
@@ -245,9 +245,9 @@ void func_808A54B0(EnSt* this, PlayState* play) {
|
||||
if ((this->unk_18C & 1) && (this->actor.colChkInfo.health != 0)) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->unk_2C0].segment);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlot].segment);
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[this->unk_2C0].segment);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[this->objectSlot].segment);
|
||||
|
||||
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
@@ -693,7 +693,7 @@ s32 func_808A6A3C(EnSt* this) {
|
||||
void func_808A6A78(EnSt* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->unk_2C0)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 8.0f);
|
||||
SkelAnime_Init(play, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, 30);
|
||||
SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, 0);
|
||||
@@ -842,9 +842,9 @@ void func_808A701C(EnSt* this, PlayState* play) {
|
||||
void EnSt_Init(Actor* thisx, PlayState* play) {
|
||||
EnSt* this = THIS;
|
||||
|
||||
this->unk_2C0 = Object_GetSlot(&play->objectCtx, GAMEPLAY_KEEP);
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, GAMEPLAY_KEEP);
|
||||
if (((ENST_GET_SWITCH_FLAG(&this->actor) != 0x3F) && Flags_GetSwitch(play, ENST_GET_SWITCH_FLAG(&this->actor))) ||
|
||||
(this->unk_2C0 < 0)) {
|
||||
(this->objectSlot <= OBJECT_SLOT_NONE)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ typedef struct EnSt {
|
||||
/* 0x1DC */ ColliderCylinder collider2;
|
||||
/* 0x228 */ ColliderCylinder collider3;
|
||||
/* 0x274 */ ColliderCylinder collider4;
|
||||
/* 0x2C0 */ s8 unk_2C0;
|
||||
/* 0x2C0 */ s8 objectSlot;
|
||||
/* 0x2C4 */ f32 unk_2C4;
|
||||
/* 0x2C8 */ f32 unk_2C8;
|
||||
/* 0x2CC */ f32 unk_2CC;
|
||||
|
||||
@@ -108,16 +108,16 @@ static Color_RGB8 sShirtColors[] = {
|
||||
void EnSth_Init(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
EnSth* this = THIS;
|
||||
s32 objectId;
|
||||
s32 objectSlot;
|
||||
|
||||
// this actor can draw two separate bodies that use different objects
|
||||
if (STH_GET_SWAMP_BODY(&this->actor)) {
|
||||
objectId = Object_GetSlot(&play->objectCtx, OBJECT_AHG);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_AHG);
|
||||
} else {
|
||||
objectId = Object_GetSlot(&play->objectCtx, OBJECT_STH);
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_STH);
|
||||
}
|
||||
this->mainObjectId = objectId;
|
||||
this->maskOfTruthObjectId = Object_GetSlot(&play->objectCtx, OBJECT_MASK_TRUTH);
|
||||
this->mainObjectSlot = objectSlot;
|
||||
this->maskOfTruthObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MASK_TRUTH);
|
||||
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
@@ -619,8 +619,8 @@ void EnSth_UpdateWaitForObject(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
EnSth* this = THIS;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->mainObjectId)) {
|
||||
this->actor.objBankIndex = this->mainObjectId;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->mainObjectSlot)) {
|
||||
this->actor.objectSlot = this->mainObjectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
|
||||
if (STH_GET_SWAMP_BODY(&this->actor)) {
|
||||
@@ -733,14 +733,14 @@ void EnSth_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
if (this->sthFlags & STH_FLAG_DRAW_MASK_OF_TRUTH) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->maskOfTruthObjectId)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->maskOfTruthObjectSlot)) {
|
||||
Matrix_Push();
|
||||
Matrix_RotateZS(0x3A98, MTXMODE_APPLY);
|
||||
Matrix_Translate(0.0f, 190.0f, 0.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0A, play->objectCtx.slots[this->maskOfTruthObjectId].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0A, play->objectCtx.slots[this->maskOfTruthObjectSlot].segment);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_mask_truth_DL_0001A0);
|
||||
|
||||
Matrix_Pop();
|
||||
|
||||
@@ -42,8 +42,8 @@ typedef struct EnSth {
|
||||
/* 0x294 */ Vec3s headRot;
|
||||
/* 0x29A */ s16 animIndex;
|
||||
/* 0x29C */ u16 sthFlags;
|
||||
/* 0x29E */ u8 mainObjectId;
|
||||
/* 0x29F */ u8 maskOfTruthObjectId;
|
||||
/* 0x29E */ u8 mainObjectSlot;
|
||||
/* 0x29F */ u8 maskOfTruthObjectSlot;
|
||||
/* 0x2A0 */ EnSthActionFunc actionFunc;
|
||||
} EnSth; // size = 0x2A4
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ ActorInit En_Sth2_InitVars = {
|
||||
void EnSth2_Init(Actor* thisx, PlayState* play) {
|
||||
EnSth2* this = THIS;
|
||||
|
||||
this->objIndex = Object_GetSlot(&play->objectCtx, OBJECT_STH);
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_STH);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
|
||||
this->unused = 0;
|
||||
@@ -60,8 +60,8 @@ void EnSth2_Update(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
EnSth2* this = THIS;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
this->actor.objBankIndex = this->objIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
SkelAnime_InitFlex(play, &this->skelAnime, &gSthSkel, &gEnSth2WavingHandAnim, this->jointTable,
|
||||
this->morphTable, STH_LIMB_MAX);
|
||||
|
||||
@@ -14,7 +14,7 @@ typedef struct EnSth2 {
|
||||
/* 0x188 */ Vec3s jointTable[STH_LIMB_MAX];
|
||||
/* 0x1E8 */ Vec3s morphTable[STH_LIMB_MAX];
|
||||
/* 0x248 */ s16 unused;
|
||||
/* 0x24A */ u8 objIndex;
|
||||
/* 0x24A */ u8 objectSlot;
|
||||
/* 0x24C */ EnSth2ActionFunc actionFunc;
|
||||
} EnSth2; // size = 0x250
|
||||
|
||||
|
||||
@@ -79,18 +79,18 @@ void EnTest2_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
void EnTest2_Update(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
EnTest2ModelInfo* modelInfo;
|
||||
EnTest2* this = THIS;
|
||||
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, sObjectIds[this->actor.params]);
|
||||
if (objectIndex < 0) {
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[this->actor.params]);
|
||||
if (objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
if (Object_IsLoaded(&play->objectCtx, objectIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, objectSlot)) {
|
||||
modelInfo = &sModelInfo[this->actor.params];
|
||||
this->actor.objBankIndex = objectIndex;
|
||||
this->actor.objectSlot = objectSlot;
|
||||
this->actor.draw = EnTest2_Draw;
|
||||
if (modelInfo->animMat != NULL) {
|
||||
Actor_SetObjectDependency(play, &this->actor);
|
||||
|
||||
@@ -60,7 +60,8 @@ void EnWarptag_Init(Actor* thisx, PlayState* play) {
|
||||
this->actionFunc = EnWarpTag_WaitForPlayer;
|
||||
|
||||
} else {
|
||||
if ((this->dangeonKeepObject = Object_GetSlot(&play->objectCtx, GAMEPLAY_DANGEON_KEEP)) < 0) {
|
||||
if ((this->dangeonKeepObjectSlot = Object_GetSlot(&play->objectCtx, GAMEPLAY_DANGEON_KEEP)) <=
|
||||
OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
}
|
||||
|
||||
@@ -83,11 +84,11 @@ void EnWarptag_Destroy(Actor* thisx, PlayState* play) {
|
||||
* Loads DynaPoly from GAMEPLAY_DANGEON_KEEP.
|
||||
*/
|
||||
void EnWarpTag_CheckDungeonKeepObject(EnWarptag* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->dangeonKeepObject)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->dangeonKeepObjectSlot)) {
|
||||
this->actionFunc = EnWarpTag_WaitForPlayer;
|
||||
DynaPolyActor_Init(&this->dyna, 0x1);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &gWarpTagGoronTrialBaseCol);
|
||||
this->dyna.actor.objBankIndex = this->dangeonKeepObject;
|
||||
this->dyna.actor.objectSlot = this->dangeonKeepObjectSlot;
|
||||
this->dyna.actor.draw = EnWarpTag_Draw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ typedef void (*EnWarptagActionFunc)(struct EnWarptag*, PlayState*);
|
||||
|
||||
typedef struct EnWarptag {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ s8 dangeonKeepObject;
|
||||
/* 0x15C */ s8 dangeonKeepObjectSlot;
|
||||
/* 0x15E */ union {
|
||||
s16 reusedValue; // default name
|
||||
s16 unkValue15E; // passed to unk play func, mods player rotation, stepped to 0x2710
|
||||
|
||||
@@ -55,12 +55,12 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
ItemEtcetera* this = THIS;
|
||||
s32 type = ITEMETCETERA_GET_FF(&this->actor);
|
||||
s32 objBankIndex = Object_GetSlot(&play->objectCtx, sObjectIds[type]);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[type]);
|
||||
|
||||
if (objBankIndex < 0) {
|
||||
if (objectSlot <= OBJECT_SLOT_NONE) {
|
||||
// assert on debug
|
||||
} else {
|
||||
this->objIndex = objBankIndex;
|
||||
this->objectSlot = objectSlot;
|
||||
}
|
||||
this->getItemDrawId = sGetItemDrawIds[type];
|
||||
this->getItemId = sGetItemIds[type];
|
||||
@@ -93,8 +93,8 @@ void ItemEtcetera_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void ItemEtcetera_WaitForObject(ItemEtcetera* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
this->actor.objBankIndex = this->objIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
this->actor.draw = this->drawFunc;
|
||||
this->actionFunc = this->futureActionFunc;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ typedef struct ItemEtcetera {
|
||||
/* 0x144 */ ItemEtceteraActionFunc futureActionFunc;
|
||||
/* 0x148 */ s16 getItemDrawId;
|
||||
/* 0x14A */ s16 getItemId;
|
||||
/* 0x14C */ u8 objIndex;
|
||||
/* 0x14C */ u8 objectSlot;
|
||||
/* 0x150 */ ActorFunc drawFunc;
|
||||
/* 0x154 */ ItemEtceteraActionFunc actionFunc;
|
||||
} ItemEtcetera; // size = 0x158
|
||||
|
||||
@@ -52,7 +52,7 @@ static ColliderCylinderInit sCylinderInit = {
|
||||
{ 20, 14, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
static s16 objectIds[] = {
|
||||
static s16 sObjectIds[] = {
|
||||
GAMEPLAY_KEEP,
|
||||
GAMEPLAY_KEEP,
|
||||
GAMEPLAY_KEEP,
|
||||
@@ -71,7 +71,7 @@ static f32 oscillationTable[] = {
|
||||
void ObjEtcetera_Init(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
ObjEtcetera* this = THIS;
|
||||
s32 objectIndex;
|
||||
s32 objectSlot;
|
||||
s32 type = DEKU_FLOWER_TYPE(&this->dyna.actor);
|
||||
s32 floorBgId;
|
||||
Vec3f pos;
|
||||
@@ -80,9 +80,9 @@ void ObjEtcetera_Init(Actor* thisx, PlayState* play) {
|
||||
type = DEKU_FLOWER_TYPE_PINK;
|
||||
}
|
||||
|
||||
objectIndex = Object_GetSlot(&play->objectCtx, objectIds[type]);
|
||||
if (objectIndex >= 0) {
|
||||
this->objIndex = objectIndex;
|
||||
objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[type]);
|
||||
if (objectSlot > OBJECT_SLOT_NONE) {
|
||||
this->objectSlot = objectSlot;
|
||||
}
|
||||
|
||||
pos.x = this->dyna.actor.world.pos.x;
|
||||
@@ -257,8 +257,8 @@ void ObjEtcetera_Setup(ObjEtcetera* this, PlayState* play) {
|
||||
type = DEKU_FLOWER_TYPE_PINK;
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
this->dyna.actor.objBankIndex = this->objIndex;
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->dyna.actor.objectSlot = this->objectSlot;
|
||||
Actor_SetObjectDependency(play, &this->dyna.actor);
|
||||
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
|
||||
thisCollisionHeader = collisionHeaders[type];
|
||||
|
||||
@@ -28,7 +28,7 @@ typedef struct ObjEtcetera {
|
||||
/* 0x270 */ f32 bounceOscillationScale;
|
||||
/* 0x274 */ s16 oscillationTimer;
|
||||
/* 0x276 */ u16 burrowFlag;
|
||||
/* 0x278 */ s8 objIndex;
|
||||
/* 0x278 */ s8 objectSlot;
|
||||
/* 0x27C */ Gfx* dList;
|
||||
/* 0x280 */ ObjEtceteraActionFunc actionFunc;
|
||||
} ObjEtcetera; // size = 0x284
|
||||
|
||||
@@ -68,7 +68,7 @@ static ColliderCylinderInit sCylinderInit = {
|
||||
{ 15, 30, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
static s16 sObjectIdList[] = { GAMEPLAY_DANGEON_KEEP, OBJECT_KIBAKO };
|
||||
static s16 sObjectIds[] = { GAMEPLAY_DANGEON_KEEP, OBJECT_KIBAKO };
|
||||
|
||||
static Gfx* sKakeraDisplayLists[] = { gameplay_dangeon_keep_DL_007980, gSmallCrateFragmentDL };
|
||||
|
||||
@@ -135,12 +135,12 @@ void func_80926394(ObjKibako* this, PlayState* play) {
|
||||
void ObjKibako_Init(Actor* thisx, PlayState* play2) {
|
||||
PlayState* play = play2;
|
||||
ObjKibako* this = THIS;
|
||||
s32 whichBankIndex;
|
||||
s32 objectIndex;
|
||||
|
||||
whichBankIndex = KIBAKO_BANK_INDEX(thisx);
|
||||
objectIndex = KIBAKO_BANK_INDEX(thisx);
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
Actor_SetScale(&this->actor, 0.15f);
|
||||
if (whichBankIndex == 0) {
|
||||
if (objectIndex == 0) {
|
||||
this->actor.uncullZoneForward = 4000.0f;
|
||||
} else {
|
||||
this->actor.uncullZoneForward = 800.0f;
|
||||
@@ -149,8 +149,8 @@ void ObjKibako_Init(Actor* thisx, PlayState* play2) {
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
this->bankIndex = Object_GetSlot(&play->objectCtx, sObjectIdList[whichBankIndex]);
|
||||
if (this->bankIndex < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[objectIndex]);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
@@ -197,7 +197,7 @@ void ObjKibako_AirBreak(ObjKibako* this, PlayState* play) {
|
||||
}
|
||||
|
||||
EffectSsKakera_Spawn(play, &pos, &velocity, worldPos, -200, phi_s0, 20, 0, 0, (Rand_ZeroOne() * 38.0f) + 10.0f,
|
||||
0, 0, 60, -1, sObjectIdList[KIBAKO_BANK_INDEX(&this->actor)],
|
||||
0, 0, 60, -1, sObjectIds[KIBAKO_BANK_INDEX(&this->actor)],
|
||||
sKakeraDisplayLists[KIBAKO_BANK_INDEX(&this->actor)]);
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ void ObjKibako_WaterBreak(ObjKibako* this, PlayState* play) {
|
||||
phi_s0 = (temp_rand < 0.2f) ? 0x40 : 0x20;
|
||||
|
||||
EffectSsKakera_Spawn(play, &pos, &velocity, worldPos, -180, phi_s0, 50, 5, 0, (Rand_ZeroOne() * 35.0f) + 10.0f,
|
||||
0, 0, 70, -1, sObjectIdList[KIBAKO_BANK_INDEX(&this->actor)],
|
||||
0, 0, 70, -1, sObjectIds[KIBAKO_BANK_INDEX(&this->actor)],
|
||||
sKakeraDisplayLists[KIBAKO_BANK_INDEX(&this->actor)]);
|
||||
}
|
||||
}
|
||||
@@ -254,9 +254,9 @@ void func_80926B54(ObjKibako* this, PlayState* play) {
|
||||
Actor_MoveWithGravity(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 18.0f, 15.0f, 0.0f,
|
||||
UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4 | UPDBGCHECKINFO_FLAG_40);
|
||||
if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
this->actor.draw = ObjKibako_Draw;
|
||||
this->actor.objBankIndex = this->bankIndex;
|
||||
this->actor.objectSlot = this->objectSlot;
|
||||
ObjKibako_SetupIdle(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ typedef struct ObjKibako {
|
||||
/* 0x144 */ ObjKibakoActionFunc actionFunc;
|
||||
/* 0x148 */ ColliderCylinder collider;
|
||||
/* 0x194 */ s16 timer;
|
||||
/* 0x196 */ s16 bankIndex;
|
||||
/* 0x196 */ s16 objectSlot;
|
||||
/* 0x198 */ s8 isDropCollected;
|
||||
/* 0x199 */ s8 unk199; /* room? */
|
||||
} ObjKibako; // size = 0x19C
|
||||
|
||||
@@ -49,7 +49,7 @@ static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_U8(targetMode, TARGET_MODE_0, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
s16 D_80BA34B8[] = { OBJECT_SECOM_OBJ, OBJECT_GI_MSSA, OBJECT_SECOM_OBJ, OBJECT_SECOM_OBJ };
|
||||
static s16 sObjectIds[] = { OBJECT_SECOM_OBJ, OBJECT_GI_MSSA, OBJECT_SECOM_OBJ, OBJECT_SECOM_OBJ };
|
||||
|
||||
Vec3f D_80BA34C0 = { 0.0f, 0.0f, -1110.0f };
|
||||
|
||||
@@ -93,15 +93,15 @@ void ObjNozoki_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80BA2514(ObjNozoki* this, PlayState* play) {
|
||||
s32 sp24 = Object_GetSlot(&play->objectCtx, D_80BA34B8[this->unk_15C]);
|
||||
s32 objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[this->unk_15C]);
|
||||
|
||||
if (sp24 < 0) {
|
||||
if (objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, sp24)) {
|
||||
this->dyna.actor.objBankIndex = sp24;
|
||||
if (Object_IsLoaded(&play->objectCtx, objectSlot)) {
|
||||
this->dyna.actor.objectSlot = objectSlot;
|
||||
this->dyna.actor.draw = ObjNozoki_Draw;
|
||||
|
||||
if (this->unk_15C == 0) {
|
||||
|
||||
@@ -130,8 +130,8 @@ void ObjPurify_Init(Actor* thisx, PlayState* play) {
|
||||
if (sp20 == 1) {
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
}
|
||||
this->objIndex = Object_GetSlot(&play->objectCtx, info->objectId);
|
||||
if (this->objIndex < 0) {
|
||||
this->objectSlot = Object_GetSlot(&play->objectCtx, info->objectId);
|
||||
if (this->objectSlot <= OBJECT_SLOT_NONE) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
} else if (sp20 == 0) {
|
||||
func_80A84EAC(this);
|
||||
@@ -158,10 +158,10 @@ void func_80A84EC0(ObjPurify* this, PlayState* play) {
|
||||
s32 sp28;
|
||||
s32 index;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objIndex)) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objectSlot)) {
|
||||
sp28 = OBJPURIFY_GET_UNK_FLAG(&this->dyna.actor);
|
||||
index = OBJPURIFY_GET_INFO_INDEX(&this->dyna.actor);
|
||||
this->dyna.actor.objBankIndex = this->objIndex;
|
||||
this->dyna.actor.objectSlot = this->objectSlot;
|
||||
Actor_SetObjectDependency(play, &this->dyna.actor);
|
||||
if (sp28 == 1) {
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, sObjPurifyInfo[index].colHeader);
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef struct ObjPurify {
|
||||
/* 0x15C */ ObjPurifyActionFunc actionFunc;
|
||||
/* 0x160 */ s32 gfxIndex;
|
||||
/* 0x164 */ s16 timer;
|
||||
/* 0x166 */ s16 objIndex;
|
||||
/* 0x166 */ s16 objectSlot;
|
||||
/* 0x168 */ f32 unk168[2];
|
||||
} ObjPurify; // size = 0x170
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user