1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-27 23:36:22 +00:00

Improve Matches: Part 3 (#1544)

* improve matchings

* spacing
This commit is contained in:
engineer124 2023-09-21 02:41:47 +10:00 committed by GitHub
parent 72334df180
commit d7f6961918
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 234 additions and 221 deletions

View file

@ -852,7 +852,7 @@ void EnRr_Draw(Actor* thisx, PlayState* play) {
Mtx* segMtx = Graph_Alloc(play->state.gfxCtx, 4 * sizeof(Mtx));
OPEN_DISPS(play->state.gfxCtx, "../z_en_rr.c", 1478);
if (1) {}
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPSegment(POLY_XLU_DISP++, 0x0C, segMtx);
gSPSegment(POLY_XLU_DISP++, 0x08,
@ -867,9 +867,11 @@ void EnRr_Draw(Actor* thisx, PlayState* play) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_rr.c", 1501),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Matrix_Pop();
zeroVec.x = 0.0f;
zeroVec.y = 0.0f;
zeroVec.z = 0.0f;
for (i = 1; i < 5; i++) {
Matrix_Translate(0.0f, this->bodySegs[i].height + 1000.0f, 0.0f, MTXMODE_APPLY);
@ -883,19 +885,26 @@ void EnRr_Draw(Actor* thisx, PlayState* play) {
segMtx++;
Matrix_MultVec3f(&zeroVec, &this->effectPos[i]);
}
this->effectPos[0] = this->actor.world.pos;
Matrix_MultVec3f(&zeroVec, &this->mouthPos);
gSPDisplayList(POLY_XLU_DISP++, gLikeLikeDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_en_rr.c", 1551);
if (this->effectTimer != 0) {
Vec3f effectPos;
s16 effectTimer = this->effectTimer - 1;
s32 segIndex;
s32 offIndex;
this->actor.colorFilterTimer++;
if ((effectTimer & 1) == 0) {
s32 segIndex = 4 - (effectTimer >> 2);
s32 offIndex = (effectTimer >> 1) & 3;
if ((effectTimer & 1) != 0) {
return;
}
segIndex = 4 - (effectTimer >> 2);
offIndex = (effectTimer >> 1) & 3;
effectPos.x = this->effectPos[segIndex].x + sEffectOffsets[offIndex].x + Rand_CenteredFloat(10.0f);
effectPos.y = this->effectPos[segIndex].y + sEffectOffsets[offIndex].y + Rand_CenteredFloat(10.0f);
@ -907,4 +916,3 @@ void EnRr_Draw(Actor* thisx, PlayState* play) {
}
}
}
}

View file

@ -290,7 +290,6 @@ void func_80AF95C4(EnSda* this, u8* shadowTexture, Player* player, PlayState* pl
Matrix_RotateX(BINANG_TO_RAD_ALT(sp178.x), MTXMODE_APPLY);
for (i = 0; i < 22; i++) {
Matrix_MultVec3f(&D_80AFA180[i], &sp188);
if (1) {}
sp64[i].x = (((KREG(82) / 100.0f) + 4.0f) * sp188.x) + sp16C.x;
sp64[i].y = (((KREG(82) / 100.0f) + 4.0f) * sp188.y) + sp16C.y;
sp64[i].z = (((KREG(82) / 100.0f) + 4.0f) * sp188.z) + sp16C.z;
@ -306,7 +305,7 @@ void func_80AF95C4(EnSda* this, u8* shadowTexture, Player* player, PlayState* pl
temp_t0 = sp188.x + 32.0f;
temp_t1 = (s16)sp188.y << 6;
do {
for (j = 0; j < 6; j++) {
for (j = 0, phi_a3 = -0xC0; j < 7; j++, phi_a3 += 0x40) {
for (phi_a0 = -D_80AFA0E8[j]; phi_a0 < D_80AFA0E8[j] - 1; phi_a0++) {
temp_v0 = temp_t0 + phi_a0;
@ -318,8 +317,7 @@ void func_80AF95C4(EnSda* this, u8* shadowTexture, Player* player, PlayState* pl
}
}
}
j++;
} while (j < 6);
}
}
}
if (BREG(61) == 1) {

View file

@ -300,8 +300,12 @@ void EnShopnuts_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
f32 y;
f32 z;
if ((limbIndex == BUSINESS_SCRUB_LIMB_NOSE) && (this->actionFunc == EnShopnuts_ThrowNut)) {
if ((limbIndex != BUSINESS_SCRUB_LIMB_NOSE) || (this->actionFunc != EnShopnuts_ThrowNut)) {
return;
}
OPEN_DISPS(play->state.gfxCtx, "../z_en_shopnuts.c", 682);
curFrame = this->skelAnime.curFrame;
if (curFrame <= 6.0f) {
y = 1.0f - (curFrame * 0.0833f);
@ -318,13 +322,12 @@ void EnShopnuts_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
}
Matrix_Scale(x, y, z, MTXMODE_APPLY);
if (1) {}
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_shopnuts.c", 714),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gBusinessScrubNoseDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_en_shopnuts.c", 717);
}
}
void EnShopnuts_Draw(Actor* thisx, PlayState* play) {
EnShopnuts* this = (EnShopnuts*)thisx;

View file

@ -182,7 +182,6 @@ s32 func_80B0C0CC(EnSw* this, PlayState* play, s32 arg2) {
if (phi_s1 == 0) {
sp78.x = sp84.x - (this->unk_37C.x * 24.0f);
sp78.y = sp84.y - (this->unk_37C.y * 24.0f);
if (0) {}
sp78.z = sp84.z - (this->unk_37C.z * 24.0f);
} else if (phi_s1 == 1) {
sp78.x = sp84.x + (this->unk_370.x * 24.0f);
@ -194,7 +193,10 @@ s32 func_80B0C0CC(EnSw* this, PlayState* play, s32 arg2) {
sp78.z = sp84.z - (this->unk_370.z * 24.0f);
}
temp_v0_2 = func_80B0C020(play, &sp84, &sp78, &sp9C, &sp6C);
if (temp_v0_2 != NULL) {
if (temp_v0_2 == NULL) {
continue;
}
if (arg2 == 1) {
func_80B0BE20(this, temp_v0_2);
this->actor.world.pos = sp9C;
@ -204,7 +206,6 @@ s32 func_80B0C0CC(EnSw* this, PlayState* play, s32 arg2) {
break;
}
}
}
Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 8, 0xFA0, 1);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 8, 0xFA0, 1);

View file

@ -287,9 +287,12 @@ void EnSyatekiMan_WaitForGame(EnSyatekiMan* this, PlayState* play) {
EnSyatekiItm* gallery;
SkelAnime_Update(&this->skelAnime);
if (1) {}
gallery = ((EnSyatekiItm*)this->actor.parent);
if ((gallery->actor.update != NULL) && (gallery->signal == ENSYATEKI_END)) {
if ((gallery->actor.update == NULL) || (gallery->signal != ENSYATEKI_END)) {
return;
}
this->subCamId = OnePointCutscene_Init(play, 8002, -99, &this->actor, CAM_ID_MAIN);
switch (gallery->hitCount) {
case 10:
@ -314,7 +317,6 @@ void EnSyatekiMan_WaitForGame(EnSyatekiMan* this, PlayState* play) {
Message_StartTextbox(play, this->actor.textId, NULL);
this->actionFunc = EnSyatekiMan_EndGame;
}
}
void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) {
EnSyatekiItm* gallery;

View file

@ -93,10 +93,11 @@ void EnTkEff_Draw(EnTk* this, PlayState* play) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
if (1) {}
for (i = 0; i < ARRAY_COUNT(this->eff); i++, eff++) {
if (eff->active == 0) {
continue;
}
for (i = 0; i < ARRAY_COUNT(this->eff); i++) {
if (eff->active != 0) {
if (gfxSetup == 0) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, gDampeEff1DL);
@ -119,8 +120,6 @@ void EnTkEff_Draw(EnTk* this, PlayState* play) {
gSPDisplayList(POLY_XLU_DISP++, gDampeEff2DL);
}
eff++;
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_tk_eff.c", 154);
}

View file

@ -872,8 +872,10 @@ void EnViewer_UpdateGanondorfCape(PlayState* play, EnViewer* this) {
Vec3f forearmModelOffset;
Vec3f forearmWorldOffset;
if ((this->actor.params >> 8) == ENVIEWER_TYPE_5_GANONDORF) {
if (1) {}
if ((this->actor.params >> 8) != ENVIEWER_TYPE_5_GANONDORF) {
return;
}
sGanondorfCape->backPush = BREG(54) / 10.0f;
sGanondorfCape->backSwayMagnitude = (BREG(60) + 25) / 100.0f;
sGanondorfCape->sideSwayMagnitude = (BREG(55) - 45) / 10.0f;
@ -896,4 +898,3 @@ void EnViewer_UpdateGanondorfCape(PlayState* play, EnViewer* this) {
sGanondorfCape->leftForearmPos.y = sGanondorfNeckWorldPos.y + forearmWorldOffset.y;
sGanondorfCape->leftForearmPos.z = sGanondorfNeckWorldPos.z + forearmWorldOffset.z;
}
}

View file

@ -55,10 +55,13 @@ void EnZo_SpawnBubble(EnZo* this, Vec3f* pos) {
f32 waterSurface;
effect = this->effects;
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++) {
if (1) {}
if (effect->type == ENZO_EFFECT_NONE) {
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++, effect++) {
if (effect->type != ENZO_EFFECT_NONE) {
continue;
}
waterSurface = this->actor.world.pos.y + this->actor.yDistToWater;
if (!(waterSurface <= pos->y)) {
effect->type = ENZO_EFFECT_BUBBLE;
effect->pos = *pos;
@ -68,8 +71,6 @@ void EnZo_SpawnBubble(EnZo* this, Vec3f* pos) {
break;
}
}
effect++;
}
}
void EnZo_SpawnSplash(EnZo* this, Vec3f* pos, Vec3f* vel, f32 scale) {
@ -78,9 +79,10 @@ void EnZo_SpawnSplash(EnZo* this, Vec3f* pos, Vec3f* vel, f32 scale) {
s16 i;
effect = this->effects;
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++) {
if (1) {}
if (effect->type != ENZO_EFFECT_SPLASH) {
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++, effect++) {
if (effect->type == ENZO_EFFECT_SPLASH) {
continue;
}
effect->type = ENZO_EFFECT_SPLASH;
effect->pos = *pos;
effect->vec = accel;
@ -89,8 +91,6 @@ void EnZo_SpawnSplash(EnZo* this, Vec3f* pos, Vec3f* vel, f32 scale) {
effect->scale = scale;
break;
}
effect++;
}
}
void EnZo_UpdateEffectsRipples(EnZo* this) {
@ -178,10 +178,13 @@ void EnZo_DrawEffectsRipples(EnZo* this, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_en_zo_eff.c", 217);
materialFlag = false;
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++) {
if (effect->type == ENZO_EFFECT_RIPPLE) {
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++, effect++) {
if (effect->type != ENZO_EFFECT_RIPPLE) {
continue;
}
if (!materialFlag) {
if (1) {}
gDPPipeSync(POLY_XLU_DISP++);
gSPDisplayList(POLY_XLU_DISP++, gZoraRipplesMaterialDL);
gDPSetEnvColor(POLY_XLU_DISP++, 155, 155, 155, 0);
@ -195,8 +198,7 @@ void EnZo_DrawEffectsRipples(EnZo* this, PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gZoraRipplesModelDL);
}
effect++;
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_zo_eff.c", 248);
}
@ -208,10 +210,13 @@ void EnZo_DrawEffectsBubbles(EnZo* this, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_en_zo_eff.c", 260);
materialFlag = false;
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++) {
if (effect->type == ENZO_EFFECT_BUBBLE) {
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++, effect++) {
if (effect->type != ENZO_EFFECT_BUBBLE) {
continue;
}
if (!materialFlag) {
if (1) {}
gSPDisplayList(POLY_XLU_DISP++, gZoraBubblesMaterialDL);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 150, 150, 150, 0);
@ -228,8 +233,6 @@ void EnZo_DrawEffectsBubbles(EnZo* this, PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gZoraBubblesModelDL);
}
effect++;
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_zo_eff.c", 286);
}
@ -242,10 +245,11 @@ void EnZo_DrawEffectsSplashes(EnZo* this, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_en_zo_eff.c", 298);
materialFlag = false;
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++) {
if (effect->type == ENZO_EFFECT_SPLASH) {
for (i = 0; i < EN_ZO_EFFECT_COUNT; i++, effect++) {
if (effect->type != ENZO_EFFECT_SPLASH) {
continue;
}
if (!materialFlag) {
if (1) {}
gSPDisplayList(POLY_XLU_DISP++, gZoraSplashesMaterialDL);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetEnvColor(POLY_XLU_DISP++, 200, 200, 200, 0);
@ -261,8 +265,6 @@ void EnZo_DrawEffectsSplashes(EnZo* this, PlayState* play) {
gSPDisplayList(POLY_XLU_DISP++, gZoraSplashesModelDL);
}
effect++;
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_zo_eff.c", 331);
}

View file

@ -4709,13 +4709,14 @@ void Fishing_DrawGroupFishes(PlayState* play) {
scale = 0.00475f;
}
if (1) {}
OPEN_DISPS(play->state.gfxCtx, "../z_fishing.c", 8048);
for (i = 0; i < GROUP_FISH_COUNT; i++) {
if (fish->type != FS_GROUP_FISH_NONE) {
if (materialFlag == 0) {
for (i = 0; i < GROUP_FISH_COUNT; i++, fish++) {
if (fish->type == FS_GROUP_FISH_NONE) {
continue;
}
if (!materialFlag) {
gSPDisplayList(POLY_OPA_DISP++, gFishingGroupFishMaterialDL);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 155, 155, 155, 255);
materialFlag++;
@ -4732,8 +4733,6 @@ void Fishing_DrawGroupFishes(PlayState* play) {
gSPDisplayList(POLY_OPA_DISP++, gFishingGroupFishModelDL);
}
}
fish++;
}
CLOSE_DISPS(play->state.gfxCtx, "../z_fishing.c", 8099);
}