training ground fix for OnRails

This commit is contained in:
Sonic Dreamcaster 2024-11-27 04:33:56 -03:00
parent ef594b20ca
commit dfcff1a365

View File

@ -1418,66 +1418,91 @@ void Background_DrawGround(void) {
break; break;
case LEVEL_TRAINING: case LEVEL_TRAINING:
static Vtx trainingGroundVtx_FIX[] = {
{ { { 4000, 0, -6000 }, 0, { 20947, -19923 }, { 0, 120, 0, 255 } } },
{ { { -4000, 0, -6000 }, 0, { 0, -19923 }, { 0, 120, 0, 255 } } },
{ { { -4000, 0, 0 }, 0, { 0, -9449 }, { 0, 120, 0, 255 } } },
{ { { 4000, 0, 0 }, 0, { 20947, -9449 }, { 0, 120, 0, 255 } } },
{ { { -4000, 0, 6000 }, 0, { 0, 1023 }, { 0, 120, 0, 255 } } },
{ { { 4000, 0, 6000 }, 0, { 20947, 1023 }, { 0, 120, 0, 255 } } },
};
static Gfx trainingGroundDL_FIX[] = {
gsSPVertex(trainingGroundVtx_FIX, 6, 0),
gsSP2Triangles(1, 2, 3, 0, 1, 3, 0, 0),
gsSP2Triangles(4, 5, 3, 0, 4, 3, 2, 0),
gsSPEndDisplayList(),
};
sp1C4 = D_TR_6005938;
sp1C0 = trainingGroundDL_FIX;
gDPLoadTextureBlock(gMasterDisp++, sp1C4, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
skipInterpolationGround = (fabsf(gPlayer[gPlayerNum].xPath - prevPlayerPath) > 12000.0f / 2.0f); skipInterpolationGround = (fabsf(gPlayer[gPlayerNum].xPath - prevPlayerPath) > 12000.0f / 2.0f);
skipInterpolationGround2 = prevPlayerPath2 != sp1D4; skipInterpolationGround2 = prevPlayerPath2 != sp1D4;
if (gLevelMode == LEVELMODE_ON_RAILS) { if (gLevelMode == LEVELMODE_ON_RAILS) {
if (gPathTexScroll > (32.0f * 36.7f) / 2.0f) { // if (gPathTexScroll > (32.0f * 36.7f) / 2.0f) {
gPathTexScroll -= (32.0f * 36.7f) / 2.0f; // gPathTexScroll -= (32.0f * 36.7f) / 2.0f;
} // }
gDPSetTextureImage(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sp1C4);
temp_s0 = fabsf(Math_ModF(2.0f * (gPathTexScroll * 0.2133333f), 128.0f)); // 0.64f / 3.0f
temp_fv0 = Math_ModF((10000.0f - gPlayer[gPlayerNum].xPath) * 0.32f, 128.0f);
gDPSetupTile(gMasterDisp++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, temp_fv0, temp_s0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
// Original Display (Center) // Original Display (Center)
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -2500.0f + gPathTexScroll, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -2500.0f /*+ gPathTexScroll*/, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880); gSPDisplayList(gMasterDisp++, sp1C0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
// Mirrored Display - Left Side // Mirrored Display - Left Side
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, -8000.0f, 0.0f, -2500.0f + gPathTexScroll, Matrix_Translate(gGfxMatrix, -8000.0f, 0.0f, -2500.0f /*+ gPathTexScroll*/,
MTXF_APPLY); // Move left by the width of the original (-8000.0f) MTXF_APPLY); // Move left by the width of the original (-8000.0f)
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880); gSPDisplayList(gMasterDisp++, sp1C0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
// Mirrored Display - Right Side // Mirrored Display - Right Side
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 8000.0f, 0.0f, -2500.0f + gPathTexScroll, Matrix_Translate(gGfxMatrix, 8000.0f, 0.0f, -2500.0f /*+ gPathTexScroll*/,
MTXF_APPLY); // Move right by the width of the original (+8000.0f) MTXF_APPLY); // Move right by the width of the original (+8000.0f)
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880); gSPDisplayList(gMasterDisp++, sp1C0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
// Original Display for the second section (Center) // Original Display for the second section (Center)
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -8435.0f + 65 + gPathTexScroll, MTXF_APPLY); Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -8435.0f + 65 /*+ gPathTexScroll*/, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880); gSPDisplayList(gMasterDisp++, sp1C0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
// Mirrored Display - Left Side for the second section // Mirrored Display - Left Side for the second section
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, -8000.0f, 0.0f, -8435.0f + 65 + gPathTexScroll, Matrix_Translate(gGfxMatrix, -8000.0f, 0.0f, -8435.0f + 65 /*+ gPathTexScroll*/,
MTXF_APPLY); // Move left by the width of the original (-8000.0f) MTXF_APPLY); // Move left by the width of the original (-8000.0f)
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880); gSPDisplayList(gMasterDisp++, sp1C0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
// Mirrored Display - Right Side for the second section // Mirrored Display - Right Side for the second section
Matrix_Push(&gGfxMatrix); Matrix_Push(&gGfxMatrix);
Matrix_Translate(gGfxMatrix, 8000.0f, 0.0f, -8435.0f + 65 + gPathTexScroll, Matrix_Translate(gGfxMatrix, 8000.0f, 0.0f, -8435.0f + 65 /*+ gPathTexScroll*/,
MTXF_APPLY); // Move right by the width of the original (+8000.0f) MTXF_APPLY); // Move right by the width of the original (+8000.0f)
Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 1.0f, 1.0f, 0.5f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_TR_6005880); gSPDisplayList(gMasterDisp++, sp1C0);
Matrix_Pop(&gGfxMatrix); Matrix_Pop(&gGfxMatrix);
} else { } else {
u32 skipInfo = skipInterpolationGround << 8 | skipInterpolationGround2 << 16; u32 skipInfo = skipInterpolationGround << 8 | skipInterpolationGround2 << 16;