summaryrefslogtreecommitdiff
path: root/viewport.c
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2004-12-14 20:54:01 +0000
committerdominik <dominik@openttd.org>2004-12-14 20:54:01 +0000
commitb3c7d7f3bdd2796d97eed04fafcc7be98d5c5d18 (patch)
treefac4c84e745b0bd4dcaad799eecf398665dc5456 /viewport.c
parentb0fa342aaaae58f21d4576bd4d77f41d7abe0477 (diff)
downloadopenttd-b3c7d7f3bdd2796d97eed04fafcc7be98d5c5d18.tar.xz
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
Diffstat (limited to 'viewport.c')
-rw-r--r--viewport.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/viewport.c b/viewport.c
index 3259e286b..dc91e988d 100644
--- a/viewport.c
+++ b/viewport.c
@@ -1111,20 +1111,9 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, StringSpriteToDraw *ss)
SetDParam(0, ss->params[0]);
SetDParam(1, ss->params[1]);
if (_display_opt & DO_TRANS_BUILDINGS && ss->width != 0) {
- /* This is such a frustrating mess - I need to convert
- * from real color codes to string color codes and guess
- * what, they are completely different. --pasky */
- static const byte ci2sci[17] = {
- /* 0 */ 16, /* 1 */ 0, /* 2 */ 5,
- /* 3X*/ 2, /* 4 */ 8, /* 5 */ 3,
- /* 6X*/ 14, /* 7 */ 7, /* 8 */ 9,
- /* 9 */ 13, /* 10 */ 10, /* 11 */ 15,
- /* 12 */ 4, /* 13 */ 6, /* 14 */ 11,
- /* 15 */ 1, /* 16 */ 12
- };
- byte color = ci2sci[ss->color + 1];
-
- DrawString(ss->x >> zoom, (ss->y >> zoom) - (ss->width&0x8000?2:0), ss->string, color);
+ /* Real colors need the IS_PALETTE_COLOR flag, otherwise colors from _string_colormap are assumed. */
+ DrawString(ss->x >> zoom, (ss->y >> zoom) - (ss->width&0x8000?2:0), ss->string,
+ (_color_list[ss->color].window_color_bgb | IS_PALETTE_COLOR));
} else {
DrawString(ss->x >> zoom, (ss->y >> zoom) - (ss->width&0x8000?2:0), ss->string, 16);
}