smallmap_gui.c
changeset 1214 33e07bbb7779
parent 1209 a1ac96655b79
child 1349 07514c2cc6d1
equal deleted inserted replaced
1213:bb9906f67932 1214:33e07bbb7779
   296 
   296 
   297 static inline uint32 GetSmallMapCountoursPixels(uint tile)
   297 static inline uint32 GetSmallMapCountoursPixels(uint tile)
   298 {
   298 {
   299 	uint t;
   299 	uint t;
   300 
   300 
   301 	t = TileType(tile);
   301 	t = GetTileType(tile);
   302 	if (t == MP_TUNNELBRIDGE) {
   302 	if (t == MP_TUNNELBRIDGE) {
   303 		t = _map5[tile];
   303 		t = _map5[tile];
   304 		if ((t & 0x80) == 0) t>>=1;
   304 		if ((t & 0x80) == 0) t>>=1;
   305 		if ((t & 6) == 0) {
   305 		if ((t & 6) == 0) {
   306 			t = MP_RAILWAY;
   306 			t = MP_RAILWAY;
   326 
   326 
   327 static inline uint32 GetSmallMapVehiclesPixels(uint tile)
   327 static inline uint32 GetSmallMapVehiclesPixels(uint tile)
   328 {
   328 {
   329 	uint t;
   329 	uint t;
   330 
   330 
   331 	t = TileType(tile);
   331 	t = GetTileType(tile);
   332 	if (t == MP_TUNNELBRIDGE) {
   332 	if (t == MP_TUNNELBRIDGE) {
   333 		t = _map5[tile];
   333 		t = _map5[tile];
   334 		if ((t & 0x80) == 0) t>>=1;
   334 		if ((t & 0x80) == 0) t>>=1;
   335 		if ((t & 6) == 0) {
   335 		if ((t & 6) == 0) {
   336 			t = MP_RAILWAY;
   336 			t = MP_RAILWAY;
   379 
   379 
   380 static inline uint32 GetSmallMapIndustriesPixels(uint tile)
   380 static inline uint32 GetSmallMapIndustriesPixels(uint tile)
   381 {
   381 {
   382 	int t;
   382 	int t;
   383 
   383 
   384 	t = TileType(tile);
   384 	t = GetTileType(tile);
   385 	if (t == MP_INDUSTRY) {
   385 	if (t == MP_INDUSTRY) {
   386 		byte color = _industry_smallmap_colors[_map5[tile]];
   386 		byte color = _industry_smallmap_colors[_map5[tile]];
   387 		return color + (color << 8) + (color << 16) + (color << 24);
   387 		return color + (color << 8) + (color << 16) + (color << 24);
   388 	} else {
   388 	} else {
   389 		if (t == MP_TUNNELBRIDGE) {
   389 		if (t == MP_TUNNELBRIDGE) {
   412 static inline uint32 GetSmallMapRoutesPixels(uint tile)
   412 static inline uint32 GetSmallMapRoutesPixels(uint tile)
   413 {
   413 {
   414 	int t;
   414 	int t;
   415 	uint32 bits;
   415 	uint32 bits;
   416 
   416 
   417 	t = TileType(tile);
   417 	t = GetTileType(tile);
   418 	if (t == MP_STATION) {
   418 	if (t == MP_STATION) {
   419 		byte m5 = _map5[tile];
   419 		byte m5 = _map5[tile];
   420 		(bits = MKCOLOR(0x56565656), m5 < 8) ||			//   8 - railroad station (green)
   420 		(bits = MKCOLOR(0x56565656), m5 < 8) ||			//   8 - railroad station (green)
   421 		(bits = MKCOLOR(0xB8B8B8B8), m5 < 0x43) ||	//  67 - airport (red)
   421 		(bits = MKCOLOR(0xB8B8B8B8), m5 < 0x43) ||	//  67 - airport (red)
   422 		(bits = MKCOLOR(0xC2C2C2C2), m5 < 0x47) ||	//  71 - truck loading bay (orange)
   422 		(bits = MKCOLOR(0xC2C2C2C2), m5 < 0x47) ||	//  71 - truck loading bay (orange)
   468 static inline uint32 GetSmallMapVegetationPixels(uint tile)
   468 static inline uint32 GetSmallMapVegetationPixels(uint tile)
   469 {
   469 {
   470 	int i,t;
   470 	int i,t;
   471 	uint32 bits;
   471 	uint32 bits;
   472 
   472 
   473 	t = TileType(tile);
   473 	t = GetTileType(tile);
   474 	if (t == MP_CLEAR) {
   474 	if (t == MP_CLEAR) {
   475 		i = (_map5[tile] & 0x1F) - 4;
   475 		i = (_map5[tile] & 0x1F) - 4;
   476 		if (i >= 0) i = (i >> 2);
   476 		if (i >= 0) i = (i >> 2);
   477 		bits = _vegetation_clear_bits[i + 4];
   477 		bits = _vegetation_clear_bits[i + 4];
   478 	} else if (t == MP_INDUSTRY) {
   478 	} else if (t == MP_INDUSTRY) {
   513 
   513 
   514 static inline uint32 GetSmallMapOwnerPixels(uint tile)
   514 static inline uint32 GetSmallMapOwnerPixels(uint tile)
   515 {
   515 {
   516 	int t;
   516 	int t;
   517 
   517 
   518 	t = TileType(tile);
   518 	t = GetTileType(tile);
   519 	if (t == MP_HOUSE || _map_owner[tile] == OWNER_TOWN) {
   519 	if (t == MP_HOUSE || _map_owner[tile] == OWNER_TOWN) {
   520 		t = 0x80;
   520 		t = 0x80;
   521 	} else if (t == MP_INDUSTRY) {
   521 	} else if (t == MP_INDUSTRY) {
   522 		t = 0xff;
   522 		t = 0xff;
   523 	} else {
   523 	} else {