diff options
| author | Archez <Archez@users.noreply.github.com> | 2024-04-29 20:40:23 -0400 |
|---|---|---|
| committer | Garrett Cox <garrettjcox@gmail.com> | 2024-05-22 09:05:02 -0500 |
| commit | bbb0e2a4e0b8e30fa1ddb0513b8a92cd9d91f5c4 (patch) | |
| tree | ac1e3974cfe0c4141afad768241f9c1d246bca9a /mm/src/code | |
| parent | 8f2d8565199a9a60360ce428f00ecda255998952 (diff) | |
Fix interpolation crashes due to unclosed records (#263)
* Fix interpolation crashes due to unclosed records
* rework en_mnk drawface to avoid return in open/close disps pair [still matching]
* fix placement of close_disps in en_osn draw
* replace returns with goto to follow other decomp patterns
Diffstat (limited to 'mm/src/code')
| -rw-r--r-- | mm/src/code/speed_meter.c | 2 | ||||
| -rw-r--r-- | mm/src/code/z_eff_blure.c | 5 | ||||
| -rw-r--r-- | mm/src/code/z_player_lib.c | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/mm/src/code/speed_meter.c b/mm/src/code/speed_meter.c index 9669e73ce..e9a04a63b 100644 --- a/mm/src/code/speed_meter.c +++ b/mm/src/code/speed_meter.c @@ -115,6 +115,8 @@ void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) { /*! @bug if gIrqMgrRetraceTime is 0, CLOSE_DISPS will never be reached */ if (gIrqMgrRetraceTime == 0) { + // 2S2H [Port] We need our close disps helpers called to prevent interpolation crashes + CLOSE_DISPS_PORT_HELPERS(gfxCtx); return; } diff --git a/mm/src/code/z_eff_blure.c b/mm/src/code/z_eff_blure.c index 97d350fb0..77fb627f4 100644 --- a/mm/src/code/z_eff_blure.c +++ b/mm/src/code/z_eff_blure.c @@ -652,7 +652,7 @@ void EffectBlure_DrawSmooth(EffectBlure* this2, GraphicsContext* gfxCtx) { FrameInterpolation_RecordOpenChild(this, interpolationEpoch); if (this->numElements < 2) { - return; + goto close_disps; } this->elements[0].flags &= ~3; @@ -672,7 +672,7 @@ void EffectBlure_DrawSmooth(EffectBlure* this2, GraphicsContext* gfxCtx) { mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp5C); if (mtx == NULL) { - return; + goto close_disps; } gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -691,6 +691,7 @@ void EffectBlure_DrawSmooth(EffectBlure* this2, GraphicsContext* gfxCtx) { } } +close_disps: FrameInterpolation_RecordCloseChild(); CLOSE_DISPS(gfxCtx); } diff --git a/mm/src/code/z_player_lib.c b/mm/src/code/z_player_lib.c index 872936851..f90867392 100644 --- a/mm/src/code/z_player_lib.c +++ b/mm/src/code/z_player_lib.c @@ -2818,6 +2818,8 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) { D_801C05F0[1].unk_2 = D_801C05F0[0].unk_2; } else { //! @bug Skips CLOSE_DISPS + // 2S2H [Port] We need our close disps helpers called to prevent interpolation crashes + CLOSE_DISPS_PORT_HELPERS(play->state.gfxCtx); return; } |
