smallmap_gui.c
changeset 2049 538e73c53f54
parent 1981 3c9c682f1212
child 2062 57db03be52ad
equal deleted inserted replaced
2048:54fd558314dc 2049:538e73c53f54
   343 static inline TileType GetEffectiveTileType(TileIndex tile)
   343 static inline TileType GetEffectiveTileType(TileIndex tile)
   344 {
   344 {
   345 	TileType t = GetTileType(tile);
   345 	TileType t = GetTileType(tile);
   346 
   346 
   347 	if (t == MP_TUNNELBRIDGE) {
   347 	if (t == MP_TUNNELBRIDGE) {
   348 		t = _map5[tile];
   348 		t = _m[tile].m5;
   349 		if ((t & 0x80) == 0) t >>= 1;
   349 		if ((t & 0x80) == 0) t >>= 1;
   350 		if ((t & 6) == 0) {
   350 		if ((t & 6) == 0) {
   351 			t = MP_RAILWAY;
   351 			t = MP_RAILWAY;
   352 		} else if ((t & 6) == 2) {
   352 		} else if ((t & 6) == 2) {
   353 			t = MP_STREET;
   353 			t = MP_STREET;
   419 static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile)
   419 static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile)
   420 {
   420 {
   421 	TileType t = GetEffectiveTileType(tile);
   421 	TileType t = GetEffectiveTileType(tile);
   422 
   422 
   423 	if (t == MP_INDUSTRY) {
   423 	if (t == MP_INDUSTRY) {
   424 		byte color = _industry_smallmap_colors[_map5[tile]];
   424 		byte color = _industry_smallmap_colors[_m[tile].m5];
   425 		return color + (color << 8) + (color << 16) + (color << 24);
   425 		return color + (color << 8) + (color << 16) + (color << 24);
   426 	}
   426 	}
   427 
   427 
   428 	return ApplyMask(MKCOLOR(0x54545454), &_smallmap_vehicles_andor[t]);
   428 	return ApplyMask(MKCOLOR(0x54545454), &_smallmap_vehicles_andor[t]);
   429 }
   429 }
   438 {
   438 {
   439 	TileType t = GetEffectiveTileType(tile);
   439 	TileType t = GetEffectiveTileType(tile);
   440 	uint32 bits;
   440 	uint32 bits;
   441 
   441 
   442 	if (t == MP_STATION) {
   442 	if (t == MP_STATION) {
   443 		byte m5 = _map5[tile];
   443 		byte m5 = _m[tile].m5;
   444 		(bits = MKCOLOR(0x56565656), m5 < 8) ||			//   8 - railroad station (green)
   444 		(bits = MKCOLOR(0x56565656), m5 < 8) ||			//   8 - railroad station (green)
   445 		(bits = MKCOLOR(0xB8B8B8B8), m5 < 0x43) ||	//  67 - airport (red)
   445 		(bits = MKCOLOR(0xB8B8B8B8), m5 < 0x43) ||	//  67 - airport (red)
   446 		(bits = MKCOLOR(0xC2C2C2C2), m5 < 0x47) ||	//  71 - truck loading bay (orange)
   446 		(bits = MKCOLOR(0xC2C2C2C2), m5 < 0x47) ||	//  71 - truck loading bay (orange)
   447 		(bits = MKCOLOR(0xBFBFBFBF), m5 < 0x4B) ||	//  75 - bus station (yellow)
   447 		(bits = MKCOLOR(0xBFBFBFBF), m5 < 0x4B) ||	//  75 - bus station (yellow)
   448 		(bits = MKCOLOR(0x98989898), m5 < 0x53) ||	//  83 - docks (blue)
   448 		(bits = MKCOLOR(0x98989898), m5 < 0x53) ||	//  83 - docks (blue)
   477 	int i;
   477 	int i;
   478 	uint32 bits;
   478 	uint32 bits;
   479 
   479 
   480 	switch (t) {
   480 	switch (t) {
   481 		case MP_CLEAR:
   481 		case MP_CLEAR:
   482 			i = (_map5[tile] & 0x1F) - 4;
   482 			i = (_m[tile].m5 & 0x1F) - 4;
   483 			if (i >= 0) i >>= 2;
   483 			if (i >= 0) i >>= 2;
   484 			bits = _vegetation_clear_bits[i + 4];
   484 			bits = _vegetation_clear_bits[i + 4];
   485 			break;
   485 			break;
   486 
   486 
   487 		case MP_INDUSTRY:
   487 		case MP_INDUSTRY:
   488 			bits = IS_BYTE_INSIDE(_map5[tile], 0x10, 0x12) ? MKCOLOR(0xD0D0D0D0) : MKCOLOR(0xB5B5B5B5);
   488 			bits = IS_BYTE_INSIDE(_m[tile].m5, 0x10, 0x12) ? MKCOLOR(0xD0D0D0D0) : MKCOLOR(0xB5B5B5B5);
   489 			break;
   489 			break;
   490 
   490 
   491 		case MP_TREES:
   491 		case MP_TREES:
   492 			if ((_map2[tile] & 0x30) == 0x20)
   492 			if ((_m[tile].m2 & 0x30) == 0x20)
   493 				bits = (_opt.landscape == LT_HILLY) ? MKCOLOR(0x98575798) : MKCOLOR(0xC25757C2);
   493 				bits = (_opt.landscape == LT_HILLY) ? MKCOLOR(0x98575798) : MKCOLOR(0xC25757C2);
   494 			else
   494 			else
   495 				bits = MKCOLOR(0x54575754);
   495 				bits = MKCOLOR(0x54575754);
   496 			break;
   496 			break;
   497 
   497