change misleading switch case field label (#781)
This commit is contained in:
parent
7568a8564f
commit
af6e0afbcf
@ -33,7 +33,7 @@ Gfx *geo_num3_switch(s32 callContext, struct GraphNode *node, UNUSED void *conte
|
|||||||
s32 number = ((struct Object *) gCurGraphNodeObject)->oBehParams2ndByte;
|
s32 number = ((struct Object *) gCurGraphNodeObject)->oBehParams2ndByte;
|
||||||
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node;
|
struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node;
|
||||||
s32 numMin, numMax, numDiv;
|
s32 numMin, numMax, numDiv;
|
||||||
switch (switchCase->numCases) {
|
switch (switchCase->parameter) {
|
||||||
case 0: numMin = 0; numMax = 9; numDiv = 1; break;
|
case 0: numMin = 0; numMax = 9; numDiv = 1; break;
|
||||||
case 1: numMin = 10; numMax = 99; numDiv = 10; break;
|
case 1: numMin = 10; numMax = 99; numDiv = 10; break;
|
||||||
case 2: numMin = 10; numMax = 99; numDiv = 1; break;
|
case 2: numMin = 10; numMax = 99; numDiv = 1; break;
|
||||||
|
@ -128,7 +128,7 @@ override_field_immutable = {
|
|||||||
"GraphNodeObject": [ "angle", "animInfo", "cameraToObject", "node", "pos", "prevAngle", "prevPos", "prevScale", "prevScaleTimestamp", "prevShadowPos", "prevShadowPosTimestamp", "prevThrowMatrix", "prevThrowMatrixTimestamp", "prevTimestamp", "scale", "shadowPos", "sharedChild", "skipInterpolationTimestamp", "throwMatrixPrev", "unk4C", ],
|
"GraphNodeObject": [ "angle", "animInfo", "cameraToObject", "node", "pos", "prevAngle", "prevPos", "prevScale", "prevScaleTimestamp", "prevShadowPos", "prevShadowPosTimestamp", "prevThrowMatrix", "prevThrowMatrixTimestamp", "prevTimestamp", "scale", "shadowPos", "sharedChild", "skipInterpolationTimestamp", "throwMatrixPrev", "unk4C", ],
|
||||||
"GraphNodeObjectParent": [ "sharedChild" ],
|
"GraphNodeObjectParent": [ "sharedChild" ],
|
||||||
"GraphNodePerspective": [ "unused" ],
|
"GraphNodePerspective": [ "unused" ],
|
||||||
"GraphNodeSwitchCase": [ "fnNode", "numCases", "unused" ],
|
"GraphNodeSwitchCase": [ "fnNode", "unused" ],
|
||||||
"ObjectWarpNode": [ "next "],
|
"ObjectWarpNode": [ "next "],
|
||||||
"Animation": [ "length" ],
|
"Animation": [ "length" ],
|
||||||
"AnimationTable": [ "count" ],
|
"AnimationTable": [ "count" ],
|
||||||
|
@ -974,7 +974,7 @@
|
|||||||
|
|
||||||
--- @class GraphNodeSwitchCase
|
--- @class GraphNodeSwitchCase
|
||||||
--- @field public fnNode FnGraphNode
|
--- @field public fnNode FnGraphNode
|
||||||
--- @field public numCases integer
|
--- @field public parameter integer
|
||||||
--- @field public selectedCase integer
|
--- @field public selectedCase integer
|
||||||
--- @field public unused integer
|
--- @field public unused integer
|
||||||
|
|
||||||
|
@ -1489,7 +1489,7 @@
|
|||||||
| Field | Type | Access |
|
| Field | Type | Access |
|
||||||
| ----- | ---- | ------ |
|
| ----- | ---- | ------ |
|
||||||
| fnNode | [FnGraphNode](structs.md#FnGraphNode) | read-only |
|
| fnNode | [FnGraphNode](structs.md#FnGraphNode) | read-only |
|
||||||
| numCases | `integer` | read-only |
|
| parameter | `integer` | |
|
||||||
| selectedCase | `integer` | |
|
| selectedCase | `integer` | |
|
||||||
| unused | `integer` | read-only |
|
| unused | `integer` | read-only |
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ enum SkyBackgroundParams {
|
|||||||
/**
|
/**
|
||||||
* 0x0E: Create switch-case scene graph node
|
* 0x0E: Create switch-case scene graph node
|
||||||
* 0x01: unused
|
* 0x01: unused
|
||||||
* 0x02: s16 numCases
|
* 0x02: s16 parameter
|
||||||
* 0x04: GraphNodeFunc caseSelectorFunc
|
* 0x04: GraphNodeFunc caseSelectorFunc
|
||||||
*/
|
*/
|
||||||
#define GEO_SWITCH_CASE(count, function) \
|
#define GEO_SWITCH_CASE(count, function) \
|
||||||
|
@ -342,7 +342,7 @@ void geo_layout_cmd_node_switch_case(void) {
|
|||||||
|
|
||||||
graphNode =
|
graphNode =
|
||||||
init_graph_node_switch_case(gGraphNodePool, NULL,
|
init_graph_node_switch_case(gGraphNodePool, NULL,
|
||||||
cur_geo_cmd_s16(0x02), // case which is initially selected
|
cur_geo_cmd_s16(0x02), // parameter used by switch func
|
||||||
0,
|
0,
|
||||||
(GraphNodeFunc) cur_geo_cmd_ptr(0x04), // case update function
|
(GraphNodeFunc) cur_geo_cmd_ptr(0x04), // case update function
|
||||||
0);
|
0);
|
||||||
@ -800,7 +800,7 @@ void geo_layout_cmd_node_switch_case_ext(void) {
|
|||||||
|
|
||||||
graphNode = init_graph_node_switch_case(
|
graphNode = init_graph_node_switch_case(
|
||||||
gGraphNodePool, NULL,
|
gGraphNodePool, NULL,
|
||||||
cur_geo_cmd_s16(0x02), // num cases
|
cur_geo_cmd_s16(0x02), // parameter used by switch func
|
||||||
0,
|
0,
|
||||||
(GraphNodeFunc) geo_process_lua_function,
|
(GraphNodeFunc) geo_process_lua_function,
|
||||||
0
|
0
|
||||||
|
@ -169,7 +169,7 @@ struct GraphNodeLevelOfDetail *init_graph_node_render_range(struct DynamicPool *
|
|||||||
*/
|
*/
|
||||||
struct GraphNodeSwitchCase *init_graph_node_switch_case(struct DynamicPool *pool,
|
struct GraphNodeSwitchCase *init_graph_node_switch_case(struct DynamicPool *pool,
|
||||||
struct GraphNodeSwitchCase *graphNode,
|
struct GraphNodeSwitchCase *graphNode,
|
||||||
s16 numCases, s16 selectedCase,
|
s16 parameter, s16 selectedCase,
|
||||||
GraphNodeFunc nodeFunc, s32 unused) {
|
GraphNodeFunc nodeFunc, s32 unused) {
|
||||||
if (pool != NULL) {
|
if (pool != NULL) {
|
||||||
graphNode = dynamic_pool_alloc(pool, sizeof(struct GraphNodeSwitchCase));
|
graphNode = dynamic_pool_alloc(pool, sizeof(struct GraphNodeSwitchCase));
|
||||||
@ -177,7 +177,7 @@ struct GraphNodeSwitchCase *init_graph_node_switch_case(struct DynamicPool *pool
|
|||||||
|
|
||||||
if (graphNode != NULL) {
|
if (graphNode != NULL) {
|
||||||
init_scene_graph_node_links(&graphNode->fnNode.node, GRAPH_NODE_TYPE_SWITCH_CASE);
|
init_scene_graph_node_links(&graphNode->fnNode.node, GRAPH_NODE_TYPE_SWITCH_CASE);
|
||||||
graphNode->numCases = numCases;
|
graphNode->parameter = parameter;
|
||||||
graphNode->selectedCase = selectedCase;
|
graphNode->selectedCase = selectedCase;
|
||||||
graphNode->fnNode.func = nodeFunc;
|
graphNode->fnNode.func = nodeFunc;
|
||||||
graphNode->unused = unused;
|
graphNode->unused = unused;
|
||||||
|
@ -175,7 +175,7 @@ struct GraphNodeSwitchCase
|
|||||||
{
|
{
|
||||||
/*0x00*/ struct FnGraphNode fnNode;
|
/*0x00*/ struct FnGraphNode fnNode;
|
||||||
/*0x18*/ s32 unused;
|
/*0x18*/ s32 unused;
|
||||||
/*0x1C*/ s16 numCases;
|
/*0x1C*/ s16 parameter;
|
||||||
/*0x1E*/ s16 selectedCase;
|
/*0x1E*/ s16 selectedCase;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ struct GraphNodeMasterList *init_graph_node_master_list(struct DynamicPool *pool
|
|||||||
struct GraphNodeLevelOfDetail *init_graph_node_render_range(struct DynamicPool *pool, struct GraphNodeLevelOfDetail *graphNode,
|
struct GraphNodeLevelOfDetail *init_graph_node_render_range(struct DynamicPool *pool, struct GraphNodeLevelOfDetail *graphNode,
|
||||||
s16 minDistance, s16 maxDistance);
|
s16 minDistance, s16 maxDistance);
|
||||||
struct GraphNodeSwitchCase *init_graph_node_switch_case(struct DynamicPool *pool, struct GraphNodeSwitchCase *graphNode,
|
struct GraphNodeSwitchCase *init_graph_node_switch_case(struct DynamicPool *pool, struct GraphNodeSwitchCase *graphNode,
|
||||||
s16 numCases, s16 selectedCase, GraphNodeFunc nodeFunc, s32 unused);
|
s16 parameter, s16 selectedCase, GraphNodeFunc nodeFunc, s32 unused);
|
||||||
struct GraphNodeCamera *init_graph_node_camera(struct DynamicPool *pool, struct GraphNodeCamera *graphNode,
|
struct GraphNodeCamera *init_graph_node_camera(struct DynamicPool *pool, struct GraphNodeCamera *graphNode,
|
||||||
f32 *pos, f32 *focus, GraphNodeFunc func, s32 mode);
|
f32 *pos, f32 *focus, GraphNodeFunc func, s32 mode);
|
||||||
struct GraphNodeTranslationRotation *init_graph_node_translation_rotation(struct DynamicPool *pool, struct GraphNodeTranslationRotation *graphNode,
|
struct GraphNodeTranslationRotation *init_graph_node_translation_rotation(struct DynamicPool *pool, struct GraphNodeTranslationRotation *graphNode,
|
||||||
|
@ -401,7 +401,7 @@ Gfx* geo_switch_mario_eyes(s32 callContext, struct GraphNode* node, UNUSED Mat4*
|
|||||||
|
|
||||||
if (callContext == GEO_CONTEXT_RENDER) {
|
if (callContext == GEO_CONTEXT_RENDER) {
|
||||||
if (bodyState->eyeState == 0) {
|
if (bodyState->eyeState == 0) {
|
||||||
blinkFrame = ((switchCase->numCases * 32 + (gAreaUpdateCounter + geo_get_processing_object_index() * 32)) >> 1) & 0x1F;
|
blinkFrame = ((switchCase->parameter * 32 + (gAreaUpdateCounter + geo_get_processing_object_index() * 32)) >> 1) & 0x1F;
|
||||||
if (blinkFrame < 7) {
|
if (blinkFrame < 7) {
|
||||||
switchCase->selectedCase = gMarioBlinkAnimation[blinkFrame];
|
switchCase->selectedCase = gMarioBlinkAnimation[blinkFrame];
|
||||||
}
|
}
|
||||||
@ -511,7 +511,7 @@ Gfx* geo_switch_mario_hand(s32 callContext, struct GraphNode* node, UNUSED Mat4*
|
|||||||
switchCase->selectedCase = ((bodyState->action & ACT_FLAG_SWIMMING_OR_FLYING) != 0);
|
switchCase->selectedCase = ((bodyState->action & ACT_FLAG_SWIMMING_OR_FLYING) != 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (switchCase->numCases == 0) {
|
if (switchCase->parameter == 0) {
|
||||||
switchCase->selectedCase =
|
switchCase->selectedCase =
|
||||||
(bodyState->handState < 5) ? bodyState->handState : MARIO_HAND_OPEN;
|
(bodyState->handState < 5) ? bodyState->handState : MARIO_HAND_OPEN;
|
||||||
}
|
}
|
||||||
|
@ -172,9 +172,9 @@ Gfx *geo_switch_anim_state(s32 callContext, struct GraphNode *node) {
|
|||||||
obj = gCurGraphNodeHeldObject->objNode;
|
obj = gCurGraphNodeHeldObject->objNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the case is greater than the number of cases, set to 0 to avoid overflowing
|
// if the case is greater than the number of anim states, set to 0 to avoid overflowing
|
||||||
// the switch.
|
// the switch.
|
||||||
if (obj->oAnimState >= switchCase->numCases) {
|
if (obj->oAnimState >= switchCase->parameter) {
|
||||||
obj->oAnimState = 0;
|
obj->oAnimState = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1229,7 +1229,7 @@ static struct LuaObjectField sGraphNodeStartFields[LUA_GRAPH_NODE_START_FIELD_CO
|
|||||||
#define LUA_GRAPH_NODE_SWITCH_CASE_FIELD_COUNT 4
|
#define LUA_GRAPH_NODE_SWITCH_CASE_FIELD_COUNT 4
|
||||||
static struct LuaObjectField sGraphNodeSwitchCaseFields[LUA_GRAPH_NODE_SWITCH_CASE_FIELD_COUNT] = {
|
static struct LuaObjectField sGraphNodeSwitchCaseFields[LUA_GRAPH_NODE_SWITCH_CASE_FIELD_COUNT] = {
|
||||||
{ "fnNode", LVT_COBJECT, offsetof(struct GraphNodeSwitchCase, fnNode), true, LOT_FNGRAPHNODE, 1, sizeof(struct FnGraphNode) },
|
{ "fnNode", LVT_COBJECT, offsetof(struct GraphNodeSwitchCase, fnNode), true, LOT_FNGRAPHNODE, 1, sizeof(struct FnGraphNode) },
|
||||||
{ "numCases", LVT_S16, offsetof(struct GraphNodeSwitchCase, numCases), true, LOT_NONE, 1, sizeof(s16) },
|
{ "parameter", LVT_S16, offsetof(struct GraphNodeSwitchCase, parameter), false, LOT_NONE, 1, sizeof(s16) },
|
||||||
{ "selectedCase", LVT_S16, offsetof(struct GraphNodeSwitchCase, selectedCase), false, LOT_NONE, 1, sizeof(s16) },
|
{ "selectedCase", LVT_S16, offsetof(struct GraphNodeSwitchCase, selectedCase), false, LOT_NONE, 1, sizeof(s16) },
|
||||||
{ "unused", LVT_S32, offsetof(struct GraphNodeSwitchCase, unused), true, LOT_NONE, 1, sizeof(s32) },
|
{ "unused", LVT_S32, offsetof(struct GraphNodeSwitchCase, unused), true, LOT_NONE, 1, sizeof(s32) },
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user