Zones: Fix water shadows

This commit is contained in:
Sonic Dreamcaster 2025-01-07 20:44:44 -03:00
parent 194700ecb0
commit e12d1f926e
3 changed files with 2073 additions and 26 deletions

View File

@ -1828,6 +1828,7 @@ void Background_DrawGround(void) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -3000.0f, MTXF_APPLY); // Center Further
Matrix_Scale(gGfxMatrix, 3.0f, 2.0f, 3.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
} else {
@ -1844,10 +1845,11 @@ void Background_DrawGround(void) {
gSPTexture(gMasterDisp++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);
@ -1862,9 +1864,9 @@ void Background_DrawGround(void) {
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);
@ -1891,9 +1893,9 @@ void Background_DrawGround(void) {
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);
@ -1907,10 +1909,11 @@ void Background_DrawGround(void) {
gSPTexture(gMasterDisp++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);
@ -1936,10 +1939,11 @@ void Background_DrawGround(void) {
gSPTexture(gMasterDisp++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);
@ -1953,10 +1957,11 @@ void Background_DrawGround(void) {
gSPTexture(gMasterDisp++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);
@ -1966,6 +1971,7 @@ void Background_DrawGround(void) {
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, 0.0f, MTXF_APPLY); // Center
Matrix_Scale(gGfxMatrix, 3.0f, 2.0f, 3.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
} else {
@ -1982,10 +1988,11 @@ void Background_DrawGround(void) {
gSPTexture(gMasterDisp++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);
@ -1999,10 +2006,11 @@ void Background_DrawGround(void) {
gSPTexture(gMasterDisp++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);
@ -2028,10 +2036,11 @@ void Background_DrawGround(void) {
gSPTexture(gMasterDisp++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);
@ -2045,10 +2054,11 @@ void Background_DrawGround(void) {
gSPTexture(gMasterDisp++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
gDPSetTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_RENDERTILE, 0, G_TX_WRAP, 5, G_TX_NOLOD,
G_TX_WRAP, 5, G_TX_NOLOD);
if ((gGameFrameCount % 2) != 0) {
gSPDisplayList(gMasterDisp++, D_ZO_6008830);
gSPDisplayList(gMasterDisp++, D_ZO_6008830_copy);
} else {
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0);
gSPDisplayList(gMasterDisp++, D_ZO_600B0E0_copy);
}
gSPSetGeometryMode(gMasterDisp++, G_CULL_BACK); // Re-enable backface culling
Matrix_Pop(&gGfxMatrix);

View File

@ -27,6 +27,8 @@ extern float gCurrentScreenWidth;
extern float gCurrentScreenHeight;
extern Vtx D_SO_6001C50_copy[];
extern Vtx D_SO_6004500_copy[];
extern Vtx D_ZO_6009ED0_copy[];
extern Vtx D_ZO_600C780_copy[];
UNK_TYPE D_800D2F50 = 0; // unused
s32 sOverheadCam = 0;
@ -154,9 +156,7 @@ void Play_UpdateDynaFloor(void) {
Matrix_MultVec3fNoTranslate(gCalcMatrix, &spC4, &spB8);
if (gCurrentLevel == LEVEL_SOLAR) {
spB4[*spB0].n.n[0] = spB8.x;
}
spB4[*spB0].n.n[0] = spB8.x;
spB4[*spB0].n.n[1] = spB8.y;
spB4[*spB0].n.n[2] = spB8.z;
}
@ -182,7 +182,7 @@ void Play_UpdateDynaFloor(void) {
// spB4_copy[*spB0].n.n[2] *= -1.0f;
}
break;
/*
case LEVEL_ZONESS:
if ((gGameFrameCount % 2) != 0) {
spB4 = SEGMENTED_TO_VIRTUAL(D_ZO_6009ED0);
@ -193,7 +193,7 @@ void Play_UpdateDynaFloor(void) {
}
spB0 = SEGMENTED_TO_VIRTUAL(D_ZO_602AC50);
memcpy2(spB4_copy, spB4, 17 * 17 * sizeof(Vtx));
memcpy(spB4_copy, spB4, 17 * 17 * sizeof(Vtx));
for (i = 0; (i < 17 * 17); i++, spB0++) {
// spB4_copy[*spB0] = spB4[*spB0];
@ -202,7 +202,6 @@ void Play_UpdateDynaFloor(void) {
// spB4_copy[*spB0].n.n[2] *= -1.0f;
}
break;
*/
}
}

File diff suppressed because it is too large Load Diff