mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-02-02 16:23:57 +03:00
mitigate AllRange ground interpolation problems
This commit is contained in:
parent
0deeddf8cb
commit
6f48acd76c
@ -1332,14 +1332,38 @@ void Background_DrawGround(void) {
|
|||||||
gGroundSurface = SURFACE_GRASS;
|
gGroundSurface = SURFACE_GRASS;
|
||||||
gBgColor = 0x845; // 8, 8, 32
|
gBgColor = 0x845; // 8, 8, 32
|
||||||
|
|
||||||
|
skipInterpolationGround = prevPlayerPath != gPlayer[gPlayerNum].xPath;
|
||||||
|
skipInterpolationGround2 = prevPlayerPath2 != sp1D4;
|
||||||
|
|
||||||
|
if (skipInterpolationGround || skipInterpolationGround2) {
|
||||||
|
// @port Skip interpolation
|
||||||
|
FrameInterpolation_ShouldInterpolateFrame(false);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sGroundPositions360x); i++) {
|
for (i = 0; i < ARRAY_COUNT(sGroundPositions360x); i++) {
|
||||||
|
if (!skipInterpolationGround && !skipInterpolationGround2) {
|
||||||
|
// @port: Tag the transform.
|
||||||
|
FrameInterpolation_RecordOpenChild("360Ground", i);
|
||||||
|
}
|
||||||
|
|
||||||
Matrix_Push(&gGfxMatrix);
|
Matrix_Push(&gGfxMatrix);
|
||||||
Matrix_Translate(gGfxMatrix, sGroundPositions360x_FIX[i], 0.0f, sGroundPositions360z_FIX[i],
|
Matrix_Translate(gGfxMatrix, sGroundPositions360x_FIX[i], 0.0f, sGroundPositions360z_FIX[i],
|
||||||
MTXF_APPLY);
|
MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
gSPDisplayList(gMasterDisp++, D_CO_601EAA0);
|
gSPDisplayList(gMasterDisp++, D_CO_601EAA0);
|
||||||
|
|
||||||
|
if (!skipInterpolationGround && !skipInterpolationGround2) {
|
||||||
|
// @port: Tag the transform.
|
||||||
|
FrameInterpolation_RecordCloseChild();
|
||||||
|
}
|
||||||
Matrix_Pop(&gGfxMatrix);
|
Matrix_Pop(&gGfxMatrix);
|
||||||
}
|
}
|
||||||
|
if (skipInterpolationGround || skipInterpolationGround2) {
|
||||||
|
// @port renable interpolation
|
||||||
|
FrameInterpolation_ShouldInterpolateFrame(true);
|
||||||
|
}
|
||||||
|
prevPlayerPath = gPlayer[gPlayerNum].xPath;
|
||||||
|
prevPlayerPath2 = sp1D4;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1445,9 +1469,6 @@ void Background_DrawGround(void) {
|
|||||||
G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
|
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);
|
|
||||||
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;
|
||||||
@ -1510,20 +1531,33 @@ void Background_DrawGround(void) {
|
|||||||
gSPDisplayList(gMasterDisp++, sp1C0);
|
gSPDisplayList(gMasterDisp++, sp1C0);
|
||||||
Matrix_Pop(&gGfxMatrix);
|
Matrix_Pop(&gGfxMatrix);
|
||||||
} else {
|
} else {
|
||||||
u32 skipInfo = skipInterpolationGround << 8 | skipInterpolationGround2 << 16;
|
skipInterpolationGround = prevPlayerPath != gPlayer[gPlayerNum].xPath;
|
||||||
|
skipInterpolationGround2 = prevPlayerPath2 != sp1D4;
|
||||||
|
|
||||||
|
if (skipInterpolationGround || skipInterpolationGround2) {
|
||||||
|
// @port Skip interpolation
|
||||||
|
FrameInterpolation_ShouldInterpolateFrame(false);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sGroundPositions360x_FIX); i++) {
|
for (i = 0; i < ARRAY_COUNT(sGroundPositions360x_FIX); i++) {
|
||||||
FrameInterpolation_RecordOpenChild("Ground", i | skipInfo);
|
if (!skipInterpolationGround && !skipInterpolationGround2) {
|
||||||
FrameInterpolation_RecordMarker(__FILE__, __LINE__);
|
// @port: Tag the transform.
|
||||||
|
FrameInterpolation_RecordOpenChild("360Ground", i);
|
||||||
|
}
|
||||||
|
|
||||||
Matrix_Push(&gGfxMatrix);
|
Matrix_Push(&gGfxMatrix);
|
||||||
Matrix_Translate(gGfxMatrix, sGroundPositions360x_FIX[i], 0.0f, sGroundPositions360z_FIX[i],
|
Matrix_Translate(gGfxMatrix, sGroundPositions360x_FIX[i], 0.0f, sGroundPositions360z_FIX[i],
|
||||||
MTXF_APPLY);
|
MTXF_APPLY);
|
||||||
Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY);
|
Matrix_Scale(gGfxMatrix, 1.5f, 1.0f, 1.0f, MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
gSPDisplayList(gMasterDisp++, D_TR_6005880);
|
gSPDisplayList(gMasterDisp++, D_TR_6005880);
|
||||||
Matrix_Pop(&gGfxMatrix);
|
|
||||||
|
if (!skipInterpolationGround && !skipInterpolationGround2) {
|
||||||
|
// @port: Tag the transform.
|
||||||
FrameInterpolation_RecordCloseChild();
|
FrameInterpolation_RecordCloseChild();
|
||||||
}
|
}
|
||||||
|
Matrix_Pop(&gGfxMatrix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
prevPlayerPath = gPlayer[gPlayerNum].xPath;
|
prevPlayerPath = gPlayer[gPlayerNum].xPath;
|
||||||
prevPlayerPath2 = sp1D4;
|
prevPlayerPath2 = sp1D4;
|
||||||
@ -1703,26 +1737,25 @@ void Background_DrawGround(void) {
|
|||||||
RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
|
RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
|
||||||
}
|
}
|
||||||
|
|
||||||
skipInterpolationGround = (fabsf(gPlayer[gPlayerNum].xPath - prevPlayerPath) > 12000.0f / 2.0f);
|
skipInterpolationGround = prevPlayerPath != gPlayer[gPlayerNum].xPath;
|
||||||
skipInterpolationGround2 = prevPlayerPath2 != sp1D4;
|
skipInterpolationGround2 = prevPlayerPath2 != sp1D4;
|
||||||
|
|
||||||
// if (skipInterpolationGround || skipInterpolationGround2) {
|
if (skipInterpolationGround || skipInterpolationGround2) {
|
||||||
// printf(" Ground interpolation Skipped! \n");
|
// @port Skip interpolation
|
||||||
// }
|
FrameInterpolation_ShouldInterpolateFrame(false);
|
||||||
|
}
|
||||||
{
|
|
||||||
u32 skipInfo = skipInterpolationGround << 8 | skipInterpolationGround2 << 16;
|
|
||||||
|
|
||||||
// printf("skipInfo: %x \n", skipInfo);
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sGroundPositions360x_FIX); i++) {
|
for (i = 0; i < ARRAY_COUNT(sGroundPositions360x_FIX); i++) {
|
||||||
FrameInterpolation_RecordOpenChild("Ground", i | skipInfo);
|
if (!skipInterpolationGround && !skipInterpolationGround2) {
|
||||||
FrameInterpolation_RecordMarker(__FILE__, __LINE__);
|
// @port: Tag the transform.
|
||||||
|
FrameInterpolation_RecordOpenChild("360Ground", i);
|
||||||
|
}
|
||||||
|
|
||||||
Matrix_Push(&gGfxMatrix);
|
Matrix_Push(&gGfxMatrix);
|
||||||
Matrix_Translate(gGfxMatrix, sGroundPositions360x_FIX[i], 0.0f, sGroundPositions360z_FIX[i],
|
Matrix_Translate(gGfxMatrix, sGroundPositions360x_FIX[i], 0.0f, sGroundPositions360z_FIX[i],
|
||||||
MTXF_APPLY);
|
MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
|
|
||||||
if (gCurrentLevel == LEVEL_FORTUNA) {
|
if (gCurrentLevel == LEVEL_FORTUNA) {
|
||||||
gSPDisplayList(gMasterDisp++, D_FO_6001360);
|
gSPDisplayList(gMasterDisp++, D_FO_6001360);
|
||||||
} else if (gCurrentLevel == LEVEL_KATINA) {
|
} else if (gCurrentLevel == LEVEL_KATINA) {
|
||||||
@ -1732,10 +1765,16 @@ void Background_DrawGround(void) {
|
|||||||
} else if (gCurrentLevel == LEVEL_VENOM_2) {
|
} else if (gCurrentLevel == LEVEL_VENOM_2) {
|
||||||
gSPDisplayList(gMasterDisp++, D_VE2_6010700);
|
gSPDisplayList(gMasterDisp++, D_VE2_6010700);
|
||||||
}
|
}
|
||||||
Matrix_Pop(&gGfxMatrix);
|
|
||||||
|
|
||||||
|
if (!skipInterpolationGround && !skipInterpolationGround2) {
|
||||||
|
// @port: Tag the transform.
|
||||||
FrameInterpolation_RecordCloseChild();
|
FrameInterpolation_RecordCloseChild();
|
||||||
}
|
}
|
||||||
|
Matrix_Pop(&gGfxMatrix);
|
||||||
|
}
|
||||||
|
if (skipInterpolationGround || skipInterpolationGround2) {
|
||||||
|
// @port renable interpolation
|
||||||
|
FrameInterpolation_ShouldInterpolateFrame(true);
|
||||||
}
|
}
|
||||||
prevPlayerPath = gPlayer[gPlayerNum].xPath;
|
prevPlayerPath = gPlayer[gPlayerNum].xPath;
|
||||||
prevPlayerPath2 = sp1D4;
|
prevPlayerPath2 = sp1D4;
|
||||||
@ -1748,7 +1787,20 @@ void Background_DrawGround(void) {
|
|||||||
RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
|
RCP_SetupDL_20(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skipInterpolationGround = prevPlayerPath != gPlayer[gPlayerNum].xPath;
|
||||||
|
skipInterpolationGround2 = prevPlayerPath2 != sp1D4;
|
||||||
|
|
||||||
|
if (skipInterpolationGround || skipInterpolationGround2) {
|
||||||
|
// @port Skip interpolation
|
||||||
|
FrameInterpolation_ShouldInterpolateFrame(false);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sGroundPositions360x); i++) {
|
for (i = 0; i < ARRAY_COUNT(sGroundPositions360x); i++) {
|
||||||
|
if (!skipInterpolationGround && !skipInterpolationGround2) {
|
||||||
|
// @port: Tag the transform.
|
||||||
|
FrameInterpolation_RecordOpenChild("360Ground", i);
|
||||||
|
}
|
||||||
|
|
||||||
Matrix_Push(&gGfxMatrix);
|
Matrix_Push(&gGfxMatrix);
|
||||||
Matrix_Translate(gGfxMatrix, sGroundPositions360x[i], 0.0f, sGroundPositions360z[i], MTXF_APPLY);
|
Matrix_Translate(gGfxMatrix, sGroundPositions360x[i], 0.0f, sGroundPositions360z[i], MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
@ -1757,8 +1809,18 @@ void Background_DrawGround(void) {
|
|||||||
} else {
|
} else {
|
||||||
gSPDisplayList(gMasterDisp++, D_versus_30160A0);
|
gSPDisplayList(gMasterDisp++, D_versus_30160A0);
|
||||||
}
|
}
|
||||||
|
if (!skipInterpolationGround && !skipInterpolationGround2) {
|
||||||
|
// @port: Tag the transform.
|
||||||
|
FrameInterpolation_RecordCloseChild();
|
||||||
|
}
|
||||||
Matrix_Pop(&gGfxMatrix);
|
Matrix_Pop(&gGfxMatrix);
|
||||||
}
|
}
|
||||||
|
if (skipInterpolationGround || skipInterpolationGround2) {
|
||||||
|
// @port renable interpolation
|
||||||
|
FrameInterpolation_ShouldInterpolateFrame(true);
|
||||||
|
}
|
||||||
|
prevPlayerPath = gPlayer[gPlayerNum].xPath;
|
||||||
|
prevPlayerPath2 = sp1D4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LEVEL_SOLAR: // WIP
|
case LEVEL_SOLAR: // WIP
|
||||||
|
Loading…
Reference in New Issue
Block a user