Only force in movtexs and collisions within that levels subfolders

This commit is contained in:
MysterD 2022-04-06 22:14:40 -07:00
parent b346054807
commit 67f0afa80c
2 changed files with 22 additions and 5 deletions

View File

@ -2015,12 +2015,18 @@ static bool DynOS_Lvl_GeneratePack_Internal(const SysPath &aPackFolder, Array<Pa
PrintNoNewLine("%s.lvl: Model identifier: %X - Processing... ", _LvlRootName.begin(), _GfxData->mModelIdentifier);
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);
// Force all of the movtexs and collisions into the compiled lvl
for (auto &_Node : _GfxData->mMovtexs) {
if (_Node->mModelIdentifier != _GfxData->mModelIdentifier) { continue; }
DynOS_Movtex_Parse(_GfxData, _Node, false);
}
for (auto &_MovtexQCNode : _GfxData->mMovtexQCs) {
DynOS_MovtexQC_Parse(_GfxData, _MovtexQCNode);
for (auto &_Node : _GfxData->mMovtexQCs) {
if (_Node->mModelIdentifier != _GfxData->mModelIdentifier) { continue; }
DynOS_MovtexQC_Parse(_GfxData, _Node);
}
for (auto &_Node : _GfxData->mCollisions) {
if (_Node->mModelIdentifier != _GfxData->mModelIdentifier) { continue; }
DynOS_Col_Parse(_GfxData, _Node, false);
}
// Write if no error
@ -2107,6 +2113,7 @@ void DynOS_Lvl_GeneratePack(const SysPath &aPackFolder) {
// Only parse folders with a 'script.c'
if (!fs_sys_file_exists(fstring("%s/script.c", _Folder.c_str()).c_str()) && !fs_sys_file_exists(fstring("%s/custom.script.c", _Folder.c_str()).c_str())) continue;
_GfxData->mModelIdentifier++;
DynOS_Lvl_GeneratePack_Recursive(_Folder, _GfxData);
}

View File

@ -609,6 +609,16 @@ void DynOS_Col_Add(const SysPath &aPackFolder, const char *aCollisionName) {
}
Collision* DynOS_Col_Get(const char* collisionName) {
// check levels
for (auto& lvl : sDynosCustomLevelScripts) {
for (auto& col : lvl.second->mCollisions) {
if (col->mName == collisionName) {
return col->mData;
}
}
}
// check normal actor collisions
for (s32 i = 0; i < sDynosCollisions.Count(); ++i) {
if (!strcmp(sDynosCollisions[i].first, collisionName)) {
return sDynosCollisions[i].second->mData;