Codechange: Move usage of ResolverObjects to newgrf_xxx.cpp (#14116)

This commit is contained in:
frosch
2025-04-26 20:53:50 +02:00
committed by GitHub
parent be39a05327
commit f62f728187
6 changed files with 55 additions and 43 deletions

View File

@@ -21,6 +21,7 @@
#include "window_type.h"
#include "timer/timer_game_calendar.h"
#include "town.h"
#include "tile_cmd.h"
#include "viewport_func.h"
#include "newgrf_animation_base.h"
#include "newgrf_sound.h"
@@ -349,6 +350,14 @@ void DrawRoadStopTile(int x, int y, RoadType roadtype, const RoadStopSpec *spec,
DrawCommonTileSeqInGUI(x, y, dts, 0, 0, palette, true);
}
const TileLayoutSpriteGroup *GetRoadStopLayout(TileInfo *ti, const RoadStopSpec *spec, BaseStation *st, StationType type, int view)
{
RoadStopResolverObject object(spec, st, ti->tile, INVALID_ROADTYPE, type, view);
const SpriteGroup *group = object.Resolve();
if (group == nullptr || group->type != SGT_TILELAYOUT) return nullptr;
return static_cast<const TileLayoutSpriteGroup *>(group);
}
/** Wrapper for animation control, see GetRoadStopCallback. */
uint16_t GetAnimRoadStopCallback(CallbackID callback, uint32_t param1, uint32_t param2, const RoadStopSpec *roadstopspec, BaseStation *st, TileIndex tile, int)
{