sm64coopdx/data/dynos_main.cpp
PeachyPeach 467b22e939
Some checks failed
Build coop / build-ubuntu (push) Has been cancelled
Build coop / build-windows (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
Gfx set command: v2 + Gfx/Vtx dynamic alloc (#718)
* 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
2025-04-12 18:19:14 -04:00

54 lines
1.2 KiB
C++

#include "dynos.cpp.h"
extern "C" {
#include "level_commands.h"
#include "game/level_update.h"
#include "game/object_list_processor.h"
}
//
// Update
//
static bool sDynosIsLevelEntry = false;
void *DynOS_SwapCmd(void *aCmd) {
return DynOS_Lvl_Override(aCmd);
}
void *DynOS_UpdateCmd(void *aCmd) {
if (!aCmd) { return NULL; }
static const uintptr_t sCmdLevelEntry[] = { CALL(0, lvl_init_or_update) };
sDynosIsLevelEntry |= (((uintptr_t*)aCmd)[0] == sCmdLevelEntry[0] && ((uintptr_t*)aCmd)[1] == sCmdLevelEntry[1]);
return DynOS_Warp_Update(aCmd, sDynosIsLevelEntry);
}
void DynOS_UpdateGfx() {
DynOS_Mod_Update();
DynOS_Tex_Update();
}
bool DynOS_IsTransitionActive() {
return gWarpTransition.isActive;
}
//
// Misc
//
static bool sDynosModShutdown = false;
void DynOS_Mod_Update() {
if (sDynosModShutdown) {
sDynosModShutdown = false;
DynOS_Actor_ModShutdown();
DynOS_Col_ModShutdown();
DynOS_Lvl_ModShutdown();
DynOS_Bhv_ModShutdown();
DynOS_MovtexQC_ModShutdown();
DynOS_Tex_ModShutdown();
DynOS_Gfx_ModShutdown();
}
}
void DynOS_Mod_Shutdown() {
sDynosModShutdown = true;
}