industry_cmd.c
changeset 5687 a6f0e780d714
parent 5686 03c3d3b3e7eb
equal deleted inserted replaced
5686:03c3d3b3e7eb 5687:a6f0e780d714
   201 	IndustryDrawCoalPlantSparks,
   201 	IndustryDrawCoalPlantSparks,
   202 };
   202 };
   203 
   203 
   204 static void DrawTile_Industry(TileInfo *ti)
   204 static void DrawTile_Industry(TileInfo *ti)
   205 {
   205 {
       
   206 	const IndustryGfx gfx = GetIndustryGfx(ti->tile);
   206 	const Industry *ind;
   207 	const Industry *ind;
   207 	const DrawBuildingsTileStruct *dits;
   208 	const DrawBuildingsTileStruct *dits;
   208 	byte z;
   209 	byte z;
   209 	uint32 image, ormod;
   210 	uint32 image, ormod;
   210 
   211 
   211 	/* Pointer to industry */
   212 	/* Pointer to industry */
   212 	ind = GetIndustryByTile(ti->tile);
   213 	ind = GetIndustryByTile(ti->tile);
   213 	ormod = GENERAL_SPRITE_COLOR(ind->random_color);
   214 	ormod = GENERAL_SPRITE_COLOR(ind->random_color);
   214 
   215 
   215 	/* Retrieve pointer to the draw industry tile struct */
   216 	/* Retrieve pointer to the draw industry tile struct */
   216 	dits = &_industry_draw_tile_data[GetIndustryGfx(ti->tile) << 2 | GetIndustryConstructionStage(ti->tile)];
   217 	dits = &_industry_draw_tile_data[gfx << 2 | (_industry_section_draw_animation_state[gfx] ?
       
   218 			GetIndustryAnimationState(ti->tile) & 3 :
       
   219 			GetIndustryConstructionStage(ti->tile))];
   217 
   220 
   218 	image = dits->ground;
   221 	image = dits->ground;
   219 	if (image & PALETTE_MODIFIER_COLOR && (image & PALETTE_SPRITE_MASK) == 0)
   222 	if (image & PALETTE_MODIFIER_COLOR && (image & PALETTE_SPRITE_MASK) == 0)
   220 		image |= ormod;
   223 		image |= ormod;
   221 
   224 
   494 
   497 
   495 			if (state < 0x1A0) {
   498 			if (state < 0x1A0) {
   496 				if (state < 0x20 || state >= 0x180) {
   499 				if (state < 0x20 || state >= 0x180) {
   497 					m = GetIndustryAnimationState(tile);
   500 					m = GetIndustryAnimationState(tile);
   498 					if (!(m & 0x40)) {
   501 					if (!(m & 0x40)) {
   499 						SetIndustryAnimationState(tile, m |= 0x40);
   502 						SetIndustryAnimationState(tile, m | 0x40);
   500 						SndPlayTileFx(SND_0B_MINING_MACHINERY, tile);
   503 						SndPlayTileFx(SND_0B_MINING_MACHINERY, tile);
   501 					}
   504 					}
   502 					if (state & 7)
   505 					if (state & 7)
   503 						return;
   506 						return;
   504 				} else {
   507 				} else {