MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DrawNewObjectTile

Function DrawNewObjectTile

src/newgrf_object.cpp:472–483  ·  view source on GitHub ↗

* Draw an object on the map. * @param ti Information about the tile to draw on. * @param spec Object spec to draw. */

Source from the content-addressed store, hash-verified

470 * @param spec Object spec to draw.
471 */
472void DrawNewObjectTile(TileInfo *ti, const ObjectSpec *spec)
473{
474 Object *o = Object::GetByTile(ti->tile);
475 ObjectResolverObject object(spec, o, ti->tile);
476
477 const auto *group = object.Resolve<TileLayoutSpriteGroup>();
478 if (group == nullptr) return;
479
480 auto processor = group->ProcessRegisters(object, nullptr);
481 auto dts = processor.GetLayout();
482 DrawTileLayout(ti, dts, spec);
483}
484
485/**
486 * Draw representation of an object (tile) for GUI purposes.

Callers 1

DrawTile_ObjectFunction · 0.85

Calls 3

GetLayoutMethod · 0.80
DrawTileLayoutFunction · 0.70
ProcessRegistersMethod · 0.45

Tested by

no test coverage detected