Changeset - r13165:024ce8aa50e8
[Not reviewed]
master
0 16 0
rubidium - 15 years ago 2009-10-02 15:13:15
rubidium@openttd.org
(svn r17682) -Codechange: remove erroneous space before some commas
16 files changed with 21 insertions and 21 deletions:
0 comments (0 inline, 0 general)
src/console_cmds.cpp
Show inline comments
 
@@ -1668,13 +1668,13 @@ DEF_CONSOLE_CMD(ConContent)
 
	}
 

	
 
	if (strcasecmp(argv[1], "state") == 0) {
 
		IConsolePrintF(CC_WHITE, "id, type, state, name");
 
		for (ConstContentIterator iter = _network_content_client.Begin(); iter != _network_content_client.End(); iter++) {
 
			static const char * const types[] = { "Base graphics", "NewGRF", "AI", "AI library", "Scenario", "Heightmap" };
 
			static const char * const states[] = { "Not selected", "Selected" , "Dep Selected", "Installed", "Unknown" };
 
			static const char * const states[] = { "Not selected", "Selected", "Dep Selected", "Installed", "Unknown" };
 
			static const ConsoleColour state_to_colour[] = { CC_COMMAND, CC_INFO, CC_INFO, CC_WHITE, CC_ERROR };
 

	
 
			const ContentInfo *ci = *iter;
 
			IConsolePrintF(state_to_colour[ci->state], "%d, %s, %s, %s", ci->id, types[ci->type - 1], states[ci->state], ci->name);
 
		}
 
		return true;
src/fileio.cpp
Show inline comments
 
@@ -904,13 +904,13 @@ void DeterminePaths(const char *exe)
 

	
 
	Searchpath sp;
 
	FOR_ALL_SEARCHPATHS(sp) DEBUG(misc, 4, "%s added as search path", _searchpaths[sp]);
 

	
 
	if (_config_file != NULL) {
 
		_personal_dir = strdup(_config_file);
 
		char *end = strrchr(_personal_dir , PATHSEPCHAR);
 
		char *end = strrchr(_personal_dir, PATHSEPCHAR);
 
		if (end == NULL) {
 
			_personal_dir[0] = '\0';
 
		} else {
 
			end[1] = '\0';
 
		}
 
	} else {
src/industry_cmd.cpp
Show inline comments
 
@@ -1551,14 +1551,14 @@ static void DoCreateNewIndustry(Industry
 

	
 
	/* don't use smooth economy for industries using production related callbacks */
 
	if (_settings_game.economy.smooth_economy &&
 
	    !(HasBit(indspec->callback_mask, CBM_IND_PRODUCTION_256_TICKS) || HasBit(indspec->callback_mask, CBM_IND_PRODUCTION_CARGO_ARRIVAL)) && // production callbacks
 
	    !(HasBit(indspec->callback_mask, CBM_IND_MONTHLYPROD_CHANGE) || HasBit(indspec->callback_mask, CBM_IND_PRODUCTION_CHANGE))             // production change callbacks
 
	) {
 
		i->production_rate[0] = min((RandomRange(256) + 128) * i->production_rate[0] >> 8 , 255);
 
		i->production_rate[1] = min((RandomRange(256) + 128) * i->production_rate[1] >> 8 , 255);
 
		i->production_rate[0] = min((RandomRange(256) + 128) * i->production_rate[0] >> 8, 255);
 
		i->production_rate[1] = min((RandomRange(256) + 128) * i->production_rate[1] >> 8, 255);
 
	}
 

	
 
	i->town = t;
 
	i->owner = owner;
 

	
 
	r = Random();
src/newgrf.cpp
Show inline comments
 
@@ -6067,13 +6067,13 @@ static void ActivateOldShore()
 
	if (_loaded_newgrf_features.shore == SHORE_REPLACE_NONE) _loaded_newgrf_features.shore = SHORE_REPLACE_ACTION_A;
 

	
 
	if (_loaded_newgrf_features.shore != SHORE_REPLACE_ACTION_5) {
 
		DupSprite(SPR_ORIGINALSHORE_START +  1, SPR_SHORE_BASE +  1); // SLOPE_W
 
		DupSprite(SPR_ORIGINALSHORE_START +  2, SPR_SHORE_BASE +  2); // SLOPE_S
 
		DupSprite(SPR_ORIGINALSHORE_START +  6, SPR_SHORE_BASE +  3); // SLOPE_SW
 
		DupSprite(SPR_ORIGINALSHORE_START     , SPR_SHORE_BASE +  4); // SLOPE_E
 
		DupSprite(SPR_ORIGINALSHORE_START +  0, SPR_SHORE_BASE +  4); // SLOPE_E
 
		DupSprite(SPR_ORIGINALSHORE_START +  4, SPR_SHORE_BASE +  6); // SLOPE_SE
 
		DupSprite(SPR_ORIGINALSHORE_START +  3, SPR_SHORE_BASE +  8); // SLOPE_N
 
		DupSprite(SPR_ORIGINALSHORE_START +  7, SPR_SHORE_BASE +  9); // SLOPE_NW
 
		DupSprite(SPR_ORIGINALSHORE_START +  5, SPR_SHORE_BASE + 12); // SLOPE_NE
 
	}
 

	
src/newgrf_commons.cpp
Show inline comments
 
@@ -302,13 +302,13 @@ TileIndex GetNearbyTile(byte parameter, 
 

	
 
	/* Make sure we never roam outside of the map, better wrap in that case */
 
	return TILE_MASK(tile + TileDiffXY(x, y));
 
}
 

	
 
/**
 
 * Common part of station var 0x67 , house var 0x62, indtile var 0x60, industry var 0x62.
 
 * Common part of station var 0x67, house var 0x62, indtile var 0x60, industry var 0x62.
 
 *
 
 * @param tile the tile of interest.
 
 * @return 0czzbbss: c = TileType; zz = TileZ; bb: 7-3 zero, 4-2 TerrainType, 1 water/shore, 0 zero; ss = TileSlope
 
 */
 
uint32 GetNearbyTileInformation(TileIndex tile)
 
{
src/order_cmd.cpp
Show inline comments
 
@@ -1377,13 +1377,13 @@ void RestoreVehicleOrders(const Vehicle 
 
				break;
 
			}
 
		}
 
	}
 

	
 
	/* Restore vehicle order-index and service interval */
 
	DoCommandP(0, v->index, bak->orderindex | (bak->service_interval << 16) , CMD_RESTORE_ORDER_INDEX);
 
	DoCommandP(0, v->index, bak->orderindex | (bak->service_interval << 16), CMD_RESTORE_ORDER_INDEX);
 

	
 
	/* Restore vehicle group */
 
	DoCommandP(0, bak->group, v->index, CMD_ADD_VEHICLE_GROUP);
 
}
 

	
 
/** Restore the current order-index of a vehicle and sets service-interval.
src/station.cpp
Show inline comments
 
@@ -319,13 +319,13 @@ void Station::RecomputeIndustriesNear()
 
		&this->industries_near
 
	};
 

	
 
	/* Compute maximum extent of acceptance rectangle wrt. station sign */
 
	TileIndex start_tile = this->xy;
 
	uint max_radius = max(
 
		max(DistanceManhattan(start_tile, TileXY(riv.rect.left , riv.rect.top)), DistanceManhattan(start_tile, TileXY(riv.rect.left , riv.rect.bottom))),
 
		max(DistanceManhattan(start_tile, TileXY(riv.rect.left,  riv.rect.top)), DistanceManhattan(start_tile, TileXY(riv.rect.left,  riv.rect.bottom))),
 
		max(DistanceManhattan(start_tile, TileXY(riv.rect.right, riv.rect.top)), DistanceManhattan(start_tile, TileXY(riv.rect.right, riv.rect.bottom)))
 
	);
 

	
 
	CircularTileSearch(&start_tile, 2 * max_radius + 1, &FindIndustryToDeliver, &riv);
 
}
 

	
src/station_gui.cpp
Show inline comments
 
