Add setting to show restricted electric signals using the default sprites.

This is to improve visual distinctiveness of restricted signals when
using signal GRFs.
This defaults to off.
This commit is contained in:
Jonathan G Rennison
2015-12-09 01:01:37 +00:00
parent 8edf5e0a34
commit a93714a720
8 changed files with 43 additions and 3 deletions

View File

@@ -5671,11 +5671,19 @@ static void GraphicsNew(ByteReader *buf)
/* Load <num> sprites starting from <replace>, then skip <skip_num> sprites. */
grfmsg(2, "GraphicsNew: Replacing sprites %d to %d of %s (type 0x%02X) at SpriteID 0x%04X", offset, offset + num - 1, action5_type->name, type, replace);
for (; num > 0; num--) {
for (uint16 n = num; n > 0; n--) {
_cur.nfo_line++;
LoadNextSprite(replace == 0 ? _cur.spriteid++ : replace++, _cur.file_index, _cur.nfo_line, _cur.grf_container_ver);
}
if (type == 0x04 && (_cur.grffile->is_ottdfile || _cur.grfconfig->ident.grfid == BSWAP32(0xFF4F4701))) {
/* Signal graphics action 5: Fill duplicate signal sprite block if this is a baseset GRF or OpenGFX */
const SpriteID end = offset + num;
for (SpriteID i = offset; i < end; i++) {
DupSprite(SPR_SIGNALS_BASE + i, SPR_DUP_SIGNALS_BASE + i);
}
}
if (type == 0x0D) _loaded_newgrf_features.shore = SHORE_REPLACE_ACTION_5;
_cur.skip_sprites = skip_num;