Fix More Interpolation (#220)

* Fix SetTextMatrix Interpolation (flashing text)

* Interpolate pause menu item box

* Interp mtxf_translation_x_y_rotate_z_scale_x_y

* Fix billboarding for freecam

* Fix menus battle mode back to grand prix bug

* Fix snow interp

* interp star clouds
This commit is contained in:
MegaMech
2025-06-15 22:17:24 -06:00
committed by GitHub
parent 547d651cc4
commit 9fe391a2a4
11 changed files with 135 additions and 33 deletions
+18 -8
View File
@@ -35,8 +35,8 @@ void AddMatrixFixed(std::vector<Mtx>& stack, s32 flags) {
}
// Used in func_80095BD0
Mtx* SetTextMatrix(f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
Mat4 mf;
void SetTextMatrix(Mat4 mf, f32 x, f32 y, f32 arg3, f32 arg4) {
FrameInterpolation_Record_SetTextMatrix((Mat4*)&mf, x, y, arg3, arg4);
mf[0][0] = arg3;
mf[0][1] = 0.0f;
mf[0][2] = 0.0f;
@@ -49,15 +49,25 @@ Mtx* SetTextMatrix(f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
mf[2][1] = 0.0f;
mf[2][2] = 1.0f;
mf[2][3] = 0.0f;
mf[3][0] = arg1;
mf[3][1] = arg2;
mf[3][0] = x;
mf[3][1] = y;
mf[3][2] = 0.0f;
mf[3][3] = 1.0f;
Mtx* mtx = GetMatrix(gWorldInstance.Mtx.Effects);
FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)mf, mtx);
guMtxF2L(mf, mtx);
}
return mtx;
// AddMatrix but with custom gfx ptr arg and flags are predefined
Gfx* AddTextMatrix(Gfx* displayListHead, Mat4 mtx) {
// Push a new matrix to the stack
gWorldInstance.Mtx.Effects.emplace_back();
// Convert to a fixed-point matrix
FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)mtx, &gWorldInstance.Mtx.Effects.back());
guMtxF2L(mtx, &gWorldInstance.Mtx.Effects.back());
// Load the matrix
gSPMatrix(displayListHead++, &gWorldInstance.Mtx.Effects.back(), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
return displayListHead;
}
void ApplyMatrixTransformations(Mat4 mtx, FVector pos, IRotator rot, FVector scale) {
+2 -1
View File
@@ -17,7 +17,8 @@ void AddObjectMatrix(Mat4 mtx, s32 flags);
void AddEffectMatrix(Mat4 mtx, s32 flags);
void AddEffectMatrixOrtho(void);
void AddEffectMatrixFixed(s32 flags);
Mtx* SetTextMatrix(f32 arg1, f32 arg2, f32 arg3, f32 arg4);
void SetTextMatrix(Mat4 mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4);
Gfx* AddTextMatrix(Gfx* displayListHead, Mat4 mtx);
Mtx* GetEffectMatrix(void);
void ClearHudMatrixPool(void);
void ClearEffectsMatrixPool(void);
+1 -1
View File
@@ -178,7 +178,6 @@ void FrappeSnowland::BeginPlay() {
void FrappeSnowland::InitClouds() {
s32 var_s0;
s32 var_s4;
if (gPlayerCount == 1) {
var_s4 = 0x32;
} else {
@@ -189,6 +188,7 @@ void FrappeSnowland::InitClouds() {
}
D_8018D1F8 += var_s0;
D_8018D1F0 = var_s0;
D_8018D230 = 0; // This must be turned off or mayhem ensues
}
void FrappeSnowland::UpdateClouds(s32 sp1C, Camera* camera) {