namespace "Msp::Game";
api "MSPGAME_API" "msp/game/mspgame_api.h";
+external "msp/game/setups_special.h"
+{
+ namespace "Msp::Game";
+ component Shape;
+};
+
enum CameraScaling
{
value ORIGINAL_SIZE;
--- /dev/null
+#include "setups_special.h"
+#include <msp/geometry/loader.h>
+
+namespace Msp::Game {
+
+ShapeSetup::Loader::Loader(ShapeSetup &s):
+ ObjectLoader(s)
+{
+ static ActionMap shared_actions;
+ set_actions(shared_actions);
+}
+
+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()
+{
+ Geometry::Loader<float, 3> ldr;
+ load_sub_with(ldr);
+ obj.shape = ldr.take_shape();
+}
+
+} // namespace Msp::Game
--- /dev/null
+#ifndef MSP_GAME_SETUPSSPECIAL_H_
+#define MSP_GAME_SETUPSSPECIAL_H_
+
+#include <memory>
+#include <msp/datafile/objectloader.h>
+#include <msp/geometry/shape.h>
+#include "mspgame_api.h"
+
+namespace Msp::Game {
+
+struct MSPGAME_API ShapeSetup
+{
+ class MSPGAME_API Loader: public DataFile::ObjectLoader<ShapeSetup>
+ {
+ public:
+ Loader(ShapeSetup &);
+
+ private:
+ void init_actions() override;
+
+ void shape();
+ };
+
+ std::unique_ptr<Geometry::Shape<float, 3>> shape;
+ std::string technique_name;
+ unsigned render_detail = 4;
+};
+
+} // namespace Msp::Game
+
+#endif
#include "shape.h"
-#include <msp/geometry/loader.h>
using namespace std;
throw invalid_argument("Shape::Shape");
}
-ShapeSetup::Loader::Loader(ShapeSetup &s):
- ObjectLoader(s)
-{
- static ActionMap shared_actions;
- set_actions(shared_actions);
-}
-
-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()
-{
- Geometry::Loader<float, 3> ldr;
- load_sub_with(ldr);
- obj.shape = ldr.take_shape();
-}
-
} // namespace Msp::Game
#ifndef MSP_GAME_SHAPE_H_
#define MSP_GAME_SHAPE_H_
-#include <memory>
-#include <msp/datafile/objectloader.h>
-#include <msp/geometry/shape.h>
#include "component.h"
#include "mspgame_api.h"
+#include "setups_special.h"
namespace Msp::Game {
-// TODO Make this visible to the setup generator
-struct MSPGAME_API ShapeSetup
-{
- class MSPGAME_API Loader: public DataFile::ObjectLoader<ShapeSetup>
- {
- public:
- Loader(ShapeSetup &);
-
- private:
- void init_actions() override;
-
- void shape();
- };
-
- std::unique_ptr<Geometry::Shape<float, 3>> shape;
- std::string technique_name;
- unsigned render_detail = 4;
-};
-
class MSPGAME_API Shape: public Component
{
public: