road_cmd.c
changeset 4212 0308ef21b4e1
parent 4158 a8f7265a6fd0
child 4226 3926da9dc486
equal deleted inserted replaced
4211:d8c4c40eba62 4212:0308ef21b4e1
   791 
   791 
   792 			ormod = PALETTE_TO_GREY;	//was this a bug/problem?
   792 			ormod = PALETTE_TO_GREY;	//was this a bug/problem?
   793 			player = GetTileOwner(ti->tile);
   793 			player = GetTileOwner(ti->tile);
   794 			if (player < MAX_PLAYERS) ormod = PLAYER_SPRITE_COLOR(player);
   794 			if (player < MAX_PLAYERS) ormod = PLAYER_SPRITE_COLOR(player);
   795 
   795 
   796 			drss = _road_display_datas[GetRoadDepotDirection(ti->tile)];
   796 			drss = _road_depot[GetRoadDepotDirection(ti->tile)];
   797 
   797 
   798 			DrawGroundSprite(drss++->image);
   798 			DrawGroundSprite(drss++->image);
   799 
   799 
   800 			for (; drss->image != 0; drss++) {
   800 			for (; drss->image != 0; drss++) {
   801 				uint32 image = drss->image;
   801 				uint32 image = drss->image;
   811 			break;
   811 			break;
   812 		}
   812 		}
   813 	}
   813 	}
   814 }
   814 }
   815 
   815 
   816 void DrawRoadDepotSprite(int x, int y, int image)
   816 void DrawRoadDepotSprite(int x, int y, DiagDirection dir)
   817 {
   817 {
   818 	const DrawRoadSeqStruct* dtss = _road_display_datas[image];
   818 	const DrawRoadSeqStruct* dtss = _road_depot[dir];
   819 	uint32 ormod = PLAYER_SPRITE_COLOR(_local_player);
   819 	uint32 ormod = PLAYER_SPRITE_COLOR(_local_player);
   820 
   820 
   821 	x += 33;
   821 	x += 33;
   822 	y += 17;
   822 	y += 17;
   823 
   823 
   824 	DrawSprite(dtss++->image, x, y);
   824 	DrawSprite(dtss++->image, x, y);
   825 
   825 
   826 	for (; dtss->image != 0; dtss++) {
   826 	for (; dtss->image != 0; dtss++) {
   827 		Point pt = RemapCoords(dtss->subcoord_x, dtss->subcoord_y, 0);
   827 		Point pt = RemapCoords(dtss->subcoord_x, dtss->subcoord_y, 0);
   828 
   828 		uint32 image = dtss->image;
   829 		image = dtss->image;
   829 
   830 		if (image & PALETTE_MODIFIER_COLOR) image |= ormod;
   830 		if (image & PALETTE_MODIFIER_COLOR) image |= ormod;
   831 
   831 
   832 		DrawSprite(image, x + pt.x, y + pt.y);
   832 		DrawSprite(image, x + pt.x, y + pt.y);
   833 	}
   833 	}
   834 }
   834 }