Changeset - r14736:e919fd200318
[Not reviewed]
master
0 2 0
alberth - 14 years ago 2010-03-06 11:54:59
alberth@openttd.org
(svn r19334) -Codechange: method-call codestyle fixes, and introduction of const reference formal parameter.
2 files changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/base_station_base.h
Show inline comments
 
@@ -46,7 +46,7 @@ struct StationRect : public Rect {
 

	
 
	static bool ScanForStationTiles(StationID st_id, int left_a, int top_a, int right_a, int bottom_a);
 

	
 
	StationRect& operator = (Rect src);
 
	StationRect& operator = (const Rect &src);
 
};
 

	
 
/** Base class for all station-ish types */
src/station.cpp
Show inline comments
 
@@ -370,13 +370,13 @@ bool StationRect::BeforeAddTile(TileInde
 
{
 
	int x = TileX(tile);
 
	int y = TileY(tile);
 
	if (IsEmpty()) {
 
	if (this->IsEmpty()) {
 
		/* we are adding the first station tile */
 
		if (mode != ADD_TEST) {
 
			this->left = this->right = x;
 
			this->top = this->bottom = y;
 
		}
 
	} else if (!PtInExtendedRect(x, y)) {
 
	} else if (!this->PtInExtendedRect(x, y)) {
 
		/* current rect is not empty and new point is outside this rect
 
		 * make new spread-out rectangle */
 
		Rect new_rect = {min(x, this->left), min(y, this->top), max(x, this->right), max(y, this->bottom)};
 
@@ -481,15 +481,15 @@ bool StationRect::AfterRemoveTile(BaseSt
 

	
 
bool StationRect::AfterRemoveRect(BaseStation *st, TileIndex tile, int w, int h)
 
{
 
	assert(PtInExtendedRect(TileX(tile), TileY(tile)));
 
	assert(PtInExtendedRect(TileX(tile) + w - 1, TileY(tile) + h - 1));
 
	assert(this->PtInExtendedRect(TileX(tile), TileY(tile)));
 
	assert(this->PtInExtendedRect(TileX(tile) + w - 1, TileY(tile) + h - 1));
 

	
 
	bool empty = this->AfterRemoveTile(st, tile);
 
	if (w != 1 || h != 1) empty = empty || AfterRemoveTile(st, TILE_ADDXY(tile, w - 1, h - 1));
 
	if (w != 1 || h != 1) empty = empty || this->AfterRemoveTile(st, TILE_ADDXY(tile, w - 1, h - 1));
 
	return empty;
 
}
 

	
 
StationRect& StationRect::operator = (Rect src)
 
StationRect& StationRect::operator = (const Rect &src)
 
{
 
	this->left = src.left;
 
	this->top = src.top;
0 comments (0 inline, 0 general)