Changeset - r16979:924a59c4f2ac
[Not reviewed]
master
0 1 0
terkhen - 14 years ago 2011-01-04 21:03:01
terkhen@openttd.org
(svn r21725) -Cleanup: Remove unused owner code.
1 file changed with 11 insertions and 23 deletions:
0 comments (0 inline, 0 general)
src/smallmap_gui.cpp
Show inline comments
 
@@ -515,38 +515,42 @@ static inline uint32 GetSmallMapVegetati
 

	
 
		default:
 
			return ApplyMask(MKCOLOUR(0x54545454), &_smallmap_vehicles_andor[t]);
 
	}
 
}
 

	
 

	
 
static uint32 _owner_colours[OWNER_END + 1];
 

	
 
/**
 
 * Return the colour a tile would be displayed with in the small map in mode "Owner".
 
 *
 
 * @param tile The tile of which we would like to get the colour.
 
 * @param t    Effective tile type of the tile (see #GetEffectiveTileType).
 
 * @return The colour of tile in the small map in mode "Owner"
 
 */
 
static inline uint32 GetSmallMapOwnerPixels(TileIndex tile, TileType t)
 
{
 
	Owner o;
 

	
 
	switch (t) {
 
		case MP_INDUSTRY: o = OWNER_END;          break;
 
		case MP_HOUSE:    o = OWNER_TOWN;         break;
 
		case MP_INDUSTRY: return MKCOLOUR(0x20202020);
 
		case MP_HOUSE:    return MKCOLOUR(0xB4B4B4B4);
 
		default:          o = GetTileOwner(tile); break;
 
		/* FIXME: For MP_ROAD there are multiple owners.
 
		 * GetTileOwner returns the rail owner (level crossing) resp. the owner of ROADTYPE_ROAD (normal road),
 
		 * even if there are no ROADTYPE_ROAD bits on the tile.
 
		 */
 
	}
 

	
 
	if (o <= MAX_COMPANIES && !_legend_land_owners[_company_to_list_pos[o]].show_on_map) o = OWNER_NONE;
 
	return _owner_colours[o];
 
	if ((o <= MAX_COMPANIES && !_legend_land_owners[_company_to_list_pos[o]].show_on_map) || o == OWNER_NONE) {
 
		return _heightmap_schemes[_settings_client.gui.smallmap_land_colour].default_colour;
 
	} else if (o == OWNER_WATER) {
 
		return MKCOLOUR(0xCACACACA);
 
	} else if (o == OWNER_TOWN) {
 
		return MKCOLOUR(0xB4B4B4B4);
 
	}
 

	
 
	return _legend_land_owners[_company_to_list_pos[o]].colour * 0x01010101;
 
}
 

	
 
/** Vehicle colours in #SMT_VEHICLES mode. Indexed by #VehicleTypeByte. */
 
static const byte _vehicle_type_colours[6] = {
 
	184, 191, 152, 15, 215, 184
 
};
 
@@ -941,28 +945,12 @@ class SmallMapWindow : public Window {
 
		old_dpi = _cur_dpi;
 
		_cur_dpi = dpi;
 

	
 
		/* Clear it */
 
		GfxFillRect(dpi->left, dpi->top, dpi->left + dpi->width - 1, dpi->top + dpi->height - 1, 0);
 

	
 
		/* Setup owner table */
 
		if (this->map_type == SMT_OWNER) {
 
			const Company *c;
 

	
 
			/* Fill with some special colours */
 
			_owner_colours[OWNER_TOWN]  = MKCOLOUR(0xB4B4B4B4);
 
			_owner_colours[OWNER_NONE]  = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].default_colour;
 
			_owner_colours[OWNER_WATER] = MKCOLOUR(0xCACACACA);
 
			_owner_colours[OWNER_END]   = MKCOLOUR(0x20202020); // Industry
 

	
 
			/* Now fill with the company colours */
 
			FOR_ALL_COMPANIES(c) {
 
				_owner_colours[c->index] = _colour_gradient[c->colour][5] * 0x01010101;
 
			}
 
		}
 

	
 
		/* Which tile is displayed at (dpi->left, dpi->top)? */
 
		int dx;
 
		Point tile = this->PixelToTile(dpi->left, dpi->top, &dx);
 
		int tile_x = this->scroll_x / (int)TILE_SIZE + tile.x;
 
		int tile_y = this->scroll_y / (int)TILE_SIZE + tile.y;
 

	
0 comments (0 inline, 0 general)