src/newgrf_industrytiles.cpp
branchNewGRF_ports
changeset 6868 7eb395287b3d
parent 6743 cabfaa4a0295
child 6870 ca3fd1fbe311
equal deleted inserted replaced
6867:a4ad48192617 6868:7eb395287b3d
    33 uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index)
    33 uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index)
    34 {
    34 {
    35 	byte tile_type;
    35 	byte tile_type;
    36 	bool is_same_industry;
    36 	bool is_same_industry;
    37 
    37 
    38 	tile = GetNearbyTile(parameter, tile);
    38 	if (parameter != 0) tile = GetNearbyTile(parameter, tile); // only perform if it is required
    39 	is_same_industry = (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == index);
    39 	is_same_industry = (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == index);
    40 	tile_type = GetTerrainType(tile) << 2 | (IsTileType(tile, MP_WATER) ? 1 : 0) << 1 | (is_same_industry ? 1 : 0);
    40 	tile_type = GetTerrainType(tile) << 2 | (IsTileType(tile, MP_WATER) ? 1 : 0) << 1 | (is_same_industry ? 1 : 0);
    41 
    41 
    42 	return GetTileType(tile) << 24 | (TileHeight(tile) * 8) << 16 | tile_type << 8 | GetTileSlope(tile, NULL);
    42 	return GetTileType(tile) << 24 | (TileHeight(tile) * 8) << 16 | tile_type << 8 | GetTileSlope(tile, NULL);
    43 }
    43 }
   234 
   234 
   235 bool PerformIndustryTileSlopeCheck(TileIndex tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx)
   235 bool PerformIndustryTileSlopeCheck(TileIndex tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx)
   236 {
   236 {
   237 	Industry ind;
   237 	Industry ind;
   238 	ind.xy = 0;
   238 	ind.xy = 0;
       
   239 	ind.width = 0;
   239 	ind.type = type;
   240 	ind.type = type;
   240 
   241 
   241 	uint16 callback_res = GetIndustryTileCallback(CBID_INDTILE_SHAPE_CHECK, 0, 0, gfx, &ind, tile);
   242 	uint16 callback_res = GetIndustryTileCallback(CBID_INDTILE_SHAPE_CHECK, 0, 0, gfx, &ind, tile);
   242 	if (its->grf_prop.grffile->grf_version < 7) {
   243 	if (its->grf_prop.grffile->grf_version < 7) {
   243 		return callback_res != 0;
   244 		return callback_res != 0;