Color detached caps according to player palette

This commit is contained in:
MysterD 2021-08-06 01:02:07 -07:00
parent 16fb9d3dff
commit 710a7e4749
19 changed files with 59 additions and 24 deletions

View file

@ -31,6 +31,7 @@ const GeoLayout klepto_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(0, geo_offset_klepto_held_object),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 0, 100, 0, 180, 270, 0, mario_cap_seg3_dl_03022F48),
GEO_CLOSE_NODE(),
@ -57,6 +58,7 @@ const GeoLayout klepto_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(0, geo_offset_klepto_held_object),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 0, 100, 0, 180, 270, 0, luigi_cap_seg3_dl_03022F48),
GEO_CLOSE_NODE(),

View file

@ -4,6 +4,7 @@ const GeoLayout luigis_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
@ -21,6 +22,7 @@ const GeoLayout luigis_metal_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
@ -38,6 +40,7 @@ const GeoLayout luigis_wing_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
@ -62,6 +65,7 @@ const GeoLayout luigis_winged_metal_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),

View file

@ -180,8 +180,8 @@ const Gfx luigi_cap_seg3_dl_03022CC8[] = {
// 0x03022D10 - 0x03022D38
const Gfx luigi_cap_seg3_dl_03022D10[] = {
gsSPDisplayList(luigi_cap_seg3_dl_03022B68),
gsSPLight(&luigi_cap_seg3_lights_0301CF08.l, 1),
gsSPLight(&luigi_cap_seg3_lights_0301CF08.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&luigi_cap_seg3_lights_0301CF08.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&luigi_cap_seg3_lights_0301CF08.a, 2),
gsSPDisplayList(luigi_cap_seg3_dl_03022CC8),
gsSPEndDisplayList(),
};
@ -264,8 +264,8 @@ const Gfx luigi_cap_seg3_dl_03022F48[] = {
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, luigi_cap_seg3_texture_0301DF50),
gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
gsSPLight(&luigi_cap_seg3_lights_0301CF38.l, 1),
gsSPLight(&luigi_cap_seg3_lights_0301CF38.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&luigi_cap_seg3_lights_0301CF38.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&luigi_cap_seg3_lights_0301CF38.a, 2),
gsSPDisplayList(luigi_cap_seg3_dl_03022B30),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPPipeSync(),
@ -285,8 +285,8 @@ const Gfx luigi_cap_seg3_dl_03022FF8[] = {
gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE),
gsDPLoadTextureBlock(luigi_cap_seg3_texture_0301CF50, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 6, 5, G_TX_NOLOD, G_TX_NOLOD),
gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_ON),
gsSPLight(&luigi_cap_seg3_lights_0301CF20.l, 1),
gsSPLight(&luigi_cap_seg3_lights_0301CF20.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&luigi_cap_seg3_lights_0301CF20.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&luigi_cap_seg3_lights_0301CF20.a, 2),
gsSPDisplayList(luigi_cap_seg3_dl_03022B30),
gsSPDisplayList(luigi_cap_seg3_dl_03022B68),
gsSPDisplayList(luigi_cap_seg3_dl_03022CC8),
@ -341,8 +341,8 @@ const Gfx luigi_cap_seg3_dl_03023160[] = {
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, luigi_cap_seg3_texture_0301DF50),
gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
gsSPLight(&luigi_cap_seg3_lights_0301CF38.l, 1),
gsSPLight(&luigi_cap_seg3_lights_0301CF38.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&luigi_cap_seg3_lights_0301CF38.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&luigi_cap_seg3_lights_0301CF38.a, 2),
gsSPDisplayList(luigi_cap_seg3_dl_03022B30),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPPipeSync(),
@ -385,8 +385,8 @@ const Gfx luigi_cap_seg3_dl_03023298[] = {
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 6, G_TX_NOLOD),
gsDPSetTileSize(0, 0, 0, (64 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_ON),
gsSPLight(&luigi_cap_seg3_lights_0301CF20.l, 1),
gsSPLight(&luigi_cap_seg3_lights_0301CF20.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&luigi_cap_seg3_lights_0301CF20.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&luigi_cap_seg3_lights_0301CF20.a, 2),
gsSPDisplayList(luigi_cap_seg3_dl_03022B30),
gsSPDisplayList(luigi_cap_seg3_dl_03022B68),
gsSPDisplayList(luigi_cap_seg3_dl_03022CC8),

View file

@ -4,6 +4,7 @@ const GeoLayout marios_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
@ -21,6 +22,7 @@ const GeoLayout marios_metal_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
@ -38,6 +40,7 @@ const GeoLayout marios_wing_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
@ -62,6 +65,7 @@ const GeoLayout marios_winged_metal_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),

