From 4a89900a8bb1cafdc978233a6e8ee753b90550b8 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 10 Apr 2022 16:20:02 -0700 Subject: [PATCH] Fix error in LOAD_MODEL_FROM_GEO_EXT (level gen) --- data/dynos_bin_lvl.cpp | 5 +++-- levels/scripts.c | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/data/dynos_bin_lvl.cpp b/data/dynos_bin_lvl.cpp index c8bfbb6d..7e679c3a 100644 --- a/data/dynos_bin_lvl.cpp +++ b/data/dynos_bin_lvl.cpp @@ -1369,6 +1369,7 @@ s64 DynOS_Lvl_ParseLevelScriptConstants(const String& _Arg, bool* found) { static LevelScript ParseLevelScriptSymbolArgInternal(GfxData* aGfxData, DataNode* aNode, u64& aTokenIndex, bool* found) { String _Arg = aNode->mTokens[aTokenIndex++]; + *found = true; // Integers bool integerFound = false; @@ -1766,7 +1767,7 @@ static void ParseLevelScriptSymbol(GfxData* aGfxData, DataNode* aNo // LOAD_MODEL_FROM_GEO if (_Symbol == "LOAD_MODEL_FROM_GEO") { u64 topTokenIndex = aTokenIndex; - bool foundGeo = true; + bool foundGeo = false; LevelScript model = ParseLevelScriptSymbolArg(aGfxData, aNode, aTokenIndex); LevelScript geo = ParseLevelScriptSymbolArgInternal(aGfxData, aNode, aTokenIndex, &foundGeo); if (foundGeo) { @@ -1776,7 +1777,7 @@ static void ParseLevelScriptSymbol(GfxData* aGfxData, DataNode* aNo aHead += (sizeof(_Ls) / sizeof(_Ls[0])); } else { u32 geoIndex = DynOS_Lua_RememberVariable(aGfxData, aHead + 1, aNode->mTokens[topTokenIndex + 1]); - LevelScript _Ls[] = { LOAD_MODEL_FROM_GEO_EXT(model, geo) }; + LevelScript _Ls[] = { LOAD_MODEL_FROM_GEO_EXT(model, geoIndex) }; memcpy(aHead, _Ls, sizeof(_Ls)); aHead += (sizeof(_Ls) / sizeof(_Ls[0])); } diff --git a/levels/scripts.c b/levels/scripts.c index bccc6f25..c0f7a231 100644 --- a/levels/scripts.c +++ b/levels/scripts.c @@ -79,7 +79,7 @@ const LevelScript level_main_scripts_entry[] = { LOAD_MODEL_FROM_GEO(MODEL_STAR, star_geo), LOAD_MODEL_FROM_GEO(MODEL_TRANSPARENT_STAR, transparent_star_geo), LOAD_MODEL_FROM_GEO(MODEL_WOODEN_SIGNPOST, wooden_signpost_geo), - LOAD_MODEL_FROM_DL( MODEL_WHITE_PARTICLE_SMALL, white_particle_small_dl, LAYER_ALPHA), + LOAD_MODEL_FROM_DL (MODEL_WHITE_PARTICLE_SMALL, white_particle_small_dl, LAYER_ALPHA), LOAD_MODEL_FROM_GEO(MODEL_RED_FLAME, red_flame_geo), LOAD_MODEL_FROM_GEO(MODEL_BLUE_FLAME, blue_flame_geo), LOAD_MODEL_FROM_GEO(MODEL_BURN_SMOKE, burn_smoke_geo), @@ -88,13 +88,13 @@ const LevelScript level_main_scripts_entry[] = { LOAD_MODEL_FROM_GEO(MODEL_FISH, fish_geo), LOAD_MODEL_FROM_GEO(MODEL_FISH_SHADOW, fish_shadow_geo), LOAD_MODEL_FROM_GEO(MODEL_SPARKLES_ANIMATION, sparkles_animation_geo), - LOAD_MODEL_FROM_DL( MODEL_SAND_DUST, sand_seg3_dl_0302BCD0, LAYER_ALPHA), + LOAD_MODEL_FROM_DL (MODEL_SAND_DUST, sand_seg3_dl_0302BCD0, LAYER_ALPHA), LOAD_MODEL_FROM_GEO(MODEL_BUTTERFLY, butterfly_geo), LOAD_MODEL_FROM_GEO(MODEL_BURN_SMOKE_UNUSED, burn_smoke_geo), - LOAD_MODEL_FROM_DL( MODEL_PEBBLE, pebble_seg3_dl_0301CB00, LAYER_ALPHA), + LOAD_MODEL_FROM_DL (MODEL_PEBBLE, pebble_seg3_dl_0301CB00, LAYER_ALPHA), LOAD_MODEL_FROM_GEO(MODEL_MIST, mist_geo), LOAD_MODEL_FROM_GEO(MODEL_WHITE_PUFF, white_puff_geo), - LOAD_MODEL_FROM_DL( MODEL_WHITE_PARTICLE_DL, white_particle_dl, LAYER_ALPHA), + LOAD_MODEL_FROM_DL (MODEL_WHITE_PARTICLE_DL, white_particle_dl, LAYER_ALPHA), LOAD_MODEL_FROM_GEO(MODEL_WHITE_PARTICLE, white_particle_geo), LOAD_MODEL_FROM_GEO(MODEL_YELLOW_COIN_NO_SHADOW, yellow_coin_no_shadow_geo), LOAD_MODEL_FROM_GEO(MODEL_BLUE_COIN, blue_coin_geo), @@ -103,7 +103,7 @@ const LevelScript level_main_scripts_entry[] = { LOAD_MODEL_FROM_GEO(MODEL_MARIOS_METAL_CAP, marios_metal_cap_geo), LOAD_MODEL_FROM_GEO(MODEL_MARIOS_WING_CAP, marios_wing_cap_geo), LOAD_MODEL_FROM_GEO(MODEL_MARIOS_CAP, marios_cap_geo), - LOAD_MODEL_FROM_GEO(MODEL_MARIOS_CAP, marios_cap_geo), // repeated + //LOAD_MODEL_FROM_GEO(MODEL_MARIOS_CAP, marios_cap_geo), // repeated LOAD_MODEL_FROM_GEO(MODEL_BOWSER_KEY_CUTSCENE, bowser_key_cutscene_geo), LOAD_MODEL_FROM_GEO(MODEL_BOWSER_KEY, bowser_key_geo), LOAD_MODEL_FROM_GEO(MODEL_RED_FLAME_SHADOW, red_flame_shadow_geo),