From 93beb2001eae4467d46c824dfbf72b641ac23cab Mon Sep 17 00:00:00 2001 From: MysterD Date: Thu, 14 Apr 2022 21:49:41 -0700 Subject: [PATCH] Prevent generating extra geos for player models, allow referencing mario textures --- actors/mario/model.inc.c | 38 ++++++++++++++++---------------- data/dynos_bin_actor.cpp | 15 ++++++++++--- data/dynos_mgr_builtin.cpp | 20 +++++++++++++++++ data/dynos_mgr_builtin_externs.h | 19 ++++++++++++++++ 4 files changed, 70 insertions(+), 22 deletions(-) diff --git a/actors/mario/model.inc.c b/actors/mario/model.inc.c index 7f125f5f..b375949a 100644 --- a/actors/mario/model.inc.c +++ b/actors/mario/model.inc.c @@ -37,99 +37,99 @@ static const Lights1 mario_brown2_lights_group = gdSPDefLights1( ); // 0x04000090 -ALIGNED8 static const u8 mario_texture_metal[] = { +ALIGNED8 const u8 mario_texture_metal[] = { #include "actors/mario/mario_metal.rgba16.inc.c" }; // 0x04001090 -ALIGNED8 static const u8 mario_texture_yellow_button[] = { +ALIGNED8 const u8 mario_texture_yellow_button[] = { #include "actors/mario/mario_overalls_button.rgba16.inc.c" }; // 0x04001890 -ALIGNED8 static const u8 mario_texture_m_logo[] = { +ALIGNED8 const u8 mario_texture_m_logo[] = { #include "actors/mario/custom_mario_logo.rgba16.inc.c" }; // 0x04002090 -ALIGNED8 static const u8 mario_texture_hair_sideburn[] = { +ALIGNED8 const u8 mario_texture_hair_sideburn[] = { #include "actors/mario/mario_sideburn.rgba16.inc.c" }; // 0x04002890 -ALIGNED8 static const u8 mario_texture_mustache[] = { +ALIGNED8 const u8 mario_texture_mustache[] = { #include "actors/mario/mario_mustache.rgba16.inc.c" }; // 0x04003090 -ALIGNED8 static const u8 mario_texture_eyes_front[] = { +ALIGNED8 const u8 mario_texture_eyes_front[] = { #include "actors/mario/mario_eyes_center.rgba16.inc.c" }; // 0x04003890 -ALIGNED8 static const u8 mario_texture_eyes_half_closed[] = { +ALIGNED8 const u8 mario_texture_eyes_half_closed[] = { #include "actors/mario/mario_eyes_half_closed.rgba16.inc.c" }; // 0x04004090 -ALIGNED8 static const u8 mario_texture_eyes_closed[] = { +ALIGNED8 const u8 mario_texture_eyes_closed[] = { #include "actors/mario/mario_eyes_closed.rgba16.inc.c" }; // Unreferenced // 0x04004890 -ALIGNED8 static const u8 mario_texture_eyes_closed_unused1[] = { +ALIGNED8 const u8 mario_texture_eyes_closed_unused1[] = { #include "actors/mario/mario_eyes_closed_unused_0.rgba16.inc.c" }; // Unreferenced // 0x04005090 -ALIGNED8 static const u8 mario_texture_eyes_closed_unused2[] = { +ALIGNED8 const u8 mario_texture_eyes_closed_unused2[] = { #include "actors/mario/mario_eyes_closed_unused_1.rgba16.inc.c" }; // 0x04005890 -ALIGNED8 static const u8 mario_texture_eyes_right[] = { +ALIGNED8 const u8 mario_texture_eyes_right[] = { #include "actors/mario/mario_eyes_left_unused.rgba16.inc.c" }; // 0x04006090 -ALIGNED8 static const u8 mario_texture_eyes_left[] = { +ALIGNED8 const u8 mario_texture_eyes_left[] = { #include "actors/mario/mario_eyes_right_unused.rgba16.inc.c" }; // 0x04006890 -ALIGNED8 static const u8 mario_texture_eyes_up[] = { +ALIGNED8 const u8 mario_texture_eyes_up[] = { #include "actors/mario/mario_eyes_up_unused.rgba16.inc.c" }; // 0x04007090 -ALIGNED8 static const u8 mario_texture_eyes_down[] = { +ALIGNED8 const u8 mario_texture_eyes_down[] = { #include "actors/mario/mario_eyes_down_unused.rgba16.inc.c" }; // 0x04007890 -ALIGNED8 static const u8 mario_texture_eyes_dead[] = { +ALIGNED8 const u8 mario_texture_eyes_dead[] = { #include "actors/mario/mario_eyes_dead.rgba16.inc.c" }; // 0x04008090 -ALIGNED8 static const u8 mario_texture_wings_half_1[] = { +ALIGNED8 const u8 mario_texture_wings_half_1[] = { #include "actors/mario/mario_wing.rgba16.inc.c" }; // 0x04009090 -ALIGNED8 static const u8 mario_texture_wings_half_2[] = { +ALIGNED8 const u8 mario_texture_wings_half_2[] = { #include "actors/mario/mario_wing_tip.rgba16.inc.c" }; // 0x0400A090 -ALIGNED8 static const u8 mario_texture_metal_wings_half_1[] = { +ALIGNED8 const u8 mario_texture_metal_wings_half_1[] = { #include "actors/mario/mario_metal_wing_unused.rgba16.inc.c" }; // 0x0400B090 -ALIGNED8 static const u8 mario_texture_metal_wings_half_2[] = { +ALIGNED8 const u8 mario_texture_metal_wings_half_2[] = { #include "actors/mario/mario_metal_wing_tip_unused.rgba16.inc.c" }; diff --git a/data/dynos_bin_actor.cpp b/data/dynos_bin_actor.cpp index 1fa9638a..0d1f406d 100644 --- a/data/dynos_bin_actor.cpp +++ b/data/dynos_bin_actor.cpp @@ -146,6 +146,18 @@ static String GetActorFolder(const Array> &aActorsFolders, u64 } static void DynOS_Actor_Generate(const SysPath &aPackFolder, Array> _ActorsFolders, GfxData *_GfxData) { + // do not regen this folder if we find any existing bins + for (s32 geoIndex = _GfxData->mGeoLayouts.Count() - 1; geoIndex >= 0; geoIndex--) { + auto &_GeoNode = _GfxData->mGeoLayouts[geoIndex]; + String _GeoRootName = _GeoNode->mName; + + // If there is an existing binary file for this layout, skip and go to the next actor + SysPath _BinFilename = fstring("%s/%s.bin", aPackFolder.c_str(), _GeoRootName.begin()); + if (fs_sys_file_exists(_BinFilename.c_str())) { + return; + } + } + // generate in reverse order to detect children for (s32 geoIndex = _GfxData->mGeoLayouts.Count() - 1; geoIndex >= 0; geoIndex--) { auto &_GeoNode = _GfxData->mGeoLayouts[geoIndex]; @@ -159,9 +171,6 @@ static void DynOS_Actor_Generate(const SysPath &aPackFolder, ArraymLoadIndex = 0; diff --git a/data/dynos_mgr_builtin.cpp b/data/dynos_mgr_builtin.cpp index d5446a6d..0e251de0 100644 --- a/data/dynos_mgr_builtin.cpp +++ b/data/dynos_mgr_builtin.cpp @@ -1744,6 +1744,26 @@ static const void* sDynosBuiltinTexs[] = { define_builtin(bobomb_seg8_texture_08020A60), define_builtin(bobomb_seg8_texture_08021A60), define_builtin(bobomb_seg8_texture_08022260), + // mario + define_builtin(mario_texture_metal), + define_builtin(mario_texture_yellow_button), + define_builtin(mario_texture_m_logo), + define_builtin(mario_texture_hair_sideburn), + define_builtin(mario_texture_mustache), + define_builtin(mario_texture_eyes_front), + define_builtin(mario_texture_eyes_half_closed), + define_builtin(mario_texture_eyes_closed), + define_builtin(mario_texture_eyes_closed_unused1), + define_builtin(mario_texture_eyes_closed_unused2), + define_builtin(mario_texture_eyes_right), + define_builtin(mario_texture_eyes_left), + define_builtin(mario_texture_eyes_up), + define_builtin(mario_texture_eyes_down), + define_builtin(mario_texture_eyes_dead), + define_builtin(mario_texture_wings_half_1), + define_builtin(mario_texture_wings_half_2), + define_builtin(mario_texture_metal_wings_half_1), + define_builtin(mario_texture_metal_wings_half_2), }; const Texture* DynOS_Builtin_Tex_GetFromName(const char* aDataName) { diff --git a/data/dynos_mgr_builtin_externs.h b/data/dynos_mgr_builtin_externs.h index ae274c07..b09fa912 100644 --- a/data/dynos_mgr_builtin_externs.h +++ b/data/dynos_mgr_builtin_externs.h @@ -439,3 +439,22 @@ extern ALIGNED8 const Texture bobomb_seg8_texture_0801FA60[]; extern ALIGNED8 const Texture bobomb_seg8_texture_08020A60[]; extern ALIGNED8 const Texture bobomb_seg8_texture_08021A60[]; extern ALIGNED8 const Texture bobomb_seg8_texture_08022260[]; +extern ALIGNED8 const u8 mario_texture_metal[]; +extern ALIGNED8 const u8 mario_texture_yellow_button[]; +extern ALIGNED8 const u8 mario_texture_m_logo[]; +extern ALIGNED8 const u8 mario_texture_hair_sideburn[]; +extern ALIGNED8 const u8 mario_texture_mustache[]; +extern ALIGNED8 const u8 mario_texture_eyes_front[]; +extern ALIGNED8 const u8 mario_texture_eyes_half_closed[]; +extern ALIGNED8 const u8 mario_texture_eyes_closed[]; +extern ALIGNED8 const u8 mario_texture_eyes_closed_unused1[]; +extern ALIGNED8 const u8 mario_texture_eyes_closed_unused2[]; +extern ALIGNED8 const u8 mario_texture_eyes_right[]; +extern ALIGNED8 const u8 mario_texture_eyes_left[]; +extern ALIGNED8 const u8 mario_texture_eyes_up[]; +extern ALIGNED8 const u8 mario_texture_eyes_down[]; +extern ALIGNED8 const u8 mario_texture_eyes_dead[]; +extern ALIGNED8 const u8 mario_texture_wings_half_1[]; +extern ALIGNED8 const u8 mario_texture_wings_half_2[]; +extern ALIGNED8 const u8 mario_texture_metal_wings_half_1[]; +extern ALIGNED8 const u8 mario_texture_metal_wings_half_2[];