diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index 753d039a..f9b79979 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -142,7 +142,6 @@ static Gfx starSetupDL[] = { gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), // Disable texturing gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_CULL_BACK | G_SHADING_SMOOTH), - //gsDPPipeSync(), gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE), // Use primitive color gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE, @@ -171,8 +170,6 @@ void Background_DrawStarfield(void) { float vy; const float STAR_MARGIN = 10.0f; // Margin to hide seam stars - FrameInterpolation_RecordOpenChild("Starfield", 0); - // Set projection to orthographic before drawing stars Lib_InitOrtho(&gMasterDisp); @@ -216,6 +213,7 @@ void Background_DrawStarfield(void) { zCos = __cosf(gStarfieldRoll); zSin = __sinf(gStarfieldRoll); + for (i = 0; i < starCount; i++, yStar++, xStar++, color++) { // Adjust star positions with field offsets bx = *xStar + xField; @@ -248,11 +246,7 @@ void Background_DrawStarfield(void) { // Check if the star is within the visible screen area with margin if ((vx >= STAR_MARGIN) && (vx < currentScreenWidth - STAR_MARGIN) && (vy >= STAR_MARGIN) && (vy < currentScreenHeight - STAR_MARGIN)) { - // @recomp Tag the transform. - // gEXMatrixGroupDecomposed(gMasterDisp++, TAG_STARFIELD + i, G_EX_PUSH, G_MTX_MODELVIEW, - // G_EX_COMPONENT_AUTO, G_EX_COMPONENT_AUTO, G_EX_COMPONENT_AUTO, - // G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_SKIP, - // G_EX_COMPONENT_INTERPOLATE, G_EX_ORDER_AUTO, G_EX_EDIT_ALLOW); + FrameInterpolation_RecordOpenChild("Starfield", i); // Translate to (vx, vy) in ortho coordinates Matrix_Push(&gGfxMatrix); @@ -276,7 +270,7 @@ void Background_DrawStarfield(void) { gSPDisplayList(gMasterDisp++, starDL); // Pop the transform id - // gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW); + FrameInterpolation_RecordCloseChild(); } } } @@ -287,8 +281,6 @@ void Background_DrawStarfield(void) { // Finalize rendering state gDPPipeSync(gMasterDisp++); gDPSetColorDither(gMasterDisp++, G_CD_MAGICSQ); - - FrameInterpolation_RecordCloseChild(); } void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in the Epilogue @@ -312,8 +304,6 @@ void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in float starfieldWidth = 1.0f * currentScreenWidth; float starfieldHeight = 1.0f * currentScreenHeight; - FrameInterpolation_RecordOpenChild("Starfield", 0); - // Graphics pipeline setup gDPPipeSync(gMasterDisp++); gDPSetCycleType(gMasterDisp++, G_CYC_FILL); @@ -362,11 +352,7 @@ void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in // Check if the star is within the visible screen area if ((vx >= 0) && (vx < currentScreenWidth) && (yMin < vy) && (vy < yMax)) { // Tag the transform. Assuming TAG_STARFIELD is a defined base tag value - // @recomp Tag the transform. - // gEXMatrixGroupDecomposed(gMasterDisp++, TAG_STARFIELD + i, G_EX_PUSH, G_MTX_MODELVIEW, G_EX_COMPONENT_AUTO, - // G_EX_COMPONENT_AUTO, G_EX_COMPONENT_AUTO, G_EX_COMPONENT_INTERPOLATE, - // G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_INTERPOLATE, - // G_EX_ORDER_AUTO, G_EX_EDIT_ALLOW); + FrameInterpolation_RecordOpenChild("SmallStarfield", i); // Translate to (vx, vy) in ortho coordinates Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, vx - (currentScreenWidth / 2.0f), -(vy - (currentScreenHeight / 2.0f)), 0.0f, @@ -389,12 +375,11 @@ void Background_DrawPartialStarfield(s32 yMin, s32 yMax) { // Stars that are in gSPDisplayList(gMasterDisp++, starDLPartial); // Pop the transform id - // gEXPopMatrixGroup(gMasterDisp++, G_MTX_MODELVIEW); + FrameInterpolation_RecordCloseChild(); } } gDPPipeSync(gMasterDisp++); gDPSetColorDither(gMasterDisp++, G_CD_MAGICSQ); - FrameInterpolation_RecordCloseChild(); } void func_bg_8003E1E0(void) { diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index 8e5124b3..12ab0f10 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -1505,8 +1505,8 @@ void Display_ActorMarks(void) { RCP_SetupDL_40(); for (i = 0; i < ARRAY_COUNT(gTeamArrowsViewPos); i++) { - FrameInterpolation_RecordOpenChild(&gTeamArrowsViewPos[i], i); if (gTeamArrowsViewPos[i].z < 0.0f) { + FrameInterpolation_RecordOpenChild(&gTeamArrowsViewPos[i], i); var_fs0 = (VEC3F_MAG(&gTeamArrowsViewPos[i])) * 0.0015f; if (var_fs0 > 100.0f) { var_fs0 = 100.0f; @@ -1533,10 +1533,10 @@ void Display_ActorMarks(void) { gSPDisplayList(gMasterDisp++, sTeammateMarkDLs[i]); } Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } gTeamArrowsViewPos[i].x = gTeamArrowsViewPos[i].y = 0; gTeamArrowsViewPos[i].z = 100.0f; - FrameInterpolation_RecordCloseChild(); } gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); } @@ -1551,6 +1551,7 @@ void Display_LockOnIndicator(void) { if (gLockOnTargetViewPos[i].z < 0.0f) { var_fs0 = VEC3F_MAG(&gLockOnTargetViewPos[i]); if (var_fs0 < 20000.0f) { + FrameInterpolation_RecordOpenChild("LcckOnIndicator", 0); var_fs0 *= 0.0015f; if (var_fs0 > 100.0f) { var_fs0 = 100.0f; @@ -1575,6 +1576,7 @@ void Display_LockOnIndicator(void) { gDPSetEnvColor(gMasterDisp++, 255, 0, 0, 255); gSPDisplayList(gMasterDisp++, D_1024F60); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } }