smallmap_gui.c
changeset 4455 f7e53dabbb72
parent 4435 40eff4363774
child 4481 ce61d412fdc6
equal deleted inserted replaced
4454:e76250abab97 4455:f7e53dabbb72
     4 #include "openttd.h"
     4 #include "openttd.h"
     5 #include "functions.h"
     5 #include "functions.h"
     6 #include "bridge_map.h"
     6 #include "bridge_map.h"
     7 #include "clear_map.h"
     7 #include "clear_map.h"
     8 #include "industry_map.h"
     8 #include "industry_map.h"
     9 #include "spritecache.h"
       
    10 #include "station_map.h"
     9 #include "station_map.h"
    11 #include "table/strings.h"
    10 #include "table/strings.h"
    12 #include "table/sprites.h"
    11 #include "table/sprites.h"
    13 #include "map.h"
    12 #include "map.h"
    14 #include "tile.h"
    13 #include "tile.h"
   556 
   555 
   557 static const byte _vehicle_type_colors[6] = {
   556 static const byte _vehicle_type_colors[6] = {
   558 	184, 191, 152, 15, 215, 184
   557 	184, 191, 152, 15, 215, 184
   559 };
   558 };
   560 
   559 
   561 static inline uint32 dup_byte32(byte b) {
       
   562 	return b + (b << 8) + (b << 16) + (b << 24);
       
   563 }
       
   564 
   560 
   565 static void DrawVertMapIndicator(int x, int y, int x2, int y2)
   561 static void DrawVertMapIndicator(int x, int y, int x2, int y2)
   566 {
   562 {
   567 	GfxFillRect(x, y,      x2, y + 3, 69);
   563 	GfxFillRect(x, y,      x2, y + 3, 69);
   568 	GfxFillRect(x, y2 - 3, x2, y2,    69);
   564 	GfxFillRect(x, y2 - 3, x2, y2,    69);
   615 
   611 
   616 		/* now fill with the player colors */
   612 		/* now fill with the player colors */
   617 		FOR_ALL_PLAYERS(p) {
   613 		FOR_ALL_PLAYERS(p) {
   618 			if (p->is_active) {
   614 			if (p->is_active) {
   619 				_owner_colors[p->index] =
   615 				_owner_colors[p->index] =
   620 					dup_byte32(GetNonSprite(PALETTE_RECOLOR_START + p->player_color)[0xCB]); // XXX - magic pixel
   616 					_colour_gradient[p->player_color][5] * 0x01010101;
   621 			}
   617 			}
   622 		}
   618 		}
   623 	}
   619 	}
   624 
   620 
   625 	tile_x = WP(w,smallmap_d).scroll_x / TILE_SIZE;
   621 	tile_x = WP(w,smallmap_d).scroll_x / TILE_SIZE;