summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-01-13 15:43:04 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-01-13 15:43:04 +0100
commit36c5c7e4bca651e95686b193a5b8b5193077c371 (patch)
treedac2b47407cb1606afbdb8ec7b3bb39820b903eb /test
parent71fbc6049b57b2b3f9a1588131ecf8fdb82de279 (diff)
a
Diffstat (limited to 'test')
-rw-r--r--test/serializer.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/serializer.cpp b/test/serializer.cpp
index 8d5d7ab2..09ea7927 100644
--- a/test/serializer.cpp
+++ b/test/serializer.cpp
@@ -36,23 +36,33 @@ chunk& test_app::make_test_chunk(world& w, chunk_coords_ ch)
w.make_object<scenery>(w.make_id(), {ch, {3, 4}}, table);
w.make_object<scenery>(w.make_id(), {ch, {K, K+1}}, control_panel);
+#if 0
const auto add_player = [&](StringView name, Vector2i coord, bool playable) {
critter_proto cproto;
cproto.name = name;
cproto.playable = playable;
w.make_object<critter>(w.make_id(), global_coords{ch, {coord.x(), coord.y()}}, cproto);
};
-
add_player("Player 1", {10, 9}, true);
add_player("Player 2", {10, 9}, false);
add_player("Player 3", {10, 9}, true);
+#endif
{
auto& e = *w.make_object<scenery>(w.make_id(), {ch, {K+3, K+1}}, door);
- fm_assert(e.frame == e.atlas->info().nframes-1);
+ const auto index = e.index();
+ const auto end = e.atlas->info().nframes-1;
+ fm_assert(e.frame == end);
fm_assert(!e.active);
e.activate(e.index());
fm_assert(e.active);
+ e.update(index, 1.f/60);
+ fm_assert(e.frame != end);
+ for (int i = 0; i < 60*3; i++)
+ e.update(index, 1.f/60);
+ fm_assert(e.frame == 0);
+ fm_assert(!e.active);
+
}
return c;
}