mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 21:45:12 +00:00
Make inside-and-outside painting transition quicker over network
This commit is contained in:
parent
29cb0935fb
commit
c12380aff4
3 changed files with 6 additions and 6 deletions
|
@ -464,6 +464,6 @@ void star_select_finish_selection(void) {
|
||||||
|
|
||||||
gInsidePainting = FALSE;
|
gInsidePainting = FALSE;
|
||||||
if (gControlPainting) {
|
if (gControlPainting) {
|
||||||
network_send_inside_painting();
|
network_send_inside_painting(TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ void network_receive_level_warp(struct Packet* p);
|
||||||
|
|
||||||
// packet_inside_painting.c
|
// packet_inside_painting.c
|
||||||
void network_update_inside_painting(void);
|
void network_update_inside_painting(void);
|
||||||
void network_send_inside_painting(void);
|
void network_send_inside_painting(bool reliable);
|
||||||
void network_receive_inside_painting(struct Packet* p);
|
void network_receive_inside_painting(struct Packet* p);
|
||||||
|
|
||||||
// packet_collect_star.c
|
// packet_collect_star.c
|
||||||
|
|
|
@ -25,12 +25,12 @@ static void populate_packet_data(struct PacketDataInsidePainting* data) {
|
||||||
data->actIndex = sSelectedActIndex;
|
data->actIndex = sSelectedActIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void network_send_inside_painting(void) {
|
void network_send_inside_painting(bool reliable) {
|
||||||
struct PacketDataInsidePainting data = { 0 };
|
struct PacketDataInsidePainting data = { 0 };
|
||||||
populate_packet_data(&data);
|
populate_packet_data(&data);
|
||||||
|
|
||||||
struct Packet p;
|
struct Packet p;
|
||||||
packet_init(&p, PACKET_INSIDE_PAINTING, false);
|
packet_init(&p, PACKET_INSIDE_PAINTING, reliable);
|
||||||
packet_write(&p, &data, sizeof(struct PacketDataInsidePainting));
|
packet_write(&p, &data, sizeof(struct PacketDataInsidePainting));
|
||||||
network_send(&p);
|
network_send(&p);
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ void network_receive_inside_painting(struct Packet* p) {
|
||||||
|
|
||||||
if (gControlPainting && !remote.controlPainting && !gInsidePainting && remote.insidePainting) {
|
if (gControlPainting && !remote.controlPainting && !gInsidePainting && remote.insidePainting) {
|
||||||
// we're in control and no longer in the painting, let remote know
|
// we're in control and no longer in the painting, let remote know
|
||||||
network_send_inside_painting();
|
network_send_inside_painting(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gControlPainting && remote.controlPainting && !remote.insidePainting) {
|
if (!gControlPainting && remote.controlPainting && !remote.insidePainting) {
|
||||||
|
@ -77,6 +77,6 @@ void network_update_inside_painting(void) {
|
||||||
float timeSinceSend = (clock() - lastSentTime) / CLOCKS_PER_SEC;
|
float timeSinceSend = (clock() - lastSentTime) / CLOCKS_PER_SEC;
|
||||||
|
|
||||||
if (compareData != 0 || timeSinceSend > minUpdateRate) {
|
if (compareData != 0 || timeSinceSend > minUpdateRate) {
|
||||||
network_send_inside_painting();
|
network_send_inside_painting(timeSinceSend > 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue