From 2c8b46270845c6e697b9677c1e9a873892330d3b Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 5 Dec 2021 17:41:36 +0000 Subject: [PATCH] Debug: Add object view and colour to debug window --- src/table/newgrf_debug_data.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index f6d2bd0317..ab47791b58 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -856,8 +856,12 @@ class NIHObject : public NIHelper { output.print("Debug Info:"); const ObjectSpec *spec = ObjectSpec::GetByTile(index); if (spec) { + ObjectID id = GetObjectIndex(index); + const Object *obj = Object::Get(id); uint class_id = ObjectClass::Get(spec->cls_id)->global_id; - seprintf(buffer, lastof(buffer), " index: %u, type ID: %u, class ID: %c%c%c%c", GetObjectIndex(index), GetObjectType(index), class_id >> 24, class_id >> 16, class_id >> 8, class_id); + seprintf(buffer, lastof(buffer), " index: %u, type ID: %u, class ID: %c%c%c%c", id, GetObjectType(index), class_id >> 24, class_id >> 16, class_id >> 8, class_id); + output.print(buffer); + seprintf(buffer, lastof(buffer), " view: %u, colour: %u", obj->view, obj->colour); output.print(buffer); seprintf(buffer, lastof(buffer), " animation: frames: %u, status: %u, speed: %u, triggers: 0x%X", spec->animation.frames, spec->animation.status, spec->animation.speed, spec->animation.triggers); output.print(buffer);