mirror of https://github.com/zeldaret/mm.git
Misc Cleanup 14 (#1214)
* bgId * z64scene.h whitespace * SubS_ComputeTrackPointRot casts * Macros cleanup * ifs * Empty Loops * Lights_FindBufSlot void * SkelAnime_GetFrameData * }; * Struct inits * fs * @todo * Bug comments * EnPofusen and ObjUm * Trailing comma * Revert "bgId" This reverts commiteea073c5ac. * Revert "z64scene.h whitespace" This reverts commit399fd57550. * Revert "SubS_ComputeTrackPointRot casts" This reverts commitdea896c874. * FAKE * Review * Format
This commit is contained in:
parent
6d1bc6e34b
commit
9bb978527f
|
|
@ -1476,7 +1476,7 @@ void Lights_BindPointWithReference(Lights* lights, LightParams* params, Vec3f* p
|
|||
void Lights_BindPoint(Lights* lights, LightParams* params, PlayState* play);
|
||||
void Lights_BindDirectional(Lights* lights, LightParams* params, void* unused);
|
||||
void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* refPos, PlayState* play);
|
||||
LightNode* Lights_FindBufSlot();
|
||||
LightNode* Lights_FindBufSlot(void);
|
||||
void Lights_FreeNode(LightNode* light);
|
||||
void LightContext_Init(PlayState* play, LightContext* lightCtx);
|
||||
void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b);
|
||||
|
|
|
|||
|
|
@ -146,12 +146,13 @@ extern GraphicsContext* __gfxCtx;
|
|||
|
||||
#define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5))
|
||||
|
||||
#define SWAP(type, a, b) \
|
||||
{ \
|
||||
type _temp = (a); \
|
||||
(a) = (b); \
|
||||
(b) = _temp; \
|
||||
}
|
||||
#define SWAP(type, a, b) \
|
||||
{ \
|
||||
type _temp = (a); \
|
||||
(a) = (b); \
|
||||
(b) = _temp; \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#define OVERLAY_RELOCATION_OFFSET(overlayEntry) ((uintptr_t)((overlayEntry)->vramStart) - (uintptr_t)((overlayEntry)->loadedRamAddr))
|
||||
#define VRAM_PTR_SIZE(entry) ((uintptr_t)((entry)->vramEnd) - (uintptr_t)((entry)->vramStart))
|
||||
|
|
|
|||
|
|
@ -104,11 +104,13 @@ typedef struct {
|
|||
#define LERPWEIGHT(val, prev, next) (((val) - (prev)) / ((next) - (prev)))
|
||||
#define F32_LERPWEIGHT(val, prev, next) (((f32)(val) - (f32)(prev)) / ((f32)(next) - (f32)(prev)))
|
||||
|
||||
#define VEC3F_LERPIMPDST(dst, v0, v1, t){ \
|
||||
(dst)->x = (v0)->x + (((v1)->x - (v0)->x) * t); \
|
||||
(dst)->y = (v0)->y + (((v1)->y - (v0)->y) * t); \
|
||||
(dst)->z = (v0)->z + (((v1)->z - (v0)->z) * t); \
|
||||
}
|
||||
#define VEC3F_LERPIMPDST(dst, v0, v1, t) \
|
||||
{ \
|
||||
(dst)->x = (v0)->x + (((v1)->x - (v0)->x) * t); \
|
||||
(dst)->y = (v0)->y + (((v1)->y - (v0)->y) * t); \
|
||||
(dst)->z = (v0)->z + (((v1)->z - (v0)->z) * t); \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#define IS_ZERO(f) (fabsf(f) < 0.008f)
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ typedef enum TextState {
|
|||
|
||||
#define FONT_CHAR_TEX_WIDTH 16
|
||||
#define FONT_CHAR_TEX_HEIGHT 16
|
||||
//! @TODO: Make this use `sizeof(AnyFontTextureSymbol)`
|
||||
//! TODO: Make this use `sizeof(AnyFontTextureSymbol)`
|
||||
#define FONT_CHAR_TEX_SIZE ((16 * 16) / 2) // 16x16 I4 texture
|
||||
|
||||
// TODO: should Font be in its own header or is it fine to have it here?
|
||||
|
|
|
|||
|
|
@ -1450,9 +1450,12 @@ typedef enum SunsSongState {
|
|||
|
||||
#define GET_WEEKEVENTREG_RACE_FLAGS (WEEKEVENTREG(92) & WEEKEVENTREG_RACE_FLAGS)
|
||||
|
||||
#define SET_WEEKEVENTREG_RACE_FLAGS(flag) \
|
||||
WEEKEVENTREG(92) &= (u8)~WEEKEVENTREG_RACE_FLAGS; \
|
||||
WEEKEVENTREG(92) = WEEKEVENTREG(92) | (u8)((WEEKEVENTREG(92) & ~WEEKEVENTREG_RACE_FLAGS) | (flag))
|
||||
#define SET_WEEKEVENTREG_RACE_FLAGS(flag) \
|
||||
{ \
|
||||
WEEKEVENTREG(92) &= (u8)~WEEKEVENTREG_RACE_FLAGS; \
|
||||
WEEKEVENTREG(92) = WEEKEVENTREG(92) | (u8)((WEEKEVENTREG(92) & ~WEEKEVENTREG_RACE_FLAGS) | (flag)); \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
/**
|
||||
* gSaveContext.eventInf
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ typedef enum {
|
|||
/* 2 */ SUBS_CUTSCENE_SET_FLAG
|
||||
} SubSCutsceneType;
|
||||
|
||||
//! @TODO: rename based on func_8013E748 and func_800B8500
|
||||
//! TODO: rename based on func_8013E748 and func_800B8500
|
||||
typedef s32 (*func_8013E748_VerifyFunc)(struct PlayState*, Actor*, void*);
|
||||
|
||||
typedef s32 (*VerifyActor)(struct PlayState*, Actor*, Actor*, void*);
|
||||
|
|
|
|||
|
|
@ -3837,7 +3837,7 @@ void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v) {
|
|||
35.0f,
|
||||
30.0f,
|
||||
8,
|
||||
{ 0, 0, 0, 0, 128, 255, 0, 300 },
|
||||
{ 0, 0, 0, { 0, 128, 255 }, 0, 300 },
|
||||
1,
|
||||
};
|
||||
s32 effectIndex;
|
||||
|
|
@ -3892,7 +3892,7 @@ void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* p
|
|||
35.0f,
|
||||
30.0f,
|
||||
8,
|
||||
{ 0, 0, 0, 0, 128, 255, 0, 300 },
|
||||
{ 0, 0, 0, { 0, 128, 255 }, 0, 300 },
|
||||
0,
|
||||
};
|
||||
s32 effectIndex;
|
||||
|
|
|
|||
|
|
@ -630,7 +630,8 @@ void SkelAnime_GetFrameData(AnimationHeader* animation, s32 frame, s32 limbCount
|
|||
frameTable->x = jointIndices->x >= staticIndexMax ? dynamicData[jointIndices->x] : frameData[jointIndices->x];
|
||||
frameTable->y = jointIndices->y >= staticIndexMax ? dynamicData[jointIndices->y] : frameData[jointIndices->y];
|
||||
frameTable->z = jointIndices->z >= staticIndexMax ? dynamicData[jointIndices->z] : frameData[jointIndices->z];
|
||||
jointIndices++, frameTable++;
|
||||
jointIndices++;
|
||||
frameTable++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1577,7 +1578,7 @@ void SkelAnime_InitSkin(GameState* gameState, SkelAnime* skelAnime, SkeletonHead
|
|||
skelAnime->morphTable = ZeldaArena_Malloc(sizeof(*skelAnime->morphTable) * skelAnime->limbCount);
|
||||
|
||||
// Debug prints here, required to match.
|
||||
if (1) {};
|
||||
if (1) {}
|
||||
|
||||
if (animation != NULL) {
|
||||
Animation_PlayLoop(skelAnime, animation);
|
||||
|
|
|
|||
|
|
@ -42,9 +42,8 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (actor->id) {
|
||||
; // Needed to match
|
||||
}
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
// Actors which may be pictographed anywhere
|
||||
switch (actor->id) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ void osContGetReadData(OSContPad* data) {
|
|||
data->stick_x = readformat.stick_x;
|
||||
data->stick_y = readformat.stick_y;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void __osPackReadData() {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
#define _osVirtualToPhysical(ptr) \
|
||||
if (ptr != NULL) { \
|
||||
ptr = (void*)osVirtualToPhysical(ptr); \
|
||||
}
|
||||
} \
|
||||
(void)0
|
||||
|
||||
static OSTask sTmpTask;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,12 +39,9 @@ void osInitialize(void) {
|
|||
__osSetFpcCsr(0x01000800);
|
||||
__osSetWatchLo(0x04900000);
|
||||
|
||||
while (__osSiRawReadIo(0x1FC007FC, &pifdata)) {
|
||||
;
|
||||
}
|
||||
while (__osSiRawWriteIo(0x1FC007FC, pifdata | 8)) {
|
||||
;
|
||||
}
|
||||
while (__osSiRawReadIo(0x1FC007FC, &pifdata)) {}
|
||||
|
||||
while (__osSiRawWriteIo(0x1FC007FC, pifdata | 8)) {}
|
||||
|
||||
*(struct_exceptionPreamble*)0x80000000 = *((struct_exceptionPreamble*)__osExceptionPreamble);
|
||||
*(struct_exceptionPreamble*)0x80000080 = *((struct_exceptionPreamble*)__osExceptionPreamble);
|
||||
|
|
@ -72,9 +69,7 @@ void osInitialize(void) {
|
|||
}
|
||||
|
||||
if (__osGetCause() & 0x1000) {
|
||||
while (1) {
|
||||
;
|
||||
}
|
||||
while (true) {}
|
||||
}
|
||||
|
||||
HW_REG(AI_CONTROL_REG, u32) = 1;
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ int osSetTimer(OSTimer* t, OSTime value, OSTime interval, OSMesgQueue* mq, OSMes
|
|||
saveMask = __osDisableInt();
|
||||
|
||||
if (__osTimerList->next != __osTimerList) {
|
||||
if (0) {
|
||||
;
|
||||
}
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
spC = __osTimerList->next;
|
||||
sp14 = osGetCount();
|
||||
sp10 = sp14 - __osTimerCounter;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ void __osTimerInterrupt(void) {
|
|||
if (__osTimerList->next == __osTimerList) {
|
||||
return;
|
||||
}
|
||||
while (1) {
|
||||
while (true) {
|
||||
t = __osTimerList->next;
|
||||
if (t == __osTimerList) {
|
||||
__osSetCompare(0);
|
||||
|
|
@ -84,9 +84,8 @@ OSTime __osInsertTimer(OSTimer* t) {
|
|||
savedMask = __osDisableInt();
|
||||
|
||||
for (timep = __osTimerList->next, tim = t->value; timep != __osTimerList && tim > timep->value;
|
||||
tim -= timep->value, timep = timep->next) {
|
||||
;
|
||||
}
|
||||
tim -= timep->value, timep = timep->next) {}
|
||||
|
||||
t->value = tim;
|
||||
if (timep != __osTimerList) {
|
||||
timep->value -= tim;
|
||||
|
|
|
|||
|
|
@ -14,9 +14,7 @@ s32 __osVoiceGetStatus(OSMesgQueue* mq, s32 port, u8* status) {
|
|||
if (ret != CONT_ERR_CONTRFAIL) {
|
||||
__osContPifRam.status = CONT_CMD_READ_BUTTON;
|
||||
|
||||
for (i = 0; i < port; i++, *ptr++ = 0) {
|
||||
;
|
||||
}
|
||||
for (i = 0; i < port; i++, *ptr++ = 0) {}
|
||||
|
||||
*ptr++ = 1;
|
||||
*ptr++ = 3;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ void BgTobira01_Open(BgTobira01* this, PlayState* play) {
|
|||
this->timer++;
|
||||
} else {
|
||||
this->timer--;
|
||||
};
|
||||
}
|
||||
|
||||
this->timer = CLAMP(this->timer, 0, 60);
|
||||
|
||||
|
|
|
|||
|
|
@ -444,7 +444,8 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) {
|
|||
for (i = 0; i < ARRAY_COUNT(this->effects); i++) { this->effects[i].state = DEMO_KANKYO_STATE_INIT; }
|
||||
// clang-format on
|
||||
|
||||
if (1) {};
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
switch (this->actor.params) {
|
||||
case DEMO_KANKYO_TYPE_LOSTWOODS:
|
||||
|
|
|
|||
|
|
@ -351,8 +351,8 @@ s32 func_80B3EC84(EnDai* this) {
|
|||
};
|
||||
|
||||
static Vec3f D_80B3FD7C[] = {
|
||||
{ 1.0f, 1.0f, 1.0f }, { 1.0f, 0.8, 0.8 }, { 1.0f, 1.1f, 1.1f }, { 1.0f, 1.3f, 1.3f }, { 1.0f, 0.7f, 0.9f },
|
||||
{ 1.0f, 0.8, 0.9f }, { 1.0f, 0.7f, 0.9f }, { 1.0f, 0.8, 0.9f }, { 1.0f, 1.0f, 1.0f },
|
||||
{ 1.0f, 1.0f, 1.0f }, { 1.0f, 0.8f, 0.8f }, { 1.0f, 1.1f, 1.1f }, { 1.0f, 1.3f, 1.3f }, { 1.0f, 0.7f, 0.9f },
|
||||
{ 1.0f, 0.8f, 0.9f }, { 1.0f, 0.7f, 0.9f }, { 1.0f, 0.8f, 0.9f }, { 1.0f, 1.0f, 1.0f },
|
||||
};
|
||||
|
||||
s32 i;
|
||||
|
|
@ -379,7 +379,10 @@ s32 func_80B3ED88(EnDai* this) {
|
|||
static s16 D_80B3FE00[] = { 1, 2, 3 };
|
||||
|
||||
static Vec3f D_80B3FE08[] = {
|
||||
1.0f, 1.0f, 1.0f, 1.0f, 1.2f, 1.2f, 1.0f, 0.7f, 0.8f, 1.0f, 1.0f, 1.0f,
|
||||
{ 1.0f, 1.0f, 1.0f },
|
||||
{ 1.0f, 1.2f, 1.2f },
|
||||
{ 1.0f, 0.7f, 0.8f },
|
||||
{ 1.0f, 1.0f, 1.0f },
|
||||
};
|
||||
|
||||
s32 i;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ struct EnDaiku;
|
|||
|
||||
typedef void (*EnDaikuActionFunc)(struct EnDaiku*, PlayState*);
|
||||
|
||||
#define ENDAIKU_GET_FF(thisx) ((thisx)->params & 0xFF);
|
||||
#define ENDAIKU_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF);
|
||||
#define ENDAIKU_GET_FF(thisx) ((thisx)->params & 0xFF)
|
||||
#define ENDAIKU_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF)
|
||||
|
||||
enum {
|
||||
/* 0x0 */ ENDAIKU_PARAMS_FF_0,
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ struct EnDaiku2;
|
|||
|
||||
typedef void (*EnDaiku2ActionFunc)(struct EnDaiku2*, PlayState*);
|
||||
|
||||
#define ENDAIKU2_GET_7F(thisx) ((thisx)->params & 0x7F);
|
||||
#define ENDAIKU2_GET_1F80(thisx) (((thisx)->params >> 7) & 0x3F);
|
||||
#define ENDAIKU2_GET_8000(thisx) (((thisx)->params >> 15) & 0x1);
|
||||
#define ENDAIKU2_GET_7F(thisx) ((thisx)->params & 0x7F)
|
||||
#define ENDAIKU2_GET_1F80(thisx) (((thisx)->params >> 7) & 0x3F)
|
||||
#define ENDAIKU2_GET_8000(thisx) (((thisx)->params >> 15) & 0x1)
|
||||
|
||||
enum {
|
||||
/* -1 */ ENDAIKU2_GET_7F_MINUS1 = -1,
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ struct EnDekunuts;
|
|||
|
||||
typedef void (*EnDekunutsActionFunc)(struct EnDekunuts*, PlayState*);
|
||||
|
||||
#define ENDEKUNUTS_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF);
|
||||
#define ENDEKUNUTS_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF)
|
||||
|
||||
enum {
|
||||
/* 0x0 */ ENDEKUNUTS_GET_FF00_0,
|
||||
/* 0x1 */ ENDEKUNUTS_GET_FF00_1,
|
||||
/* 0x2 */ ENDEKUNUTS_GET_FF00_2,
|
||||
/* 0xFF*/ ENDEKUNUTS_GET_FF00_FF = 0xFF,
|
||||
/* 0x00 */ ENDEKUNUTS_GET_FF00_0,
|
||||
/* 0x01 */ ENDEKUNUTS_GET_FF00_1,
|
||||
/* 0x02 */ ENDEKUNUTS_GET_FF00_2,
|
||||
/* 0xFF */ ENDEKUNUTS_GET_FF00_FF = 0xFF
|
||||
};
|
||||
|
||||
typedef struct EnDekunuts {
|
||||
|
|
|
|||
|
|
@ -275,7 +275,9 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, PlayState* play2) {
|
|||
}
|
||||
Matrix_Push();
|
||||
|
||||
if (1) {};
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
arg0->unk_24 = (arg0->unk_01 / (f32)arg0->unk_02) * 255.0f;
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)arg0->unk_24);
|
||||
|
|
|
|||
|
|
@ -945,7 +945,9 @@ void func_80A73408(EnDno* this, PlayState* play) {
|
|||
|
||||
if ((Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) &&
|
||||
(this->animIndex == EN_DNO_ANIM_SHOCK_START)) {
|
||||
if (0) {};
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, EN_DNO_ANIM_SHOCK_LOOP, &this->animIndex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ s32 func_80B3CA20(EnDnp* this) {
|
|||
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_GREET2);
|
||||
}
|
||||
} else if ((this->animIndex == EN_DNP_ANIM_UNUSED_WALK) && (this->animIndex == EN_DNP_ANIM_WALK)) {
|
||||
//! @bug: Impossible to reach, && should be an ||
|
||||
if (Animation_OnFrame(&this->skelAnime, 7.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EN_DEKUHIME_WALK);
|
||||
}
|
||||
|
|
@ -217,7 +218,8 @@ s32 func_80B3CDA4(EnDnp* this, PlayState* play) {
|
|||
pitch = Math_Vec3f_Pitch(&sp3C, &sp30);
|
||||
|
||||
//! FAKE
|
||||
if (1) {};
|
||||
if (1) {}
|
||||
|
||||
Math_SmoothStepToS(&this->unk_330, pitch, 3, 0x2AA8, 0x1);
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) {
|
|||
|
||||
this->dyna.actor.targetMode = 6;
|
||||
this->dyna.actor.colChkInfo.health = 1;
|
||||
this->scale = 0.1;
|
||||
this->scale = 0.1f;
|
||||
this->switchFlag = ENCOUNT2_GET_SWITCH_FLAG(&this->dyna.actor);
|
||||
|
||||
if (this->switchFlag == 0x7F) {
|
||||
|
|
|
|||
|
|
@ -159,8 +159,8 @@ void EnGirlA_SetupAction(EnGirlA* this, EnGirlAActionFunc action) {
|
|||
void EnGirlA_InitObjIndex(EnGirlA* this, PlayState* play) {
|
||||
s16 params = this->actor.params;
|
||||
|
||||
//! @bug: Condition is impossible, && should be an ||
|
||||
if ((params >= SI_MAX) && (params < SI_POTION_RED_1)) {
|
||||
//! @bug: Impossible to reach, && should be an ||
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -934,7 +934,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, PlayState* play) {
|
|||
func_80169EFC(&play->state);
|
||||
|
||||
//! FAKE
|
||||
if (0) {}
|
||||
if (1) {}
|
||||
|
||||
if (gSaveContext.save.time > CLOCK_TIME(18, 0) || gSaveContext.save.time < CLOCK_TIME(6, 0)) {
|
||||
gSaveContext.save.time = CLOCK_TIME(6, 0);
|
||||
|
|
|
|||
|
|
@ -193,7 +193,8 @@ void func_80B2654C(EnKendoJs* this, PlayState* play) {
|
|||
} else if ((Player_GetMask(play) != PLAYER_MASK_NONE) && (Player_GetMask(play) < PLAYER_MASK_GIANT)) {
|
||||
u16 sp2E = Player_GetMask(play) + 0x273C;
|
||||
|
||||
if (0) {}
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
Message_StartTextbox(play, sp2E, &this->actor);
|
||||
this->unk_288 = sp2E;
|
||||
|
|
|
|||
|
|
@ -86,41 +86,20 @@ static ColliderCylinderInit sCylinderInit = {
|
|||
{ 15, 25, 4, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
static Vec3f D_808934C4 = {
|
||||
90000.0f,
|
||||
90000.0f,
|
||||
90000.0f,
|
||||
};
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
static Vec3f D_808934DC = {
|
||||
90000.0f,
|
||||
90000.0f,
|
||||
90000.0f,
|
||||
};
|
||||
|
||||
static Vec3f D_808934E8 = {
|
||||
90000.0f,
|
||||
90000.0f,
|
||||
90000.0f,
|
||||
};
|
||||
|
||||
static s32 pad = 0;
|
||||
|
||||
void EnNiw_Init(Actor* thisx, PlayState* play) {
|
||||
static InitChainEntry sInitChain[] = {
|
||||
ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP),
|
||||
};
|
||||
EnNiw* this = THIS;
|
||||
Vec3f dTemp = D_808934C4;
|
||||
Vec3f D_808934C4 = { 90000.0f, 90000.0f, 90000.0f };
|
||||
|
||||
if (this->actor.params < 0) { // all scene spawned cucco are (-1)
|
||||
this->actor.params = NIW_TYPE_REGULAR;
|
||||
}
|
||||
|
||||
Math_Vec3f_Copy(&this->unk2BC, &dTemp);
|
||||
Math_Vec3f_Copy(&this->unk2BC, &D_808934C4);
|
||||
|
||||
this->niwType = this->actor.params;
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
|
|
@ -138,9 +117,6 @@ void EnNiw_Init(Actor* thisx, PlayState* play) {
|
|||
Actor_SetScale(&this->actor, 0.01f);
|
||||
|
||||
if (this->niwType == NIW_TYPE_UNK1) {
|
||||
// @Bug this unused variant is broken and crashes on spawn (EnNiw_Update expects a parent, NULL)
|
||||
// if modified to change niwType to TYPE_REGULAR here, new size is smaller than normal
|
||||
// theory: was meant to be a small hand held cucco for grog to show the player
|
||||
Actor_SetScale(&this->actor, (BREG(86) / 10000.0f) + 0.004f);
|
||||
}
|
||||
|
||||
|
|
@ -450,7 +426,7 @@ void EnNiw_Idle(EnNiw* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnNiw_Held(EnNiw* this, PlayState* play) {
|
||||
Vec3f vec3fcopy = D_808934DC;
|
||||
Vec3f D_808934DC = { 90000.0f, 90000.0f, 90000.0f };
|
||||
s16 rotZ;
|
||||
|
||||
if (this->heldTimer == 0) {
|
||||
|
|
@ -483,7 +459,7 @@ void EnNiw_Held(EnNiw* this, PlayState* play) {
|
|||
this->actor.shape.rot.y = rotZ;
|
||||
this->actor.shape.rot.x = rotZ;
|
||||
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
Math_Vec3f_Copy(&this->unk2BC, &vec3fcopy);
|
||||
Math_Vec3f_Copy(&this->unk2BC, &D_808934DC);
|
||||
this->actor.flags |= ACTOR_FLAG_1; // targetable ON
|
||||
this->actionFunc = EnNiw_Thrown;
|
||||
}
|
||||
|
|
@ -666,7 +642,7 @@ void EnNiw_SetupRunAway(EnNiw* this) {
|
|||
|
||||
void EnNiw_RunAway(EnNiw* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3f tempVec3f = D_808934E8;
|
||||
Vec3f D_808934E8 = { 90000.0f, 90000.0f, 90000.0f };
|
||||
s16 temp298;
|
||||
f32 dX;
|
||||
f32 dZ;
|
||||
|
|
@ -682,7 +658,7 @@ void EnNiw_RunAway(EnNiw* this, PlayState* play) {
|
|||
this->targetLimbRots[6] = 0;
|
||||
this->targetLimbRots[5] = 0;
|
||||
this->targetLimbRots[7] = 0;
|
||||
Math_Vec3f_Copy(&this->unk2BC, &tempVec3f);
|
||||
Math_Vec3f_Copy(&this->unk2BC, &D_808934E8);
|
||||
|
||||
EnNiw_SetupIdle(this);
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ typedef struct EnNiw {
|
|||
/* 0x2E8 */ s16 yawTowardsPlayer;
|
||||
/* 0x2EA */ s16 headRotationToggle;
|
||||
/* 0x2EC */ s16 unk2EC;
|
||||
/* 0x2EE */ UNK_TYPE1 pad2EE[0x6];
|
||||
/* 0x2EE */ UNK_TYPE1 pad2EE[0x6];
|
||||
/* 0x2F4 */ f32 unusedFloat2F4; // set in EnNiw_Update if Cucco falls off map, never read
|
||||
/* 0x2F8 */ f32 unusedFloat2F8;
|
||||
/* 0x2FC */ f32 unusedFloat2FC;
|
||||
|
|
@ -91,12 +91,13 @@ typedef struct EnNiw {
|
|||
/* 0x35C */ EnNiwFeather feathers[NIW_FEATHER_COUNT];
|
||||
} EnNiw; // size = 0x7BC
|
||||
|
||||
// in init, any value below zero becomes zero
|
||||
// however, in vanilla, only 0xFFFF (-1) exists in scene spawns, actors can spawn 0x0
|
||||
#define NIW_TYPE_VANILLA 0xFFFF
|
||||
#define NIW_TYPE_REGULAR 0
|
||||
#define NIW_TYPE_UNK1 1
|
||||
#define NIW_TYPE_HELD 2 // spawns held by the bomber kid in east clock town during hide and seek
|
||||
typedef enum {
|
||||
/* -1 */ NIW_TYPE_VANILLA = -1, // Will be converted to 0, in vanilla exists only in scene spawns
|
||||
/* 0 */ NIW_TYPE_REGULAR,
|
||||
/* 1 */ NIW_TYPE_UNK1, // This unused variant must be spawned as a child, as it expects a NON-NULL parent.
|
||||
// Theory: This was meant to be a small hand held cucco for Grog to show the player
|
||||
/* 2 */ NIW_TYPE_HELD // spawns held by the bomber kid in east clock town during hide and seek
|
||||
} NiwType;
|
||||
// the attacking cuccos are not here, they are a different actor: [ ovl_En_Attack_Niw ]
|
||||
|
||||
typedef enum {
|
||||
|
|
|
|||
|
|
@ -265,8 +265,8 @@ void EnOssan_Init(Actor* thisx, PlayState* play) {
|
|||
EnOssan* this = THIS;
|
||||
s16 id;
|
||||
|
||||
//! @bug Condition is impossible, params cannot be both greater then 1 AND less then 0.
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ void EnPoFusen_Destroy(Actor* thisx, PlayState* play);
|
|||
void EnPoFusen_Update(Actor* thisx, PlayState* play);
|
||||
void EnPoFusen_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
u16 EnPoFusen_CheckParent(EnPoFusen* this, PlayState* play);
|
||||
s32 EnPoFusen_CheckParent(EnPoFusen* this, PlayState* play);
|
||||
void EnPoFusen_InitNoFuse(EnPoFusen* this);
|
||||
void EnPoFusen_InitFuse(EnPoFusen* this);
|
||||
void EnPoFusen_Pop(EnPoFusen* this, PlayState* play);
|
||||
|
|
@ -146,9 +146,9 @@ void EnPoFusen_Destroy(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Search for Romani's actor, beacuse it's PoFusen's job to update her actor on pop.
|
||||
* Search for Romani's actor, beacuse it's PoFusen's job to update her actor when the balloon is popped.
|
||||
*/
|
||||
u16 EnPoFusen_CheckParent(EnPoFusen* this, PlayState* play) {
|
||||
s32 EnPoFusen_CheckParent(EnPoFusen* this, PlayState* play) {
|
||||
Actor* actorIter = play->actorCtx.actorLists[ACTORCAT_NPC].first;
|
||||
|
||||
if (POE_BALLOON_IS_FUSE_TYPE(&this->actor)) {
|
||||
|
|
@ -166,7 +166,7 @@ u16 EnPoFusen_CheckParent(EnPoFusen* this, PlayState* play) {
|
|||
return false;
|
||||
}
|
||||
|
||||
u16 EnPoFusen_CheckCollision(EnPoFusen* this, PlayState* play) {
|
||||
s32 EnPoFusen_CheckCollision(EnPoFusen* this, PlayState* play) {
|
||||
if (this->actionFunc == EnPoFusen_IdleFuse) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -195,7 +195,6 @@ void EnPoFusen_Idle(EnPoFusen* this, PlayState* play) {
|
|||
f32 shadowScaleTmp;
|
||||
f32 shadowAlphaTmp;
|
||||
f32 heightOffset;
|
||||
f32 f255 = 255.0f;
|
||||
|
||||
this->actor.world.pos = this->actor.home.pos;
|
||||
this->randScaleChange += 0x190;
|
||||
|
|
@ -207,7 +206,7 @@ void EnPoFusen_Idle(EnPoFusen* this, PlayState* play) {
|
|||
this->actor.world.pos.y += heightOffset;
|
||||
this->actor.shape.rot.z = (Math_SinS(this->randBaseRotChange) * 910.0f);
|
||||
|
||||
if ((this->randScaleChange < 0x4000) && (this->randScaleChange >= -0x3FFF)) {
|
||||
if ((this->randScaleChange < 0x4000) && (this->randScaleChange > -0x4000)) {
|
||||
Math_SmoothStepToS(&this->limbRotChainAndLantern, 0x38E, 0x14, 0xBB8, 0x64);
|
||||
} else {
|
||||
Math_SmoothStepToS(&this->limbRotChainAndLantern, 0x71C, 0x8, 0xBB8, 0x64);
|
||||
|
|
@ -222,7 +221,7 @@ void EnPoFusen_Idle(EnPoFusen* this, PlayState* play) {
|
|||
shadowScaleTmp = ((1.0f - Math_SinS(this->randScaleChange)) * 10.0f) + 50.0f;
|
||||
shadowAlphaTmp = ((1.0f - Math_SinS(this->randScaleChange)) * 75.0f) + 100.0f;
|
||||
this->actor.shape.shadowScale = shadowScaleTmp;
|
||||
this->actor.shape.shadowAlpha = (shadowAlphaTmp > f255) ? (u8)f255 : (u8)shadowAlphaTmp;
|
||||
this->actor.shape.shadowAlpha = CLAMP_MAX(shadowAlphaTmp, 255.0f);
|
||||
}
|
||||
|
||||
void EnPoFusen_IncrementRomaniPop(EnPoFusen* this) {
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ void func_80BA39C8(EnToto* this, PlayState* play) {
|
|||
return;
|
||||
}
|
||||
|
||||
//! @TODO: 0xED02 nor 0xED01 match CLOCK_TIME macro
|
||||
//! TODO: Neither 0xED02 nor 0xED01 match CLOCK_TIME macro
|
||||
if (((play->sceneId == SCENE_MILK_BAR) &&
|
||||
!((gSaveContext.save.time >= CLOCK_TIME(6, 0)) && (gSaveContext.save.time < 0xED02))) ||
|
||||
((play->sceneId != SCENE_MILK_BAR) && func_80BA397C(this, 0x2000))) {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,9 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) {
|
|||
EnWeatherTag_SetupAction(this, func_80966E0C);
|
||||
break;
|
||||
case WEATHERTAG_TYPE_UNK3:
|
||||
if (0) {} // this can move to diff locations and still match
|
||||
//! FAKE: this can move to different locations and still match
|
||||
if (1) {}
|
||||
|
||||
EnWeatherTag_SetupAction(this, func_80966EF0);
|
||||
break;
|
||||
case WEATHERTAG_TYPE_UNK4:
|
||||
|
|
|
|||
|
|
@ -486,7 +486,9 @@ void func_80BBB8AC(EnZos* this, PlayState* play) {
|
|||
break;
|
||||
|
||||
default:
|
||||
if (0) {}
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
Message_CloseTextbox(play);
|
||||
this->actionFunc = func_80BBBDE0;
|
||||
this->unk_2B6 |= 1;
|
||||
|
|
|
|||
|
|
@ -151,7 +151,10 @@ void ObjAqua_Init(Actor* thisx, PlayState* play) {
|
|||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 60.0f);
|
||||
if (1) {};
|
||||
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
this->actor.shape.shadowAlpha = 140;
|
||||
this->alpha = 255;
|
||||
if (func_80ACBA60(this, play)) {
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ void ObjChan_CalculatePotPosition(Vec3f* childPosOut, Vec3s* childRotOut, Vec3f*
|
|||
childRotOut->y += childAngle;
|
||||
}
|
||||
|
||||
//! @TODO: Possibly takes actor and recasts
|
||||
//! TODO: Possibly takes actor and recasts
|
||||
void ObjChan_InitChandelier(ObjChan* this2, PlayState* play) {
|
||||
ObjChan* this = this2;
|
||||
s32 i;
|
||||
|
|
@ -210,7 +210,7 @@ void ObjChan_InitChandelier(ObjChan* this2, PlayState* play) {
|
|||
this->actionFunc = ObjChan_ChandelierAction;
|
||||
}
|
||||
|
||||
//! @TODO: More descriptive name than Action?
|
||||
//! TODO: More descriptive name than Action?
|
||||
void ObjChan_ChandelierAction(ObjChan* this2, PlayState* play) {
|
||||
ObjChan* this = this2;
|
||||
ObjChan* temp;
|
||||
|
|
|
|||
|
|
@ -1703,7 +1703,7 @@ void ObjUm_ChangeAnim(ObjUm* this, PlayState* play, ObjUmAnimation animIndex) {
|
|||
if (this->wheelRot / 0x199A != this->unk_420) {
|
||||
this->unk_420 = this->wheelRot / 0x199A;
|
||||
//! FAKE
|
||||
if (!&sUmAnims[0]) {}
|
||||
if (sUmAnims[0].doesMove) {}
|
||||
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CART_WHEEL);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue