From 3a93423fcc4af71c2d2dc1200202eb6c59b463bc Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 16 May 2023 00:05:26 -0700 Subject: [PATCH] Make certain GraphNodeObject fields mutable again --- autogen/convert_structs.py | 2 +- autogen/lua_definitions/constants.lua | 9 ----- docs/lua/constants.md | 3 -- docs/lua/structs.md | 6 ++-- src/pc/lua/smlua_cobject_autogen.c | 52 +++++++++++++-------------- src/pc/lua/smlua_constants_autogen.c | 3 -- 6 files changed, 30 insertions(+), 45 deletions(-) diff --git a/autogen/convert_structs.py b/autogen/convert_structs.py index b87fbc85..c7cf82fa 100644 --- a/autogen/convert_structs.py +++ b/autogen/convert_structs.py @@ -101,7 +101,7 @@ override_field_immutable = { "SpawnInfo": [ "syncID", "next", "unk18" ], "CustomLevelInfo": [ "next" ], "GraphNode": [ "children", "next", "parent", "prev", "type" ], - "GraphNodeObject": [ "*" ], + "GraphNodeObject": [ "activeAreaIndex", "angle", "animInfo", "areaIndex", "cameraToObject", "node", "pos", "prevAngle", "prevPos", "prevScale", "prevScaleTimestamp", "prevShadowPos", "prevShadowPosTimestamp", "prevThrowMatrix", "prevThrowMatrixTimestamp", "prevTimestamp", "scale", "shadowPos", "sharedChild", "skipInterpolationTimestamp", "throwMatrix", "throwMatrixPrev", "unk4C", ], "ObjectWarpNode": [ "next "], "Animation": [ "length" ], "AnimationTable": [ "count" ], diff --git a/autogen/lua_definitions/constants.lua b/autogen/lua_definitions/constants.lua index 1d61d252..1b7570ef 100644 --- a/autogen/lua_definitions/constants.lua +++ b/autogen/lua_definitions/constants.lua @@ -342,15 +342,6 @@ INSTANT_WARP_INDEX_START = 0x00 --- @type integer INSTANT_WARP_INDEX_STOP = 0x04 ---- @type integer -LOADED_GRAPH_NODES_EXTENDED = 512 - ---- @type integer -LOADED_GRAPH_NODES_VANILLA = 256 - ---- @type integer -MAX_LOADED_GRAPH_NODES = (LOADED_GRAPH_NODES_VANILLA + LOADED_GRAPH_NODES_EXTENDED) - --- @type integer WARP_TRANSITION_FADE_FROM_BOWSER = 0x12 diff --git a/docs/lua/constants.md b/docs/lua/constants.md index 1f34b40f..08405419 100644 --- a/docs/lua/constants.md +++ b/docs/lua/constants.md @@ -70,9 +70,6 @@ ## [area.h](#area.h) - INSTANT_WARP_INDEX_START - INSTANT_WARP_INDEX_STOP -- LOADED_GRAPH_NODES_EXTENDED -- LOADED_GRAPH_NODES_VANILLA -- MAX_LOADED_GRAPH_NODES - WARP_TRANSITION_FADE_FROM_BOWSER - WARP_TRANSITION_FADE_FROM_CIRCLE - WARP_TRANSITION_FADE_FROM_COLOR diff --git a/docs/lua/structs.md b/docs/lua/structs.md index caaa0e52..1aff3a86 100644 --- a/docs/lua/structs.md +++ b/docs/lua/structs.md @@ -831,7 +831,7 @@ | animInfo | [AnimInfo](structs.md#AnimInfo) | read-only | | areaIndex | `integer` | read-only | | cameraToObject | [Vec3f](structs.md#Vec3f) | read-only | -| disableAutomaticShadowPos | `boolean` | read-only | +| disableAutomaticShadowPos | `boolean` | | | node | [GraphNode](structs.md#GraphNode) | read-only | | pos | [Vec3f](structs.md#Vec3f) | read-only | | prevAngle | [Vec3s](structs.md#Vec3s) | read-only | @@ -844,10 +844,10 @@ | prevThrowMatrixTimestamp | `integer` | read-only | | prevTimestamp | `integer` | read-only | | scale | [Vec3f](structs.md#Vec3f) | read-only | -| shadowInvisible | `boolean` | read-only | +| shadowInvisible | `boolean` | | | shadowPos | [Vec3f](structs.md#Vec3f) | read-only | | sharedChild | [GraphNode](structs.md#GraphNode) | read-only | -| skipInViewCheck | `boolean` | read-only | +| skipInViewCheck | `boolean` | | | skipInterpolationTimestamp | `integer` | read-only | | throwMatrix | `Pointer` <`Mat4`> | read-only | | throwMatrixPrev | `Pointer` <`Mat4`> | read-only | diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index fb3e18b2..8966c05c 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -644,32 +644,32 @@ static struct LuaObjectField sGraphNodeFields[LUA_GRAPH_NODE_FIELD_COUNT] = { #define LUA_GRAPH_NODE_OBJECT_FIELD_COUNT 26 static struct LuaObjectField sGraphNodeObjectFields[LUA_GRAPH_NODE_OBJECT_FIELD_COUNT] = { - { "activeAreaIndex", LVT_S8, offsetof(struct GraphNodeObject, activeAreaIndex), true, LOT_NONE }, - { "angle", LVT_COBJECT, offsetof(struct GraphNodeObject, angle), true, LOT_VEC3S }, - { "animInfo", LVT_COBJECT, offsetof(struct GraphNodeObject, animInfo), true, LOT_ANIMINFO }, - { "areaIndex", LVT_S8, offsetof(struct GraphNodeObject, areaIndex), true, LOT_NONE }, - { "cameraToObject", LVT_COBJECT, offsetof(struct GraphNodeObject, cameraToObject), true, LOT_VEC3F }, - { "disableAutomaticShadowPos", LVT_BOOL, offsetof(struct GraphNodeObject, disableAutomaticShadowPos), true, LOT_NONE }, - { "node", LVT_COBJECT, offsetof(struct GraphNodeObject, node), true, LOT_GRAPHNODE }, - { "pos", LVT_COBJECT, offsetof(struct GraphNodeObject, pos), true, LOT_VEC3F }, - { "prevAngle", LVT_COBJECT, offsetof(struct GraphNodeObject, prevAngle), true, LOT_VEC3S }, - { "prevPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevPos), true, LOT_VEC3F }, - { "prevScale", LVT_COBJECT, offsetof(struct GraphNodeObject, prevScale), true, LOT_VEC3F }, - { "prevScaleTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevScaleTimestamp), true, LOT_NONE }, - { "prevShadowPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevShadowPos), true, LOT_VEC3F }, - { "prevShadowPosTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevShadowPosTimestamp), true, LOT_NONE }, - { "prevThrowMatrix", LVT_COBJECT, offsetof(struct GraphNodeObject, prevThrowMatrix), true, LOT_MAT4 }, - { "prevThrowMatrixTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevThrowMatrixTimestamp), true, LOT_NONE }, - { "prevTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevTimestamp), true, LOT_NONE }, - { "scale", LVT_COBJECT, offsetof(struct GraphNodeObject, scale), true, LOT_VEC3F }, - { "shadowInvisible", LVT_BOOL, offsetof(struct GraphNodeObject, shadowInvisible), true, LOT_NONE }, - { "shadowPos", LVT_COBJECT, offsetof(struct GraphNodeObject, shadowPos), true, LOT_VEC3F }, - { "sharedChild", LVT_COBJECT_P, offsetof(struct GraphNodeObject, sharedChild), true, LOT_GRAPHNODE }, - { "skipInViewCheck", LVT_BOOL, offsetof(struct GraphNodeObject, skipInViewCheck), true, LOT_NONE }, - { "skipInterpolationTimestamp", LVT_U32, offsetof(struct GraphNodeObject, skipInterpolationTimestamp), true, LOT_NONE }, - { "throwMatrix", LVT_COBJECT_P, offsetof(struct GraphNodeObject, throwMatrix), true, LOT_POINTER }, - { "throwMatrixPrev", LVT_COBJECT_P, offsetof(struct GraphNodeObject, throwMatrixPrev), true, LOT_POINTER }, - { "unk4C", LVT_COBJECT_P, offsetof(struct GraphNodeObject, unk4C), true, LOT_SPAWNINFO }, + { "activeAreaIndex", LVT_S8, offsetof(struct GraphNodeObject, activeAreaIndex), true, LOT_NONE }, + { "angle", LVT_COBJECT, offsetof(struct GraphNodeObject, angle), true, LOT_VEC3S }, + { "animInfo", LVT_COBJECT, offsetof(struct GraphNodeObject, animInfo), true, LOT_ANIMINFO }, + { "areaIndex", LVT_S8, offsetof(struct GraphNodeObject, areaIndex), true, LOT_NONE }, + { "cameraToObject", LVT_COBJECT, offsetof(struct GraphNodeObject, cameraToObject), true, LOT_VEC3F }, + { "disableAutomaticShadowPos", LVT_BOOL, offsetof(struct GraphNodeObject, disableAutomaticShadowPos), false, LOT_NONE }, + { "node", LVT_COBJECT, offsetof(struct GraphNodeObject, node), true, LOT_GRAPHNODE }, + { "pos", LVT_COBJECT, offsetof(struct GraphNodeObject, pos), true, LOT_VEC3F }, + { "prevAngle", LVT_COBJECT, offsetof(struct GraphNodeObject, prevAngle), true, LOT_VEC3S }, + { "prevPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevPos), true, LOT_VEC3F }, + { "prevScale", LVT_COBJECT, offsetof(struct GraphNodeObject, prevScale), true, LOT_VEC3F }, + { "prevScaleTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevScaleTimestamp), true, LOT_NONE }, + { "prevShadowPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevShadowPos), true, LOT_VEC3F }, + { "prevShadowPosTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevShadowPosTimestamp), true, LOT_NONE }, + { "prevThrowMatrix", LVT_COBJECT, offsetof(struct GraphNodeObject, prevThrowMatrix), true, LOT_MAT4 }, + { "prevThrowMatrixTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevThrowMatrixTimestamp), true, LOT_NONE }, + { "prevTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevTimestamp), true, LOT_NONE }, + { "scale", LVT_COBJECT, offsetof(struct GraphNodeObject, scale), true, LOT_VEC3F }, + { "shadowInvisible", LVT_BOOL, offsetof(struct GraphNodeObject, shadowInvisible), false, LOT_NONE }, + { "shadowPos", LVT_COBJECT, offsetof(struct GraphNodeObject, shadowPos), true, LOT_VEC3F }, + { "sharedChild", LVT_COBJECT_P, offsetof(struct GraphNodeObject, sharedChild), true, LOT_GRAPHNODE }, + { "skipInViewCheck", LVT_BOOL, offsetof(struct GraphNodeObject, skipInViewCheck), false, LOT_NONE }, + { "skipInterpolationTimestamp", LVT_U32, offsetof(struct GraphNodeObject, skipInterpolationTimestamp), true, LOT_NONE }, + { "throwMatrix", LVT_COBJECT_P, offsetof(struct GraphNodeObject, throwMatrix), true, LOT_POINTER }, + { "throwMatrixPrev", LVT_COBJECT_P, offsetof(struct GraphNodeObject, throwMatrixPrev), true, LOT_POINTER }, + { "unk4C", LVT_COBJECT_P, offsetof(struct GraphNodeObject, unk4C), true, LOT_SPAWNINFO }, }; #define LUA_GRAPH_NODE_802_A45_E4_FIELD_COUNT 6 diff --git a/src/pc/lua/smlua_constants_autogen.c b/src/pc/lua/smlua_constants_autogen.c index a3c51822..2b6628b2 100644 --- a/src/pc/lua/smlua_constants_autogen.c +++ b/src/pc/lua/smlua_constants_autogen.c @@ -307,9 +307,6 @@ char gSmluaConstants[] = "" "COURSE_COUNT = 25\n" "--- @type integer\n" "COURSE_MIN = 1\n" -"LOADED_GRAPH_NODES_VANILLA = 256\n" -"LOADED_GRAPH_NODES_EXTENDED = 512\n" -"MAX_LOADED_GRAPH_NODES = (LOADED_GRAPH_NODES_VANILLA + LOADED_GRAPH_NODES_EXTENDED)\n" "INSTANT_WARP_INDEX_START = 0x00\n" "INSTANT_WARP_INDEX_STOP = 0x04\n" "WARP_TRANSITION_FADE_FROM_COLOR = 0x00\n"