Introduce this new pack in a more proper reviewable manner (#1192)

* Introduce this new pack in a more proper reviewable manner

Ideally I should have made a PR for my new pack and I understand the new geo function may have come out of no where. I've been thinking about adding it for a while and was going to utilize it in a new project I'm working on but I should have explained it first before pushing anything for sure

* Address suggestions

* Restore these, whoops
This commit is contained in:
Agent X 2026-04-21 23:41:44 -04:00 committed by GitHub
parent 638a242763
commit 6919878b40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 21 additions and 0 deletions

View file

@ -2037,6 +2037,7 @@ static const DynosBuiltinFunction sDynosBuiltinFuncs[] = {
define_builtin_function(bhv_ambient_light_update, FUNCTION_BHV),
define_builtin_function(bhv_point_light_init, FUNCTION_BHV),
define_builtin_function(bhv_point_light_loop, FUNCTION_BHV),
define_builtin_function(geo_switch_character_type, FUNCTION_GEO),
};
static const char *sDynosBuiltinFuncTypeNames[] = {

Binary file not shown.

View file

@ -926,3 +926,22 @@ Gfx *geo_process_lua_function(s32 callContext, struct GraphNode *node, UNUSED Ma
return NULL;
}
Gfx *geo_switch_character_type(s32 callContext, struct GraphNode *node, UNUSED void *context) {
struct GraphNodeSwitchCase *switchCase;
if (callContext == GEO_CONTEXT_RENDER) {
// move to a local var because GraphNodes are passed in all geo functions.
// cast the pointer.
switchCase = (struct GraphNodeSwitchCase *) node;
// pass in -1 to always use local mario
// otherwise use the mariostate asssociated with the object
struct MarioState* marioState = switchCase->parameter == -1 ? gMarioState : geo_get_mario_state();
// assign the case number for execution.
switchCase->selectedCase = marioState->character->type;
}
return NULL;
}

View file

@ -38,5 +38,6 @@ Gfx *geo_mirror_mario_backface_culling(s32 callContext, struct GraphNode *node,
Gfx* geo_mario_set_player_colors(s32 callContext, struct GraphNode* node, UNUSED Mat4* c);
Gfx* geo_mario_cap_display_list(s32 callContext, struct GraphNode* node, UNUSED Mat4* c);
Gfx *geo_process_lua_function(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
Gfx *geo_switch_character_type(s32 callContext, struct GraphNode *node, UNUSED void *context);
#endif // MARIO_MISC_H