View file

@ -180,8 +180,8 @@ const Gfx mario_cap_seg3_dl_03022CC8[] = {
// 0x03022D10 - 0x03022D38
const Gfx mario_cap_seg3_dl_03022D10[] = {
gsSPDisplayList(mario_cap_seg3_dl_03022B68),
gsSPLight(&mario_cap_seg3_lights_0301CF08.l, 1),
gsSPLight(&mario_cap_seg3_lights_0301CF08.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&mario_cap_seg3_lights_0301CF08.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&mario_cap_seg3_lights_0301CF08.a, 2),
gsSPDisplayList(mario_cap_seg3_dl_03022CC8),
gsSPEndDisplayList(),
};
@ -264,8 +264,8 @@ const Gfx mario_cap_seg3_dl_03022F48[] = {
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_cap_seg3_texture_0301DF50),
gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
gsSPLight(&mario_cap_seg3_lights_0301CF38.l, 1),
gsSPLight(&mario_cap_seg3_lights_0301CF38.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&mario_cap_seg3_lights_0301CF38.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&mario_cap_seg3_lights_0301CF38.a, 2),
gsSPDisplayList(mario_cap_seg3_dl_03022B30),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPPipeSync(),
@ -285,8 +285,8 @@ const Gfx mario_cap_seg3_dl_03022FF8[] = {
gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE),
gsDPLoadTextureBlock(mario_cap_seg3_texture_0301CF50, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 6, 5, G_TX_NOLOD, G_TX_NOLOD),
gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_ON),
gsSPLight(&mario_cap_seg3_lights_0301CF20.l, 1),
gsSPLight(&mario_cap_seg3_lights_0301CF20.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&mario_cap_seg3_lights_0301CF20.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&mario_cap_seg3_lights_0301CF20.a, 2),
gsSPDisplayList(mario_cap_seg3_dl_03022B30),
gsSPDisplayList(mario_cap_seg3_dl_03022B68),
gsSPDisplayList(mario_cap_seg3_dl_03022CC8),
@ -341,8 +341,8 @@ const Gfx mario_cap_seg3_dl_03023160[] = {
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_cap_seg3_texture_0301DF50),
gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
gsSPLight(&mario_cap_seg3_lights_0301CF38.l, 1),
gsSPLight(&mario_cap_seg3_lights_0301CF38.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&mario_cap_seg3_lights_0301CF38.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&mario_cap_seg3_lights_0301CF38.a, 2),
gsSPDisplayList(mario_cap_seg3_dl_03022B30),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPPipeSync(),
@ -385,8 +385,8 @@ const Gfx mario_cap_seg3_dl_03023298[] = {
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 6, G_TX_NOLOD),
gsDPSetTileSize(0, 0, 0, (64 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_ON),
gsSPLight(&mario_cap_seg3_lights_0301CF20.l, 1),
gsSPLight(&mario_cap_seg3_lights_0301CF20.a, 2),
gsSPCopyLightEXT(1, 5), //gsSPLight(&mario_cap_seg3_lights_0301CF20.l, 1),
gsSPCopyLightEXT(2, 6), //gsSPLight(&mario_cap_seg3_lights_0301CF20.a, 2),
gsSPDisplayList(mario_cap_seg3_dl_03022B30),
gsSPDisplayList(mario_cap_seg3_dl_03022B68),
gsSPDisplayList(mario_cap_seg3_dl_03022CC8),

View file

@ -28,6 +28,7 @@ const GeoLayout mr_blizzard_hidden_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 490, 14, 43, 305, 0, 248, mario_cap_seg3_dl_03022F48),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),

View file

@ -22,6 +22,7 @@ const GeoLayout ukiki_geo[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, ukiki_seg5_dl_0500B2E8),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 100, 0, 0, -90, -90, 0, mario_cap_seg3_dl_03022F48),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
@ -29,6 +30,7 @@ const GeoLayout ukiki_geo[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, ukiki_seg5_dl_0500B310),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 100, 0, 0, -90, -90, 0, mario_cap_seg3_dl_03022F48),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
@ -36,6 +38,7 @@ const GeoLayout ukiki_geo[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, ukiki_seg5_dl_0500B2E8),
GEO_OPEN_NODE(),
GEO_ASM(0, geo_mario_set_player_colors),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 100, 0, 0, -90, -90, 0, luigi_cap_seg3_dl_03022F48),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),

