GRF: Add railtype custom signal sprite restricted flag, and control flag
This commit is contained in:
@@ -124,13 +124,14 @@ SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSp
|
||||
* @param gui Is the sprite being used on the map or in the GUI?
|
||||
* @return The sprite to draw.
|
||||
*/
|
||||
SpriteID GetCustomSignalSprite(const RailtypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, SignalState state, bool gui)
|
||||
SpriteID GetCustomSignalSprite(const RailtypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, SignalState state, bool gui, bool restricted)
|
||||
{
|
||||
if (rti->group[RTSG_SIGNALS] == nullptr) return 0;
|
||||
if (type == SIGTYPE_PROG && !HasBit(rti->ctrl_flags, RTCF_PROGSIG)) return 0;
|
||||
|
||||
uint32 param1 = gui ? 0x10 : 0x00;
|
||||
uint32 param2 = (type << 16) | (var << 8) | state;
|
||||
if (restricted && HasBit(rti->ctrl_flags, RTCF_RESTRICTEDSIG)) SetBit(param2, 24);
|
||||
RailTypeResolverObject object(rti, tile, TCX_NORMAL, RTSG_SIGNALS, param1, param2);
|
||||
|
||||
const SpriteGroup *group = object.Resolve();
|
||||
|
Reference in New Issue
Block a user