mirror of https://github.com/OpenTTD/OpenTTD
(svn r14944) -Cleanup: add spaces around some operators
parent
c08f520acf
commit
cda853872a
|
@ -3401,7 +3401,7 @@ static void AiStateAirportStuff(Company *c)
|
||||||
static CommandCost AiDoBuildDefaultAirportBlock(TileIndex tile, const AiDefaultBlockData *p, byte flag)
|
static CommandCost AiDoBuildDefaultAirportBlock(TileIndex tile, const AiDefaultBlockData *p, byte flag)
|
||||||
{
|
{
|
||||||
uint32 avail_airports = GetValidAirports();
|
uint32 avail_airports = GetValidAirports();
|
||||||
CommandCost ret,total_cost(EXPENSES_CONSTRUCTION);
|
CommandCost ret, total_cost(EXPENSES_CONSTRUCTION);
|
||||||
|
|
||||||
for (; p->mode == 0; p++) {
|
for (; p->mode == 0; p++) {
|
||||||
if (!HasBit(avail_airports, p->attr)) return CMD_ERROR;
|
if (!HasBit(avail_airports, p->attr)) return CMD_ERROR;
|
||||||
|
|
|
@ -64,7 +64,7 @@ CommandCost AiNew_Build_Bridge(Company *c, TileIndex tile_a, TileIndex tile_b, b
|
||||||
// Find a good bridgetype (the best money can buy)
|
// Find a good bridgetype (the best money can buy)
|
||||||
bridge_len = GetTunnelBridgeLength(tile_a, tile_b);
|
bridge_len = GetTunnelBridgeLength(tile_a, tile_b);
|
||||||
type = type2 = 0;
|
type = type2 = 0;
|
||||||
for (bridge_type = MAX_BRIDGES-1; bridge_type >= 0; bridge_type--) {
|
for (bridge_type = MAX_BRIDGES - 1; bridge_type >= 0; bridge_type--) {
|
||||||
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
|
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
|
||||||
type2 = type;
|
type2 = type;
|
||||||
type = bridge_type;
|
type = bridge_type;
|
||||||
|
@ -142,7 +142,7 @@ CommandCost AiNew_Build_RoutePart(Company *c, Ai_PathFinderInfo *PathFinderInfo,
|
||||||
if (route_extra[part - 1] == 0 && route_extra[part] == 0) {
|
if (route_extra[part - 1] == 0 && route_extra[part] == 0) {
|
||||||
while (route_extra[part] == 0) {
|
while (route_extra[part] == 0) {
|
||||||
// Get the current direction
|
// Get the current direction
|
||||||
dir = AiNew_GetRailDirection(route[part-1], route[part], route[part+1]);
|
dir = AiNew_GetRailDirection(route[part - 1], route[part], route[part + 1]);
|
||||||
// Is it the same as the last one?
|
// Is it the same as the last one?
|
||||||
if (old_dir != -1 && old_dir != dir) break;
|
if (old_dir != -1 && old_dir != dir) break;
|
||||||
old_dir = dir;
|
old_dir = dir;
|
||||||
|
@ -191,10 +191,10 @@ CommandCost AiNew_Build_RoutePart(Company *c, Ai_PathFinderInfo *PathFinderInfo,
|
||||||
// Keep it doing till we go an other way
|
// Keep it doing till we go an other way
|
||||||
// EnsureNoVehicleOnGround makes sure we don't build on a tile where a vehicle is. This way
|
// EnsureNoVehicleOnGround makes sure we don't build on a tile where a vehicle is. This way
|
||||||
// it will wait till the vehicle is gone..
|
// it will wait till the vehicle is gone..
|
||||||
if (route_extra[part-1] == 0 && route_extra[part] == 0 && (flag != DC_EXEC || EnsureNoVehicleOnGround(route[part]))) {
|
if (route_extra[part - 1] == 0 && route_extra[part] == 0 && (flag != DC_EXEC || EnsureNoVehicleOnGround(route[part]))) {
|
||||||
while (route_extra[part] == 0 && (flag != DC_EXEC || EnsureNoVehicleOnGround(route[part]))) {
|
while (route_extra[part] == 0 && (flag != DC_EXEC || EnsureNoVehicleOnGround(route[part]))) {
|
||||||
// Get the current direction
|
// Get the current direction
|
||||||
dir = AiNew_GetRoadDirection(route[part-1], route[part], route[part+1]);
|
dir = AiNew_GetRoadDirection(route[part - 1], route[part], route[part + 1]);
|
||||||
// Is it the same as the last one?
|
// Is it the same as the last one?
|
||||||
if (old_dir != -1 && old_dir != dir) break;
|
if (old_dir != -1 && old_dir != dir) break;
|
||||||
old_dir = dir;
|
old_dir = dir;
|
||||||
|
|
|
@ -180,7 +180,7 @@ void ZoomInOrOutToCursorWindow(bool in, Window *w)
|
||||||
if ((in && vp->zoom == ZOOM_LVL_MIN) || (!in && vp->zoom == ZOOM_LVL_MAX))
|
if ((in && vp->zoom == ZOOM_LVL_MIN) || (!in && vp->zoom == ZOOM_LVL_MAX))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Point pt = GetTileZoomCenterWindow(in,w);
|
Point pt = GetTileZoomCenterWindow(in, w);
|
||||||
if (pt.x != -1) {
|
if (pt.x != -1) {
|
||||||
ScrollWindowTo(pt.x, pt.y, w, true);
|
ScrollWindowTo(pt.x, pt.y, w, true);
|
||||||
|
|
||||||
|
|
|
@ -575,7 +575,7 @@ void ShowEstimatedCostOrIncome(Money cost, int x, int y)
|
||||||
|
|
||||||
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
|
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
|
||||||
{
|
{
|
||||||
Point pt = RemapCoords(x,y,z);
|
Point pt = RemapCoords(x, y, z);
|
||||||
StringID msg = STR_0801_COST;
|
StringID msg = STR_0801_COST;
|
||||||
|
|
||||||
if (cost < 0) {
|
if (cost < 0) {
|
||||||
|
@ -588,7 +588,7 @@ void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
|
||||||
|
|
||||||
void ShowFeederIncomeAnimation(int x, int y, int z, Money cost)
|
void ShowFeederIncomeAnimation(int x, int y, int z, Money cost)
|
||||||
{
|
{
|
||||||
Point pt = RemapCoords(x,y,z);
|
Point pt = RemapCoords(x, y, z);
|
||||||
|
|
||||||
SetDParam(0, cost);
|
SetDParam(0, cost);
|
||||||
AddTextEffect(STR_FEEDER, pt.x, pt.y, 0x250, TE_RISING);
|
AddTextEffect(STR_FEEDER, pt.x, pt.y, 0x250, TE_RISING);
|
||||||
|
|
|
@ -1036,7 +1036,7 @@ static void NetworkGenerateUniqueId()
|
||||||
{
|
{
|
||||||
Md5 checksum;
|
Md5 checksum;
|
||||||
uint8 digest[16];
|
uint8 digest[16];
|
||||||
char hex_output[16*2 + 1];
|
char hex_output[16 * 2 + 1];
|
||||||
char coding_string[NETWORK_NAME_LENGTH];
|
char coding_string[NETWORK_NAME_LENGTH];
|
||||||
int di;
|
int di;
|
||||||
|
|
||||||
|
|
|
@ -59,12 +59,12 @@ static const Widget _smallmap_widgets[] = {
|
||||||
static int _smallmap_industry_count;
|
static int _smallmap_industry_count;
|
||||||
|
|
||||||
/** Macro for ordinary entry of LegendAndColor */
|
/** Macro for ordinary entry of LegendAndColor */
|
||||||
#define MK(a,b) {a, b, INVALID_INDUSTRYTYPE, true, false, false}
|
#define MK(a, b) {a, b, INVALID_INDUSTRYTYPE, true, false, false}
|
||||||
/** Macro for end of list marker in arrays of LegendAndColor */
|
/** Macro for end of list marker in arrays of LegendAndColor */
|
||||||
#define MKEND() {0, STR_NULL, INVALID_INDUSTRYTYPE, true, true, false}
|
#define MKEND() {0, STR_NULL, INVALID_INDUSTRYTYPE, true, true, false}
|
||||||
/** Macro for break marker in arrays of LegendAndColor.
|
/** Macro for break marker in arrays of LegendAndColor.
|
||||||
* It will have valid data, though */
|
* It will have valid data, though */
|
||||||
#define MS(a,b) {a, b, INVALID_INDUSTRYTYPE, true, false, true}
|
#define MS(a, b) {a, b, INVALID_INDUSTRYTYPE, true, false, true}
|
||||||
|
|
||||||
/** Structure for holding relevant data for legends in small map */
|
/** Structure for holding relevant data for legends in small map */
|
||||||
struct LegendAndColour {
|
struct LegendAndColour {
|
||||||
|
@ -144,7 +144,7 @@ static const LegendAndColour _legend_land_owners[] = {
|
||||||
|
|
||||||
/** Allow room for all industries, plus a terminator entry
|
/** Allow room for all industries, plus a terminator entry
|
||||||
* This is required in order to have the indutry slots all filled up */
|
* This is required in order to have the indutry slots all filled up */
|
||||||
static LegendAndColour _legend_from_industries[NUM_INDUSTRYTYPES+1];
|
static LegendAndColour _legend_from_industries[NUM_INDUSTRYTYPES + 1];
|
||||||
/* For connecting industry type to position in industries list(small map legend) */
|
/* For connecting industry type to position in industries list(small map legend) */
|
||||||
static uint _industry_to_list_pos[NUM_INDUSTRYTYPES];
|
static uint _industry_to_list_pos[NUM_INDUSTRYTYPES];
|
||||||
|
|
||||||
|
@ -583,7 +583,7 @@ public:
|
||||||
{
|
{
|
||||||
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
|
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
|
||||||
DrawPixelInfo *old_dpi;
|
DrawPixelInfo *old_dpi;
|
||||||
int dx,dy, x, y, x2, y2;
|
int dx, dy, x, y, x2, y2;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
int tile_x;
|
int tile_x;
|
||||||
int tile_y;
|
int tile_y;
|
||||||
|
@ -755,7 +755,7 @@ public:
|
||||||
Point pt;
|
Point pt;
|
||||||
|
|
||||||
/* Find main viewport. */
|
/* Find main viewport. */
|
||||||
vp = FindWindowById(WC_MAIN_WINDOW,0)->viewport;
|
vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
|
||||||
|
|
||||||
pt = RemapCoords(this->scroll_x, this->scroll_y, 0);
|
pt = RemapCoords(this->scroll_x, this->scroll_y, 0);
|
||||||
|
|
||||||
|
|
|
@ -860,7 +860,7 @@ Vehicle *CheckClickOnVehicle(const ViewPort *vp, int x, int y)
|
||||||
y = ScaleByZoom(y, vp->zoom) + vp->virtual_top;
|
y = ScaleByZoom(y, vp->zoom) + vp->virtual_top;
|
||||||
|
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
if ((v->vehstatus & (VS_HIDDEN|VS_UNCLICKABLE)) == 0 &&
|
if ((v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) == 0 &&
|
||||||
x >= v->left_coord && x <= v->right_coord &&
|
x >= v->left_coord && x <= v->right_coord &&
|
||||||
y >= v->top_coord && y <= v->bottom_coord) {
|
y >= v->top_coord && y <= v->bottom_coord) {
|
||||||
|
|
||||||
|
@ -958,7 +958,7 @@ void AgeVehicle(Vehicle *v)
|
||||||
if (v->age < 65535) v->age++;
|
if (v->age < 65535) v->age++;
|
||||||
|
|
||||||
int age = v->age - v->max_age;
|
int age = v->age - v->max_age;
|
||||||
if (age == 366*0 || age == 366*1 || age == 366*2 || age == 366*3 || age == 366*4) v->reliability_spd_dec <<= 1;
|
if (age == 366 * 0 || age == 366 * 1 || age == 366 * 2 || age == 366 * 3 || age == 366 * 4) v->reliability_spd_dec <<= 1;
|
||||||
|
|
||||||
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
||||||
|
|
||||||
|
|
|
@ -88,10 +88,10 @@ struct VkMapping {
|
||||||
|
|
||||||
static const VkMapping _vk_mapping[] = {
|
static const VkMapping _vk_mapping[] = {
|
||||||
/* Pageup stuff + up/down */
|
/* Pageup stuff + up/down */
|
||||||
AM(VK_PRIOR,VK_DOWN, WKC_PAGEUP, WKC_DOWN),
|
AM(VK_PRIOR, VK_DOWN, WKC_PAGEUP, WKC_DOWN),
|
||||||
/* Map letters & digits */
|
/* Map letters & digits */
|
||||||
AM('A','Z','A','Z'),
|
AM('A', 'Z', 'A', 'Z'),
|
||||||
AM('0','9','0','9'),
|
AM('0', '9', '0', '9'),
|
||||||
|
|
||||||
AS(VK_ESCAPE, WKC_ESC),
|
AS(VK_ESCAPE, WKC_ESC),
|
||||||
AS(VK_PAUSE, WKC_PAUSE),
|
AS(VK_PAUSE, WKC_PAUSE),
|
||||||
|
@ -169,7 +169,7 @@ static void ClientSizeChanged(int w, int h)
|
||||||
// It allows you to redraw the screen from within the MSVC debugger
|
// It allows you to redraw the screen from within the MSVC debugger
|
||||||
int RedrawScreenDebug()
|
int RedrawScreenDebug()
|
||||||
{
|
{
|
||||||
HDC dc,dc2;
|
HDC dc, dc2;
|
||||||
static int _fooctr;
|
static int _fooctr;
|
||||||
HBITMAP old_bmp;
|
HBITMAP old_bmp;
|
||||||
HPALETTE old_palette;
|
HPALETTE old_palette;
|
||||||
|
|
|
@ -270,14 +270,14 @@ static void DoSetViewportPosition(const Window *w, int left, int top, int width,
|
||||||
left += xo;
|
left += xo;
|
||||||
width -= xo;
|
width -= xo;
|
||||||
} else if (xo < 0) {
|
} else if (xo < 0) {
|
||||||
RedrawScreenRect(left+width+xo, top, left+width, top + height);
|
RedrawScreenRect(left + width + xo, top, left + width, top + height);
|
||||||
width += xo;
|
width += xo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (yo > 0) {
|
if (yo > 0) {
|
||||||
RedrawScreenRect(left, top, width+left, top + yo);
|
RedrawScreenRect(left, top, width + left, top + yo);
|
||||||
} else if (yo < 0) {
|
} else if (yo < 0) {
|
||||||
RedrawScreenRect(left, top + height + yo, width+left, top + height);
|
RedrawScreenRect(left, top + height + yo, width + left, top + height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -364,7 +364,7 @@ ViewPort *IsPtInWindowViewport(const Window *w, int x, int y)
|
||||||
static Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y)
|
static Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y)
|
||||||
{
|
{
|
||||||
Point pt;
|
Point pt;
|
||||||
int a,b;
|
int a, b;
|
||||||
uint z;
|
uint z;
|
||||||
|
|
||||||
if ( (uint)(x -= vp->left) >= (uint)vp->width ||
|
if ( (uint)(x -= vp->left) >= (uint)vp->width ||
|
||||||
|
@ -376,8 +376,8 @@ static Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y)
|
||||||
x = (ScaleByZoom(x, vp->zoom) + vp->virtual_left) >> 2;
|
x = (ScaleByZoom(x, vp->zoom) + vp->virtual_left) >> 2;
|
||||||
y = (ScaleByZoom(y, vp->zoom) + vp->virtual_top) >> 1;
|
y = (ScaleByZoom(y, vp->zoom) + vp->virtual_top) >> 1;
|
||||||
|
|
||||||
a = y-x;
|
a = y - x;
|
||||||
b = y+x;
|
b = y + x;
|
||||||
|
|
||||||
/* we need to move variables in to the valid range, as the
|
/* we need to move variables in to the valid range, as the
|
||||||
* GetTileZoomCenterWindow() function can call here with invalid x and/or y,
|
* GetTileZoomCenterWindow() function can call here with invalid x and/or y,
|
||||||
|
|
|
@ -939,7 +939,7 @@ void ShowInfo(const char *str)
|
||||||
wchar_t help_msgW[8192];
|
wchar_t help_msgW[8192];
|
||||||
#endif
|
#endif
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
_left_button_clicked =_left_button_down = false;
|
_left_button_clicked = _left_button_down = false;
|
||||||
|
|
||||||
old = MyShowCursor(true);
|
old = MyShowCursor(true);
|
||||||
if (MessageBox(GetActiveWindow(), MB_TO_WIDE_BUFFER(str, help_msgW, lengthof(help_msgW)), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) {
|
if (MessageBox(GetActiveWindow(), MB_TO_WIDE_BUFFER(str, help_msgW, lengthof(help_msgW)), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) {
|
||||||
|
|
Loading…
Reference in New Issue