1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-28 15:56:51 +00:00

improve matches (#1542)

This commit is contained in:
engineer124 2023-09-21 00:41:03 +10:00 committed by GitHub
parent 107c0288cc
commit a8d670fe5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 140 additions and 134 deletions

View file

@ -277,16 +277,22 @@ void DemoKekkai_DrawTrialBarrier(Actor* thisx, PlayState* play2) {
Vtx* energyVtx = SEGMENTED_TO_VIRTUAL(gTrialBarrierEnergyVtx); Vtx* energyVtx = SEGMENTED_TO_VIRTUAL(gTrialBarrierEnergyVtx);
s32 i; s32 i;
if (this->orbScale != 0.0f) { if (this->orbScale == 0.0f) {
if (1) {} return;
}
alphas[2] = (s32)(this->energyAlpha * 202.0f); alphas[2] = (s32)(this->energyAlpha * 202.0f);
alphas[1] = (s32)(this->energyAlpha * 126.0f); alphas[1] = (s32)(this->energyAlpha * 126.0f);
alphas[0] = 0; alphas[0] = 0;
for (i = 0; i < 102; i++) { for (i = 0; i < 102; i++) {
energyVtx[i].v.cn[3] = alphas[alphaIndex[i]]; energyVtx[i].v.cn[3] = alphas[alphaIndex[i]];
} }
colorIndex = (this->actor.params - 1) * 6; colorIndex = (this->actor.params - 1) * 6;
OPEN_DISPS(play->state.gfxCtx, "../z_demo_kekkai.c", 632); OPEN_DISPS(play->state.gfxCtx, "../z_demo_kekkai.c", 632);
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
Matrix_Push(); Matrix_Push();
Matrix_Translate(0.0f, 1200.0f, 0.0f, MTXMODE_APPLY); Matrix_Translate(0.0f, 1200.0f, 0.0f, MTXMODE_APPLY);
@ -303,8 +309,7 @@ void DemoKekkai_DrawTrialBarrier(Actor* thisx, PlayState* play2) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x80, 50, 0, 100, 255); gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x80, 50, 0, 100, 255);
gSPSegment( gSPSegment(POLY_XLU_DISP++, 0x0A,
POLY_XLU_DISP++, 0x0A,
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1, frames, frames, 0x20, 0x20)); Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x20, 1, frames, frames, 0x20, 0x20));
gSPDisplayList(POLY_XLU_DISP++, gTrialBarrierFloorDL); gSPDisplayList(POLY_XLU_DISP++, gTrialBarrierFloorDL);
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
@ -316,9 +321,9 @@ void DemoKekkai_DrawTrialBarrier(Actor* thisx, PlayState* play2) {
Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, frames * 5, frames * -10, 0x20, 0x20, 1, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, frames * 5, frames * -10, 0x20, 0x20, 1,
frames * 5, frames * -10, 0x20, 0x40)); frames * 5, frames * -10, 0x20, 0x40));
gSPDisplayList(POLY_XLU_DISP++, gTrialBarrierEnergyDL); gSPDisplayList(POLY_XLU_DISP++, gTrialBarrierEnergyDL);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_kekkai.c", 696); CLOSE_DISPS(play->state.gfxCtx, "../z_demo_kekkai.c", 696);
} }
}
void DemoKekkai_DrawTowerBarrier(Actor* thisx, PlayState* play) { void DemoKekkai_DrawTowerBarrier(Actor* thisx, PlayState* play) {
s32 pad; s32 pad;

View file

@ -281,9 +281,12 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) {
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL); gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) {
if (*distanceTraveled < 1.0f) { if (!(*distanceTraveled < 1.0f)) {
aux = 1.0f - (*distanceTraveled * *distanceTraveled); continue;
}
aux = 1.0f - SQ(*distanceTraveled);
Matrix_Translate(this->actor.world.pos.x + (initialPositions->x * ((this->dx * aux) + (1.0f - this->dx))), Matrix_Translate(this->actor.world.pos.x + (initialPositions->x * ((this->dx * aux) + (1.0f - this->dx))),
this->actor.world.pos.y + (initialPositions->y * ((this->dy * aux) + (1.0f - this->dy))), this->actor.world.pos.y + (initialPositions->y * ((this->dy * aux) + (1.0f - this->dy))),
this->actor.world.pos.z + (initialPositions->z * ((this->dz * aux) + (1.0f - this->dz))), this->actor.world.pos.z + (initialPositions->z * ((this->dz * aux) + (1.0f - this->dz))),
@ -297,12 +300,6 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
} }
initialPositions++;
distanceTraveled++;
// Needed for matching.
if (0) {}
}
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 458); CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 458);
} }
@ -333,14 +330,14 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) {
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL); gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) {
if (*distanceTraveled < 1.0f) { if (!(*distanceTraveled < 1.0f)) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255); continue;
}
// Needed to match. gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255);
if (!this) {}
aux = 1.0f - (*distanceTraveled * *distanceTraveled); aux = 1.0f - SQ(*distanceTraveled);
Matrix_Mult(&player->mf_9E0, MTXMODE_NEW); Matrix_Mult(&player->mf_9E0, MTXMODE_NEW);
@ -358,10 +355,6 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, PlayState* play2) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL)); gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
} }
initialPositions++;
distanceTraveled++;
}
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 515); CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 515);
} }

