mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Revert "Reset Mario animations on server shutdown"
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
This reverts commit 7405ae7244.
Make Animation and AnimationTable fields immutable
Fix variable type in music_changed_through_warp
This commit is contained in:
parent
da13adf72c
commit
653056bd10
10 changed files with 26 additions and 63 deletions
|
|
@ -132,7 +132,7 @@ override_disallowed_functions = {
|
|||
"src/pc/djui/djui_hud_utils.h": [ "djui_hud_render_texture_raw", "djui_hud_render_texture_tile_raw" ],
|
||||
"src/pc/lua/utils/smlua_level_utils.h": [ "smlua_level_util_reset" ],
|
||||
"src/pc/lua/utils/smlua_text_utils.h": [ "smlua_text_utils_init", "smlua_text_utils_shutdown", "get_dialog_text_ascii", "smlua_text_utils_dialog_get_unmodified"],
|
||||
"src/pc/lua/utils/smlua_anim_utils.h": [ "smlua_anim_util_init", "smlua_anim_util_reset", "smlua_anim_util_register_animation" ],
|
||||
"src/pc/lua/utils/smlua_anim_utils.h": [ "smlua_anim_util_reset", "smlua_anim_util_register_animation" ],
|
||||
"src/pc/lua/utils/smlua_gfx_utils.h": [ "gfx_allocate_internal", "vtx_allocate_internal", "gfx_get_length_no_sentinel" ],
|
||||
"src/pc/network/lag_compensation.h": [ "lag_compensation_clear" ],
|
||||
"src/game/first_person_cam.h": [ "first_person_update" ],
|
||||
|
|
|
|||
|
|
@ -83,10 +83,6 @@ override_field_mutable = {
|
|||
"overridePalette",
|
||||
"overridePaletteIndex",
|
||||
],
|
||||
"Animation": [
|
||||
"values",
|
||||
"index",
|
||||
],
|
||||
}
|
||||
|
||||
override_field_invisible = {
|
||||
|
|
@ -135,9 +131,9 @@ override_field_immutable = {
|
|||
"GraphNodePerspective": [ "unused" ],
|
||||
"GraphNodeSwitchCase": [ "fnNode", "unused" ],
|
||||
"GraphNodeRoot": ["node", "areaIndex", "numViews"],
|
||||
"ObjectWarpNode": [ "next "],
|
||||
"Animation": [ "length" ],
|
||||
"AnimationTable": [ "count" ],
|
||||
"ObjectWarpNode": [ "next" ],
|
||||
"Animation": [ "*" ],
|
||||
"AnimationTable": [ "*" ],
|
||||
"Controller": [ "controllerData", "statusData" ],
|
||||
"FirstPersonCamera": [ "enabled" ],
|
||||
"ModAudio": [ "isStream", "loaded" ],
|
||||
|
|
|
|||
|
|
@ -155,16 +155,16 @@
|
|||
|
||||
| Field | Type | Access |
|
||||
| ----- | ---- | ------ |
|
||||
| flags | `integer` | |
|
||||
| animYTransDivisor | `integer` | |
|
||||
| startFrame | `integer` | |
|
||||
| loopStart | `integer` | |
|
||||
| loopEnd | `integer` | |
|
||||
| values | `Pointer` <`integer`> | |
|
||||
| index | `Pointer` <`integer`> | |
|
||||
| flags | `integer` | read-only |
|
||||
| animYTransDivisor | `integer` | read-only |
|
||||
| startFrame | `integer` | read-only |
|
||||
| loopStart | `integer` | read-only |
|
||||
| loopEnd | `integer` | read-only |
|
||||
| values | `Pointer` <`integer`> | read-only |
|
||||
| index | `Pointer` <`integer`> | read-only |
|
||||
| length | `integer` | read-only |
|
||||
| valuesLength | `integer` | |
|
||||
| indexLength | `integer` | |
|
||||
| valuesLength | `integer` | read-only |
|
||||
| indexLength | `integer` | read-only |
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
|
|
@ -2899,7 +2899,7 @@
|
|||
| ----- | ---- | ------ |
|
||||
| node | [WarpNode](structs.md#WarpNode) | read-only |
|
||||
| object | [Object](structs.md#Object) | |
|
||||
| next | [ObjectWarpNode](structs.md#ObjectWarpNode) | |
|
||||
| next | [ObjectWarpNode](structs.md#ObjectWarpNode) | read-only |
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
|
|
|
|||
|
|
@ -54,8 +54,6 @@ extern struct MarioAnimation D_80339D10[MAX_PLAYERS];
|
|||
extern struct MarioAnimation gDemo;
|
||||
|
||||
extern u8 gMarioAnims[];
|
||||
extern size_t gMarioAnimsSize;
|
||||
|
||||
extern u8 gDemoInputs[];
|
||||
|
||||
extern u16 frameBufferIndex;
|
||||
|
|
|
|||
|
|
@ -713,7 +713,7 @@ s16 music_changed_through_warp(s16 arg) {
|
|||
|
||||
s16 destArea = warpNode->node.destArea;
|
||||
s16 val4 = TRUE;
|
||||
s16 sp2C;
|
||||
u16 sp2C;
|
||||
|
||||
if (levelNum == LEVEL_BOB && levelNum == gCurrLevelNum && destArea == gCurrAreaIndex) {
|
||||
sp2C = get_current_background_music();
|
||||
|
|
|
|||
|
|
@ -337,7 +337,6 @@ void smlua_init(void) {
|
|||
|
||||
smlua_cobject_init_globals();
|
||||
smlua_model_util_initialize();
|
||||
smlua_anim_util_init();
|
||||
|
||||
// load scripts
|
||||
mods_size_enforce(&gActiveMods);
|
||||
|
|
|
|||
|
|
@ -180,16 +180,16 @@ static struct LuaObjectField sAnimInfoFields[LUA_ANIM_INFO_FIELD_COUNT] = {
|
|||
|
||||
#define LUA_ANIMATION_FIELD_COUNT 10
|
||||
static struct LuaObjectField sAnimationFields[LUA_ANIMATION_FIELD_COUNT] = {
|
||||
{ "animYTransDivisor", LVT_S16, offsetof(struct Animation, animYTransDivisor), false, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "flags", LVT_S16, offsetof(struct Animation, flags), false, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "index", LVT_U16_P, offsetof(struct Animation, index), false, LOT_POINTER, 1, sizeof(u16*) },
|
||||
{ "indexLength", LVT_U32, offsetof(struct Animation, indexLength), false, LOT_NONE, 1, sizeof(u32) },
|
||||
{ "length", LVT_U32, offsetof(struct Animation, length), true, LOT_NONE, 1, sizeof(u32) },
|
||||
{ "loopEnd", LVT_S16, offsetof(struct Animation, loopEnd), false, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "loopStart", LVT_S16, offsetof(struct Animation, loopStart), false, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "startFrame", LVT_S16, offsetof(struct Animation, startFrame), false, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "values", LVT_U16_P, offsetof(struct Animation, values), false, LOT_POINTER, 1, sizeof(u16*) },
|
||||
{ "valuesLength", LVT_U32, offsetof(struct Animation, valuesLength), false, LOT_NONE, 1, sizeof(u32) },
|
||||
{ "animYTransDivisor", LVT_S16, offsetof(struct Animation, animYTransDivisor), true, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "flags", LVT_S16, offsetof(struct Animation, flags), true, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "index", LVT_U16_P, offsetof(struct Animation, index), true, LOT_POINTER, 1, sizeof(u16*) },
|
||||
{ "indexLength", LVT_U32, offsetof(struct Animation, indexLength), true, LOT_NONE, 1, sizeof(u32) },
|
||||
{ "length", LVT_U32, offsetof(struct Animation, length), true, LOT_NONE, 1, sizeof(u32) },
|
||||
{ "loopEnd", LVT_S16, offsetof(struct Animation, loopEnd), true, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "loopStart", LVT_S16, offsetof(struct Animation, loopStart), true, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "startFrame", LVT_S16, offsetof(struct Animation, startFrame), true, LOT_NONE, 1, sizeof(s16) },
|
||||
{ "values", LVT_U16_P, offsetof(struct Animation, values), true, LOT_POINTER, 1, sizeof(u16*) },
|
||||
{ "valuesLength", LVT_U32, offsetof(struct Animation, valuesLength), true, LOT_NONE, 1, sizeof(u32) },
|
||||
};
|
||||
|
||||
#define LUA_ANIMATION_TABLE_FIELD_COUNT 1
|
||||
|
|
@ -2510,7 +2510,7 @@ static struct LuaObjectField sObjectNodeFields[LUA_OBJECT_NODE_FIELD_COUNT] = {
|
|||
|
||||
#define LUA_OBJECT_WARP_NODE_FIELD_COUNT 3
|
||||
static struct LuaObjectField sObjectWarpNodeFields[LUA_OBJECT_WARP_NODE_FIELD_COUNT] = {
|
||||
{ "next", LVT_COBJECT_P, offsetof(struct ObjectWarpNode, next), false, LOT_OBJECTWARPNODE, 1, sizeof(struct ObjectWarpNode*) },
|
||||
{ "next", LVT_COBJECT_P, offsetof(struct ObjectWarpNode, next), true, LOT_OBJECTWARPNODE, 1, sizeof(struct ObjectWarpNode*) },
|
||||
{ "node", LVT_COBJECT, offsetof(struct ObjectWarpNode, node), true, LOT_WARPNODE, 1, sizeof(struct WarpNode) },
|
||||
{ "object", LVT_COBJECT_P, offsetof(struct ObjectWarpNode, object), false, LOT_OBJECT, 1, sizeof(struct Object*) },
|
||||
};
|
||||
|
|
|
|||
|
|
@ -88,28 +88,6 @@ struct GlobalObjectAnimations gGlobalObjectAnimations = {
|
|||
.yoshi_seg5_anims_05024100 = (struct AnimationTable*) &yoshi_seg5_anims_05024100,
|
||||
};
|
||||
|
||||
//////////////////////
|
||||
// mario animations //
|
||||
//////////////////////
|
||||
|
||||
static u8 *sMarioAnimsOrig = NULL;
|
||||
|
||||
static void smlua_anim_util_init_mario_animations() {
|
||||
if (!sMarioAnimsOrig) {
|
||||
sMarioAnimsOrig = malloc(gMarioAnimsSize);
|
||||
if (!sMarioAnimsOrig) {
|
||||
sys_fatal("Cannot initialize Mario animations");
|
||||
}
|
||||
memcpy(sMarioAnimsOrig, gMarioAnims, gMarioAnimsSize);
|
||||
}
|
||||
}
|
||||
|
||||
static void smlua_anim_util_reset_mario_animations() {
|
||||
if (sMarioAnimsOrig) {
|
||||
memcpy(gMarioAnims, sMarioAnimsOrig, gMarioAnimsSize);
|
||||
}
|
||||
}
|
||||
|
||||
struct Animation *get_mario_vanilla_animation(u16 index) {
|
||||
static struct MarioAnimDmaRelatedThing *marioAnims = (struct MarioAnimDmaRelatedThing *) gMarioAnims;
|
||||
|
||||
|
|
@ -147,13 +125,7 @@ static struct CustomAnimation *get_custom_animation_node(const char *name) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void smlua_anim_util_init(void) {
|
||||
smlua_anim_util_init_mario_animations();
|
||||
}
|
||||
|
||||
void smlua_anim_util_reset(void) {
|
||||
smlua_anim_util_reset_mario_animations();
|
||||
|
||||
for (struct CustomAnimation *node = sCustomAnimationHead; node;) {
|
||||
struct CustomAnimation *next = node->next;
|
||||
if (node->name) {
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ extern struct GlobalObjectAnimations gGlobalObjectAnimations;
|
|||
/* |description|Gets a vanilla mario Animation with `index`|descriptionEnd| */
|
||||
struct Animation *get_mario_vanilla_animation(u16 index);
|
||||
|
||||
void smlua_anim_util_init();
|
||||
void smlua_anim_util_reset();
|
||||
void smlua_anim_util_register_animation(const char *name, s16 flags, s16 animYTransDivisor, s16 startFrame, s16 loopStart, s16 loopEnd, u16 *values, u32 valuesLength, u16 *index, u32 indexLength);
|
||||
/* |description|Sets the animation of `obj` to the animation `name` corresponds to|descriptionEnd| */
|
||||
|
|
|
|||
|
|
@ -179,7 +179,6 @@ try:
|
|||
for s in structobj:
|
||||
print(s)
|
||||
print("};")
|
||||
print("size_t gMarioAnimsSize = sizeof(gMarioAnims);")
|
||||
|
||||
for asset in asset_loads:
|
||||
print(asset)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue