smallmap_gui.c
changeset 1092 e3b4a131db7c
parent 1044 63e0601a43cc
child 1093 4fdc46eaf423
equal deleted inserted replaced
1091:0f113f2ed794 1092:e3b4a131db7c
   506 			WRITE_PIXELS_OR(dst, GetSmallMapVegetationPixels(TILE_XY(xc,yc)) & mask);
   506 			WRITE_PIXELS_OR(dst, GetSmallMapVegetationPixels(TILE_XY(xc,yc)) & mask);
   507 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   507 	} while (xc++,yc++,dst+=pitch,--reps != 0);
   508 }
   508 }
   509 
   509 
   510 
   510 
   511 static uint32 *_owner_colors;
   511 static uint32 _owner_colors[256];
   512 
   512 
   513 static inline uint32 GetSmallMapOwnerPixels(uint tile)
   513 static inline uint32 GetSmallMapOwnerPixels(uint tile)
   514 {
   514 {
   515 	int t;
   515 	int t;
   516 
   516 
   601 	GfxFillRect(dpi->left, dpi->top, dpi->left + dpi->width - 1, dpi->top + dpi->height - 1, 0);
   601 	GfxFillRect(dpi->left, dpi->top, dpi->left + dpi->width - 1, dpi->top + dpi->height - 1, 0);
   602 
   602 
   603 	/* setup owner table */
   603 	/* setup owner table */
   604 	if (type == 5) {
   604 	if (type == 5) {
   605 		Player *p;
   605 		Player *p;
   606 		uint32 *tbl;
       
   607 
       
   608 		/* setup owners ptr */
       
   609 		_owner_colors = tbl = alloca(256 * sizeof(*_owner_colors));
       
   610 
   606 
   611 		/* clear the town colors */
   607 		/* clear the town colors */
   612 		memset(tbl + 128, 0xB4, 128 * sizeof(*_owner_colors));
   608 		memset(&_owner_colors[128], 0xB4, 128 * sizeof(*_owner_colors));
   613 
   609 
   614 		/* fill with some special colors */
   610 		/* fill with some special colors */
   615 		tbl[0x10] = MKCOLOR(0x54545454);
   611 		_owner_colors[0x10] = MKCOLOR(0x54545454);
   616 		tbl[0x11] = MKCOLOR(0xCACACACA);
   612 		_owner_colors[0x11] = MKCOLOR(0xCACACACA);
   617 		tbl[0xff] = MKCOLOR(0x20202020); /* industry */
   613 		_owner_colors[0xff] = MKCOLOR(0x20202020); /* industry */
   618 
   614 
   619 		/* now fill with the player colors */
   615 		/* now fill with the player colors */
   620 		FOR_ALL_PLAYERS(p) {
   616 		FOR_ALL_PLAYERS(p) {
   621 			if (p->is_active) {
   617 			if (p->is_active)
   622 				tbl[p->index] = dup_byte32(GetSpritePtr(0x307 + p->player_color)[0xCB]);
   618 				_owner_colors[p->index] =
   623 			}
   619 					dup_byte32(GetSpritePtr(0x307 + p->player_color)[0xCB]);
   624 		}
   620 		}
   625 	}
   621 	}
   626 
   622 
   627 	tile_x = (int)WP(w,smallmap_d).scroll_x >> 4;
   623 	tile_x = (int)WP(w,smallmap_d).scroll_x >> 4;
   628 	tile_y = (int)WP(w,smallmap_d).scroll_y >> 4;
   624 	tile_y = (int)WP(w,smallmap_d).scroll_y >> 4;