src/industry_cmd.cpp
branchnoai
changeset 10294 7798ae816af8
parent 10249 58810805030e
child 10355 ee4b5f7a5bf2
equal deleted inserted replaced
10292:7856e972f8aa 10294:7798ae816af8
    37 #include "date_func.h"
    37 #include "date_func.h"
    38 #include "vehicle_func.h"
    38 #include "vehicle_func.h"
    39 #include "sound_func.h"
    39 #include "sound_func.h"
    40 #include "station_base.h"
    40 #include "station_base.h"
    41 #include "oldpool_func.h"
    41 #include "oldpool_func.h"
       
    42 #include "animated_tile_func.h"
       
    43 #include "effectvehicle_func.h"
    42 
    44 
    43 #include "table/strings.h"
    45 #include "table/strings.h"
    44 #include "table/sprites.h"
    46 #include "table/sprites.h"
    45 #include "table/industry_land.h"
    47 #include "table/industry_land.h"
    46 #include "table/build_industry.h"
    48 #include "table/build_industry.h"
   618 			}
   620 			}
   619 		} break;
   621 		} break;
   620 	}
   622 	}
   621 }
   623 }
   622 
   624 
   623 static void CreateIndustryEffectSmoke(TileIndex tile)
   625 static void CreateChimneySmoke(TileIndex tile)
   624 {
   626 {
   625 	uint x = TileX(tile) * TILE_SIZE;
   627 	uint x = TileX(tile) * TILE_SIZE;
   626 	uint y = TileY(tile) * TILE_SIZE;
   628 	uint y = TileY(tile) * TILE_SIZE;
   627 	uint z = GetTileMaxZ(tile);
   629 	uint z = GetTileMaxZ(tile);
   628 
   630 
   655 		return;
   657 		return;
   656 	}
   658 	}
   657 
   659 
   658 	switch (gfx) {
   660 	switch (gfx) {
   659 	case GFX_POWERPLANT_CHIMNEY:
   661 	case GFX_POWERPLANT_CHIMNEY:
   660 		CreateIndustryEffectSmoke(tile);
   662 		CreateChimneySmoke(tile);
   661 		break;
   663 		break;
   662 
   664 
   663 	case GFX_OILRIG_1:
   665 	case GFX_OILRIG_1:
   664 		if (GetIndustryGfx(tile + TileDiffXY(0, 1)) == GFX_OILRIG_1) BuildOilRig(tile);
   666 		if (GetIndustryGfx(tile + TileDiffXY(0, 1)) == GFX_OILRIG_1) BuildOilRig(tile);
   665 		break;
   667 		break;
   682 
   684 
   683 static void TileLoopIndustry_BubbleGenerator(TileIndex tile)
   685 static void TileLoopIndustry_BubbleGenerator(TileIndex tile)
   684 {
   686 {
   685 	int dir;
   687 	int dir;
   686 	Vehicle *v;
   688 	Vehicle *v;
   687 	static const int8 _tileloop_ind_case_161[12] = {
   689 	static const int8 _bubble_spawn_location[3][4] = {
   688 		11,   0, -4, -14,
   690 		{ 11,   0, -4, -14 },
   689 		-4, -10, -4,   1,
   691 		{ -4, -10, -4,   1 },
   690 		49,  59, 60,  65,
   692 		{ 49,  59, 60,  65 },
   691 	};
   693 	};
   692 
   694 
   693 	SndPlayTileFx(SND_2E_EXTRACT_AND_POP, tile);
   695 	SndPlayTileFx(SND_2E_EXTRACT_AND_POP, tile);
   694 
   696 
   695 	dir = Random() & 3;
   697 	dir = Random() & 3;
   696 
   698 
   697 	v = CreateEffectVehicleAbove(
   699 	v = CreateEffectVehicleAbove(
   698 		TileX(tile) * TILE_SIZE + _tileloop_ind_case_161[dir + 0],
   700 		TileX(tile) * TILE_SIZE + _bubble_spawn_location[0][dir],
   699 		TileY(tile) * TILE_SIZE + _tileloop_ind_case_161[dir + 4],
   701 		TileY(tile) * TILE_SIZE + _bubble_spawn_location[1][dir],
   700 		_tileloop_ind_case_161[dir + 8],
   702 		_bubble_spawn_location[2][dir],
   701 		EV_BUBBLE
   703 		EV_BUBBLE
   702 	);
   704 	);
   703 
   705 
   704 	if (v != NULL) v->u.special.animation_substate = dir;
   706 	if (v != NULL) v->u.effect.animation_substate = dir;
   705 }
   707 }
   706 
   708 
   707 static void TileLoop_Industry(TileIndex tile)
   709 static void TileLoop_Industry(TileIndex tile)
   708 {
   710 {
   709 	IndustryGfx newgfx;
   711 	IndustryGfx newgfx;