src/smallmap_gui.cpp
branchnoai
changeset 9599 949374e83b78
parent 9574 698395509d12
child 9601 b499fdd106d5
equal deleted inserted replaced
9598:b73018a5ffc0 9599:949374e83b78
     9 #include "clear_map.h"
     9 #include "clear_map.h"
    10 #include "industry_map.h"
    10 #include "industry_map.h"
    11 #include "station_map.h"
    11 #include "station_map.h"
    12 #include "table/strings.h"
    12 #include "table/strings.h"
    13 #include "table/sprites.h"
    13 #include "table/sprites.h"
       
    14 #include "landscape.h"
    14 #include "map.h"
    15 #include "map.h"
    15 #include "tile.h"
    16 #include "tile.h"
    16 #include "gui.h"
    17 #include "gui.h"
    17 #include "tree_map.h"
    18 #include "tree_map.h"
    18 #include "tunnel_map.h"
    19 #include "tunnel_map.h"
   390 	TileType t = GetEffectiveTileType(tile);
   391 	TileType t = GetEffectiveTileType(tile);
   391 
   392 
   392 	return ApplyMask(MKCOLOR(0x54545454), &_smallmap_vehicles_andor[t]);
   393 	return ApplyMask(MKCOLOR(0x54545454), &_smallmap_vehicles_andor[t]);
   393 }
   394 }
   394 
   395 
   395 /* Industry colours... a total of 175 gfx - XXX - increase if more industries */
       
   396 static const byte _industry_smallmap_colors[175] = {
       
   397 	215, 215, 215, 215, 215, 215, 215, 184,
       
   398 	184, 184, 184, 194, 194, 194, 194, 194,
       
   399 	 86,  86, 191, 191, 191, 191, 191, 191,
       
   400 	152, 152, 152, 152, 152, 152, 152, 152,
       
   401 	152,  48,  48,  48,  48,  48,  48, 174,
       
   402 	174, 174, 174, 174, 174, 174, 174,  10,
       
   403 	 10,  10,  10,  10,  10,  10,  10,  10,
       
   404 	 10,  10,  15,  15,  55,  55,  55,  55,
       
   405 	 10,  10,  10,  10,  10,  10,  10,  10,
       
   406 	194, 194, 194, 194, 194, 194, 194, 194,
       
   407 	194, 194, 194, 194, 194, 194, 194, 194,
       
   408 	194,  15,  15, 184, 184, 184, 184, 184,
       
   409 	184, 184, 184, 184,  55,  55,  55,  55,
       
   410 	 55,  55,  55,  55,  55,  55,  55,  55,
       
   411 	 55,  55,  55,  55,  86,  39,  37,  37,
       
   412 	208, 174, 174, 174, 174, 194, 194, 194,
       
   413 	194,  48,  48, 174, 174, 174, 174,  39,
       
   414 	 39,  55, 208, 208, 208, 208,  10,  10,
       
   415 	 10,  10,  10,  10,  37,  37,  37,  37,
       
   416 	 37,  37,  37,  37, 184, 184, 184, 184,
       
   417 	152, 152, 152, 152, 194, 194, 194,  15,
       
   418 	 15,  15,  15,  15,  15,  15,  15,
       
   419 };
       
   420 
       
   421 /**
   396 /**
   422  * Return the color a tile would be displayed with in the small map in mode "Industries".
   397  * Return the color a tile would be displayed with in the small map in mode "Industries".
   423  *
   398  *
   424  * @param tile The tile of which we would like to get the color.
   399  * @param tile The tile of which we would like to get the color.
   425  * @return The color of tile in the small map in mode "Industries"
   400  * @return The color of tile in the small map in mode "Industries"
   427 static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile)
   402 static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile)
   428 {
   403 {
   429 	TileType t = GetEffectiveTileType(tile);
   404 	TileType t = GetEffectiveTileType(tile);
   430 
   405 
   431 	if (t == MP_INDUSTRY) {
   406 	if (t == MP_INDUSTRY) {
   432 		return _industry_smallmap_colors[GetIndustryGfx(tile)] * 0x01010101;
   407 		return GetIndustrySpec(GetIndustryByTile(tile)->type)->map_colour * 0x01010101;
   433 	}
   408 	}
   434 
   409 
   435 	return ApplyMask(MKCOLOR(0x54545454), &_smallmap_vehicles_andor[t]);
   410 	return ApplyMask(MKCOLOR(0x54545454), &_smallmap_vehicles_andor[t]);
   436 }
   411 }
   437 
   412