View file

@ -881,17 +881,22 @@ void EnFd_DrawEffectsFlames(EnFd* this, PlayState* play) {
EnFdEffect* eff = this->effects; EnFdEffect* eff = this->effects;
OPEN_DISPS(play->state.gfxCtx, "../z_en_fd.c", 1969); OPEN_DISPS(play->state.gfxCtx, "../z_en_fd.c", 1969);
materialFlag = false; materialFlag = false;
if (1) {}
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
for (i = 0; i < EN_FD_EFFECT_COUNT; i++, eff++) { for (i = 0; i < EN_FD_EFFECT_COUNT; i++, eff++) {
if (eff->type == FD_EFFECT_FLAME) { if (eff->type != FD_EFFECT_FLAME) {
continue;
}
if (!materialFlag) { if (!materialFlag) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerDL_7928); gSPDisplayList(POLY_XLU_DISP++, gFlareDancerDL_7928);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 10, 0, (u8)((this->fadeAlpha / 255.0f) * 255)); gDPSetEnvColor(POLY_XLU_DISP++, 255, 10, 0, (u8)((this->fadeAlpha / 255.0f) * 255));
materialFlag = true; materialFlag = true;
} }
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 0, (u8)((this->fadeAlpha / 255.0f) * 255)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 0, (u8)((this->fadeAlpha / 255.0f) * 255));
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
@ -903,7 +908,7 @@ void EnFd_DrawEffectsFlames(EnFd* this, PlayState* play) {
gSPSegment(POLY_XLU_DISP++, 0x8, SEGMENTED_TO_VIRTUAL(dustTextures[idx])); gSPSegment(POLY_XLU_DISP++, 0x8, SEGMENTED_TO_VIRTUAL(dustTextures[idx]));
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerSquareParticleDL); gSPDisplayList(POLY_XLU_DISP++, gFlareDancerSquareParticleDL);
} }
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_fd.c", 2020); CLOSE_DISPS(play->state.gfxCtx, "../z_en_fd.c", 2020);
} }
@ -918,16 +923,19 @@ void EnFd_DrawEffectsDots(EnFd* this, PlayState* play) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
for (i = 0; i < EN_FD_EFFECT_COUNT; i++, eff++) { for (i = 0; i < EN_FD_EFFECT_COUNT; i++, eff++) {
if (eff->type == FD_EFFECT_DOT) { if (eff->type != FD_EFFECT_DOT) {
continue;
}
if (!materialFlag) { if (!materialFlag) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerDL_79F8); gSPDisplayList(POLY_XLU_DISP++, gFlareDancerDL_79F8);
materialFlag = true; materialFlag = true;
} }
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, eff->color.r, eff->color.g, eff->color.b, gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, eff->color.r, eff->color.g, eff->color.b,
(u8)(eff->color.a * (this->fadeAlpha / 255.0f))); (u8)(eff->color.a * (this->fadeAlpha / 255.0f)));
gDPPipeSync(POLY_XLU_DISP++); gDPPipeSync(POLY_XLU_DISP++);
if (1) {}
Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW); Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF); Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Scale(eff->scale, eff->scale, 1.0f, MTXMODE_APPLY); Matrix_Scale(eff->scale, eff->scale, 1.0f, MTXMODE_APPLY);
@ -935,7 +943,6 @@ void EnFd_DrawEffectsDots(EnFd* this, PlayState* play) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerTriangleParticleDL); gSPDisplayList(POLY_XLU_DISP++, gFlareDancerTriangleParticleDL);
} }
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_fd.c", 2071); CLOSE_DISPS(play->state.gfxCtx, "../z_en_fd.c", 2071);
} }

