summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-09-02 20:01:18 +0000
committerfrosch <frosch@openttd.org>2008-09-02 20:01:18 +0000
commit7a13b29190329e16b60eaba5b8cce8700a7d180a (patch)
tree4e9876c631d7047f15a9a651d805d769dbb28eb1 /src/newgrf.cpp
parent9ca1972e010d38db34b1a117f55818c5b7dca897 (diff)
downloadopenttd-7a13b29190329e16b60eaba5b8cce8700a7d180a.tar.xz
(svn r14230) -Codechange: Simplify MapDOSColour() using the new stuff.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index dea96f88c..842993598 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -321,18 +321,10 @@ StringID MapGRFStringID(uint32 grfid, StringID str)
return str;
}
-static uint8 MapDOSColour(uint8 colour)
+static inline uint8 MapDOSColour(uint8 colour)
{
- if (_use_palette == PAL_DOS) return colour;
-
- if (colour < 10) {
- static uint8 dos_to_win_colour_map[] = { 0, 215, 216, 136, 88, 106, 32, 33, 40, 245 };
- return dos_to_win_colour_map[colour];
- }
-
- if (colour >= 245 && colour < 254) return colour - 28;
-
- return colour;
+ extern const byte _palmap_d2w[];
+ return (_use_palette == PAL_DOS ? colour : _palmap_d2w[colour]);
}
static std::map<uint32, uint32> _grf_id_overrides;