summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-06-07 04:20:47 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-06-07 04:20:47 +0200
commitd74a0ca1f0bca44b4c2ea657139cfadf883f0e4f (patch)
tree83fb8874d0afd2c630b901e947b3f9ca4271c949
parent4764df57de6b784a12f86bbb9f63f594b137658b (diff)
c inspector window title
-rw-r--r--editor/inspect-draw.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/editor/inspect-draw.cpp b/editor/inspect-draw.cpp
index c420c03e..f3b4982f 100644
--- a/editor/inspect-draw.cpp
+++ b/editor/inspect-draw.cpp
@@ -75,46 +75,52 @@ void app::entity_friendly_name(char* buf, size_t len, const object& obj)
{
switch (obj.type())
{
- default:
- std::snprintf(buf, len, "(unknown?)");
+ case object_type::none:
+ case object_type::COUNT:
break;
+ case object_type::hole:
+ std::snprintf(buf, len, "%s", "hole");
+ return;
case object_type::critter: {
const auto& c = static_cast<const critter&>(obj);
std::snprintf(buf, len, "critter %s", c.name.data());
- break;
+ return;
}
case object_type::light: {
const auto& L = static_cast<const light&>(obj);
- const char* type;
+ const char* type = "(unknown?)";
switch (L.falloff)
{
+ case light_falloff::COUNT: break;
case light_falloff::constant: type = "constant"; break;
case light_falloff::linear: type = "linear"; break;
case light_falloff::quadratic: type = "quadratic"; break;
- default: type = "(unknown?)"; break;
}
std::snprintf(buf, len, "light #%hhx%hhx%hhx%hhx %s:%.2f",
L.color.r(), L.color.g(), L.color.b(), L.color.a(),
type,
L.falloff == light_falloff::constant ? 0. : (double)L.max_distance);
- break;
+ return;
}
case object_type::scenery: {
const auto& sc = static_cast<const scenery&>(obj);
switch (sc.scenery_type())
{
- default:
- std::snprintf(buf, len, "(unknown?)");
+ case scenery_type::none:
+ case scenery_type::COUNT:
break;
case scenery_type::door:
std::snprintf(buf, len, "door");
- break;
+ return;
case scenery_type::generic:
std::snprintf(buf, len, "scenery %s", sc.atlas->name().data());
- break;
+ return;
}
+ std::snprintf(buf, len, "(scenery?)");
+ return;
}
}
+ std::snprintf(buf, len, "(unknown?)");
}
} // namespace floormat