summaryrefslogtreecommitdiffhomepage
path: root/editor/ctor.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-01-15 12:01:33 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-01-15 12:01:33 +0100
commit9a231ffd8bd35108092d218c834544657bfb5986 (patch)
tree7e34f76e6eb4195cab263f042061800abb077482 /editor/ctor.cpp
parent6aae07688b650be756a443495fa760c2f0a5dc24 (diff)
c
Diffstat (limited to 'editor/ctor.cpp')
-rw-r--r--editor/ctor.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/editor/ctor.cpp b/editor/ctor.cpp
new file mode 100644
index 00000000..0d912ded
--- /dev/null
+++ b/editor/ctor.cpp
@@ -0,0 +1,37 @@
+#include "app.hpp"
+#include "compat/enum-bitset.hpp"
+#include "src/world.hpp"
+#include "editor.hpp"
+#include "draw/wireframe-meshes.hpp"
+#include "floormat/main.hpp"
+#include <Magnum/ImGuiIntegration/Context.h>
+
+namespace floormat {
+
+app::app(fm_settings&& opts) :
+ M{floormat_main::create(*this, Utility::move(opts))},
+ _wireframe{InPlaceInit},
+ _tests{tests_data_::make()},
+ _editor{InPlaceInit, this},
+ keys_{InPlaceInit, 0}
+{
+ reset_world();
+ auto& w = M->world();
+ constexpr chunk_coords_ coord{0, 0, 0};
+ maybe_initialize_chunk_(coord, w[coord]);
+ reset_camera_offset();
+ M->set_render_vobjs(_render_vobjs);
+ inspectors.reserve(16);
+}
+
+app::~app()
+{
+}
+
+void app::reset_world()
+{
+ reset_world(world{});
+}
+
+
+} // namespace floormat