@@ -352,13 +352,13 @@ public:
 
		int xb = 2; ///< offset from left of widget
 

	
 
		uint i = 0;
 
		const CargoSpec *cs;
 
		FOR_ALL_CARGOSPECS(cs) {
 
			cg_ofst = HasBit(this->cargo_filter, cs->Index()) ? 2 : 1;
 
			GfxFillRect(x + cg_ofst, y + cg_ofst, x + cg_ofst + 10 , y + cg_ofst + 7, cs->rating_colour);
 
			GfxFillRect(x + cg_ofst, y + cg_ofst, x + cg_ofst + 10, y + cg_ofst + 7, cs->rating_colour);
 
			DrawString(x + cg_ofst, x + 12 + cg_ofst, y + cg_ofst, cs->abbrev, TC_BLACK, SA_CENTER);
 
			x += 14;
 
			i++;
 
		}
 

	
 
		cg_ofst = this->IsWidgetLowered(SLW_NOCARGOWAITING) ? 2 : 1;
src/terraform_gui.cpp
Show inline comments
 
@@ -221,13 +221,13 @@ static void TerraformClick_Level(Window 
 
{
 
	HandlePlacePushButton(w, TTW_LEVEL_LAND, SPR_CURSOR_LEVEL_LAND, HT_POINT, PlaceProc_LevelLand);
 
}
 

	
 
static void TerraformClick_Dynamite(Window *w)
 
{
 
	HandlePlacePushButton(w, TTW_DEMOLISH, ANIMCURSOR_DEMOLISH , HT_RECT, PlaceProc_DemolishArea);
 
	HandlePlacePushButton(w, TTW_DEMOLISH, ANIMCURSOR_DEMOLISH, HT_RECT, PlaceProc_DemolishArea);
 
}
 

	
 
static void TerraformClick_BuyLand(Window *w)
 
{
 
	HandlePlacePushButton(w, TTW_BUY_LAND, SPR_CURSOR_BUY_LAND, HT_RECT, PlaceProc_BuyLand);
 
}
src/tgp.cpp
Show inline comments
 
@@ -535,13 +535,13 @@ static void HeightMapAdjustWaterLevel(am
 
	}
 

	
 
	/* We now have the proper water level value.
 
	 * Transform the height map into new (normalized) height map:
 
	 *   values from range: h_min..h_water_level will become negative so it will be clamped to 0
 
	 *   values from range: h_water_level..h_max are transformed into 0..h_max_new
 
	 * , where h_max_new is 4, 8, 12 or 16 depending on terrain type (very flat, flat, hilly, mountains)
 
	 *   where h_max_new is 4, 8, 12 or 16 depending on terrain type (very flat, flat, hilly, mountains)
 
	 */
 
	FOR_ALL_TILES_IN_HEIGHT(h) {
 
		/* Transform height from range h_water_level..h_max into 0..h_max_new range */
 
		*h = (height_t)(((int)h_max_new) * (*h - h_water_level) / (h_max - h_water_level)) + I2H(1);
 
		/* Make sure all values are in the proper range (0..h_max_new) */
 
		if (*h < 0) *h = I2H(0);
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -939,13 +939,13 @@ static void DrawTile_TunnelBridge(TileIn
 

	
 
		AddSortableSpriteToDraw(image + 1, PAL_NONE, ti->x + TILE_SIZE - 1, ti->y + TILE_SIZE - 1, BB_data[0], BB_data[1], TILE_HEIGHT, ti->z, false, BB_data[2], BB_data[3], BB_Z_SEPARATOR);
 

	
 
		if (catenary) EndSpriteCombine();
 

	
 
		/* Add helper BB for sprite sorting, that separate the tunnel from things beside of it */
 
		AddSortableSpriteToDraw(SPR_EMPTY_BOUNDING_BOX, PAL_NONE, ti->x             , ti->y             , BB_data[6], BB_data[7], TILE_HEIGHT, ti->z);
 
		AddSortableSpriteToDraw(SPR_EMPTY_BOUNDING_BOX, PAL_NONE, ti->x,              ti->y,              BB_data[6], BB_data[7], TILE_HEIGHT, ti->z);
 
		AddSortableSpriteToDraw(SPR_EMPTY_BOUNDING_BOX, PAL_NONE, ti->x + BB_data[4], ti->y + BB_data[5], BB_data[6], BB_data[7], TILE_HEIGHT, ti->z);
 

	
 
		DrawBridgeMiddle(ti);
 
	} else { // IsBridge(ti->tile)
 
		const PalSpriteID *psid;
 
		int base_offset;
src/unmovable_map.h
Show inline comments
 
@@ -174,13 +174,13 @@ static inline void SetCompanyHQSection(T
 
static inline void EnlargeCompanyHQ(TileIndex t, byte size)
 
{
 
	assert(GetCompanyHQSection(t) == 0);
 
	assert(size <= 4);
 
	if (size <= GetCompanyHQSize(t)) return;
 

	
 
	SetCompanyHQSize(t                   , size);
 
	SetCompanyHQSize(t,                    size);
 
	SetCompanyHQSize(t + TileDiffXY(0, 1), size);
 
	SetCompanyHQSize(t + TileDiffXY(1, 0), size);
 
	SetCompanyHQSize(t + TileDiffXY(1, 1), size);
 
}
 

	
 

	
 
@@ -260,13 +260,13 @@ static inline void MakeUnmovableHQHelper
 
 * Make an HQ with the give tile as it's northern tile.
 
 * @param t the tile to make the northern tile of a HQ.
 
 * @param o the owner of the HQ.
 
 */
 
static inline void MakeCompanyHQ(TileIndex t, Owner o)
 
{
 
	MakeUnmovableHQHelper(t                   , 0, o);
 
	MakeUnmovableHQHelper(t,                    0, o);
 
	MakeUnmovableHQHelper(t + TileDiffXY(0, 1), 1, o);
 
	MakeUnmovableHQHelper(t + TileDiffXY(1, 0), 2, o);
 
	MakeUnmovableHQHelper(t + TileDiffXY(1, 1), 3, o);
 
}
 

	
 
#endif /* UNMOVABLE_MAP_H */
src/vehicle.cpp
Show inline comments
 
@@ -1120,15 +1120,15 @@ GetNewVehiclePosResult GetNewVehiclePos(
 
	gp.old_tile = v->tile;
 
	gp.new_tile = TileVirtXY(x, y);
 
	return gp;
 
}
 

	
 
static const Direction _new_direction_table[] = {
 
	DIR_N , DIR_NW, DIR_W ,
 
	DIR_N,  DIR_NW, DIR_W,
 
	DIR_NE, DIR_SE, DIR_SW,
 
	DIR_E , DIR_SE, DIR_S
 
	DIR_E,  DIR_SE, DIR_S
 
};
 

	
 
Direction GetDirectionTowards(const Vehicle *v, int x, int y)
 
{
 
	int i = 0;
 

	
src/vehicle_cmd.cpp
Show inline comments
 
@@ -440,13 +440,13 @@ CommandCost CmdCloneVehicle(TileIndex ti
 
	do {
 
		do {
 
			if (flags & DC_EXEC) {
 
				assert(w != NULL);
 

	
 
				if (w->cargo_type != v->cargo_type || w->cargo_subtype != v->cargo_subtype) {
 
					CommandCost cost = DoCommand(0, w->index, v->cargo_type | (v->cargo_subtype << 8) | 1U << 16 , flags, GetCmdRefitVeh(v));
 
					CommandCost cost = DoCommand(0, w->index, v->cargo_type | (v->cargo_subtype << 8) | 1U << 16, flags, GetCmdRefitVeh(v));
 
					if (CmdSucceeded(cost)) total_cost.AddCost(cost);
 
				}
 

	
 
				if (w->type == VEH_TRAIN && Train::From(w)->HasArticulatedPart()) {
 
					w = Train::From(w)->GetNextArticPart();
 
				} else if (w->type == VEH_ROAD && RoadVehicle::From(w)->HasArticulatedPart()) {
src/viewport.cpp
Show inline comments
 
@@ -238,25 +238,25 @@ static void DoSetViewportPosition(const 
 
				DoSetViewportPosition(w, left + (w->left - left), top, width - (w->left - left), height);
 
				return;
 
			}
 

	
 
			if (left + width > w->left + w->width) {
 
				DoSetViewportPosition(w, left, top, (w->left + w->width - left), height);
 
				DoSetViewportPosition(w, left + (w->left + w->width - left), top, width - (w->left + w->width - left) , height);
 
				DoSetViewportPosition(w, left + (w->left + w->width - left), top, width - (w->left + w->width - left), height);
 
				return;
 
			}
 

	
 
			if (top < w->top) {
 
				DoSetViewportPosition(w, left, top, width, (w->top - top));
 
				DoSetViewportPosition(w, left, top + (w->top - top), width, height - (w->top - top));
 
				return;
 
			}
 

	
 
			if (top + height > w->top + w->height) {
 
				DoSetViewportPosition(w, left, top, width, (w->top + w->height - top));
 
				DoSetViewportPosition(w, left, top + (w->top + w->height - top), width , height - (w->top + w->height - top));
 
				DoSetViewportPosition(w, left, top + (w->top + w->height - top), width, height - (w->top + w->height - top));
 
				return;
 
			}
 

	
 
			return;
 
		}
 
	}
src/window.cpp
Show inline comments
 
@@ -2161,14 +2161,14 @@ static const int8 scrollamt[16][2] = {
 
	{ 0, -2}, ///<  2 : up
 
	{-2, -1}, ///<  3 : left  + up
 
	{ 2,  0}, ///<  4 : right
 
	{ 0,  0}, ///<  5 : left  + right = nothing
 
	{ 2, -1}, ///<  6 : right + up
 
	{ 0, -2}, ///<  7 : right + left  + up = up
 
	{ 0  ,2}, ///<  8 : down
 
	{-2  ,1}, ///<  9 : down  + left
 
	{ 0,  2}, ///<  8 : down
 
	{-2,  1}, ///<  9 : down  + left
 
	{ 0,  0}, ///< 10 : down  + up    = nothing
 
	{-2,  0}, ///< 11 : left  + up    +  down = left
 
	{ 2,  1}, ///< 12 : down  + right
 
	{ 0,  2}, ///< 13 : left  + right +  down = down
 
	{ 2,  0}, ///< 14 : right + up    +  down = right
 
	{ 0,  0}, ///< 15 : left  + up    +  right + down  = nothing
0 comments (0 inline, 0 general)