From 11496c386b000ae83d734afb3be698291d32de8b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 15 Mar 2025 12:54:35 +0200 Subject: [PATCH] Drop the shape wrapper statement from ShapeSetup loader Instead use an auxiliary loader to allow the shape to be specified inline with the rest of the setup. --- source/game/setups_special.cpp | 10 ++++------ source/game/setups_special.h | 7 +++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/game/setups_special.cpp b/source/game/setups_special.cpp index 1e0ca79..2f7075b 100644 --- a/source/game/setups_special.cpp +++ b/source/game/setups_special.cpp @@ -1,5 +1,4 @@ #include "setups_special.h" -#include namespace Msp::Game { @@ -8,20 +7,19 @@ ShapeSetup::Loader::Loader(ShapeSetup &s): { static ActionMap shared_actions; set_actions(shared_actions); + + add_auxiliary_loader(shape_ldr); } void ShapeSetup::Loader::init_actions() { add("render_detail", &ShapeSetup::render_detail); - add("shape", &Loader::shape); add("technique_name", &ShapeSetup::technique_name); } -void ShapeSetup::Loader::shape() +void ShapeSetup::Loader::finish() { - Geometry::Loader ldr; - load_sub_with(ldr); - obj.shape = ldr.take_shape(); + obj.shape = shape_ldr.take_shape(); } } // namespace Msp::Game diff --git a/source/game/setups_special.h b/source/game/setups_special.h index 9e6d206..1674a7c 100644 --- a/source/game/setups_special.h +++ b/source/game/setups_special.h @@ -3,6 +3,7 @@ #include #include +#include #include #include "mspgame_api.h" @@ -12,13 +13,15 @@ struct MSPGAME_API ShapeSetup { class MSPGAME_API Loader: public DataFile::ObjectLoader { + private: + Geometry::Loader shape_ldr; + public: Loader(ShapeSetup &); private: void init_actions() override; - - void shape(); + void finish() override; }; std::unique_ptr> shape; -- 2.45.2