Added a toggle to disable interpolation

This commit is contained in:
KiritoDv
2024-10-16 15:32:08 -06:00
parent 13fd4ece9f
commit 783b626209
6 changed files with 23 additions and 3 deletions
+7
View File
@@ -213,6 +213,9 @@ void Background_DrawStarfield(void) {
zCos = __cosf(gStarfieldRoll);
zSin = __sinf(gStarfieldRoll);
if(CVarGetInteger("gDisableStarsInterpolation", 0) == 1){
FrameInterpolation_ShouldInterpolateFrame(false);
}
for (i = 0; i < starCount; i++, yStar++, xStar++, color++) {
// Adjust star positions with field offsets
@@ -273,6 +276,10 @@ void Background_DrawStarfield(void) {
FrameInterpolation_RecordCloseChild();
}
}
if(CVarGetInteger("gDisableStarsInterpolation", 0) == 1){
FrameInterpolation_ShouldInterpolateFrame(true);
}
}
// Restore original perspective after drawing stars
+6 -2
View File
@@ -827,6 +827,7 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) {
s32 i;
if (((gGameFrameCount & 0x18) != 0) && (this->state == 0)) {
FrameInterpolation_RecordOpenChild(this, 0);
Matrix_Push(&gGfxMatrix);
RCP_SetupDL(&gMasterDisp, SETUPDL_64);
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 255, 255, 0, 255);
@@ -836,7 +837,9 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) {
gSPDisplayList(gMasterDisp++, D_1023C80);
gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP);
Matrix_Pop(&gGfxMatrix);
FrameInterpolation_RecordCloseChild();
}
FrameInterpolation_RecordOpenChild(this, 1);
RCP_SetupDL(&gMasterDisp, SETUPDL_29);
gSPTexture(gMasterDisp++, 2000, 2000, 0, G_TX_RENDERTILE, G_ON);
gSPSetGeometryMode(gMasterDisp++, G_TEXTURE_GEN);
@@ -852,6 +855,7 @@ void ItemCheckpoint_Draw(ItemCheckpoint* this) {
Matrix_Pop(&gGfxMatrix);
}
gSPClearGeometryMode(gMasterDisp++, G_TEXTURE_GEN);
FrameInterpolation_RecordCloseChild();
}
void ItemSilverRing_Draw(ItemSilverRing* this) {
@@ -1674,8 +1678,8 @@ void Object_DrawAll(s32 arg0) {
}
for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) {
FrameInterpolation_RecordOpenChild(scenery360, i);
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];
@@ -1686,8 +1690,8 @@ void Object_DrawAll(s32 arg0) {
Matrix_Push(&gGfxMatrix);
Scenery360_Draw(scenery360);
Matrix_Pop(&gGfxMatrix);
FrameInterpolation_RecordCloseChild();
}
FrameInterpolation_RecordCloseChild();
}
} else {
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
+3
View File
@@ -1,5 +1,6 @@
#include "fox_title.h"
#include "global.h"
#include "port/interpolation/FrameInterpolation.h"
void Title_Main(void);
void Title_Draw(void);
@@ -30,7 +31,9 @@ void OvlMenu_CallFunction(u32 mode, void* ptr) {
break;
case OVLCALL_MAP_DRAW:
FrameInterpolation_RecordOpenChild("MapDraw", 0);
Map_Draw();
FrameInterpolation_RecordCloseChild();
break;
case OVLCALL_OPTION_UPDATE:
+1
View File
@@ -15,6 +15,7 @@
#include "assets/ast_map.h"
#include "assets/ast_text.h"
#include "assets/ast_font_3d.h"
#include "port/interpolation/FrameInterpolation.h"
// BSS STARTS HERE
u8 gMapVenomCloudTex[96 * 96];
@@ -402,7 +402,8 @@ unordered_map<Mtx*, MtxF> FrameInterpolation_Interpolate(float step) {
bool camera_interpolation = true;
void FrameInterpolation_ShouldInterpolateFrame(bool shouldInterpolate) {
camera_interpolation = shouldInterpolate;
// camera_interpolation = shouldInterpolate;
is_recording = shouldInterpolate;
}
void FrameInterpolation_StartRecord(void) {
+4
View File
@@ -468,6 +468,10 @@ void DrawDebugMenu() {
.tooltip = "Allows you to play sound effects from the game"
});
UIWidgets::CVarCheckbox("Disable stars interpolation", "gDisableStarsInterpolation", {
.tooltip = "Disable starfield interpolation for performance"
});
UIWidgets::Spacer(0);
UIWidgets::WindowButton("Stats", "gStatsEnabled", GameUI::mStatsWindow, {