From d5770f1b55185469e6a38ff6d74ff0aaee6617a1 Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 5 Apr 2022 08:15:08 -0700 Subject: [PATCH] Force Movtexs into compiled DynOS lvls --- data/dynos_bin_lvl.cpp | 8 ++++++++ data/dynos_bin_movtex.cpp | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/data/dynos_bin_lvl.cpp b/data/dynos_bin_lvl.cpp index 1eb97d77..78e8df4a 100644 --- a/data/dynos_bin_lvl.cpp +++ b/data/dynos_bin_lvl.cpp @@ -2005,6 +2005,14 @@ static bool DynOS_Lvl_GeneratePack_Internal(const SysPath &aPackFolder, ArraymModelIdentifier); DynOS_Lvl_Parse(_GfxData, _LvlRoot, true); + // Force all of the movtexs into the compiled lvl + for (auto &_MovtexNode : _GfxData->mMovtexs) { + DynOS_Movtex_Parse(_GfxData, _MovtexNode, false); + } + for (auto &_MovtexQCNode : _GfxData->mMovtexQCs) { + DynOS_MovtexQC_Parse(_GfxData, _MovtexQCNode); + } + // Write if no error if (_GfxData->mErrorCount == 0) { DynOS_Lvl_WriteBinary(_LvlFilename, _GfxData); diff --git a/data/dynos_bin_movtex.cpp b/data/dynos_bin_movtex.cpp index b941e4f8..020d1d42 100644 --- a/data/dynos_bin_movtex.cpp +++ b/data/dynos_bin_movtex.cpp @@ -132,6 +132,15 @@ static void ParseMovtexSymbol(GfxData* aGfxData, DataNode* aNode, Movtex movtex_symbol_0(MOV_TEX_END); movtex_symbol_0(MOV_TEX_ROT_END); + // Integers + s32 x; + if ((_Symbol[1] == 'x' && sscanf(_Symbol.begin(), "%x", &x) == 1) || (sscanf(_Symbol.begin(), "%d", &x) == 1)) { + Movtex _Mt[] = { (s16)x }; + memcpy(aHead, _Mt, sizeof(_Mt)); + aHead += (sizeof(_Mt) / sizeof(_Mt[0])); + return; + } + // Unknown PrintError(" ERROR: Unknown movtex symbol: %s", _Symbol.begin()); }