diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-01 13:21:32 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-01 13:21:32 +0100 |
commit | 81f68a2c83c0c25259cd526c8bb4839caa361e8f (patch) | |
tree | ff2db492dbd3dddfc341370a4cf4b2a95abdae70 /test | |
parent | 511d823c2dc2b917afed6a9c50ad940e5c58c5d5 (diff) |
serialize, loader, test: add serializing scenery
Diffstat (limited to 'test')
-rw-r--r-- | test/serializer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/serializer.cpp b/test/serializer.cpp index 568d0217..8a22d0e5 100644 --- a/test/serializer.cpp +++ b/test/serializer.cpp @@ -1,6 +1,7 @@ #include "app.hpp" #include "src/world.hpp" #include "loader/loader.hpp" +#include "loader/scenery.hpp" #include "src/tile-atlas.hpp" #include <Corrade/Utility/Path.h> @@ -17,11 +18,19 @@ static chunk make_test_chunk() chunk c; for (auto [x, k, pt] : c) x.ground() = { tiles, variant_t(k % tiles->num_tiles()) }; + auto door = loader.scenery("door1"), + table = loader.scenery("table1"), + control_panel = loader.scenery("control panel (wall) 1"); + control_panel.frame.r = rotation::W; constexpr auto K = N/2; c[{K, K }].wall_north() = { metal1, 0 }; c[{K, K }].wall_west() = { metal2, 0 }; c[{K, K+1}].wall_north() = { metal1, 0 }; c[{K+1, K }].wall_west() = { metal2, 0 }; + c[{K+3, K+1}].scenery() = door; + c[{ 3, 4 }].scenery() = table; + c[{K, K+1}].scenery() = control_panel; + c.mark_modified(); return c; } |