From 45c8f9f46fc8a7037cd726279ccfb14e83b3ca19 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 10 Apr 2022 03:07:55 -0700 Subject: [PATCH] Add SM74's geo_choose_area --- data/dynos_mgr_builtin.cpp | 1 + src/game/object_helpers.c | 7 +++++++ src/game/object_helpers.h | 1 + 3 files changed, 9 insertions(+) diff --git a/data/dynos_mgr_builtin.cpp b/data/dynos_mgr_builtin.cpp index 1825e388..0d507cee 100644 --- a/data/dynos_mgr_builtin.cpp +++ b/data/dynos_mgr_builtin.cpp @@ -1382,6 +1382,7 @@ static const void* sDynosBuiltinFuncs[] = { define_builtin(geo_mario_set_player_colors), define_builtin(geo_movtex_draw_water_regions_ext), define_builtin(lvl_init_or_update), + define_builtin(geo_choose_area_ext), }; const void* DynOS_Builtin_Func_GetFromName(const char* aDataName) { diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index da8fc54a..305afd9e 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -237,6 +237,13 @@ Gfx *geo_switch_area(s32 callContext, struct GraphNode *node) { return NULL; } +Gfx *geo_choose_area_ext(UNUSED s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { + struct GraphNodeSwitchCase *switchCase; + switchCase = (struct GraphNodeSwitchCase *) node; + switchCase->selectedCase = sWarpDest.areaIdx-1; + return NULL; +} + void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1) { f32 spC = a1->oParentRelativePosX; f32 sp8 = a1->oParentRelativePosY; diff --git a/src/game/object_helpers.h b/src/game/object_helpers.h index be3ba4b2..25cb9dab 100644 --- a/src/game/object_helpers.h +++ b/src/game/object_helpers.h @@ -79,6 +79,7 @@ Gfx *geo_switch_area(s32 callContext, struct GraphNode *node, UNUSED void *conte Gfx *geo_switch_anim_state(s32 callContext, struct GraphNode *node); Gfx *geo_switch_area(s32 callContext, struct GraphNode *node); #endif +Gfx *geo_choose_area_ext(s32 callContext, UNUSED struct GraphNode *node, Mat4 mtx); void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1); void obj_apply_scale_to_matrix(struct Object *obj, Mat4 dst, Mat4 src); void create_transformation_from_matrices(Mat4 a0, Mat4 a1, Mat4 a2);