View file

@ -461,10 +461,12 @@ void EnFw_DrawEffects(EnFw* this, PlayState* play) {
materialFlag = false; materialFlag = false;
Gfx_SetupDL_25Xlu(play->state.gfxCtx); Gfx_SetupDL_25Xlu(play->state.gfxCtx);
if (1) {}
for (i = 0; i < EN_FW_EFFECT_COUNT; i++, eff++) { for (i = 0; i < EN_FW_EFFECT_COUNT; i++, eff++) {
if (eff->type != 0) { if (eff->type == 0) {
continue;
}
if (!materialFlag) { if (!materialFlag) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0); POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerDL_7928); gSPDisplayList(POLY_XLU_DISP++, gFlareDancerDL_7928);
@ -484,7 +486,6 @@ void EnFw_DrawEffects(EnFw* this, PlayState* play) {
gSPSegment(POLY_XLU_DISP++, 0x8, SEGMENTED_TO_VIRTUAL(dustTextures[idx])); gSPSegment(POLY_XLU_DISP++, 0x8, SEGMENTED_TO_VIRTUAL(dustTextures[idx]));
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerSquareParticleDL); gSPDisplayList(POLY_XLU_DISP++, gFlareDancerSquareParticleDL);
} }
}
CLOSE_DISPS(play->state.gfxCtx, "../z_en_fw.c", 1243); CLOSE_DISPS(play->state.gfxCtx, "../z_en_fw.c", 1243);
} }

View file

@ -129,12 +129,12 @@ void EnGanonMant_Tear(EnGanonMant* this) {
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if ((0 <= tx && tx < MANT_TEX_WIDTH) && (0 <= ty && ty < MANT_TEX_HEIGHT)) { if ((0 <= tx && tx < MANT_TEX_WIDTH) && (0 <= ty && ty < MANT_TEX_HEIGHT)) {
for (areaX = 0; areaX <= tearAreaSizes[i]; areaX++) { for (areaX = 0; areaX <= tearAreaSizes[i]; areaX++) {
if (1) {}
for (areaY = 0; areaY <= tearAreaSizes[i]; areaY++) { for (areaY = 0; areaY <= tearAreaSizes[i]; areaY++) {
texIdx = (s16)((s16)tx + ((s16)ty * MANT_TEX_WIDTH)) + ((s16)areaX + ((s16)areaY * MANT_TEX_WIDTH)); texIdx = (s16)((s16)tx + ((s16)ty * MANT_TEX_WIDTH)) + ((s16)areaX + ((s16)areaY * MANT_TEX_WIDTH));
if (texIdx < MANT_TEX_WIDTH * MANT_TEX_HEIGHT) { if (texIdx >= MANT_TEX_WIDTH * MANT_TEX_HEIGHT) {
((u16*)gMantTex)[texIdx] = 0; continue;
} }
((u16*)gMantTex)[texIdx] = 0;
} }
} }
} }