diff options
author | peter1138 <peter1138@openttd.org> | 2007-04-16 06:35:10 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-04-16 06:35:10 +0000 |
commit | 15e112c290458f05ccaadfb893328b67f689a520 (patch) | |
tree | 7b0d8c65195994199958ec5bcf645b6d50d2e919 /src | |
parent | cc647a08a0e10377358c471adcce00274b6cae06 (diff) | |
download | openttd-15e112c290458f05ccaadfb893328b67f689a520.tar.xz |
(svn r9645) -Feature: Add NewGRF Action 5 (Sprite Replacement) support for 2cc colour maps, airport, and road stop sprites.
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf.cpp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 46ac8fd72..d22c2cae9 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2835,7 +2835,7 @@ static void GraphicsNew(byte *buf, int len) switch (type) { case 0x04: // Signal graphics if (num != 112 && num != 240) { - grfmsg(1, "GraphicsNews: Signal graphics sprite count must be 112 or 240, skipping"); + grfmsg(1, "GraphicsNew: Signal graphics sprite count must be 112 or 240, skipping"); return; } _signal_base = _cur_spriteid; @@ -2843,7 +2843,7 @@ static void GraphicsNew(byte *buf, int len) case 0x05: // Catenary graphics if (num != 48) { - grfmsg(1, "GraphicsNews: Catenary graphics sprite count must be 48, skipping"); + grfmsg(1, "GraphicsNew: Catenary graphics sprite count must be 48, skipping"); return; } replace = SPR_ELRAIL_BASE + 3; @@ -2851,7 +2851,7 @@ static void GraphicsNew(byte *buf, int len) case 0x06: // Foundations if (num != 74) { - grfmsg(1, "GraphicsNews: Foundation graphics sprite count must be 74, skipping"); + grfmsg(1, "GraphicsNew: Foundation graphics sprite count must be 74, skipping"); return; } replace = SPR_SLOPES_BASE; @@ -2859,20 +2859,44 @@ static void GraphicsNew(byte *buf, int len) case 0x08: // Canal graphics if (num != 65) { - grfmsg(1, "GraphicsNews: Canal graphics sprite count must be 65, skipping"); + grfmsg(1, "GraphicsNew: Canal graphics sprite count must be 65, skipping"); return; } replace = SPR_CANALS_BASE + 5; break; + case 0x0A: // 2CC colour maps + if (num != 256) { + grfmsg(1, "GraphicsNew: 2CC colour maps sprite count must be 256, skipping"); + return; + } + replace = SPR_2CCMAP_BASE; + break; + case 0x0D: // Coast graphics if (num != 16) { - grfmsg(1, "GraphicsNews: Coast graphics sprite count must be 16, skipping"); + grfmsg(1, "GraphicsNew: Coast graphics sprite count must be 16, skipping"); return; } _coast_base = _cur_spriteid; break; + case 0x10: // New airport sprites + if (num != 15) { + grfmsg(1, "GraphicsNew: Airport graphics sprite count must be 8, skipping"); + return; + } + replace = SPR_AIRPORTX_BASE; + break; + + case 0x11: // Road stop sprites + if (num != 8) { + grfmsg(1, "GraphicsNew: Road stop graphics sprite count must be 8, skipping"); + return; + } + replace = SPR_ROADSTOP_BASE; + break; + default: grfmsg(2, "GraphicsNew: Custom graphics (type 0x%02X) sprite block of length %u (unimplemented, ignoring)", type, num); |