diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2024-10-16 11:53:41 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2024-10-16 11:53:41 -0600 |
| commit | efe08a91bf7678a8460cfc9b831b994ac6d831b9 (patch) | |
| tree | 4a60d0b2bfc6028aa0ca0b39446649f71e7d8349 /src/engine | |
| parent | 94e3cded043c555065aff81fc40bd7ab9e8bfdab (diff) | |
Added interpolation system
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/fox_beam.c | 3 | ||||
| -rw-r--r-- | src/engine/fox_bg.c | 2 | ||||
| -rw-r--r-- | src/engine/fox_display.c | 17 | ||||
| -rw-r--r-- | src/engine/fox_edisplay.c | 19 | ||||
| -rw-r--r-- | src/engine/fox_game.c | 3 | ||||
| -rw-r--r-- | src/engine/fox_hud.c | 3 |
6 files changed, 45 insertions, 2 deletions
diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index 0ba4696a..8a990226 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -3,6 +3,7 @@ #include "assets/ast_aquas.h" #include "assets/ast_great_fox.h" #include "assets/ast_versus.h" +#include "port/interpolation/FrameInterpolation.h" Vec3f sShotViewPos; @@ -1502,6 +1503,7 @@ void PlayerShot_DrawShot(PlayerShot* shot) { } void PlayerShot_Draw(PlayerShot* shot) { + FrameInterpolation_RecordOpenChild(shot, 0); switch (shot->obj.status) { case SHOT_ACTIVE: PlayerShot_DrawShot(shot); @@ -1510,6 +1512,7 @@ void PlayerShot_Draw(PlayerShot* shot) { PlayerShot_DrawHitmark(shot); break; } + FrameInterpolation_RecordCloseChild(); } void PlayerShot_UpdateHitmark(PlayerShot* shot) { diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index 3ca59718..566ff05b 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -22,6 +22,7 @@ #include "assets/ast_zoness.h" #include "prevent_bss_reordering2.h" +#include "port/interpolation/FrameInterpolation.h" // #include "prevent_bss_reordering3.h" f32 gWarpZoneBgAlpha; @@ -252,6 +253,7 @@ void Background_DrawBackdrop(void) { u8 levelType; s32 levelId; + if (gDrawBackdrop == 0) { return; } diff --git a/src/engine/fox_display.c b/src/engine/fox_display.c index ca4ec967..8e5124b3 100644 --- a/src/engine/fox_display.c +++ b/src/engine/fox_display.c @@ -4,6 +4,7 @@ #include "assets/ast_landmaster.h" #include "assets/ast_versus.h" #include "assets/ast_sector_z.h" +#include "port/interpolation/FrameInterpolation.h" Vec3f D_display_801613B0[4]; Vec3f D_display_801613E0[4]; @@ -704,12 +705,13 @@ void Display_Arwing(Player* player, s32 reflectY) { void Display_Reticle(Player* player) { Vec3f* translate; s32 i; - + if ((gPlayerNum == player->num) && ((player->form == FORM_ARWING) || (player->form == FORM_LANDMASTER)) && player->draw && (((gGameState == GSTATE_PLAY) && (player->state_1C8 == PLAYERSTATE_1C8_ACTIVE)) || (gGameState == GSTATE_MENU))) { for (i = 0; i < 2; i++) { + FrameInterpolation_RecordOpenChild("Reticle", i); translate = &D_display_801613E0[i]; Matrix_Push(&gGfxMatrix); Matrix_Translate(gGfxMatrix, translate->x, translate->y, translate->z, MTXF_APPLY); @@ -735,6 +737,7 @@ void Display_Reticle(Player* player) { Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, D_1024F60); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } } @@ -1502,6 +1505,7 @@ 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) { var_fs0 = (VEC3F_MAG(&gTeamArrowsViewPos[i])) * 0.0015f; if (var_fs0 > 100.0f) { @@ -1532,6 +1536,7 @@ void Display_ActorMarks(void) { } gTeamArrowsViewPos[i].x = gTeamArrowsViewPos[i].y = 0; gTeamArrowsViewPos[i].z = 100.0f; + FrameInterpolation_RecordCloseChild(); } gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP); } @@ -1742,8 +1747,12 @@ void Display_Update(void) { Background_DrawStarfield(); } + FrameInterpolation_RecordOpenChild("Backdrop", 0); Background_DrawBackdrop(); + FrameInterpolation_RecordCloseChild(); + FrameInterpolation_RecordOpenChild("Sun", 0); Background_DrawSun(); + FrameInterpolation_RecordCloseChild(); Matrix_Push(&gGfxMatrix); Matrix_LookAt(gGfxMatrix, gPlayCamEye.x, gPlayCamEye.y, gPlayCamEye.z, gPlayCamAt.x, gPlayCamAt.y, gPlayCamAt.z, playerCamUp.x, playerCamUp.y, playerCamUp.z, MTXF_APPLY); @@ -1759,7 +1768,9 @@ void Display_Update(void) { Matrix_Pop(&gGfxMatrix); } else if (gGroundSurface != SURFACE_WATER) { D_bg_8015F964 = false; + FrameInterpolation_RecordOpenChild("Ground", 0); Background_DrawGround(); + FrameInterpolation_RecordCloseChild(); } } @@ -1823,7 +1834,9 @@ void Display_Update(void) { if ((gGroundSurface == SURFACE_WATER) || (gAqDrawMode != 0)) { D_bg_8015F964 = true; Effect_Draw(1); + FrameInterpolation_RecordOpenChild("Ground", 0); Background_DrawGround(); + FrameInterpolation_RecordCloseChild(); } if ((gCurrentLevel != LEVEL_AQUAS) && @@ -1837,9 +1850,11 @@ void Display_Update(void) { for (i = 0, player = &gPlayer[0]; i < gCamCount; i++, player++) { if (sPlayersVisible[i]) { + FrameInterpolation_RecordOpenChild(player, i); Display_PlayerShadow_Update(player); Display_PlayerFeatures(player); Display_ArwingWingTrail_Update(player); + FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index 04d3ee45..0c044598 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -22,6 +22,7 @@ #include "assets/ast_enmy_planet.h" #include "assets/ast_ve1_boss.h" #include "assets/ast_zoness.h" +#include "port/interpolation/FrameInterpolation.h" Vec3f D_edisplay_801615D0; Vec3f sViewPos; @@ -1674,6 +1675,7 @@ void Object_DrawAll(s32 arg0) { for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { if ((scenery360->obj.status == OBJ_ACTIVE) && (scenery360->obj.id != OBJ_SCENERY_LEVEL_OBJECTS)) { + FrameInterpolation_RecordOpenChild(scenery360, i); if (gCurrentLevel == LEVEL_BOLSE) { spAC.x = scenery360->sfxSource[0]; spAC.y = scenery360->sfxSource[1]; @@ -1684,12 +1686,14 @@ void Object_DrawAll(s32 arg0) { Matrix_Push(&gGfxMatrix); Scenery360_Draw(scenery360); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } } else { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); for (i = 0, scenery = gScenery; i < ARRAY_COUNT(gScenery); i++, scenery++) { if (scenery->obj.status >= OBJ_ACTIVE) { + FrameInterpolation_RecordOpenChild(scenery, i); if (arg0 > 0) { Display_SetSecondLight(&scenery->obj.pos); } @@ -1697,12 +1701,14 @@ void Object_DrawAll(s32 arg0) { Scenery_Draw(scenery, arg0); Matrix_Pop(&gGfxMatrix); Object_UpdateSfxSource(scenery->sfxSource); + FrameInterpolation_RecordCloseChild(); } } } for (i = 0, boss = gBosses; i < ARRAY_COUNT(gBosses); i++, boss++) { if ((boss->obj.status >= OBJ_ACTIVE) && (boss->obj.id != OBJ_BOSS_BO_BASE_SHIELD)) { + FrameInterpolation_RecordOpenChild(boss, i); if ((boss->timer_05C % 2) == 0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { @@ -1718,6 +1724,7 @@ void Object_DrawAll(s32 arg0) { Object_DrawShadow(i, &boss->obj); Matrix_Pop(&gGfxMatrix); } + FrameInterpolation_RecordCloseChild(); } } @@ -1726,6 +1733,7 @@ void Object_DrawAll(s32 arg0) { for (i = 0, sprite = gSprites; i < ARRAY_COUNT(gSprites); i++, sprite++) { if ((sprite->obj.status >= OBJ_ACTIVE) && func_enmy_80060FE4(&sprite->obj.pos, -12000.0f)) { + FrameInterpolation_RecordOpenChild(sprite, i); Matrix_Push(&gGfxMatrix); if ((sprite->obj.id == OBJ_SPRITE_CO_RUIN1) || (sprite->obj.id == OBJ_SPRITE_CO_RUIN2)) { @@ -1736,11 +1744,13 @@ void Object_DrawAll(s32 arg0) { Sprite_Draw(sprite, arg0); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } for (i = 0, actor = &gActors[0]; i < ARRAY_COUNT(gActors); i++, actor++) { if (actor->obj.status >= OBJ_ACTIVE) { + FrameInterpolation_RecordOpenChild(actor, i); if ((actor->timer_0C6 % 2) == 0) { if (gCurrentLevel == LEVEL_UNK_15) { RCP_SetupDL_23(); @@ -1789,6 +1799,7 @@ void Object_DrawAll(s32 arg0) { } break; } + FrameInterpolation_RecordCloseChild(); } } @@ -1799,11 +1810,13 @@ void Object_DrawAll(s32 arg0) { for (i = 0, item = &gItems[0]; i < ARRAY_COUNT(gItems); i++, item++) { if (item->obj.status >= OBJ_ACTIVE) { + FrameInterpolation_RecordOpenChild(item, i); Matrix_Push(&gGfxMatrix); RCP_SetupDL(&gMasterDisp, SETUPDL_29); Object_SetCullDirection(arg0); Item_Draw(item, arg0); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } @@ -1820,6 +1833,7 @@ void Effect_DrawAll(s32 arg0) { for (i = 0, effect = &gEffects[0]; i < ARRAY_COUNT(gEffects); i++, effect++) { if (effect->obj.status >= OBJ_ACTIVE) { + FrameInterpolation_RecordOpenChild(effect, i); if (effect->info.unk_14 == 1) { effect->obj.rot.y = RAD_TO_DEG(-gPlayer[gPlayerNum].camYaw); effect->obj.rot.x = RAD_TO_DEG(gPlayer[gPlayerNum].camPitch); @@ -1840,11 +1854,13 @@ void Effect_DrawAll(s32 arg0) { Matrix_Pop(&gGfxMatrix); } } + FrameInterpolation_RecordCloseChild(); } } for (i = 0, boss = &gBosses[0]; i < ARRAY_COUNT(gBosses); i++, boss++) { if ((boss->obj.status >= OBJ_ACTIVE) && (boss->obj.id == OBJ_BOSS_BO_BASE_SHIELD)) { + FrameInterpolation_RecordOpenChild(boss, i); if ((boss->timer_05C % 2) == 0) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); } else { @@ -1854,6 +1870,7 @@ void Effect_DrawAll(s32 arg0) { Matrix_Push(&gGfxMatrix); Boss_Draw(boss, arg0); Matrix_Pop(&gGfxMatrix); + FrameInterpolation_RecordCloseChild(); } } } @@ -1914,6 +1931,7 @@ void TexturedLine_Draw(void) { for (i = 0; i < ARRAY_COUNT(gTexturedLines); i++) { TexturedLine* texLine = &gTexturedLines[i]; + FrameInterpolation_RecordOpenChild(texLine, i); if (gTexturedLines[i].mode != 0) { Matrix_Push(&gGfxMatrix); @@ -1953,6 +1971,7 @@ void TexturedLine_Draw(void) { } Matrix_Pop(&gGfxMatrix); } + FrameInterpolation_RecordCloseChild(); } } diff --git a/src/engine/fox_game.c b/src/engine/fox_game.c index 1af20305..2e7cfef9 100644 --- a/src/engine/fox_game.c +++ b/src/engine/fox_game.c @@ -3,6 +3,7 @@ #include "sf64dma.h" #include "assets/ast_logo.h" #include "mods.h" +#include "port/interpolation/FrameInterpolation.h" f32 gNextVsViewScale; f32 gVsViewScale; @@ -267,6 +268,7 @@ void Game_InitViewport(Gfx** dList, u8 camCount, u8 camIndex) { } void Game_Draw(s32 playerNum) { + FrameInterpolation_StartRecord(); switch (gDrawMode) { case DRAW_NONE: break; @@ -303,6 +305,7 @@ void Game_Draw(s32 playerNum) { Ending_Draw(); break; } + FrameInterpolation_StopRecord(); } void Game_SetScene(void) { diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index 65f35841..45d6979e 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -1,6 +1,7 @@ #include "sf64math.h" #include "fox_hud.h" #include "prevent_bss_reordering.h" +#include "port/interpolation/FrameInterpolation.h" Vec3f D_801616A0; Vec3f D_801616B0; @@ -3278,7 +3279,7 @@ void HUD_Hitpoints_Update(f32 xPos, f32 yPos) { } } RCP_SetupDL(&gMasterDisp, SETUPDL_76); - gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, 255); + gDPSetPrimColor(gMasterDisp++, 0, 0, r, g, b, 255); HUD_Hitpoints_Draw(xPos, yPos); } |
