Removed vestigial painting warp code, made painting selection instant

This commit is contained in:
MysterD 2020-08-12 22:17:12 -07:00
parent 0e2dff8190
commit 09dad965bb
2 changed files with 9 additions and 18 deletions

View File

@ -154,6 +154,7 @@ void bhv_act_selector_init(void) {
}
render_100_coin_star(stars);
gInsidePainting = TRUE;
}
/**
@ -459,4 +460,9 @@ void star_select_finish_selection(void) {
sLoadedActNum = sInitSelectedActNum;
}
gDialogCourseActNum = sSelectedActIndex + 1;
gInsidePainting = FALSE;
if (gControlPainting) {
network_send_inside_painting();
}
}

View File

@ -12,11 +12,10 @@ struct PacketDataInsidePainting {
u8 controlPainting;
u8 starIndex;
u8 actIndex;
struct WarpNode warpNode;
};
static clock_t lastSentTime = 0;
static float minUpdateRate = 0.5f;
static float minUpdateRate = 5.0f;
static struct PacketDataInsidePainting lastSentData = { 0 };
static void populate_packet_data(struct PacketDataInsidePainting* data) {
@ -24,7 +23,6 @@ static void populate_packet_data(struct PacketDataInsidePainting* data) {
data->controlPainting = gControlPainting;
data->starIndex = sSelectableStarIndex;
data->actIndex = sSelectedActIndex;
data->warpNode = gPaintingWarpNode;
}
void network_send_inside_painting(void) {
@ -55,24 +53,11 @@ void network_receive_inside_painting(struct Packet* p) {
sSelectedActIndex = remote.actIndex;
}
// see if the warp nodes are the same
int compareNodes = memcmp(&gPaintingWarpNode, &remote.warpNode, sizeof(struct WarpNode));
if (gControlPainting && !remote.controlPainting && (compareNodes == 0)) {
if (gControlPainting && !remote.controlPainting) {
// remote is well behaved now, we can control the painting
gWaitingForRemotePainting = false;
}
bool shouldJumpInside = !gControlPainting && (!gInsidePainting && remote.insidePainting);
// ERROR: THE DESTINATION MISMATCH DOESN'T MOVE THE CLIENT TO THE CORRECT SCREEN!
bool destinationMismatch = !gControlPainting && (compareNodes != 0);
if (shouldJumpInside || destinationMismatch) {
initiate_painting_warp_node(&remote.warpNode, true);
set_play_mode(PLAY_MODE_CHANGE_LEVEL);
}
if (gControlPainting && !remote.controlPainting && !gInsidePainting && remote.insidePainting) {
// we're in control and no longer in the painting, let remote know
network_send_inside_painting();