From 2361aaf601e4355986e607e525a75377bf754de8 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 21 Sep 2014 07:57:45 +0000 Subject: [PATCH] (svn r26869) -Add: support for an all black palette to prevent the need of having a black tile of all different slopes (ic111) --- bin/baseset/openttd.grf | Bin 825565 -> 825852 bytes bin/baseset/orig_dos.obg | 2 +- bin/baseset/orig_dos_de.obg | 2 +- bin/baseset/orig_win.obg | 2 +- config.lib | 12 ++++++------ media/extra_grf/openttd.nfo | 1 + media/extra_grf/palette.nfo | 20 ++++++++++++++++++++ src/newgrf.cpp | 1 + src/table/sprites.h | 8 +++++++- 9 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 media/extra_grf/palette.nfo diff --git a/bin/baseset/openttd.grf b/bin/baseset/openttd.grf index 5ee3115802c8a2b75a048a24b489b15892eec8d0..efe35ffd3897113f03b34162f7b177b8375010bf 100644 GIT binary patch delta 347 zcmcb+(df@+BNi5h|FardT3HxdS(sW`m|IzZY}Qs5wpJGQRu+y{7S2`{u2vTAtt>p3 zXVeQZ{O57Z$x%qkNleaGC`imnEh$N5X86x4!N|z?p8-hF6x7qybi#(K6I8+g1_04r B8N~nq delta 58 zcmeyf+34;@BNi5h|I-^;T3HxdS(sW`m|IzZY}Qs5wpJGQRu+y{7S2`{u2vTAtt>p3 JXRtAV0Ra9=4j=#k diff --git a/bin/baseset/orig_dos.obg b/bin/baseset/orig_dos.obg index d5f20332b5..51e8571583 100644 --- a/bin/baseset/orig_dos.obg +++ b/bin/baseset/orig_dos.obg @@ -70,7 +70,7 @@ TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8 TRGC.GRF = ed446637e034104c5559b32c18afe78d TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9 TRGT.GRF = e30e8a398ae86c03dc534a8ac7dfb3b6 -OPENTTD.GRF = 75a93cea2ed455c2fd5dcbda39e53538 +OPENTTD.GRF = 505d96061556d3bb5cec6234096ec5bc [origin] default = You can find it on your Transport Tycoon Deluxe CD-ROM. diff --git a/bin/baseset/orig_dos_de.obg b/bin/baseset/orig_dos_de.obg index 4cc59f48c3..6e446dccd4 100644 --- a/bin/baseset/orig_dos_de.obg +++ b/bin/baseset/orig_dos_de.obg @@ -70,7 +70,7 @@ TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8 TRGC.GRF = ed446637e034104c5559b32c18afe78d TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9 TRGT.GRF = fcde1d7e8a74197d72a62695884b909e -OPENTTD.GRF = 75a93cea2ed455c2fd5dcbda39e53538 +OPENTTD.GRF = 505d96061556d3bb5cec6234096ec5bc [origin] default = You can find it on your Transport Tycoon Deluxe CD-ROM. diff --git a/bin/baseset/orig_win.obg b/bin/baseset/orig_win.obg index ac1165bb4e..ce51077e76 100644 --- a/bin/baseset/orig_win.obg +++ b/bin/baseset/orig_win.obg @@ -70,7 +70,7 @@ TRGIR.GRF = 0c2484ff6be49fc63a83be6ab5c38f32 TRGCR.GRF = 3668f410c761a050b5e7095a2b14879b TRGHR.GRF = 06bf2b7a31766f048baac2ebe43457b1 TRGTR.GRF = de53650517fe661ceaa3138c6edb0eb8 -OPENTTD.GRF = 75a93cea2ed455c2fd5dcbda39e53538 +OPENTTD.GRF = 505d96061556d3bb5cec6234096ec5bc [origin] default = You can find it on your Transport Tycoon Deluxe CD-ROM. diff --git a/config.lib b/config.lib index c58b396632..9698a052ae 100644 --- a/config.lib +++ b/config.lib @@ -3183,9 +3183,9 @@ detect_grfcodec() { log 2 " returned $version" log 2 " exit code $ret" - if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version" -lt "949" ]; then - if [ -n "$version" ] && [ "$version" -lt "949" ]; then - log 1 "checking grfcodec... needs at least version 6.0.2 (r949), disabled" + if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version" -lt "985" ]; then + if [ -n "$version" ] && [ "$version" -lt "985" ]; then + log 1 "checking grfcodec... needs at least version 6.0.5 (r985), disabled" else log 1 "checking grfcodec... not found" fi @@ -3225,9 +3225,9 @@ detect_nforenum() { log 2 " returned $version" log 2 " exit code $ret" - if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version" -lt "949" ]; then - if [ -n "$version" ] && [ "$version" -lt "949" ]; then - log 1 "checking nforenum... needs at least version 6.0.2 (r949), disabled" + if [ -z "$version" ] || [ "$ret" != "0" ] || [ "$version" -lt "985" ]; then + if [ -n "$version" ] && [ "$version" -lt "985" ]; then + log 1 "checking nforenum... needs at least version 6.0.5 (r985), disabled" else log 1 "checking nforenum... not found" fi diff --git a/media/extra_grf/openttd.nfo b/media/extra_grf/openttd.nfo index e93b2066fb..66149a37e5 100644 --- a/media/extra_grf/openttd.nfo +++ b/media/extra_grf/openttd.nfo @@ -104,3 +104,4 @@ #include "rivers/tropic.nfo" #include "rivers/toyland.nfo" #include "tunnel_portals.nfo" +#include "palette.nfo" diff --git a/media/extra_grf/palette.nfo b/media/extra_grf/palette.nfo new file mode 100644 index 0000000000..4a6ae69505 --- /dev/null +++ b/media/extra_grf/palette.nfo @@ -0,0 +1,20 @@ +// +// $Id$ +// +// This file is part of OpenTTD. +// OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. +// OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . +// + + -1 * 0 0C "All black palette" + -1 * 0 05 18 01 + -1 * 0 00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 + 01 diff --git a/src/newgrf.cpp b/src/newgrf.cpp index b1b6f5ff14..88b3b25a48 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5594,6 +5594,7 @@ static const Action5Type _action5_types[] = { /* 0x15 */ { A5BLOCK_ALLOW_OFFSET, SPR_OPENTTD_BASE, 1, OPENTTD_SPRITE_COUNT, "OpenTTD GUI graphics" }, /* 0x16 */ { A5BLOCK_ALLOW_OFFSET, SPR_AIRPORT_PREVIEW_BASE, 1, SPR_AIRPORT_PREVIEW_COUNT, "Airport preview graphics" }, /* 0x17 */ { A5BLOCK_ALLOW_OFFSET, SPR_RAILTYPE_TUNNEL_BASE, 1, RAILTYPE_TUNNEL_BASE_COUNT, "Railtype tunnel base" }, + /* 0x18 */ { A5BLOCK_ALLOW_OFFSET, SPR_PALETTE_BASE, 1, PALETTE_SPRITE_COUNT, "Palette" }, }; /* Action 0x05 */ diff --git a/src/table/sprites.h b/src/table/sprites.h index 5d42caccb6..b5b3321b0d 100644 --- a/src/table/sprites.h +++ b/src/table/sprites.h @@ -290,8 +290,12 @@ static const uint16 RAILTYPE_TUNNEL_BASE_COUNT = 16; static const SpriteID SPR_EMPTY_BOUNDING_BOX = SPR_RAILTYPE_TUNNEL_BASE + RAILTYPE_TUNNEL_BASE_COUNT; static const uint16 EMPTY_BOUNDING_BOX_SPRITE_COUNT = 1; +/* Black palette sprite, needed for painting (fictive) tiles outside map */ +static const SpriteID SPR_PALETTE_BASE = SPR_EMPTY_BOUNDING_BOX + EMPTY_BOUNDING_BOX_SPRITE_COUNT; +static const uint16 PALETTE_SPRITE_COUNT = 1; + /* From where can we start putting NewGRFs? */ -static const SpriteID SPR_NEWGRFS_BASE = SPR_EMPTY_BOUNDING_BOX + EMPTY_BOUNDING_BOX_SPRITE_COUNT; +static const SpriteID SPR_NEWGRFS_BASE = SPR_PALETTE_BASE + PALETTE_SPRITE_COUNT; /* Manager face sprites */ static const SpriteID SPR_GRADIENT = 874; // background gradient behind manager face @@ -1562,4 +1566,6 @@ static const PaletteID PALETTE_CRASH = 804; ///< Recolour sprite static const PaletteID PALETTE_CHURCH_RED = 1438; ///< Recolour sprite for reddish churches static const PaletteID PALETTE_CHURCH_CREAM = 1439; ///< Recolour sprite for white churches +static const PaletteID PALETTE_ALL_BLACK = SPR_PALETTE_BASE; ///< Exchange any color by black, needed for painting fictive tiles outside map + #endif /* SPRITES_H */