Reset transition timers when forced to warp (fixes screen flashing)

Fixes #50
This commit is contained in:
MysterD 2020-09-27 23:57:52 -07:00
parent a4e3688812
commit be6bff6e12
3 changed files with 9 additions and 1 deletions

View File

@ -36,6 +36,8 @@
#include "pc/configfile.h" #include "pc/configfile.h"
#include "pc/network/network.h" #include "pc/network/network.h"
#include "game/screen_transition.h"
#define WARP_NODE_F0 0xF0 #define WARP_NODE_F0 0xF0
#define WARP_NODE_DEATH 0xF1 #define WARP_NODE_DEATH 0xF1
#define WARP_NODE_F2 0xF2 #define WARP_NODE_F2 0xF2
@ -1006,7 +1008,7 @@ static void check_received_warp(void) {
extern s16 gMenuMode; extern s16 gMenuMode;
gMenuMode = -1; gMenuMode = -1;
reset_dialog_render_state(); reset_dialog_render_state();
gWarpTransition.isActive = FALSE; reset_screen_transition_timers();
} }
set_play_mode((sWarpDest.type == WARP_TYPE_CHANGE_LEVEL) set_play_mode((sWarpDest.type == WARP_TYPE_CHANGE_LEVEL)

View File

@ -19,6 +19,11 @@ u16 sTransitionTextureFadeCount[2] = { 0 };
static Gfx *sScreenTransitionVerticesPos[2]; static Gfx *sScreenTransitionVerticesPos[2];
static Vtx *sScreenTransitionVertices; static Vtx *sScreenTransitionVertices;
void reset_screen_transition_timers(void) {
memset(sTransitionColorFadeCount, 0, sizeof(u8) * 4);
memset(sTransitionTextureFadeCount, 0, sizeof(u16) * 2);
}
void patch_screen_transition_interpolated(void) { void patch_screen_transition_interpolated(void) {
if (sScreenTransitionVerticesPos[0] != NULL) { if (sScreenTransitionVerticesPos[0] != NULL) {
gSPVertex(sScreenTransitionVerticesPos[0], VIRTUAL_TO_PHYSICAL(sScreenTransitionVertices), 8, 0); gSPVertex(sScreenTransitionVerticesPos[0], VIRTUAL_TO_PHYSICAL(sScreenTransitionVertices), 8, 0);

View File

@ -21,6 +21,7 @@ enum TextureTransitionType
TRANS_TYPE_CLAMP TRANS_TYPE_CLAMP
}; };
void reset_screen_transition_timers(void);
int render_screen_transition(s8 fadeTimer, s8 transType, u8 transTime, struct WarpTransitionData *transData); int render_screen_transition(s8 fadeTimer, s8 transType, u8 transTime, struct WarpTransitionData *transData);
Gfx *geo_cannon_circle_base(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx); Gfx *geo_cannon_circle_base(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx);