1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-11 03:39:59 +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 146 additions and 140 deletions

View file

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

View file

@ -281,9 +281,12 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, PlayState* play2) {
gSPSegment(POLY_XLU_DISP++, 0x08, sEmptyDL);
for (i = 0; i < 64; i++) {
if (*distanceTraveled < 1.0f) {
aux = 1.0f - (*distanceTraveled * *distanceTraveled);
for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) {
if (!(*distanceTraveled < 1.0f)) {
continue;
}
aux = 1.0f - SQ(*distanceTraveled);
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.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));
}
initialPositions++;
distanceTraveled++;
// Needed for matching.
if (0) {}
}
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);
for (i = 0; i < 64; i++) {
if (*distanceTraveled < 1.0f) {
for (i = 0; i < 64; i++, initialPositions++, distanceTraveled++) {
if (!(*distanceTraveled < 1.0f)) {
continue;
}
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255);
// Needed to match.
if (!this) {}
aux = 1.0f - (*distanceTraveled * *distanceTraveled);
aux = 1.0f - SQ(*distanceTraveled);
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));
}
initialPositions++;
distanceTraveled++;
}
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;
OPEN_DISPS(play->state.gfxCtx, "../z_en_fd.c", 1969);
materialFlag = false;
if (1) {}
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
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) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerDL_7928);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 10, 0, (u8)((this->fadeAlpha / 255.0f) * 255));
materialFlag = true;
}
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 0, (u8)((this->fadeAlpha / 255.0f) * 255));
gDPPipeSync(POLY_XLU_DISP++);
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]));
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerSquareParticleDL);
}
}
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);
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) {
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerDL_79F8);
materialFlag = true;
}
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, eff->color.r, eff->color.g, eff->color.b,
(u8)(eff->color.a * (this->fadeAlpha / 255.0f)));
gDPPipeSync(POLY_XLU_DISP++);
if (1) {}
Matrix_Translate(eff->pos.x, eff->pos.y, eff->pos.z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
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);
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerTriangleParticleDL);
}
}
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;
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
if (1) {}
for (i = 0; i < EN_FW_EFFECT_COUNT; i++, eff++) {
if (eff->type != 0) {
if (eff->type == 0) {
continue;
}
if (!materialFlag) {
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
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]));
gSPDisplayList(POLY_XLU_DISP++, gFlareDancerSquareParticleDL);
}
}
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++) {
if ((0 <= tx && tx < MANT_TEX_WIDTH) && (0 <= ty && ty < MANT_TEX_HEIGHT)) {
for (areaX = 0; areaX <= tearAreaSizes[i]; areaX++) {
if (1) {}
for (areaY = 0; areaY <= tearAreaSizes[i]; areaY++) {
texIdx = (s16)((s16)tx + ((s16)ty * MANT_TEX_WIDTH)) + ((s16)areaX + ((s16)areaY * MANT_TEX_WIDTH));
if (texIdx < MANT_TEX_WIDTH * MANT_TEX_HEIGHT) {
((u16*)gMantTex)[texIdx] = 0;
if (texIdx >= MANT_TEX_WIDTH * MANT_TEX_HEIGHT) {
continue;
}
((u16*)gMantTex)[texIdx] = 0;
}
}
}