diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp index 53211b6596..fad95ece34 100644 --- a/src/newgrf_object.cpp +++ b/src/newgrf_object.cpp @@ -566,3 +566,8 @@ void TriggerObjectAnimation(Object *o, ObjectAnimationTrigger trigger, const Obj TriggerObjectTileAnimation(o, tile, trigger, spec); } } + +void DumpObjectSpriteGroup(const ObjectSpec *spec, std::function print) +{ + DumpSpriteGroup(spec->grf_prop.spritegroup[0], std::move(print)); +} diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 0ea7ae007d..9845ff6657 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -837,6 +837,7 @@ static const NIVariable _niv_objects[] = { class NIHObject : public NIHelper { bool IsInspectable(uint index) const override { return ObjectSpec::GetByTile(index)->grf_prop.grffile != nullptr; } + bool ShowSpriteDumpButton(uint index) const override { return true; } uint GetParent(uint index) const override { return GetInspectWindowNumber(GSF_FAKE_TOWNS, Object::GetByTile(index)->town->index); } const void *GetInstance(uint index)const override { return Object::GetByTile(index); } const void *GetSpec(uint index) const override { return ObjectSpec::GetByTile(index); } @@ -890,6 +891,12 @@ class NIHObject : public NIHelper { } } } + + /* virtual */ void SpriteDump(uint index, std::function print) const override + { + extern void DumpObjectSpriteGroup(const ObjectSpec *spec, std::function print); + DumpObjectSpriteGroup(ObjectSpec::GetByTile(index), std::move(print)); + } }; static const NIFeature _nif_object = {