From 2260ab972100f1d6679690b730b6f0aa7409b014 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 13 Apr 2024 17:42:30 +0200 Subject: instantiate scenery in a uniform manner Now using world::make_scenery(). Add `std::monostate` to the `scenery_proto` variant to catch potential bugs. --- test/critter.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/critter.cpp b/test/critter.cpp index f7ce3b35..72bb58cc 100644 --- a/test/critter.cpp +++ b/test/critter.cpp @@ -302,21 +302,17 @@ void test2(StringView instance_name, const Function& make_dt, double accel, uint void test3(StringView instance_name, const Function& make_dt, double accel, rotation r, bool no_unroll) { const auto W = wall_image_proto{ loader.wall_atlas("empty"), 0 }; - const auto S = scenery_proto{loader.scenery("table0")}; + auto S = loader.scenery("table0"); auto w = world(); w[{{-1,-1,0}, {13,13}}].t.wall_north() = W; w[{{-1,-1,0}, {13,13}}].t.wall_west() = W; w[{{1,1,0}, {4,5}}].t.wall_north() = W; w[{{1,1,0}, {5,4}}].t.wall_west() = W; - (void)w.make_object(w.make_id(), {{}, {0, 0}}, - std::get(S.subtype), S); // todo! - (void)w.make_object(w.make_id(), {{}, {1, 1}}, - std::get(S.subtype), S); - (void)w.make_object(w.make_id(), {{}, {14, 14}}, - std::get(S.subtype), S); - (void)w.make_object(w.make_id(), {{}, {15, 15}}, - std::get(S.subtype), S); + w.make_scenery(w.make_id(), {{}, {0, 0}}, scenery_proto(S)); + w.make_scenery(w.make_id(), {{}, {1, 1}}, scenery_proto(S)); + w.make_scenery(w.make_id(), {{}, {14, 14}}, scenery_proto(S)); + w.make_scenery(w.make_id(), {{}, {15, 15}}, scenery_proto(S)); w[chunk_coords_{}].sort_objects(); if (no_unroll) -- cgit v1.2.3