mirror of
https://github.com/zeldaret/oot.git
synced 2024-12-27 07:07:09 +00:00
improve matching (#1543)
This commit is contained in:
parent
a8d670fe5c
commit
72334df180
6 changed files with 114 additions and 101 deletions
|
@ -1200,29 +1200,32 @@ void EnGo_DrawEffects(EnGo* this, PlayState* play) {
|
|||
OPEN_DISPS(play->state.gfxCtx, "../z_en_go.c", 2626);
|
||||
materialFlag = false;
|
||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||
if (1) {}
|
||||
|
||||
for (i = 0; i < EN_GO_EFFECT_COUNT; i++, dustEffect++) {
|
||||
if (dustEffect->type) {
|
||||
if (!materialFlag) {
|
||||
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD40);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 100, 60, 20, 0);
|
||||
materialFlag = true;
|
||||
}
|
||||
|
||||
alpha = dustEffect->timer * (255.0f / dustEffect->initialTimer);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 130, 90, alpha);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
Matrix_Translate(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
Matrix_Scale(dustEffect->scale, dustEffect->scale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_go.c", 2664),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
index = dustEffect->timer * (8.0f / dustEffect->initialTimer);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[index]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50);
|
||||
if (dustEffect->type == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!materialFlag) {
|
||||
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD40);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 100, 60, 20, 0);
|
||||
materialFlag = true;
|
||||
}
|
||||
|
||||
alpha = dustEffect->timer * (255.0f / dustEffect->initialTimer);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 130, 90, alpha);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
Matrix_Translate(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
Matrix_Scale(dustEffect->scale, dustEffect->scale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_go.c", 2664),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
index = dustEffect->timer * (8.0f / dustEffect->initialTimer);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[index]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_go.c", 2678);
|
||||
}
|
||||
|
|
|
@ -225,29 +225,30 @@ void EnGo2_DrawEffects(EnGo2* this, PlayState* play) {
|
|||
|
||||
materialFlag = false;
|
||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||
if (1) {}
|
||||
|
||||
for (i = 0; i < EN_GO2_EFFECT_COUNT; i++, dustEffect++) {
|
||||
if (dustEffect->type) {
|
||||
if (!materialFlag) {
|
||||
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD40);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 100, 60, 20, 0);
|
||||
materialFlag = true;
|
||||
}
|
||||
|
||||
alpha = dustEffect->timer * (255.0f / dustEffect->initialTimer);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 130, 90, alpha);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
Matrix_Translate(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
Matrix_Scale(dustEffect->scale, dustEffect->scale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_go2_eff.c", 137),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
index = dustEffect->timer * (8.0f / dustEffect->initialTimer);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sDustTex[index]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50);
|
||||
if (dustEffect->type == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!materialFlag) {
|
||||
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD40);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 100, 60, 20, 0);
|
||||
materialFlag = true;
|
||||
}
|
||||
|
||||
alpha = dustEffect->timer * (255.0f / dustEffect->initialTimer);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 170, 130, 90, alpha);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
Matrix_Translate(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
Matrix_Scale(dustEffect->scale, dustEffect->scale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_go2_eff.c", 137),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
index = dustEffect->timer * (8.0f / dustEffect->initialTimer);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sDustTex[index]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGoronDL_00FD50);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_go2_eff.c", 151);
|
||||
|
|
|
@ -686,19 +686,20 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
|
|||
spawnPos.z = sHorseSpawns[i].pos.z;
|
||||
dist = Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &spawnPos);
|
||||
|
||||
if (play->sceneId) {}
|
||||
if (!((minDist < dist) || func_80A5BBBC(play, this, &spawnPos))) {
|
||||
minDist = dist;
|
||||
this->actor.world.pos.x = sHorseSpawns[i].pos.x;
|
||||
this->actor.world.pos.y = sHorseSpawns[i].pos.y;
|
||||
this->actor.world.pos.z = sHorseSpawns[i].pos.z;
|
||||
this->actor.prevPos = this->actor.world.pos;
|
||||
this->actor.world.rot.y = sHorseSpawns[i].angle;
|
||||
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor);
|
||||
spawn = true;
|
||||
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos,
|
||||
&this->actor.projectedPos, &this->actor.projectedW);
|
||||
if ((minDist < dist) || func_80A5BBBC(play, this, &spawnPos)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
minDist = dist;
|
||||
this->actor.world.pos.x = sHorseSpawns[i].pos.x;
|
||||
this->actor.world.pos.y = sHorseSpawns[i].pos.y;
|
||||
this->actor.world.pos.z = sHorseSpawns[i].pos.z;
|
||||
this->actor.prevPos = this->actor.world.pos;
|
||||
this->actor.world.rot.y = sHorseSpawns[i].angle;
|
||||
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor);
|
||||
spawn = true;
|
||||
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos,
|
||||
&this->actor.projectedPos, &this->actor.projectedW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -894,19 +894,22 @@ void func_80A7B024(EnIn* this, PlayState* play) {
|
|||
player->rideActor->freezeTimer = 10;
|
||||
}
|
||||
player->actor.freezeTimer = 10;
|
||||
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
|
||||
if (1) {}
|
||||
if (!GET_EVENTCHKINF(EVENTCHKINF_1B) && GET_INFTABLE(INFTABLE_AB)) {
|
||||
SET_EVENTCHKINF(EVENTCHKINF_1B);
|
||||
SET_INFTABLE(INFTABLE_AB);
|
||||
}
|
||||
func_80A79BAC(this, play, 0, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST));
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_0);
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
play->msgCtx.stateTimer = 4;
|
||||
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
|
||||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
|
||||
if (this->interactInfo.talkState != NPC_TALK_STATE_ACTION) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GET_EVENTCHKINF(EVENTCHKINF_1B) && GET_INFTABLE(INFTABLE_AB)) {
|
||||
SET_EVENTCHKINF(EVENTCHKINF_1B);
|
||||
SET_INFTABLE(INFTABLE_AB);
|
||||
}
|
||||
|
||||
func_80A79BAC(this, play, 0, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST));
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_0);
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
play->msgCtx.stateTimer = 4;
|
||||
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
|
||||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
}
|
||||
|
||||
void EnIn_Update(Actor* thisx, PlayState* play) {
|
||||
|
|
|
@ -215,14 +215,15 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
|
|||
Message_ContinueTextbox(play, 0x6080);
|
||||
this->actor.textId = 0x6080;
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
if (this->unk_1F4 & 4) {
|
||||
if (1) {}
|
||||
this->unk_1F4 &= ~4;
|
||||
HIGH_SCORE(HS_MARATHON)++;
|
||||
}
|
||||
}
|
||||
return;
|
||||
break;
|
||||
|
||||
case 0x6081:
|
||||
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
|
||||
this->unk_1F4 |= 4;
|
||||
|
@ -230,18 +231,20 @@ void func_80AAF3C0(EnMm2* this, PlayState* play) {
|
|||
Message_ContinueTextbox(play, 0x607E);
|
||||
this->actor.textId = 0x607E;
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
if (Actor_TextboxIsClosing(&this->actor, play)) {
|
||||
if (this->actor.textId == 0x607F) {
|
||||
Interface_SetSubTimer(0);
|
||||
this->actionFunc = func_80AAF57C;
|
||||
} else {
|
||||
this->actionFunc = func_80AAF57C;
|
||||
}
|
||||
this->actionFunc = func_80AAF57C;
|
||||
func_80AAEF70(this, play);
|
||||
default:
|
||||
if (Actor_TextboxIsClosing(&this->actor, play)) {
|
||||
if (this->actor.textId == 0x607F) {
|
||||
Interface_SetSubTimer(0);
|
||||
this->actionFunc = func_80AAF57C;
|
||||
} else {
|
||||
this->actionFunc = func_80AAF57C;
|
||||
}
|
||||
this->actionFunc = func_80AAF57C;
|
||||
func_80AAEF70(this, play);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -518,29 +518,31 @@ void EnNiwLady_Update(Actor* thisx, PlayState* play) {
|
|||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
this->aneObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_ANE);
|
||||
if (this->aneObjectSlot >= 0) {
|
||||
this->actionFunc(this, play);
|
||||
if (this->unusedTimer2 != 0) {
|
||||
this->unusedTimer2--;
|
||||
}
|
||||
if (this->unusedRandomTimer != 0) {
|
||||
this->unusedRandomTimer--;
|
||||
}
|
||||
this->unusedTimer++;
|
||||
if (this->unusedRandomTimer == 0) {
|
||||
this->faceState++;
|
||||
if (this->faceState >= 3) {
|
||||
this->faceState = 0;
|
||||
this->unusedRandomTimer = ((s16)Rand_ZeroFloat(60.0f) + 0x14);
|
||||
}
|
||||
}
|
||||
Actor_UpdateBgCheckInfo(play, thisx, 20.0f, 20.0f, 60.0f,
|
||||
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
|
||||
UPDBGCHECKINFO_FLAG_4);
|
||||
Collider_UpdateCylinder(thisx, &this->collider);
|
||||
if (1) {}
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
if (this->aneObjectSlot < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->actionFunc(this, play);
|
||||
|
||||
if (this->unusedTimer2 != 0) {
|
||||
this->unusedTimer2--;
|
||||
}
|
||||
if (this->unusedRandomTimer != 0) {
|
||||
this->unusedRandomTimer--;
|
||||
}
|
||||
this->unusedTimer++;
|
||||
if (this->unusedRandomTimer == 0) {
|
||||
this->faceState++;
|
||||
if (this->faceState >= 3) {
|
||||
this->faceState = 0;
|
||||
this->unusedRandomTimer = ((s16)Rand_ZeroFloat(60.0f) + 0x14);
|
||||
}
|
||||
}
|
||||
Actor_UpdateBgCheckInfo(play, thisx, 20.0f, 20.0f, 60.0f,
|
||||
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 |
|
||||
UPDBGCHECKINFO_FLAG_4);
|
||||
Collider_UpdateCylinder(thisx, &this->collider);
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue