From 1831d5d1eab5c9a607270a8a9b72a2ac1e6ce62a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 25 Nov 2022 15:05:47 +0100 Subject: add control panel scenery item --- anim/control-panel.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ anim/control-panel.tga | Bin 0 -> 15047 bytes editor/app.cpp | 3 ++- editor/app.hpp | 2 +- editor/update.cpp | 1 + 5 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 anim/control-panel.json create mode 100644 anim/control-panel.tga diff --git a/anim/control-panel.json b/anim/control-panel.json new file mode 100644 index 00000000..e7f372a2 --- /dev/null +++ b/anim/control-panel.json @@ -0,0 +1,44 @@ +{ + "actionframe": 0, + "anim_name": "", + "fps": 24, + "groups": [ + { + "frames": [ + { + "ground": "17 x 66", + "offset": "0 x 0", + "size": "41 x 78" + } + ], + "ground": "17 x 66", + "name": "n", + "offset": [ + 0, + -32, + 8 + ] + }, + { + "frames": [ + { + "ground": "23 x 66", + "offset": "0 x 78", + "size": "41 x 78" + } + ], + "ground": "23 x 66", + "name": "w", + "offset": [ + -32, + 0, + 8 + ] + } + ], + "height": 0, + "nframes": 1, + "object_name": "control-panel", + "pixel_size": "41 x 156", + "width": 41 +} diff --git a/anim/control-panel.tga b/anim/control-panel.tga new file mode 100644 index 00000000..537d6de5 Binary files /dev/null and b/anim/control-panel.tga differ diff --git a/editor/app.cpp b/editor/app.cpp index 4fcc051b..9a897d57 100644 --- a/editor/app.cpp +++ b/editor/app.cpp @@ -17,7 +17,8 @@ app::app(fm_settings&& opts) : _wall1{loader.tile_atlas("wood2", {2, 1})}, _wall2{loader.tile_atlas("wood1", {2, 1})}, _door{loader.anim_atlas("door-close")}, - _table{loader.anim_atlas("table")} + _table{loader.anim_atlas("table")}, + _control_panel(loader.anim_atlas("control-panel")) { world& w = M->world(); chunk_coords coord{0 ,0}; diff --git a/editor/app.hpp b/editor/app.hpp index aac86d76..381b4c83 100644 --- a/editor/app.hpp +++ b/editor/app.hpp @@ -114,7 +114,7 @@ private: Containers::Pointer M; ImGuiIntegration::Context _imgui{NoCreate}; std::shared_ptr _floor1, _floor2, _wall1, _wall2; - std::shared_ptr _door, _table; + std::shared_ptr _door, _table, _control_panel; GL::Texture2D _wireframe_texture = wireframe::make_constant_texture(); wireframe_mesh _wireframe_quad {_wireframe_texture}; wireframe_mesh _wireframe_wall_n {_wireframe_texture}; diff --git a/editor/update.cpp b/editor/update.cpp index 15d99d39..9e479050 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -32,6 +32,7 @@ void app::maybe_initialize_chunk_(const chunk_coords& pos, chunk& c) c[{K+1, K }].wall_west() = { _wall2, 0 }; c[{K+3, K+1}].scenery() = { scenery::door, rotation::N, _door, false }; c[{ 3, 4 }].scenery() = { scenery::generic, rotation::N, _table }; + c[{K, K+1}].scenery() = { scenery::generic, rotation::N, _control_panel, true }; c.mark_modified(); } -- cgit v1.2.3