this fixes the giant memory leak that happens due to not freeing custom level data when closing a lobby.
`DynOS_Lvl_ModShutdown` was not freeing the data nodes for the level data, it was only freeing the surface data.
To fix this, I have made it use `DynOS_Gfx_Free` to free the `GfxData` correctly. I found that the level script VM will still be trying to warp from the custom level after `DynOS_Lvl_ModShutdown` is executed, so I added a schedule to simply free it the next frame.
I've made it force the level script to change to a vanilla level during mod shutdown. This is critical to ensure the VM doesn't continue to read from a freed level script.
Removed the explicit deletion of data nodes in `DynOS_MovtexQC_ModShutdown` because `DynOS_Gfx_Free` already frees that, and it's actually data owned by the data node, so it's more appropriate in `DynOS_Gfx_Free`
When generating multiple actors, if two or more data nodes share the same name, the generated actors can reference the wrong nodes in their display lists/geo layouts.
This results in:
- The wrong nodes compiled into binary files
- Intermediate layouts generated as actors since nothing is referencing them anymore, treating them as root geo layouts
The simplest fix was to first check for the model identifier (renamed to `mDataIdentifier`, since it's no longer related to models) when looking for nodes, to ensure it picks the right node, even if multiple nodes share the same name.
Just making a brief commit and thats all to add onto dj's lighting engine improvements because I heard about the PR, in mine I
* allowed all Vtx objects to be manipulated/retrieved
* updated lighting engine demo to be an SM64 night mode with a flashlight
* Fixed longterm bug where lighting bugs out unless you spawn a light
* Added new default LE mode LE_MODE_AFFECT_ALL_SHADED_AND_COLORED which also affects vertex colored surfaces
- Renamed the `new` and `realloc` functions to `create` and `resize`
- Added `delete_all`
- Made Mod Data a class:
- Allocation is now limited to prevent out-of-memory crashes: 1024 display lists of max size 2048 and 1024 vertex buffers of max size 4096 per mod
- Added error codes to identify the cause of a failure (name not found, pointer not found, max size exceeded, item pool is full, ...)
* set_gfx_command part 2
* part 3
* get gfx/vtx from name; copy gfx/vtx
* gfx/vtx dynamic allocation lua
* gfx/vtx_new: don't take level/model/vanilla names
* Clean up gbi constants
* update example
* Isaac review; add gfx_get_next_command and vtx_get_next_vertex
* make all commands length 1; missing NULL checks