View file

@ -222,6 +222,7 @@ struct Object
/*0x25C*/ void *respawnInfo;
/*?????*/ u8 createdThroughNetwork;
/*?????*/ u32 areaTimer;
/*?????*/ u8 globalPlayerIndex;
};
struct ObjectHitbox

View file

@ -122,6 +122,7 @@ void bhv_klepto_init(void) {
network_init_object_field(o, &o->oHomeZ);
network_init_object_field(o, &o->oMoveAnglePitch);
network_init_object_field(o, &o->oGravity);
network_init_object_field(o, &o->globalPlayerIndex);
}
static void klepto_change_target(void) {
@ -290,8 +291,9 @@ static void klepto_act_dive_at_mario(void) {
if (marioState->action != ACT_SLEEPING
&& !(marioState->action & (ACT_FLAG_SHORT_HITBOX | ACT_FLAG_BUTT_OR_STOMACH_SLIDE))
&& distanceToPlayer < 200.0f && dy > 50.0f && dy < 90.0f) {
if (network_owns_object(o) && mario_lose_cap_to_enemy(marioState, 1)) {
if (network_owns_object(o) && mario_lose_cap_to_enemy(marioState, 1) && marioState->playerIndex == 0) {
o->oAnimState = marioState->character->capKleptoAnimState;
o->globalPlayerIndex = gNetworkPlayers[marioState->playerIndex].globalIndex;
network_send_object(o);
}
}
@ -427,6 +429,7 @@ void bhv_klepto_update(void) {
save_file_clear_flags(SAVE_FLAG_CAP_ON_KLEPTO);
struct Object* cap = spawn_object(o, capModel, bhvNormalCap);
cap->globalPlayerIndex = o->globalPlayerIndex;
struct Object* spawn_objects[] = { cap };
u32 models[] = { capModel };

View file

@ -248,6 +248,7 @@ static void mr_blizzard_act_death(void) {
cap = spawn_object_relative(0, 5, 105, 0, o, MODEL_MARIOS_CAP, bhvNormalCap);
if (cap != NULL) {
cap->globalPlayerIndex = o->globalPlayerIndex;
cap->oMoveAngleYaw = o->oFaceAngleYaw + (o->oFaceAngleRoll < 0 ? 0x4000 : -0x4000);
cap->oForwardVel = 10.0f;
}

View file

@ -605,6 +605,8 @@ void hat_ukiki_held_loop(void) {
if (mario_lose_cap_to_enemy(heldByMario, 2)) {
o->oUkikiTextState = UKIKI_TEXT_STEAL_HAT;
o->oUkikiHasHat |= UKIKI_HAT_ON;
o->globalPlayerIndex = gNetworkPlayers[heldByMario->playerIndex].globalIndex;
network_send_object(o);
} else {}
break;
@ -612,6 +614,7 @@ void hat_ukiki_held_loop(void) {
if (should_start_or_continue_dialog(heldByMario, o) && cur_obj_update_dialog(heldByMario, 2, 2, DIALOG_100, 0, hat_ukiki_held_loop_1)) {
o->oInteractionSubtype |= INT_SUBTYPE_DROP_IMMEDIATELY;
o->oUkikiTextState = UKIKI_TEXT_STOLE_HAT;
network_send_object(o);
}
break;
@ -624,6 +627,7 @@ void hat_ukiki_held_loop(void) {
set_mario_npc_dialog(heldByMario, 0, NULL);
o->oUkikiHasHat &= ~UKIKI_HAT_ON;
o->oUkikiTextState = UKIKI_TEXT_GAVE_HAT_BACK;
network_send_object(o);
}
break;
@ -651,6 +655,7 @@ void bhv_ukiki_init(void) {
network_init_object_field(o, &o->oUkikiChaseFleeRange);
network_init_object_field(o, &o->oUkikiCageSpinTimer);
network_init_object_field(o, &o->oIntangibleTimer);
network_init_object_field(o, &o->globalPlayerIndex);
}
/**

View file

@ -391,6 +391,8 @@ void mario_blow_off_cap(struct MarioState *m, f32 capSpeed) {
u8 capModel = m->character->capModelId;
capObject = spawn_object(m->marioObj, capModel, bhvNormalCap);
capObject->globalPlayerIndex = gNetworkPlayers[m->playerIndex].globalIndex;
capObject->oBehParams = m->playerIndex + 1;
capObject->oPosY += (m->action & ACT_FLAG_SHORT_HITBOX) ? 120.0f : 180.0f;
capObject->oForwardVel = capSpeed;

View file

@ -397,7 +397,9 @@ static u8 geo_get_processing_object_index(void) {
}
}
if (gCurGraphNodeProcessingObject == NULL) { return 0; }
u8 index = gCurGraphNodeProcessingObject->oBehParams - 1;
struct NetworkPlayer* np = network_player_from_global_index(gCurGraphNodeProcessingObject->globalPlayerIndex);
u8 index = (np == NULL) ? 0 : np->localIndex;
return (index >= MAX_PLAYERS) ? 0 : index;
}

View file

@ -31,6 +31,7 @@ Gfx *geo_mario_rotate_wing_cap_wings(s32 callContext, struct GraphNode *node, UN
Gfx *geo_switch_mario_hand_grab_pos(s32 callContext, struct GraphNode *b, Mat4 *mtx);
Gfx *geo_render_mirror_mario(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
Gfx *geo_mirror_mario_backface_culling(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
Gfx *geo_mario_set_player_colors(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
Gfx* geo_mario_set_player_colors(s32 callContext, struct GraphNode* node, UNUSED Mat4* c);
Gfx* geo_klepto_set_player_colors(s32 callContext, struct GraphNode* node, UNUSED Mat4* c);
#endif // MARIO_MISC_H

View file

@ -594,6 +594,7 @@ struct Object *spawn_object_at_origin(struct Object *parent, UNUSED s32 unusedAr
obj->parentObj = parent;
obj->header.gfx.unk18 = parent->header.gfx.unk18;
obj->header.gfx.unk19 = parent->header.gfx.unk18;
obj->globalPlayerIndex = 0;
geo_obj_init((struct GraphNodeObject *) &obj->header.gfx, gLoadedGraphNodes[model], gVec3fZero,
gVec3sZero);

View file

@ -266,6 +266,7 @@ void bhv_mario_update(void) {
for (int i = 0; i < MAX_PLAYERS; i++) {
if (gMarioStates[i].marioObj == NULL) { continue; }
gMarioStates[i].marioObj->oBehParams = i + 1;
gMarioStates[i].marioObj->globalPlayerIndex = gNetworkPlayers[i].globalIndex;
}
// set mario state to the current player

View file

@ -19,7 +19,6 @@ static u8 warpToArea = 29;
// warpToArea: 27 = upstairs
// warpToArea: 29 = courtyard
#define SCANCODE_0 0x0B
#define SCANCODE_1 0x02
#define SCANCODE_2 0x03

View file

@ -115,6 +115,7 @@ void djui_panel_update(void) {
djui_base_set_visible(parentBase, false);
}
djui_base_set_enabled(activeBase, true);
activeBase->y.value = 0;
djui_cursor_input_controlled_center(sPanelList->defaultElementBase);
if (removingBase != NULL) {

View file

@ -19,6 +19,7 @@ struct SpawnObjectData {
u16 behaviorId;
s16 activeFlags;
s32 rawData[80];
u8 globalPlayerIndex;
};
static u8 generate_parent_id(struct Object* objects[], u8 onIndex, bool sanitize) {
@ -70,6 +71,7 @@ void network_send_spawn_objects_to(u8 sendToLocalIndex, struct Object* objects[]
packet_write(&p, &o->header.gfx.scale[0], sizeof(f32));
packet_write(&p, &o->header.gfx.scale[1], sizeof(f32));
packet_write(&p, &o->header.gfx.scale[2], sizeof(f32));
packet_write(&p, &o->globalPlayerIndex, sizeof(u8));
}
if (sendToLocalIndex == PACKET_DESTINATION_BROADCAST) {
@ -101,6 +103,7 @@ void network_receive_spawn_objects(struct Packet* p) {
packet_read(p, &scale[0], sizeof(f32));
packet_read(p, &scale[1], sizeof(f32));
packet_read(p, &scale[2], sizeof(f32));
packet_read(p, &data.globalPlayerIndex, sizeof(u8));
struct Object* parentObj = NULL;
if (data.parentId == (u8)-1) {
@ -127,6 +130,7 @@ void network_receive_spawn_objects(struct Packet* p) {
void* behavior = (void*)get_behavior_from_id(data.behaviorId);
struct Object* o = spawn_object(parentObj, data.model, behavior);
o->globalPlayerIndex = data.globalPlayerIndex;
o->createdThroughNetwork = true;
memcpy(o->rawData.asU32, data.rawData, sizeof(u32) * 80);