From 7577954ced47f09803bc1b3881d47f222dbd306b Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 18 Apr 2007 22:10:36 +0000 Subject: (svn r9672) -Cleanup: lots of coding style fixes around operands. --- src/ai/ai.h | 4 +- src/ai/default/default.cpp | 90 +-- src/ai/trolly/build.cpp | 4 +- src/ai/trolly/trolly.cpp | 14 +- src/airport_gui.cpp | 8 +- src/autoreplace_cmd.cpp | 2 +- src/build_vehicle_gui.cpp | 38 +- src/clear_cmd.cpp | 12 +- src/command.cpp | 6 +- src/command.h | 2 +- src/disaster_cmd.cpp | 18 +- src/dock_gui.cpp | 14 +- src/gfx.cpp | 12 +- src/graph_gui.cpp | 8 +- src/industry_cmd.cpp | 26 +- src/industry_gui.cpp | 46 +- src/landscape.cpp | 26 +- src/macros.h | 18 +- src/map.cpp | 8 +- src/map.h | 4 +- src/misc.cpp | 2 +- src/misc_gui.cpp | 6 +- src/music_gui.cpp | 8 +- src/namegen.cpp | 8 +- src/network/core/os_abstraction.h | 2 +- src/network/network_gui.cpp | 2 +- src/newgrf.cpp | 4 +- src/news.h | 2 +- src/oldloader.cpp | 8 +- src/openttd.cpp | 4 +- src/pathfind.cpp | 2 +- src/player_gui.cpp | 50 +- src/rail.cpp | 4 +- src/road_cmd.cpp | 6 +- src/road_gui.cpp | 24 +- src/roadveh_cmd.cpp | 4 +- src/saveload.cpp | 14 +- src/screenshot.cpp | 2 +- src/settings.cpp | 20 +- src/ship_cmd.cpp | 10 +- src/ship_gui.cpp | 8 +- src/signs.cpp | 2 +- src/station_cmd.cpp | 32 +- src/strgen/strgen.cpp | 4 +- src/strings.cpp | 16 +- src/table/ai_rail.h | 108 ++-- src/table/build_industry.h | 1294 ++++++++++++++++++------------------- src/table/namegen.h | 2 +- src/table/station_land.h | 8 +- src/table/tree_land.h | 2 +- src/terraform_gui.cpp | 2 +- src/town_cmd.cpp | 18 +- src/train_cmd.cpp | 2 +- src/tree_cmd.cpp | 2 +- src/variables.h | 4 +- src/vehicle.cpp | 8 +- src/vehicle_gui.cpp | 20 +- src/video/win32_v.cpp | 6 +- src/viewport.cpp | 4 +- src/water_cmd.cpp | 2 +- src/win32.cpp | 8 +- src/window.cpp | 8 +- 62 files changed, 1051 insertions(+), 1051 deletions(-) diff --git a/src/ai/ai.h b/src/ai/ai.h index c1d0726c3..4e7c999a5 100644 --- a/src/ai/ai.h +++ b/src/ai/ai.h @@ -77,8 +77,8 @@ static inline bool AI_AllowNewAI() return true; } -#define AI_CHANCE16(a,b) ((uint16) AI_Random() <= (uint16)((65536 * a) / b)) -#define AI_CHANCE16R(a,b,r) ((uint16)(r = AI_Random()) <= (uint16)((65536 * a) / b)) +#define AI_CHANCE16(a, b) ((uint16) AI_Random() <= (uint16)((65536 * a) / b)) +#define AI_CHANCE16R(a, b, r) ((uint16)(r = AI_Random()) <= (uint16)((65536 * a) / b)) /** * The random-function that should be used by ALL AIs. diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp index 2f33e37cc..c224e065a 100644 --- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -516,7 +516,7 @@ static void AiFindSubsidyPassengerRoute(FoundRoute *fr) { uint i; const Subsidy* s; - Town *from,*to; + Town *from, *to; // initially error fr->distance = -1; @@ -1561,7 +1561,7 @@ static bool AiCheckTrackResources(TileIndex tile, const AiDefaultBlockData *p, b return false; if (cargo != CT_MAIL) return true; - return !!((values[cargo]>>1) & ~7); + return !!((values[cargo] >> 1) & ~7); } } @@ -1574,7 +1574,7 @@ static int32 AiDoBuildDefaultRailTrack(TileIndex tile, const AiDefaultBlockData* int32 total_cost = 0; Town *t = NULL; int rating = 0; - int i,j,k; + int i, j, k; for (;;) { // This will seldomly overflow for valid reasons. Mask it to be on the safe side. @@ -1588,7 +1588,7 @@ static int32 AiDoBuildDefaultRailTrack(TileIndex tile, const AiDefaultBlockData* ret = DoCommand(c, railtype, p->attr, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_TRAIN_DEPOT); } else { // Station - ret = DoCommand(c, (p->attr&1) | (p->attr>>4)<<8 | (p->attr>>1&7)<<16, railtype, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_RAILROAD_STATION); + ret = DoCommand(c, (p->attr & 1) | (p->attr >> 4) << 8 | (p->attr >> 1 & 7) << 16, railtype, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_RAILROAD_STATION); } if (CmdFailed(ret)) return CMD_ERROR; @@ -1610,7 +1610,7 @@ clear_town_stuff:; // Build the rail for (i = 0; i != 6; i++, j >>= 1) { - if (j&1) { + if (j & 1) { k = i; ret = DoCommand(c, railtype, i, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_SINGLE_RAIL); if (CmdFailed(ret)) return CMD_ERROR; @@ -1642,7 +1642,7 @@ clear_town_stuff:; total_cost += ret + _price.build_rail; if (flag & DC_EXEC) { - DoCommand(c, railtype, p->attr&1, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_SINGLE_RAIL); + DoCommand(c, railtype, p->attr & 1, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_BUILD_SINGLE_RAIL); } goto clear_town_stuff; @@ -1784,7 +1784,7 @@ static void AiStateBuildDefaultRailBlocks(Player *p) if (rule == -1) { // cannot build, terraform after a while if (p->ai.state_counter >= 600) { - AiDoTerraformLand(aib->use_tile, Random()&3, 3, (int8)p->ai.state_mode); + AiDoTerraformLand(aib->use_tile, Random() & 3, 3, (int8)p->ai.state_mode); } // also try the other terraform direction if (++p->ai.state_counter >= 1000) { @@ -1804,7 +1804,7 @@ static void AiStateBuildDefaultRailBlocks(Player *p) ); assert(!CmdFailed(r)); } - } while (++aib,--j); + } while (++aib, --j); } // check if we're done with all of them @@ -1812,7 +1812,7 @@ static void AiStateBuildDefaultRailBlocks(Player *p) j = p->ai.num_build_rec; do { if (aib->cur_building_rule == 255) return; - } while (++aib,--j); + } while (++aib, --j); // yep, all are done. switch state to the rail building state. p->ai.state = AIS_BUILD_RAIL; @@ -1857,7 +1857,7 @@ static bool AiDoFollowTrack(const Player* p) arpfd.tile2 = p->ai.cur_tile_a; arpfd.flag = false; arpfd.count = 0; - FollowTrack(p->ai.cur_tile_a + TileOffsByDiagDir(p->ai.cur_dir_a), 0x2000 | TRANSPORT_RAIL, (DiagDirection)(p->ai.cur_dir_a^2), + FollowTrack(p->ai.cur_tile_a + TileOffsByDiagDir(p->ai.cur_dir_a), 0x2000 | TRANSPORT_RAIL, (DiagDirection)(p->ai.cur_dir_a ^ 2), (TPFEnumProc*)AiEnumFollowTrack, NULL, &arpfd); return arpfd.count > 8; } @@ -2001,8 +2001,8 @@ static inline void AiCheckBuildRailTunnelHere(AiRailFinder *arf, TileIndex tile, if (GetTileSlope(tile, &z) == _dir_table_2[p[0] & 3] && z != 0) { int32 cost = DoCommand(tile, arf->player->ai.railtype_to_use, 0, DC_AUTO, CMD_BUILD_TUNNEL); - if (!CmdFailed(cost) && cost <= (arf->player->player_money>>4)) { - AiBuildRailRecursive(arf, _build_tunnel_endtile, p[0]&3); + if (!CmdFailed(cost) && cost <= (arf->player->player_money >> 4)) { + AiBuildRailRecursive(arf, _build_tunnel_endtile, p[0] & 3); if (arf->depth == 1) AiCheckRailPathBetter(arf, p); } } @@ -2017,7 +2017,7 @@ static void AiBuildRailRecursive(AiRailFinder *arf, TileIndex tile, int dir) // Reached destination? if (tile == arf->final_tile) { - if (arf->final_dir != (dir^2)) { + if (arf->final_dir != (dir ^ 2)) { if (arf->recursive_mode != 2) arf->recursive_mode = 1; } else if (arf->recursive_mode != 2) { arf->recursive_mode = 2; @@ -2063,17 +2063,17 @@ static void AiBuildRailRecursive(AiRailFinder *arf, TileIndex tile, int dir) if (arf->depth == 1) AiCheckRailPathBetter(arf, p); p += 2; - } while (!(p[0]&0x80)); + } while (!(p[0] & 0x80)); } AiCheckBuildRailBridgeHere(arf, tile, p); - AiCheckBuildRailTunnelHere(arf, tile, p+1); + AiCheckBuildRailTunnelHere(arf, tile, p + 1); arf->depth--; } -static const byte _dir_table_3[]= {0x25, 0x2A, 0x19, 0x16}; +static const byte _dir_table_3[] = {0x25, 0x2A, 0x19, 0x16}; static void AiBuildRailConstruct(Player *p) { @@ -2324,23 +2324,23 @@ static void AiStateBuildRail(Player *p) } // Find first edge to build from. - tile = AiGetEdgeOfDefaultRailBlock(aib->cur_building_rule, aib->use_tile, cmd&3, &dir); + tile = AiGetEdgeOfDefaultRailBlock(aib->cur_building_rule, aib->use_tile, cmd & 3, &dir); p->ai.start_tile_a = tile; p->ai.cur_tile_a = tile; p->ai.start_dir_a = dir; p->ai.cur_dir_a = dir; - DoCommand(TILE_MASK(tile + TileOffsByDiagDir(dir)), 0, (dir&1)?1:0, DC_EXEC, CMD_REMOVE_SINGLE_RAIL); + DoCommand(TILE_MASK(tile + TileOffsByDiagDir(dir)), 0, (dir & 1) ? 1 : 0, DC_EXEC, CMD_REMOVE_SINGLE_RAIL); assert(TILE_MASK(tile) != 0xFF00); // Find second edge to build to - aib = (&p->ai.src) + ((cmd >> 4)&0xF); - tile = AiGetEdgeOfDefaultRailBlock(aib->cur_building_rule, aib->use_tile, (cmd>>2)&3, &dir); + aib = (&p->ai.src) + ((cmd >> 4) & 0xF); + tile = AiGetEdgeOfDefaultRailBlock(aib->cur_building_rule, aib->use_tile, (cmd >> 2) & 3, &dir); p->ai.start_tile_b = tile; p->ai.cur_tile_b = tile; p->ai.start_dir_b = dir; p->ai.cur_dir_b = dir; - DoCommand(TILE_MASK(tile + TileOffsByDiagDir(dir)), 0, (dir&1)?1:0, DC_EXEC, CMD_REMOVE_SINGLE_RAIL); + DoCommand(TILE_MASK(tile + TileOffsByDiagDir(dir)), 0, (dir & 1) ? 1 : 0, DC_EXEC, CMD_REMOVE_SINGLE_RAIL); assert(TILE_MASK(tile) != 0xFF00); @@ -2503,7 +2503,7 @@ static void AiStateDeleteRailBlocks(Player *p) for (b = _default_rail_track_data[aib->cur_building_rule]->data; b->mode != 4; b++) { DoCommand(TILE_ADD(aib->use_tile, ToTileIndexDiff(b->tileoffs)), 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); } - } while (++aib,--num); + } while (++aib, --num); p->ai.state = AIS_0; } @@ -2682,14 +2682,14 @@ static void AiStateBuildDefaultRoadBlocks(Player *p) if (rule == -1) { // cannot build, terraform after a while if (p->ai.state_counter >= 600) { - AiDoTerraformLand(aib->use_tile, Random()&3, 3, (int8)p->ai.state_mode); + AiDoTerraformLand(aib->use_tile, Random() & 3, 3, (int8)p->ai.state_mode); } // also try the other terraform direction if (++p->ai.state_counter >= 1000) { p->ai.state_counter = 0; p->ai.state_mode = -p->ai.state_mode; } - } else if (CheckPlayerHasMoney(cost) && AiCheckBlockDistances(p,aib->use_tile)) { + } else if (CheckPlayerHasMoney(cost) && AiCheckBlockDistances(p, aib->use_tile)) { int32 r; // player has money, build it. @@ -2702,7 +2702,7 @@ static void AiStateBuildDefaultRoadBlocks(Player *p) ); assert(!CmdFailed(r)); } - } while (++aib,--j); + } while (++aib, --j); } // check if we're done with all of them @@ -2710,7 +2710,7 @@ static void AiStateBuildDefaultRoadBlocks(Player *p) j = p->ai.num_build_rec; do { if (aib->cur_building_rule == 255) return; - } while (++aib,--j); + } while (++aib, --j); // yep, all are done. switch state to the rail building state. p->ai.state = AIS_BUILD_ROAD; @@ -2901,8 +2901,8 @@ static inline void AiCheckBuildRoadTunnelHere(AiRoadFinder *arf, TileIndex tile, if (GetTileSlope(tile, &z) == _dir_table_2[p[0] & 3] && z != 0) { int32 cost = DoCommand(tile, 0x200, 0, DC_AUTO, CMD_BUILD_TUNNEL); - if (!CmdFailed(cost) && cost <= (arf->player->player_money>>4)) { - AiBuildRoadRecursive(arf, _build_tunnel_endtile, p[0]&3); + if (!CmdFailed(cost) && cost <= (arf->player->player_money >> 4)) { + AiBuildRoadRecursive(arf, _build_tunnel_endtile, p[0] & 3); if (arf->depth == 1) AiCheckRoadPathBetter(arf, p); } } @@ -2918,7 +2918,7 @@ static void AiBuildRoadRecursive(AiRoadFinder *arf, TileIndex tile, int dir) // Reached destination? if (tile == arf->final_tile) { - if ((arf->final_dir^2) == dir) { + if ((arf->final_dir ^ 2) == dir) { arf->recursive_mode = 2; arf->cur_best_depth = arf->depth; } @@ -2962,7 +2962,7 @@ static void AiBuildRoadRecursive(AiRoadFinder *arf, TileIndex tile, int dir) } AiCheckBuildRoadBridgeHere(arf, tile, p); - AiCheckBuildRoadTunnelHere(arf, tile, p+1); + AiCheckBuildRoadTunnelHere(arf, tile, p + 1); arf->depth--; } @@ -3020,7 +3020,7 @@ do_some_terraform: tile = TILE_MASK(p->ai.cur_tile_a + TileOffsByDiagDir(p->ai.cur_dir_a)); - if (arf.best_ptr[0]&0x80) { + if (arf.best_ptr[0] & 0x80) { int i; int32 bridge_len; p->ai.cur_tile_a = arf.bridge_end_tile; @@ -3042,7 +3042,7 @@ do_some_terraform: DoCommand(tile, p->ai.cur_tile_a, i + (0x80 << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE); p->ai.state_counter = 0; - } else if (arf.best_ptr[0]&0x40) { + } else if (arf.best_ptr[0] & 0x40) { // tunnel DoCommand(tile, 0x200, 0, DC_AUTO | DC_EXEC, CMD_BUILD_TUNNEL); p->ai.cur_tile_a = _build_tunnel_endtile; @@ -3148,7 +3148,7 @@ static void AiStateBuildRoad(Player *p) p->ai.cur_dir_a = dir; // Find second edge to build to - aib = (&p->ai.src) + (cmd&0xF); + aib = (&p->ai.src) + (cmd & 0xF); tile = AiGetRoadBlockEdge(aib->cur_building_rule, aib->use_tile, &dir); p->ai.start_tile_b = tile; p->ai.cur_tile_b = tile; @@ -3239,7 +3239,7 @@ static void AiStateDeleteRoadBlocks(Player *p) if (b->mode > 1) continue; DoCommand(TILE_ADD(aib->use_tile, ToTileIndexDiff(b->tileoffs)), 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); } - } while (++aib,--num); + } while (++aib, --num); p->ai.state = AIS_0; } @@ -3326,7 +3326,7 @@ static int32 AiDoBuildDefaultAirportBlock(TileIndex tile, const AiDefaultBlockDa for (; p->mode == 0; p++) { if (!HASBIT(avail_airports, p->attr)) return CMD_ERROR; - ret = DoCommand(TILE_MASK(tile + ToTileIndexDiff(p->tileoffs)), p->attr,0,flag | DC_AUTO | DC_NO_WATER,CMD_BUILD_AIRPORT); + ret = DoCommand(TILE_MASK(tile + ToTileIndexDiff(p->tileoffs)), p->attr, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_AIRPORT); if (CmdFailed(ret)) return CMD_ERROR; total_cost += ret; } @@ -3408,14 +3408,14 @@ static void AiStateBuildDefaultAirportBlocks(Player *p) if (rule == -1) { // cannot build, terraform after a while if (p->ai.state_counter >= 600) { - AiDoTerraformLand(aib->use_tile, Random()&3, 3, (int8)p->ai.state_mode); + AiDoTerraformLand(aib->use_tile, Random() & 3, 3, (int8)p->ai.state_mode); } // also try the other terraform direction if (++p->ai.state_counter >= 1000) { p->ai.state_counter = 0; p->ai.state_mode = -p->ai.state_mode; } - } else if (CheckPlayerHasMoney(cost) && AiCheckBlockDistances(p,aib->use_tile)) { + } else if (CheckPlayerHasMoney(cost) && AiCheckBlockDistances(p, aib->use_tile)) { // player has money, build it. int32 r; @@ -3428,7 +3428,7 @@ static void AiStateBuildDefaultAirportBlocks(Player *p) ); assert(!CmdFailed(r)); } - } while (++aib,--j); + } while (++aib, --j); } while (--i); // check if we're done with all of them @@ -3436,7 +3436,7 @@ static void AiStateBuildDefaultAirportBlocks(Player *p) j = p->ai.num_build_rec; do { if (aib->cur_building_rule == 255) return; - } while (++aib,--j); + } while (++aib, --j); // yep, all are done. switch state. p->ai.state = AIS_BUILD_AIRCRAFT_VEHICLES; @@ -3650,7 +3650,7 @@ pos_3: } } } else { - static const byte _depot_bits[] = {0x19,0x16,0x25,0x2A}; + static const byte _depot_bits[] = {0x19, 0x16, 0x25, 0x2A}; DiagDirection dir = GetRailDepotDirection(tile); @@ -3795,13 +3795,13 @@ static void AiHandleTakeover(Player *p) // Ask the guy with the highest performance hist. FOR_ALL_PLAYERS(pp) { if (pp->is_active && - !(asked&1) && + !(asked & 1) && pp->bankrupt_asked == 0 && best_val < pp->old_economy[1].performance_history) { best_val = pp->old_economy[1].performance_history; best_pl = pp; } - asked>>=1; + asked >>= 1; } // Asked all players? @@ -3843,7 +3843,7 @@ static void AiAdjustLoan(const Player* p) // Increase loan if (p->current_loan < _economy.max_loan && p->num_valid_stat_ent >= 2 && - -(p->old_economy[0].expenses+p->old_economy[1].expenses) < base * 60) { + -(p->old_economy[0].expenses + p->old_economy[1].expenses) < base * 60) { DoCommand(0, 0, 0, DC_EXEC, CMD_INCREASE_LOAN); } } @@ -3872,7 +3872,7 @@ void AiDoGameLoop(Player *p) // to the patch-setting // Also, it takes into account the setting if the service-interval is in days // or in % - _ai_service_interval = _patches.servint_ispercent?80:180; + _ai_service_interval = _patches.servint_ispercent ? 80 : 180; if (IsHumanPlayer(_current_player)) return; @@ -3883,7 +3883,7 @@ void AiDoGameLoop(Player *p) { static byte old_state = 99; static bool hasdots = false; - char *_ai_state_names[]={ + char *_ai_state_names[] = { "AiCase0", "AiCase1", "AiStateVehLoop", diff --git a/src/ai/trolly/build.cpp b/src/ai/trolly/build.cpp index 62ae8b6d0..218a4c0e8 100644 --- a/src/ai/trolly/build.cpp +++ b/src/ai/trolly/build.cpp @@ -123,7 +123,7 @@ int AiNew_Build_RoutePart(Player *p, Ai_PathFinderInfo *PathFinderInfo, byte fla } // Bridge code if ((AI_PATHFINDER_FLAG_BRIDGE & route_extra[part]) != 0) { - cost += AiNew_Build_Bridge(p, route[part], route[part-1], flag); + cost += AiNew_Build_Bridge(p, route[part], route[part - 1], flag); PathFinderInfo->position++; // TODO: problems! if (CmdFailed(cost)) { @@ -173,7 +173,7 @@ int AiNew_Build_RoutePart(Player *p, Ai_PathFinderInfo *PathFinderInfo, byte fla } // Bridge code if ((AI_PATHFINDER_FLAG_BRIDGE & route_extra[part]) != 0) { - cost += AiNew_Build_Bridge(p, route[part], route[part+1], flag); + cost += AiNew_Build_Bridge(p, route[part], route[part + 1], flag); PathFinderInfo->position++; // TODO: problems! if (CmdFailed(cost)) { diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp index bb1357c6d..7e888f629 100644 --- a/src/ai/trolly/trolly.cpp +++ b/src/ai/trolly/trolly.cpp @@ -220,9 +220,9 @@ static bool AiNew_Check_City_or_Industry(Player *p, int ic, byte type) // Check if the rating in a city is high enough // If not, take a chance if we want to continue - if (t->ratings[_current_player] < 0 && AI_CHANCE16(1,4)) return false; + if (t->ratings[_current_player] < 0 && AI_CHANCE16(1, 4)) return false; - if (t->max_pass - t->act_pass < AI_CHECKCITY_NEEDED_CARGO && !AI_CHANCE16(1,AI_CHECKCITY_CITY_CHANCE)) return false; + if (t->max_pass - t->act_pass < AI_CHECKCITY_NEEDED_CARGO && !AI_CHANCE16(1, AI_CHECKCITY_CITY_CHANCE)) return false; // Check if we have build a station in this town the last 6 months // else we don't do it. This is done, because stat updates can be slow @@ -275,7 +275,7 @@ static bool AiNew_Check_City_or_Industry(Player *p, int ic, byte type) int count = 0; int j = 0; - if (i->town != NULL && i->town->ratings[_current_player] < 0 && AI_CHANCE16(1,4)) return false; + if (i->town != NULL && i->town->ratings[_current_player] < 0 && AI_CHANCE16(1, 4)) return false; // No limits on delevering stations! // Or for industry that does not give anything yet @@ -642,8 +642,8 @@ static void AiNew_State_FindStation(Player *p) int r; uint best; uint accepts[NUM_CARGO]; - TileIndex found_spot[AI_FINDSTATION_TILE_RANGE*AI_FINDSTATION_TILE_RANGE*4]; - uint found_best[AI_FINDSTATION_TILE_RANGE*AI_FINDSTATION_TILE_RANGE*4]; + TileIndex found_spot[AI_FINDSTATION_TILE_RANGE*AI_FINDSTATION_TILE_RANGE * 4]; + uint found_best[AI_FINDSTATION_TILE_RANGE*AI_FINDSTATION_TILE_RANGE * 4]; // To find a good spot we scan a range from the center, a get the point // where we get the most cargo and where it is buildable. // TODO: also check for station of myself and make sure we are not @@ -961,13 +961,13 @@ static void AiNew_State_VerifyRoute(Player *p) // Now we can build the route, check the direction of the stations! if (p->ainew.from_direction == AI_PATHFINDER_NO_DIRECTION) { - p->ainew.from_direction = AiNew_GetDirection(p->ainew.path_info.route[p->ainew.path_info.route_length-1], p->ainew.path_info.route[p->ainew.path_info.route_length-2]); + p->ainew.from_direction = AiNew_GetDirection(p->ainew.path_info.route[p->ainew.path_info.route_length - 1], p->ainew.path_info.route[p->ainew.path_info.route_length - 2]); } if (p->ainew.to_direction == AI_PATHFINDER_NO_DIRECTION) { p->ainew.to_direction = AiNew_GetDirection(p->ainew.path_info.route[0], p->ainew.path_info.route[1]); } if (p->ainew.from_tile == AI_STATION_RANGE) - p->ainew.from_tile = p->ainew.path_info.route[p->ainew.path_info.route_length-1]; + p->ainew.from_tile = p->ainew.path_info.route[p->ainew.path_info.route_length - 1]; if (p->ainew.to_tile == AI_STATION_RANGE) p->ainew.to_tile = p->ainew.path_info.route[0]; diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index abd7afd67..92697b963 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -105,7 +105,7 @@ static void BuildAirToolbWndProc(Window *w, WindowEvent *e) w = FindWindowById(WC_BUILD_STATION, 0); if (w != 0) - WP(w,def_d).close = true; + WP(w, def_d).close = true; break; case WE_DESTROY: @@ -155,7 +155,7 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e) uint32 avail_airports; const AirportFTAClass *airport; - if (WP(w,def_d).close) return; + if (WP(w, def_d).close) return; avail_airports = GetValidAirports(); @@ -207,7 +207,7 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e) } break; case WE_MOUSELOOP: { - if (WP(w,def_d).close) { + if (WP(w, def_d).close) { DeleteWindow(w); return; } @@ -216,7 +216,7 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e) } break; case WE_DESTROY: - if (!WP(w,def_d).close) ResetObjectToPlace(); + if (!WP(w, def_d).close) ResetObjectToPlace(); break; } } diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index bdfded603..6a191cb49 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -137,7 +137,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type) /* Now we found a cargo type being carried on the train and we will see if it is possible to carry to this one */ if (v->cargo_type == new_cargo_type) return CT_NO_REFIT; if (CanRefitTo(engine_type, v->cargo_type)) return v->cargo_type; - } while ((v=v->next) != NULL); + } while ((v = v->next) != NULL); return CT_NO_REFIT; // We failed to find a cargo type on the old vehicle and we will not refit the new one } diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index c071d6d75..3a230232c 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -312,19 +312,19 @@ static EngList_SortTypeFunction * const _sorter[][9] = {{ &TrainEngineRunningCostSorter, &TrainEnginePowerVsRunningCostSorter, &EngineReliabilitySorter, -},{ +}, { /* Road vehicles */ &EngineNumberSorter, &EngineIntroDateSorter, &EngineNameSorter, &EngineReliabilitySorter, -},{ +}, { /* Ships */ &EngineNumberSorter, &EngineIntroDateSorter, &EngineNameSorter, &EngineReliabilitySorter, -},{ +}, { /* Aircraft */ &EngineNumberSorter, &AircraftEngineCostSorter, @@ -348,21 +348,21 @@ static const StringID _sort_listing[][10] = {{ STR_ENGINE_SORT_POWER_VS_RUNNING_COST, STR_SORT_BY_RELIABILITY, INVALID_STRING_ID -},{ +}, { /* Road vehicles */ STR_ENGINE_SORT_ENGINE_ID, STR_ENGINE_SORT_INTRO_DATE, STR_SORT_BY_DROPDOWN_NAME, STR_SORT_BY_RELIABILITY, INVALID_STRING_ID -},{ +}, { /* Ships */ STR_ENGINE_SORT_ENGINE_ID, STR_ENGINE_SORT_INTRO_DATE, STR_SORT_BY_DROPDOWN_NAME, STR_SORT_BY_RELIABILITY, INVALID_STRING_ID -},{ +}, { /* Aircraft */ STR_ENGINE_SORT_ENGINE_ID, STR_ENGINE_SORT_COST, @@ -392,7 +392,7 @@ static int DrawRailWagonPurchaseInfo(int x, int y, EngineID engine_number, const /* Wagon speed limit, displayed if above zero */ if (rvi->max_speed > 0 && _patches.wagon_speed_limits) { SetDParam(0, rvi->max_speed * 10 / 16); - DrawString(x,y, STR_PURCHASE_INFO_SPEED, 0); + DrawString(x, y, STR_PURCHASE_INFO_SPEED, 0); y += 10; } return y; @@ -406,13 +406,13 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons /* Purchase Cost - Engine weight */ SetDParam(0, rvi->base_cost * (_price.build_railvehicle >> 3) >> 5); SetDParam(1, rvi->weight << multihead); - DrawString(x,y, STR_PURCHASE_INFO_COST_WEIGHT, 0); + DrawString(x, y, STR_PURCHASE_INFO_COST_WEIGHT, 0); y += 10; /* Max speed - Engine power */ SetDParam(0, rvi->max_speed * 10 / 16); SetDParam(1, rvi->power << multihead); - DrawString(x,y, STR_PURCHASE_INFO_SPEED_POWER, 0); + DrawString(x, y, STR_PURCHASE_INFO_SPEED_POWER, 0); y += 10; /* Max tractive effort - not applicable if old acceleration or maglev */ @@ -424,14 +424,14 @@ static int DrawRailEnginePurchaseInfo(int x, int y, EngineID engine_number, cons /* Running cost */ SetDParam(0, (rvi->running_cost_base * _price.running_rail[rvi->running_cost_class] >> 8) << multihead); - DrawString(x,y, STR_PURCHASE_INFO_RUNNINGCOST, 0); + DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, 0); y += 10; /* Powered wagons power - Powered wagons extra weight */ if (rvi->pow_wag_power != 0) { SetDParam(0, rvi->pow_wag_power); SetDParam(1, rvi->pow_wag_weight); - DrawString(x,y, STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT, 0); + DrawString(x, y, STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT, 0); y += 10; }; @@ -444,7 +444,7 @@ static int DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number, const R bool refittable = (_engine_info[engine_number].refit_mask != 0); /* Purchase cost - Max speed */ - SetDParam(0, rvi->base_cost * (_price.roadveh_base>>3)>>5); + SetDParam(0, rvi->base_cost * (_price.roadveh_base >> 3) >> 5); SetDParam(1, rvi->max_speed * 10 / 32); DrawString(x, y, STR_PURCHASE_INFO_COST_SPEED, 0); y += 10; @@ -468,21 +468,21 @@ static int DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number, const R static int DrawShipPurchaseInfo(int x, int y, EngineID engine_number, const ShipVehicleInfo *svi) { /* Purchase cost - Max speed */ - SetDParam(0, svi->base_cost * (_price.ship_base>>3)>>5); + SetDParam(0, svi->base_cost * (_price.ship_base >> 3) >> 5); SetDParam(1, svi->max_speed * 10 / 32); - DrawString(x,y, STR_PURCHASE_INFO_COST_SPEED, 0); + DrawString(x, y, STR_PURCHASE_INFO_COST_SPEED, 0); y += 10; /* Cargo type + capacity */ SetDParam(0, svi->cargo_type); SetDParam(1, svi->capacity); SetDParam(2, svi->refittable ? STR_9842_REFITTABLE : STR_EMPTY); - DrawString(x,y, STR_PURCHASE_INFO_CAPACITY, 0); + DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0); y += 10; /* Running cost */ SetDParam(0, svi->running_cost * _price.ship_running >> 8); - DrawString(x,y, STR_PURCHASE_INFO_RUNNINGCOST, 0); + DrawString(x, y, STR_PURCHASE_INFO_RUNNINGCOST, 0); y += 10; return y; @@ -494,7 +494,7 @@ static int DrawAircraftPurchaseInfo(int x, int y, EngineID engine_number, const CargoID cargo; /* Purchase cost - Max speed */ - SetDParam(0, avi->base_cost * (_price.aircraft_base>>3)>>5); + SetDParam(0, avi->base_cost * (_price.aircraft_base >> 3) >> 5); SetDParam(1, avi->max_speed * 10 / 16); DrawString(x, y, STR_PURCHASE_INFO_COST_SPEED, 0); y += 10; @@ -560,7 +560,7 @@ int DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number) SetDParam(1, (rvi->capacity * (CountArticulatedParts(engine_number) + 1)) << multihead); SetDParam(2, refitable ? STR_9842_REFITTABLE : STR_EMPTY); } - DrawString(x,y, STR_PURCHASE_INFO_CAPACITY, 0); + DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0); y += 10; } break; @@ -1001,7 +1001,7 @@ void ShowBuildVehicleWindow(TileIndex tile, byte type) switch (type) { case VEH_TRAIN: - WP(w,buildvehicle_d).filter.railtype = (tile == 0) ? RAILTYPE_END : GetRailType(tile); + WP(w, buildvehicle_d).filter.railtype = (tile == 0) ? RAILTYPE_END : GetRailType(tile); ResizeWindow(w, 0, 16); break; case VEH_ROAD: diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp index 097aa7655..2081e0036 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -79,7 +79,7 @@ static void TerraformAddDirtyTile(TerraformerState *ts, TileIndex tile) if (count >= 625) return; - for (t = ts->tile_table; count != 0; count--,t++) { + for (t = ts->tile_table; count != 0; count--, t++) { if (*t == tile) return; } @@ -141,7 +141,7 @@ static int TerraformProc(TerraformerState *ts, TileIndex tile, int mode) } } - ret = DoCommand(tile, 0,0, ts->flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR); + ret = DoCommand(tile, 0, 0, ts->flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR); if (CmdFailed(ret)) { _terraform_err_tile = tile; @@ -215,8 +215,8 @@ static bool TerraformTileHeight(TerraformerState *ts, TileIndex tile, int height tile += ToTileIndexDiff(*ttm); r = TerraformGetHeightOfTile(ts, tile); - if (r != height && r-direction != height && r+direction != height) { - if (!TerraformTileHeight(ts, tile, r+direction)) + if (r != height && r - direction != height && r + direction != height) { + if (!TerraformTileHeight(ts, tile, r + direction)) return false; } } @@ -382,8 +382,8 @@ int32 CmdLevelLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) if (ey < sy) Swap(ey, sy); tile = TileXY(sx, sy); - size_x = ex-sx+1; - size_y = ey-sy+1; + size_x = ex - sx + 1; + size_y = ey - sy + 1; money = GetAvailableMoneyForCommand(); cost = 0; diff --git a/src/command.cpp b/src/command.cpp index 0b67cb4df..94717a38d 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -407,7 +407,7 @@ int32 GetAvailableMoneyForCommand() * the callback is called when the command succeeded or failed. */ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd) { - int32 res = 0,res2; + int32 res = 0, res2; CommandProc *proc; uint32 flags; bool notest; @@ -544,7 +544,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, if (res2 != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2); if (_additional_cash_required) { SetDParam(0, _additional_cash_required); - ShowErrorMessage(STR_0003_NOT_ENOUGH_CASH_REQUIRES, error_part1, x,y); + ShowErrorMessage(STR_0003_NOT_ENOUGH_CASH_REQUIRES, error_part1, x, y); if (res2 == 0) goto callb_err; } } @@ -558,7 +558,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, show_error: /* show error message if the command fails? */ if (IsLocalPlayer() && error_part1 != 0) { - ShowErrorMessage(_error_message, error_part1, x,y); + ShowErrorMessage(_error_message, error_part1, x, y); } callb_err: diff --git a/src/command.h b/src/command.h index ace80dc89..7a6119652 100644 --- a/src/command.h +++ b/src/command.h @@ -158,7 +158,7 @@ enum { CMD_ERROR = ((int32)0x80000000), }; -#define CMD_MSG(x) ((x)<<16) +#define CMD_MSG(x) ((x) << 16) enum { CMD_AUTO = 0x0200, diff --git a/src/disaster_cmd.cpp b/src/disaster_cmd.cpp index 7bdb71d87..9368646de 100644 --- a/src/disaster_cmd.cpp +++ b/src/disaster_cmd.cpp @@ -233,7 +233,7 @@ static void DisasterTick_Zeppeliner(Vehicle *v) SetDParam(0, GetStationIndex(tile)); AddNewsItem(STR_B000_ZEPPELIN_DISASTER_AT, - NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_VEHICLE, NT_ACCIDENT, 0), + NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_VEHICLE, NT_ACCIDENT, 0), v->index, 0); } @@ -263,7 +263,7 @@ static void DisasterTick_Zeppeliner(Vehicle *v) x = v->x_pos; y = v->y_pos; - z = GetSlopeZ(x,y); + z = GetSlopeZ(x, y); if (z < v->z_pos) z = v->z_pos - 1; SetDisasterVehiclePos(v, x, y, z); @@ -359,14 +359,14 @@ static void DisasterTick_Ufo(Vehicle *v) if (dist <= TILE_SIZE && z > u->z_pos) z--; SetDisasterVehiclePos(v, gp.x, gp.y, z); - if (z <= u->z_pos && (u->vehstatus & VS_HIDDEN)==0) { + if (z <= u->z_pos && (u->vehstatus & VS_HIDDEN) == 0) { v->age++; if (u->u.road.crashed_ctr == 0) { u->u.road.crashed_ctr++; u->vehstatus |= VS_CRASHED; AddNewsItem(STR_B001_ROAD_VEHICLE_DESTROYED, - NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_VEHICLE, NT_ACCIDENT, 0), + NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_VEHICLE, NT_ACCIDENT, 0), u->index, 0); } @@ -441,7 +441,7 @@ static void DisasterTick_Airplane(Vehicle *v) DestructIndustry(i); SetDParam(0, i->town->index); - AddNewsItem(STR_B002_OIL_REFINERY_EXPLOSION, NEWS_FLAGS(NM_THIN,NF_VIEWPORT|NF_TILE,NT_ACCIDENT,0), i->xy, 0); + AddNewsItem(STR_B002_OIL_REFINERY_EXPLOSION, NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_ACCIDENT, 0), i->xy, 0); SndPlayTileFx(SND_12_EXPLOSION, i->xy); } } else if (v->current_order.dest == 0) { @@ -514,7 +514,7 @@ static void DisasterTick_Helicopter(Vehicle *v) DestructIndustry(i); SetDParam(0, i->town->index); - AddNewsItem(STR_B003_FACTORY_DESTROYED_IN_SUSPICIOUS, NEWS_FLAGS(NM_THIN,NF_VIEWPORT|NF_TILE,NT_ACCIDENT,0), i->xy, 0); + AddNewsItem(STR_B003_FACTORY_DESTROYED_IN_SUSPICIOUS, NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_ACCIDENT, 0), i->xy, 0); SndPlayTileFx(SND_12_EXPLOSION, i->xy); } } else if (v->current_order.dest == 0) { @@ -600,7 +600,7 @@ static void DisasterTick_Big_Ufo(Vehicle *v) t = ClosestTownFromTile(v->dest_tile, (uint)-1); SetDParam(0, t->index); AddNewsItem(STR_B004_UFO_LANDS_NEAR, - NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ACCIDENT, 0), + NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_ACCIDENT, 0), v->tile, 0); @@ -951,7 +951,7 @@ static void Disaster_Small_Submarine_Init() static void Disaster_Big_Submarine_Init() { Vehicle *v = ForceAllocateSpecialVehicle(); - int x,y; + int x, y; Direction dir; uint32 r; @@ -986,7 +986,7 @@ static void Disaster_CoalMine_Init() if ((GetIndustrySpec(i->type)->behaviour & INDUSTRYBEH_CAN_SUBSIDENCE) && --index < 0) { SetDParam(0, i->town->index); AddNewsItem(STR_B005_COAL_MINE_SUBSIDENCE_LEAVES, - NEWS_FLAGS(NM_THIN,NF_VIEWPORT|NF_TILE,NT_ACCIDENT,0), i->xy + TileDiffXY(1, 1), 0); + NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_ACCIDENT, 0), i->xy + TileDiffXY(1, 1), 0); { TileIndex tile = i->xy; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 77282403c..a4a57d14b 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -165,10 +165,10 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e) RaiseWindowButtons(w); w = FindWindowById(WC_BUILD_STATION, 0); - if (w != NULL) WP(w,def_d).close = true; + if (w != NULL) WP(w, def_d).close = true; w = FindWindowById(WC_BUILD_DEPOT, 0); - if (w != NULL) WP(w,def_d).close = true; + if (w != NULL) WP(w, def_d).close = true; break; case WE_PLACE_PRESIZE: { @@ -233,7 +233,7 @@ static void BuildDockStationWndProc(Window *w, WindowEvent *e) case WE_PAINT: { int rad; - if (WP(w,def_d).close) return; + if (WP(w, def_d).close) return; DrawWindowWidgets(w); rad = (_patches.modified_catchment) ? CA_DOCK : 4; @@ -258,7 +258,7 @@ static void BuildDockStationWndProc(Window *w, WindowEvent *e) break; case WE_MOUSELOOP: - if (WP(w,def_d).close) { + if (WP(w, def_d).close) { DeleteWindow(w); return; } @@ -267,7 +267,7 @@ static void BuildDockStationWndProc(Window *w, WindowEvent *e) break; case WE_DESTROY: - if (!WP(w,def_d).close) ResetObjectToPlace(); + if (!WP(w, def_d).close) ResetObjectToPlace(); break; } } @@ -333,11 +333,11 @@ static void BuildDocksDepotWndProc(Window *w, WindowEvent *e) } break; case WE_MOUSELOOP: - if (WP(w,def_d).close) DeleteWindow(w); + if (WP(w, def_d).close) DeleteWindow(w); break; case WE_DESTROY: - if (!WP(w,def_d).close) ResetObjectToPlace(); + if (!WP(w, def_d).close) ResetObjectToPlace(); break; } } diff --git a/src/gfx.cpp b/src/gfx.cpp index 30b305d63..fa7fc671f 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -201,7 +201,7 @@ void GfxFillRect(int left, int top, int right, int bottom, int color) static void GfxSetPixel(int x, int y, int color) { const DrawPixelInfo* dpi = _cur_dpi; - if ((x-=dpi->left) < 0 || x>=dpi->width || (y-=dpi->top)<0 || y>=dpi->height) + if ((x -= dpi->left) < 0 || x >= dpi->width || (y -= dpi->top)<0 || y >= dpi->height) return; dpi->dst_ptr[y * dpi->pitch + x] = color; } @@ -461,7 +461,7 @@ uint32 FormatStringLinebreaks(char *str, int maxw) switch (c) { case '\0': return num + (size << 16); break; case SCC_SETX: str++; break; - case SCC_SETXY: str +=2; break; + case SCC_SETXY: str += 2; break; case SCC_TINYFONT: size = FS_SMALL; break; case SCC_BIGFONT: size = FS_LARGE; break; case '\n': goto end_of_inner_loop; @@ -509,7 +509,7 @@ void DrawStringMultiCenter(int x, int y, StringID str, int maxw) for (;;) { w = GetStringBoundingBox(src).width; - DoDrawString(src, x - (w>>1), y, 0xFE); + DoDrawString(src, x - (w >> 1), y, 0xFE); _cur_fontsize = _last_fontsize; for (;;) { @@ -524,7 +524,7 @@ void DrawStringMultiCenter(int x, int y, StringID str, int maxw) } else if (c == SCC_SETX) { src++; } else if (c == SCC_SETXY) { - src+=2; + src += 2; } } } @@ -574,7 +574,7 @@ uint DrawStringMultiLine(int x, int y, StringID str, int maxw, int maxh) } else if (c == SCC_SETX) { src++; } else if (c == SCC_SETXY) { - src+=2; + src += 2; } } } @@ -643,7 +643,7 @@ int DoDrawString(const char *string, int x, int y, uint16 real_color) if (color != 0xFE) { if (x >= dpi->left + dpi->width || - x + _screen.width*2 <= dpi->left || + x + _screen.width * 2 <= dpi->left || y >= dpi->top + dpi->height || y + _screen.height <= dpi->top) return x; diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 56696b371..99c0941f6 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -222,7 +222,7 @@ static void DrawGraph(const GraphDrawer *gw) y = gw->top + x_axis_offset - (x_axis_offset * datapoint) / highest_value; /* Draw the point. */ - GfxFillRect(x-1, y-1, x+1, y+1, color); + GfxFillRect(x - 1, y - 1, x + 1, y + 1, color); /* Draw the line connected to the previous point. */ if (prev_x != INVALID_DATAPOINT_POS) GfxDrawLine(prev_x, prev_y, x, y, color); @@ -268,7 +268,7 @@ static void GraphLegendWndProc(Window *w, WindowEvent *e) FOR_ALL_PLAYERS(p) { if (!p->is_active) continue; - DrawPlayerIcon(p->index, 4, 18+p->index*12); + DrawPlayerIcon(p->index, 4, 18 + p->index * 12); SetDParam(0, p->name_1); SetDParam(1, p->name_2); @@ -330,7 +330,7 @@ static void SetupGraphDrawerForPlayers(GraphDrawer *gd) const Player* p; uint excluded_players = _legend_excluded_players; byte nums; - int mo,yr; + int mo, yr; /* Exclude the players which aren't valid */ FOR_ALL_PLAYERS(p) { @@ -908,7 +908,7 @@ static const WindowDesc _company_league_desc = { void ShowCompanyLeagueTable() { - AllocateWindowDescFront(&_company_league_desc,0); + AllocateWindowDescFront(&_company_league_desc, 0); } /*****************************/ diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index d22c7a5e4..83a0c8680 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -69,7 +69,7 @@ IndustryType GetIndustryType(TileIndex tile) for (iloop = IT_COAL_MINE; iloop < IT_END; iloop += 1) { if (IS_BYTE_INSIDE(this_type, industry_gfx_Solver[iloop].MinGfx, - industry_gfx_Solver[iloop].MaxGfx+1)) { + industry_gfx_Solver[iloop].MaxGfx + 1)) { return iloop; } } @@ -496,7 +496,7 @@ static void AnimateTile_Industry(TileIndex tile) case GFX_OILWELL_ANIMATED_2: case GFX_OILWELL_ANIMATED_3: if ((_tick_counter & 7) == 0) { - bool b = CHANCE16(1,7); + bool b = CHANCE16(1, 7); IndustryGfx gfx = GetIndustryGfx(tile); m = GetIndustryAnimationState(tile) + 1; @@ -705,7 +705,7 @@ static void TileLoop_Industry(TileIndex tile) break; case GFX_POWERPLANT_SPARKS: - if (CHANCE16(1,3)) { + if (CHANCE16(1, 3)) { SndPlayTileFx(SND_0C_ELECTRIC_SPARK, tile); AddAnimatedTile(tile); } @@ -964,7 +964,7 @@ static void ProduceIndustryGoods(Industry *i) /* play a sound? */ if ((i->counter & 0x3F) == 0) { - if (CHANCE16R(1,14,r) && (num=_industry_sounds[i->type][0]) != 0) { + if (CHANCE16R(1, 14, r) && (num = _industry_sounds[i->type][0]) != 0) { SndPlayTileFx( (SoundFx)(_industry_sounds[i->type][1] + (((r >> 16) * num) >> 16)), i->xy); @@ -1668,7 +1668,7 @@ static void ExtChangeIndustryProduction(Industry *i) SetDParam(1, i->index); AddNewsItem( percent >= 0 ? STR_INDUSTRY_PROD_GOUP : STR_INDUSTRY_PROD_GODOWN, - NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY, 0), + NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_ECONOMY, 0), i->xy + TileDiffXY(1, 1), 0 ); } @@ -1682,7 +1682,7 @@ static void ExtChangeIndustryProduction(Industry *i) SetDParam(0, i->index); AddNewsItem( indspec->closure_text, - NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_OPENCLOSE, 0), + NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, 0), i->xy + TileDiffXY(1, 1), 0 ); } @@ -1698,7 +1698,7 @@ static void UpdateIndustryStatistics(Industry *i) pct = 0; if (i->last_mo_production[0] != 0) { i->last_prod_year = _cur_year; - pct = min(i->last_mo_transported[0] * 256 / i->last_mo_production[0],255); + pct = min(i->last_mo_transported[0] * 256 / i->last_mo_production[0], 255); } i->pct_transported[0] = pct; @@ -1714,7 +1714,7 @@ static void UpdateIndustryStatistics(Industry *i) pct = 0; if (i->last_mo_production[1] != 0) { i->last_prod_year = _cur_year; - pct = min(i->last_mo_transported[1] * 256 / i->last_mo_production[1],255); + pct = min(i->last_mo_transported[1] * 256 / i->last_mo_production[1], 255); } i->pct_transported[1] = pct; @@ -1791,7 +1791,7 @@ static void MaybeNewIndustry(void) SetDParam(0, ind_spc->name); SetDParam(1, ind->town->index); AddNewsItem(ind_spc->new_industry_text, - NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_OPENCLOSE, 0), ind->xy, 0); + NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, NT_OPENCLOSE, 0), ind->xy, 0); } static void ChangeIndustryProduction(Industry *i) @@ -1810,9 +1810,9 @@ static void ChangeIndustryProduction(Industry *i) if ((indspec->behaviour & INDUSTRYBEH_DONT_INCR_PROD) && _opt.landscape == LT_TEMPERATE) only_decrease = true; - if (only_decrease || CHANCE16(1,3)) { + if (only_decrease || CHANCE16(1, 3)) { /* If you transport > 60%, 66% chance we increase, else 33% chance we increase */ - if (!only_decrease && (i->pct_transported[0] > 153) != CHANCE16(1,3)) { + if (!only_decrease && (i->pct_transported[0] > 153) != CHANCE16(1, 3)) { /* Increase production */ if (i->prod_level != 0x80) { byte b; @@ -1849,7 +1849,7 @@ static void ChangeIndustryProduction(Industry *i) case INDUSTRYLIFE_CLOSABLE: /* maybe close */ - if ( (byte)(_cur_year - i->last_prod_year) >= 5 && CHANCE16(1,2)) { + if ( (byte)(_cur_year - i->last_prod_year) >= 5 && CHANCE16(1, 2)) { i->prod_level = 0; str = indspec->closure_text; } @@ -1858,7 +1858,7 @@ static void ChangeIndustryProduction(Industry *i) if (str != STR_NULL) { SetDParam(0, i->index); - AddNewsItem(str, NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, str == indspec->closure_text ? NT_OPENCLOSE : NT_ECONOMY, 0), i->xy + TileDiffXY(1, 1), 0); + AddNewsItem(str, NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_TILE, str == indspec->closure_text ? NT_OPENCLOSE : NT_ECONOMY, 0), i->xy + TileDiffXY(1, 1), 0); } } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 93bf325a5..b0d389e3a 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -37,7 +37,7 @@ static void BuildIndustryWndProc(Window *w, WindowEvent *e) case WE_PAINT: DrawWindowWidgets(w); if (_thd.place_mode == 1 && _thd.window_class == WC_BUILD_INDUSTRY) { - int ind_type = _build_industry_types[_opt_ptr->landscape][WP(w,def_d).data_1]; + int ind_type = _build_industry_types[_opt_ptr->landscape][WP(w, def_d).data_1]; SetDParam(0, (_price.build_industry >> 5) * GetIndustrySpec(ind_type)->cost_multiplier); DrawStringCentered(85, w->height - 21, STR_482F_COST, 0); @@ -48,12 +48,12 @@ static void BuildIndustryWndProc(Window *w, WindowEvent *e) int wid = e->we.click.widget; if (wid >= 3) { if (HandlePlacePushButton(w, wid, SPR_CURSOR_INDUSTRY, 1, NULL)) - WP(w,def_d).data_1 = wid - 3; + WP(w, def_d).data_1 = wid - 3; } } break; case WE_PLACE_OBJ: - if (DoCommandP(e->we.place.tile, _build_industry_types[_opt_ptr->landscape][WP(w,def_d).data_1], 0, NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY))) + if (DoCommandP(e->we.place.tile, _build_industry_types[_opt_ptr->landscape][WP(w, def_d).data_1], 0, NULL, CMD_BUILD_INDUSTRY | CMD_MSG(STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY))) ResetObjectToPlace(); break; @@ -274,7 +274,7 @@ static const WindowDesc * const _industry_window_desc[2][4] = { void ShowBuildIndustryWindow() { if (!IsValidPlayer(_current_player)) return; - AllocateWindowDescFront(_industry_window_desc[_patches.build_rawmaterial_ind][_opt_ptr->landscape],0); + AllocateWindowDescFront(_industry_window_desc[_patches.build_rawmaterial_ind][_opt_ptr->landscape], 0); } static inline bool isProductionMinimum(const Industry *i, int pt) { @@ -330,7 +330,7 @@ static void IndustryViewWndProc(Window *w, WindowEvent *e) DrawString(4 + (IsProductionAlterable(i) ? 30 : 0), 127, STR_482B_TRANSPORTED, 0); /* Let's put out those buttons.. */ if (IsProductionAlterable(i)) { - DrawArrowButtons(5, 127, 3, (WP(w,vp2_d).data_2 == 1) ? WP(w,vp2_d).data_3 : 0, + DrawArrowButtons(5, 127, 3, (WP(w, vp2_d).data_2 == 1) ? WP(w, vp2_d).data_3 : 0, !isProductionMinimum(i, 0), !isProductionMaximum(i, 0)); } @@ -341,7 +341,7 @@ static void IndustryViewWndProc(Window *w, WindowEvent *e) DrawString(4 + (IsProductionAlterable(i) ? 30 : 0), 137, STR_482B_TRANSPORTED, 0); /* Let's put out those buttons.. */ if (IsProductionAlterable(i)) { - DrawArrowButtons(5, 137, 3, (WP(w,vp2_d).data_2 == 2) ? WP(w,vp2_d).data_3 : 0, + DrawArrowButtons(5, 137, 3, (WP(w, vp2_d).data_2 == 2) ? WP(w, vp2_d).data_3 : 0, !isProductionMinimum(i, 1), !isProductionMaximum(i, 1)); } } @@ -379,11 +379,11 @@ static void IndustryViewWndProc(Window *w, WindowEvent *e) UpdateIndustryProduction(i); SetWindowDirty(w); w->flags4 |= 5 << WF_TIMEOUT_SHL; - WP(w,vp2_d).data_2 = line+1; - WP(w,vp2_d).data_3 = (x < 15 ? 1 : 2); + WP(w, vp2_d).data_2 = line + 1; + WP(w, vp2_d).data_3 = (x < 15 ? 1 : 2); } else if (IS_INT_INSIDE(x, 34, 160)) { /* clicked the text */ - WP(w,vp2_d).data_1 = line; + WP(w, vp2_d).data_1 = line; SetDParam(0, i->production_rate[line] * 8); ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_GAME_PRODUCTION, 10, 100, w, CS_ALPHANUMERAL); } @@ -397,15 +397,15 @@ static void IndustryViewWndProc(Window *w, WindowEvent *e) } break; case WE_TIMEOUT: - WP(w,vp2_d).data_2 = 0; - WP(w,vp2_d).data_3 = 0; + WP(w, vp2_d).data_2 = 0; + WP(w, vp2_d).data_3 = 0; SetWindowDirty(w); break; case WE_ON_EDIT_TEXT: if (e->we.edittext.str[0] != '\0') { Industry* i = GetIndustry(w->window_number); - int line = WP(w,vp2_d).data_1; + int line = WP(w, vp2_d).data_1; i->production_rate[line] = clampu(atoi(e->we.edittext.str), 0, 255); UpdateIndustryProduction(i); @@ -449,9 +449,9 @@ void ShowIndustryViewWindow(int industry) if (w != NULL) { w->flags4 |= WF_DISABLE_VP_SCROLL; - WP(w,vp2_d).data_1 = 0; - WP(w,vp2_d).data_2 = 0; - WP(w,vp2_d).data_3 = 0; + WP(w, vp2_d).data_1 = 0; + WP(w, vp2_d).data_2 = 0; + WP(w, vp2_d).data_3 = 0; AssignWindowViewport(w, 3, 17, 0xFE, 0x56, GetIndustry(w->window_number)->xy + TileDiffXY(1, 1), 1); } } @@ -599,7 +599,7 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e) SetVScrollCount(w, _num_industry_sort); DrawWindowWidgets(w); - DoDrawString(_industry_sort_order & 1 ? DOWNARROW : UPARROW, _indicator_positions[_industry_sort_order>>1], 15, 0x10); + DoDrawString(_industry_sort_order & 1 ? DOWNARROW : UPARROW, _indicator_positions[_industry_sort_order >> 1], 15, 0x10); p = w->vscroll.pos; n = 0; @@ -617,13 +617,13 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e) SetDParam(4, i->total_production[1]); SetDParam(5, i->pct_transported[0] * 100 >> 8); SetDParam(6, i->pct_transported[1] * 100 >> 8); - DrawString(4, 28+n*10, STR_INDUSTRYDIR_ITEM_TWO, 0); + DrawString(4, 28 + n * 10, STR_INDUSTRYDIR_ITEM_TWO, 0); } else { SetDParam(3, i->pct_transported[0] * 100 >> 8); - DrawString(4, 28+n*10, STR_INDUSTRYDIR_ITEM, 0); + DrawString(4, 28 + n * 10, STR_INDUSTRYDIR_ITEM, 0); } } else { - DrawString(4, 28+n*10, STR_INDUSTRYDIR_ITEM_NOPROD, 0); + DrawString(4, 28 + n * 10, STR_INDUSTRYDIR_ITEM_NOPROD, 0); } p++; if (++n == w->vscroll.cap) break; @@ -633,25 +633,25 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e) case WE_CLICK: switch (e->we.click.widget) { case 3: { - _industry_sort_order = _industry_sort_order==0 ? 1 : 0; + _industry_sort_order = _industry_sort_order == 0 ? 1 : 0; _industry_sort_dirty = true; SetWindowDirty(w); } break; case 4: { - _industry_sort_order = _industry_sort_order==2 ? 3 : 2; + _industry_sort_order = _industry_sort_order == 2 ? 3 : 2; _industry_sort_dirty = true; SetWindowDirty(w); } break; case 5: { - _industry_sort_order = _industry_sort_order==4 ? 5 : 4; + _industry_sort_order = _industry_sort_order == 4 ? 5 : 4; _industry_sort_dirty = true; SetWindowDirty(w); } break; case 6: { - _industry_sort_order = _industry_sort_order==6 ? 7 : 6; + _industry_sort_order = _industry_sort_order == 6 ? 7 : 6; _industry_sort_dirty = true; SetWindowDirty(w); } break; diff --git a/src/landscape.cpp b/src/landscape.cpp index 3fbb6165a..7ed95ac13 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -76,13 +76,13 @@ uint GetPartialZ(int x, int y, Slope corners) break; case SLOPE_S: - y^=0xF; + y ^= 0xF; if ( (x - y) >= 0) z = (x - y) >> 1; break; case SLOPE_SW: - z = (x>>1) + 1; + z = (x >> 1) + 1; break; case SLOPE_E: @@ -97,12 +97,12 @@ uint GetPartialZ(int x, int y, Slope corners) break; case SLOPE_SE: - z = (y>>1) + 1; + z = (y >> 1) + 1; break; case SLOPE_WSE: z = 8; - y^=0xF; + y ^= 0xF; if (x - y < 0) z += (x - y) >> 1; break; @@ -114,7 +114,7 @@ uint GetPartialZ(int x, int y, Slope corners) break; case SLOPE_NW: - z = (y^0xF)>>1; + z = (y ^ 0xF) >> 1; break; case SLOPE_NWS: @@ -124,7 +124,7 @@ uint GetPartialZ(int x, int y, Slope corners) break; case SLOPE_NE: - z = (x^0xF)>>1; + z = (x ^ 0xF) >> 1; break; case SLOPE_ENW: @@ -141,19 +141,19 @@ uint GetPartialZ(int x, int y, Slope corners) break; case SLOPE_STEEP_S: - z = 1 + ((x+y)>>1); + z = 1 + ((x + y) >> 1); break; case SLOPE_STEEP_W: - z = 1 + ((x+(y^0xF))>>1); + z = 1 + ((x + (y ^ 0xF)) >> 1); break; case SLOPE_STEEP_N: - z = 1 + (((x^0xF)+(y^0xF))>>1); + z = 1 + (((x ^ 0xF) + (y ^ 0xF)) >> 1); break; case SLOPE_STEEP_E: - z = 1 + (((x^0xF)+(y^0xF))>>1); + z = 1 + (((x ^ 0xF) + (y ^ 0xF)) >> 1); break; default: break; @@ -385,8 +385,8 @@ int32 CmdClearArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) int32 cost, ret, money; int ex; int ey; - int sx,sy; - int x,y; + int sx, sy; + int x, y; bool success = false; if (p1 >= MapSize()) return CMD_ERROR; @@ -435,7 +435,7 @@ int32 CmdClearArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) #define TILELOOP_BITS 4 #define TILELOOP_SIZE (1 << TILELOOP_BITS) -#define TILELOOP_ASSERTMASK ((TILELOOP_SIZE-1) + ((TILELOOP_SIZE-1) << MapLogX())) +#define TILELOOP_ASSERTMASK ((TILELOOP_SIZE - 1) + ((TILELOOP_SIZE - 1) << MapLogX())) #define TILELOOP_CHKMASK (((1 << (MapLogX() - TILELOOP_BITS))-1) << TILELOOP_BITS) void RunTileLoop() diff --git a/src/macros.h b/src/macros.h index 35964c07b..7b8b8dba6 100644 --- a/src/macros.h +++ b/src/macros.h @@ -82,9 +82,9 @@ template static inline T TOGGLEBIT(T& x, int y) /* checking more bits. Maybe unneccessary, but easy to use */ -#define HASBITS(x,y) ((x) & (y)) -#define SETBITS(x,y) ((x) |= (y)) -#define CLRBITS(x,y) ((x) &= ~(y)) +#define HASBITS(x, y) ((x) & (y)) +#define SETBITS(x, y) ((x) |= (y)) +#define CLRBITS(x, y) ((x) &= ~(y)) #define GENERAL_SPRITE_COLOR(color) ((color) + PALETTE_RECOLOR_START) #define PLAYER_SPRITE_COLOR(owner) (GENERAL_SPRITE_COLOR(_player_colors[owner])) @@ -98,7 +98,7 @@ extern const byte _ffb_64[128]; /* Returns x with the first bit that is not zero, counted from the left, set * to zero. So, 10110100 returns 10110000, 00000001 returns 00000000, etc. */ -#define KILL_FIRST_BIT(x) _ffb_64[(x)+64] +#define KILL_FIRST_BIT(x) _ffb_64[(x) + 64] static inline int FindFirstBit2x64(int value) { @@ -133,13 +133,13 @@ static inline int KillFirstBit2x64(int value) #define HAS_SINGLE_BIT(a) ( ((a) & ((a) - 1)) == 0) /* [min,max), strictly less than */ -#define IS_BYTE_INSIDE(a,min,max) ((byte)((a)-(min)) < (byte)((max)-(min))) -#define IS_INT_INSIDE(a,min,max) ((uint)((a)-(min)) < (uint)((max)-(min))) +#define IS_BYTE_INSIDE(a, min, max) ((byte)((a) - (min)) < (byte)((max) - (min))) +#define IS_INT_INSIDE(a, min, max) ((uint)((a) - (min)) < (uint)((max) - (min))) -#define CHANCE16(a,b) ((uint16)Random() <= (uint16)((65536 * (a)) / (b))) -#define CHANCE16R(a,b,r) ((uint16)(r=Random()) <= (uint16)((65536 * (a)) / (b))) -#define CHANCE16I(a,b,v) ((uint16)(v) <= (uint16)((65536 * (a)) / (b))) +#define CHANCE16(a, b) ((uint16)Random() <= (uint16)((65536 * (a)) / (b))) +#define CHANCE16R(a, b, r) ((uint16)(r = Random()) <= (uint16)((65536 * (a)) / (b))) +#define CHANCE16I(a, b, v) ((uint16)(v) <= (uint16)((65536 * (a)) / (b))) #define for_each_bit(_i, _b) \ diff --git a/src/map.cpp b/src/map.cpp index 00655a42e..eadaffb5f 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -86,9 +86,9 @@ TileIndex TileAdd(TileIndex tile, TileIndexDiff add, #endif } - assert(TileXY(x,y) == TILE_MASK(tile + add)); + assert(TileXY(x, y) == TILE_MASK(tile + add)); - return TileXY(x,y); + return TileXY(x, y); } #endif @@ -98,7 +98,7 @@ uint ScaleByMapSize(uint n) /* First shift by 12 to prevent integer overflow for large values of n. * >>12 is safe since the min mapsize is 64x64 * Add (1<<4)-1 to round upwards. */ - return (n * (MapSize() >> 12) + (1<<4) - 1) >> 4; + return (n * (MapSize() >> 12) + (1 << 4) - 1) >> 4; } @@ -109,7 +109,7 @@ uint ScaleByMapSize1D(uint n) * Note, not actually taking the full circumference into account, * just half of it. * (1<<9) - 1 is there to scale upwards. */ - return (n * (MapSizeX() + MapSizeY()) + (1<<9) - 1) >> 9; + return (n * (MapSizeX() + MapSizeY()) + (1 << 9) - 1) >> 9; } diff --git a/src/map.h b/src/map.h index 72e6c0c27..b3e5eef5d 100644 --- a/src/map.h +++ b/src/map.h @@ -147,7 +147,7 @@ uint DistanceMaxPlusManhattan(TileIndex, TileIndex); ///< Max + Manhattan uint DistanceFromEdge(TileIndex); ///< shortest distance from any edge of the map -#define BEGIN_TILE_LOOP(var,w,h,tile) \ +#define BEGIN_TILE_LOOP(var, w, h, tile) \ { \ int h_cur = h; \ uint var = tile; \ @@ -155,7 +155,7 @@ uint DistanceFromEdge(TileIndex); ///< shortest distance from any edge of the ma int w_cur = w; \ do { -#define END_TILE_LOOP(var,w,h,tile) \ +#define END_TILE_LOOP(var, w, h, tile) \ } while (++var, --w_cur != 0); \ } while (var += TileDiffXY(0, 1) - (w), --h_cur != 0); \ } diff --git a/src/misc.cpp b/src/misc.cpp index ec121ecb4..9ea8a738e 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -286,7 +286,7 @@ static void Load_NAME() int index; while ((index = SlIterateArray()) != -1) { - SlArray(_name_array[index],SlGetFieldLength(),SLE_UINT8); + SlArray(_name_array[index], SlGetFieldLength(), SLE_UINT8); } } diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index c22043913..bcd2ca68a 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -1457,7 +1457,7 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e) } if (_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO) { - DrawEditBox(w, &WP(w,querystr_d), 10); + DrawEditBox(w, &WP(w, querystr_d), 10); } break; } @@ -1550,7 +1550,7 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e) if (!(_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO)) break; if (IsWindowWidgetLowered(w, 11)) { // Delete button clicked - if (!FiosDelete(WP(w,querystr_d).text.buf)) { + if (!FiosDelete(WP(w, querystr_d).text.buf)) { ShowErrorMessage(INVALID_STRING_ID, STR_4008_UNABLE_TO_DELETE_FILE, 0, 0); } else { BuildFileList(); @@ -1562,7 +1562,7 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e) SetWindowDirty(w); } else if (IsWindowWidgetLowered(w, 12)) { // Save button clicked _switch_mode = SM_SAVE; - FiosMakeSavegameName(_file_to_saveload.name, WP(w,querystr_d).text.buf, sizeof(_file_to_saveload.name)); + FiosMakeSavegameName(_file_to_saveload.name, WP(w, querystr_d).text.buf, sizeof(_file_to_saveload.name)); /* In the editor set up the vehicle engines correctly (date might have changed) */ if (_game_mode == GM_EDITOR) StartupEngines(); diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 05040d539..8566a9aa2 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -207,8 +207,8 @@ static void MusicTrackSelectionWndProc(Window *w, WindowEvent *e) LowerWindowWidget(w, 4); DrawWindowWidgets(w); - GfxFillRect(3, 23, 3+177,23+191,0); - GfxFillRect(251, 23, 251+177,23+191,0); + GfxFillRect(3, 23, 3 + 177, 23 + 191, 0); + GfxFillRect(251, 23, 251 + 177, 23 + 191, 0); DrawStringCentered(92, 15, STR_01EE_TRACK_INDEX, 0); @@ -219,14 +219,14 @@ static void MusicTrackSelectionWndProc(Window *w, WindowEvent *e) SetDParam(0, i); SetDParam(2, i); SetDParam(1, SPECSTR_SONGNAME); - DrawString(4, 23+(i-1)*6, (i < 10) ? STR_01EC_0 : STR_01ED, 0); + DrawString(4, 23 + (i - 1) * 6, (i < 10) ? STR_01EC_0 : STR_01ED, 0); } for (i = 0; i != 6; i++) { DrawStringCentered(216, 45 + i * 8, STR_01D5_ALL + i, (i == msf.playlist) ? 0xC : 0x10); } - DrawStringCentered(216, 45+8*6+16, STR_01F0_CLEAR, 0); + DrawStringCentered(216, 45 + 8 * 6 + 16, STR_01F0_CLEAR, 0); #if 0 DrawStringCentered(216, 45 + 8 * 6 + 16 * 2, STR_01F1_SAVE, 0); #endif diff --git a/src/namegen.cpp b/src/namegen.cpp index 42c9e7fea..cefd0be25 100644 --- a/src/namegen.cpp +++ b/src/namegen.cpp @@ -90,7 +90,7 @@ static byte MakeEnglishAdditionalTownName(char *buf, uint32 seed, const char *la /* optional first segment */ i = SeedChanceBias(0, lengthof(name_additional_english_prefix), seed, 50); if (i >= 0) - strecat(buf,name_additional_english_prefix[i], last); + strecat(buf, name_additional_english_prefix[i], last); if (SeedChance(3, 20, seed) >= 14) { strecat(buf, name_additional_english_1a[SeedChance(6, lengthof(name_additional_english_1a), seed)], last); @@ -176,13 +176,13 @@ static byte MakeGermanTownName(char *buf, uint32 seed, const char *last) /* optional prefix */ if (seed_derivative == 12 || seed_derivative == 19) { i = SeedChance(2, lengthof(name_german_pre), seed); - strecat(buf,name_german_pre[i], last); + strecat(buf, name_german_pre[i], last); } /* mandatory middle segments including option of hardcoded name */ i = SeedChance(3, lengthof(name_german_real) + lengthof(name_german_1), seed); if (i < lengthof(name_german_real)) { - strecat(buf,name_german_real[i], last); + strecat(buf, name_german_real[i], last); } else { strecat(buf, name_german_1[i - lengthof(name_german_real)], last); @@ -679,7 +679,7 @@ static byte MakeItalianTownName(char *buf, uint32 seed, const char *last) if (SeedModChance(3, 3, seed) == 0) { strecat(buf, name_italian_2[SeedModChance(11, lengthof(name_italian_2), seed)], last); - strecat(buf,mascul_femin_italian[i], last); + strecat(buf, mascul_femin_italian[i], last); } else { strecat(buf, name_italian_2i[SeedModChance(16, lengthof(name_italian_2i), seed)], last); } diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h index dc9f488db..46be0a4fe 100644 --- a/src/network/core/os_abstraction.h +++ b/src/network/core/os_abstraction.h @@ -161,7 +161,7 @@ typedef unsigned long in_addr_t; /* Make the names compatible */ # define closesocket(s) CloseSocket(s) # define GET_LAST_ERROR() Errno() -# define ioctlsocket(s,request,status) IoctlSocket((LONG)s,(ULONG)request,(char*)status) +# define ioctlsocket(s, request, status) IoctlSocket((LONG)s, (ULONG)request, (char*)status) # define ioctl ioctlsocket typedef unsigned int in_addr_t; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 6686a1364..0117d4f29 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -789,7 +789,7 @@ static void ShowNetworkStartServerWindow() _saveload_mode = SLD_NEW_GAME; BuildFileList(); w->vscroll.cap = 12; - w->vscroll.count = _fios_num+1; + w->vscroll.count = _fios_num + 1; WP(w, network_ql_d).q.afilter = CS_ALPHANUMERAL; InitializeTextBuffer(&WP(w, network_ql_d).q.text, _edit_str_buf, lengthof(_edit_str_buf), 160); diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 235b28ae1..81c418c27 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1523,7 +1523,7 @@ static bool GlobalVarChangeInfo(uint gvid, int numinfo, int prop, byte **bufp, i uint32 tempfix = grf_load_dword(&buf); if (curidx < NUM_CURRENCY) { - memcpy(&_currency_specs[curidx].suffix,&tempfix,4); + memcpy(&_currency_specs[curidx].suffix, &tempfix, 4); _currency_specs[curidx].suffix[4] = 0; } else { grfmsg(1, "GlobalVarChangeInfo: Currency symbol %d out of range, ignoring", curidx); @@ -2796,7 +2796,7 @@ static void FeatureNewName(byte *buf, int len) case GSF_CANAL : case GSF_BRIDGE : AddGRFString(_cur_spriteid, id, lang, name); - switch (GB(id, 8,8)) { + switch (GB(id, 8, 8)) { case 0xC9: // House name default: grfmsg(7, "FeatureNewName: Unsupported ID (0x%04X)", id); diff --git a/src/news.h b/src/news.h index 84e86366d..0f5bc7cfa 100644 --- a/src/news.h +++ b/src/news.h @@ -24,7 +24,7 @@ typedef bool ValidationProc ( uint data_a, uint data_b ); typedef void DrawNewsCallbackProc(Window *w); typedef StringID GetNewsStringCallbackProc(const NewsItem *ni); -#define NEWS_FLAGS(mode,flag,type,cb) ((cb)<<24 | (type)<<16 | (flag)<<8 | (mode)) +#define NEWS_FLAGS(mode, flag, type, cb) ((cb) << 24 | (type) << 16 | (flag) << 8 | (mode)) void AddNewsItem(StringID string, uint32 flags, uint data_a, uint data_b); void NewsLoop(); void DrawNewsBorder(const Window *w); diff --git a/src/oldloader.cpp b/src/oldloader.cpp index 57745c994..ad28db2d2 100644 --- a/src/oldloader.cpp +++ b/src/oldloader.cpp @@ -149,7 +149,7 @@ static byte ReadByte(LoadgameState *ls) /* Old savegames have a nice compression algorithm (RLE) which means that we have a chunk, which starts with a length byte. If that byte is negative, we have to repeat the next byte - that many times (+1). Else, we need to read that amount of bytes. + that many times ( + 1). Else, we need to read that amount of bytes. Works pretty good if you have many zero's behind eachother */ if (ls->chunk_size == 0) { @@ -433,7 +433,7 @@ static const OldChunks town_chunk[] = { OCL_SVAR( OC_UINT16, Town, ratings[7] ), /* XXX - This is pretty odd.. we read 32bit, but only write 8bit.. sure there is - nothing changed?? */ + nothing changed ? ? */ OCL_SVAR( OC_FILE_U32 | OC_VAR_U8, Town, have_ratings ), OCL_SVAR( OC_FILE_U32 | OC_VAR_U8, Town, statues ), OCL_SVAR( OC_UINT16, Town, num_houses ), @@ -1219,8 +1219,8 @@ static bool LoadOldVehicle(LoadgameState *ls, int num) static const OldChunks sign_chunk[] = { OCL_SVAR( OC_UINT16, Sign, str ), - OCL_SVAR( OC_FILE_U16 | OC_VAR_I32,Sign, x ), - OCL_SVAR( OC_FILE_U16 | OC_VAR_I32,Sign, y ), + OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, x ), + OCL_SVAR( OC_FILE_U16 | OC_VAR_I32, Sign, y ), OCL_SVAR( OC_FILE_U16 | OC_VAR_I8, Sign, z ), OCL_NULL( 6 ), ///< Width of sign, no longer in use diff --git a/src/openttd.cpp b/src/openttd.cpp index 64dccfb37..7d342a3de 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -348,7 +348,7 @@ int ttd_main(int argc, char *argv[]) int i; const char *optformat; char musicdriver[32], sounddriver[32], videodriver[32]; - int resolution[2] = {0,0}; + int resolution[2] = {0, 0}; Year startyear = INVALID_YEAR; uint generation_seed = GENERATE_NEW_SEED; bool save_config = true; @@ -379,7 +379,7 @@ int ttd_main(int argc, char *argv[]) #endif ; - MyGetOptData mgo(argc-1, argv+1, optformat); + MyGetOptData mgo(argc - 1, argv + 1, optformat); while ((i = MyGetOpt(&mgo)) != -1) { switch (i) { diff --git a/src/pathfind.cpp b/src/pathfind.cpp index f834097cd..f73b6f094 100644 --- a/src/pathfind.cpp +++ b/src/pathfind.cpp @@ -821,7 +821,7 @@ start_at: } /* If we reach here, the tile has exactly one track, and this - track is reachable => Rail segment continues */ + track is reachable = > Rail segment continues */ track = _new_trackdir[FIND_FIRST_BIT(bits)][direction]; assert(track != INVALID_TRACKDIR); diff --git a/src/player_gui.cpp b/src/player_gui.cpp index e899476a5..d2a839760 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -29,7 +29,7 @@ static void DoShowPlayerFinances(PlayerID player, bool show_small, bool show_sti static void DrawPlayerEconomyStats(const Player *p, byte mode) { - int x,y,i,j,year; + int x, y, i, j, year; const int64 (*tbl)[13]; int64 sum, cost; StringID str; @@ -38,8 +38,8 @@ static void DrawPlayerEconomyStats(const Player *p, byte mode) /* draw categories */ DrawStringCenterUnderline(61, 15, STR_700F_EXPENDITURE_INCOME, 0); for (i = 0; i != 13; i++) - DrawString(2, 27 + i*10, STR_7011_CONSTRUCTION + i, 0); - DrawStringRightAligned(111, 27 + 10*13 + 2, STR_7020_TOTAL, 0); + DrawString(2, 27 + i * 10, STR_7011_CONSTRUCTION + i, 0); + DrawStringRightAligned(111, 27 + 10 * 13 + 2, STR_7020_TOTAL, 0); /* draw the price columns */ year = _cur_year - 2; @@ -60,16 +60,16 @@ static void DrawPlayerEconomyStats(const Player *p, byte mode) str = STR_701E; if (cost < 0) { cost = -cost; str++; } SetDParam64(0, cost); - DrawStringRightAligned(x, 27+i*10, str, 0); + DrawStringRightAligned(x, 27 + i * 10, str, 0); } } str = STR_701E; if (sum < 0) { sum = -sum; str++; } SetDParam64(0, sum); - DrawStringRightAligned(x, 27 + 13*10 + 2, str, 0); + DrawStringRightAligned(x, 27 + 13 * 10 + 2, str, 0); - GfxFillRect(x - 75, 27 + 10*13, x, 27 + 10*13, 215); + GfxFillRect(x - 75, 27 + 10 * 13, x, 27 + 10 * 13, 215); x += 95; } year++; @@ -80,7 +80,7 @@ static void DrawPlayerEconomyStats(const Player *p, byte mode) /* draw max loan aligned to loan below (y += 10) */ SetDParam64(0, (uint64)_economy.max_loan); - DrawString(202, y+10, STR_MAX_LOAN, 0); + DrawString(202, y + 10, STR_MAX_LOAN, 0); } else { y = 15; } @@ -97,7 +97,7 @@ static void DrawPlayerEconomyStats(const Player *p, byte mode) y += 12; - GfxFillRect(182 - 75, y-2, 182, y-2, 215); + GfxFillRect(182 - 75, y - 2, 182, y - 2, 215); SetDParam64(0, p->money64 - p->current_loan); DrawStringRightAligned(182, y, STR_7028, 0); @@ -166,13 +166,13 @@ static void PlayerFinancesWndProc(Window *w, WindowEvent *e) SetDParam(4, 10000); DrawWindowWidgets(w); - DrawPlayerEconomyStats(p, (byte)WP(w,def_d).data_1); + DrawPlayerEconomyStats(p, (byte)WP(w, def_d).data_1); } break; case WE_CLICK: switch (e->we.click.widget) { case 2: {/* toggle size */ - byte mode = (byte)WP(w,def_d).data_1; + byte mode = (byte)WP(w, def_d).data_1; bool stickied = !!(w->flags4 & WF_STICKY); PlayerID player = (PlayerID)w->window_number; DeleteWindow(w); @@ -239,7 +239,7 @@ static void DoShowPlayerFinances(PlayerID player, bool show_small, bool show_sti w = AllocateWindowDescFront(desc_table[mode], player); if (w != NULL) { w->caption_color = w->window_number; - WP(w,def_d).data_1 = mode; + WP(w, def_d).data_1 = mode; if (show_stickied) w->flags4 |= WF_STICKY; } } @@ -554,14 +554,14 @@ static void SelectPlayerFaceWndProc(Window *w, WindowEvent *e) LowerWindowWidget(w, WP(w, facesel_d).gender + 5); DrawWindowWidgets(w); p = GetPlayer((PlayerID)w->window_number); - DrawPlayerFace(WP(w,facesel_d).face, p->player_color, 2, 16); + DrawPlayerFace(WP(w, facesel_d).face, p->player_color, 2, 16); } break; case WE_CLICK: switch (e->we.click.widget) { case 3: DeleteWindow(w); break; case 4: /* ok click */ - DoCommandP(0, 0, WP(w,facesel_d).face, NULL, CMD_SET_PLAYER_FACE); + DoCommandP(0, 0, WP(w, facesel_d).face, NULL, CMD_SET_PLAYER_FACE); DeleteWindow(w); break; case 5: /* male click */ @@ -572,7 +572,7 @@ static void SelectPlayerFaceWndProc(Window *w, WindowEvent *e) SetWindowDirty(w); break; case 7: - WP(w,facesel_d).face = ConvertFromOldPlayerFace((WP(w, facesel_d).gender << 31) + GB(InteractiveRandom(), 0, 31)); + WP(w, facesel_d).face = ConvertFromOldPlayerFace((WP(w, facesel_d).gender << 31) + GB(InteractiveRandom(), 0, 31)); SetWindowDirty(w); break; } @@ -656,8 +656,8 @@ static void DrawPlayerVehiclesAmount(PlayerID player) } } - if (train+road+air+ship == 0) { - DrawString(x+70, y, STR_7042_NONE, 0); + if (train + road + air + ship == 0) { + DrawString(x + 70, y, STR_7042_NONE, 0); } else { if (train != 0) { SetDParam(0, train); @@ -762,7 +762,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) DrawPlayerVehiclesAmount((PlayerID)w->window_number); - DrawString(110,48, STR_7006_COLOR_SCHEME, 0); + DrawString(110, 48, STR_7006_COLOR_SCHEME, 0); /* Draw company-colour bus */ DrawSprite(SPR_VEH_BUS_SW_VIEW, PLAYER_SPRITE_COLOR(p->index), 215, 49); @@ -786,8 +786,8 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) Window *wf = AllocateWindowDescFront(&_select_player_face_desc, w->window_number); if (wf != NULL) { wf->caption_color = w->window_number; - WP(wf,facesel_d).face = GetPlayer((PlayerID)wf->window_number)->face; - WP(wf,facesel_d).gender = 0; + WP(wf, facesel_d).face = GetPlayer((PlayerID)wf->window_number)->face; + WP(wf, facesel_d).gender = 0; } break; } @@ -796,8 +796,8 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) Window *wf = AllocateWindowDescFront(_have_2cc ? &_select_player_livery_2cc_desc : &_select_player_livery_desc, w->window_number); if (wf != NULL) { wf->caption_color = wf->window_number; - WP(wf,livery_d).livery_class = LC_OTHER; - WP(wf,livery_d).sel = 1; + WP(wf, livery_d).livery_class = LC_OTHER; + WP(wf, livery_d).sel = 1; LowerWindowWidget(wf, 2); } break; @@ -813,7 +813,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) case PCW_WIDGET_COMPANY_NAME: { Player *p = GetPlayer((PlayerID)w->window_number); - WP(w,def_d).byte_1 = 1; + WP(w, def_d).byte_1 = 1; SetDParam(0, p->name_2); ShowQueryString(p->name_1, STR_700A_COMPANY_NAME, 31, 150, w, CS_ALPHANUMERAL); break; @@ -852,7 +852,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) #ifdef ENABLE_NETWORK case PCW_WIDGET_COMPANY_PASSWORD: if (w->window_number == _local_player) { - WP(w,def_d).byte_1 = 2; + WP(w, def_d).byte_1 = 2; ShowQueryString(BindCString(_network_player_info[_local_player].password), STR_SET_COMPANY_PASSWORD, sizeof(_network_player_info[_local_player].password), 250, w, CS_ALPHANUMERAL); } @@ -885,10 +885,10 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) char *b = e->we.edittext.str; /* empty string is allowed for password */ - if (*b == '\0' && WP(w,def_d).byte_1 != 2) return; + if (*b == '\0' && WP(w, def_d).byte_1 != 2) return; _cmd_text = b; - switch (WP(w,def_d).byte_1) { + switch (WP(w, def_d).byte_1) { case 0: /* Change president name */ DoCommandP(0, 0, 0, NULL, CMD_CHANGE_PRESIDENT_NAME | CMD_MSG(STR_700D_CAN_T_CHANGE_PRESIDENT)); break; diff --git a/src/rail.cpp b/src/rail.cpp index 6cd97b170..86fe50393 100644 --- a/src/rail.cpp +++ b/src/rail.cpp @@ -68,8 +68,8 @@ extern const TrackBits _track_crosses_tracks[] = { /* Maps a trackdir to the (4-way) direction the tile is exited when following * that trackdir */ extern const DiagDirection _trackdir_to_exitdir[] = { - DIAGDIR_NE,DIAGDIR_SE,DIAGDIR_NE,DIAGDIR_SE,DIAGDIR_SW,DIAGDIR_SE, DIAGDIR_NE,DIAGDIR_NE, - DIAGDIR_SW,DIAGDIR_NW,DIAGDIR_NW,DIAGDIR_SW,DIAGDIR_NW,DIAGDIR_NE, + DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_SW, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_NE, + DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NW, DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NE, }; extern const Trackdir _track_exitdir_to_trackdir[][DIAGDIR_END] = { diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 5f98ae9d5..32a9b1fb3 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -60,10 +60,10 @@ bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, bool *ed /* Get a bitmask of which neighbouring roads has a tile */ n = ROAD_NONE; present = GetAnyRoadBits(tile); - if (present & ROAD_NE && GetAnyRoadBits(TILE_ADDXY(tile,-1, 0)) & ROAD_SW) n |= ROAD_NE; + if (present & ROAD_NE && GetAnyRoadBits(TILE_ADDXY(tile, -1, 0)) & ROAD_SW) n |= ROAD_NE; if (present & ROAD_SE && GetAnyRoadBits(TILE_ADDXY(tile, 0, 1)) & ROAD_NW) n |= ROAD_SE; if (present & ROAD_SW && GetAnyRoadBits(TILE_ADDXY(tile, 1, 0)) & ROAD_NE) n |= ROAD_SW; - if (present & ROAD_NW && GetAnyRoadBits(TILE_ADDXY(tile, 0,-1)) & ROAD_SE) n |= ROAD_NW; + if (present & ROAD_NW && GetAnyRoadBits(TILE_ADDXY(tile, 0, -1)) & ROAD_SE) n |= ROAD_NW; /* If 0 or 1 bits are set in n, or if no bits that match the bits to remove, * then allow it */ @@ -431,7 +431,7 @@ int32 CmdBuildLongRoad(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2) TileIndex t = start_tile; start_tile = end_tile; end_tile = t; - p2 ^= IS_INT_INSIDE(p2&3, 1, 3) ? 3 : 0; + p2 ^= IS_INT_INSIDE(p2 & 3, 1, 3) ? 3 : 0; } cost = 0; diff --git a/src/road_gui.cpp b/src/road_gui.cpp index ec34dd48f..a4f128839 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -257,11 +257,11 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) InvalidateWidget(w, RTW_REMOVE); w = FindWindowById(WC_BUS_STATION, 0); - if (w != NULL) WP(w,def_d).close = true; + if (w != NULL) WP(w, def_d).close = true; w = FindWindowById(WC_TRUCK_STATION, 0); - if (w != NULL) WP(w,def_d).close = true; + if (w != NULL) WP(w, def_d).close = true; w = FindWindowById(WC_BUILD_DEPOT, 0); - if (w != NULL) WP(w,def_d).close = true; + if (w != NULL) WP(w, def_d).close = true; break; case WE_PLACE_DRAG: { @@ -414,11 +414,11 @@ static void BuildRoadDepotWndProc(Window *w, WindowEvent *e) } break; case WE_MOUSELOOP: - if (WP(w,def_d).close) DeleteWindow(w); + if (WP(w, def_d).close) DeleteWindow(w); break; case WE_DESTROY: - if (!WP(w,def_d).close) ResetObjectToPlace(); + if (!WP(w, def_d).close) ResetObjectToPlace(); break; } } @@ -458,7 +458,7 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e) case WE_PAINT: { int image; - if (WP(w,def_d).close) return; + if (WP(w, def_d).close) return; DrawWindowWidgets(w); @@ -472,9 +472,9 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e) image = (w->window_class == WC_BUS_STATION) ? GFX_BUS_BASE : GFX_TRUCK_BASE; StationPickerDrawSprite(103, 35, RAILTYPE_BEGIN, image); - StationPickerDrawSprite(103, 85, RAILTYPE_BEGIN, image+1); - StationPickerDrawSprite(35, 85, RAILTYPE_BEGIN, image+2); - StationPickerDrawSprite(35, 35, RAILTYPE_BEGIN, image+3); + StationPickerDrawSprite(103, 85, RAILTYPE_BEGIN, image + 1); + StationPickerDrawSprite(35, 85, RAILTYPE_BEGIN, image + 2); + StationPickerDrawSprite(35, 35, RAILTYPE_BEGIN, image + 3); image = (w->window_class == WC_BUS_STATION) ? GFX_BUS_BASE_EXT : GFX_TRUCK_BASE_EXT; @@ -482,7 +482,7 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e) StationPickerDrawSprite(171, 85, RAILTYPE_BEGIN, image + 1); DrawStationCoverageAreaText(2, 146, - ((w->window_class == WC_BUS_STATION) ? (1<window_class == WC_BUS_STATION) ? (1 << CT_PASSENGERS) : ~(1 << CT_PASSENGERS)), 3); } break; @@ -507,7 +507,7 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e) } break; case WE_MOUSELOOP: { - if (WP(w,def_d).close) { + if (WP(w, def_d).close) { DeleteWindow(w); return; } @@ -516,7 +516,7 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e) } break; case WE_DESTROY: - if (!WP(w,def_d).close) ResetObjectToPlace(); + if (!WP(w, def_d).close) ResetObjectToPlace(); break; } } diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index cef00e34e..fada22c84 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -168,11 +168,11 @@ int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) y = TileY(tile) * TILE_SIZE + TILE_SIZE / 2; v->x_pos = x; v->y_pos = y; - v->z_pos = GetSlopeZ(x,y); + v->z_pos = GetSlopeZ(x, y); v->z_height = 6; v->u.road.state = RVSB_IN_DEPOT; - v->vehstatus = VS_HIDDEN|VS_STOPPED|VS_DEFPAL; + v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL; v->spritenum = rvi->image_index; v->cargo_type = rvi->cargo_type; diff --git a/src/saveload.cpp b/src/saveload.cpp index 449530504..511eb7418 100644 --- a/src/saveload.cpp +++ b/src/saveload.cpp @@ -251,14 +251,14 @@ static void SlWriteSimpleGamma(uint i) if (i >= (1 << 14)) { if (i >= (1 << 21)) { assert(i < (1 << 28)); - SlWriteByte((byte)0xE0 | (i>>24)); - SlWriteByte((byte)(i>>16)); + SlWriteByte((byte)0xE0 | (i >> 24)); + SlWriteByte((byte)(i >> 16)); } else { - SlWriteByte((byte)0xC0 | (i>>16)); + SlWriteByte((byte)0xC0 | (i >> 16)); } - SlWriteByte((byte)(i>>8)); + SlWriteByte((byte)(i >> 8)); } else { - SlWriteByte((byte)(0x80 | (i>>8))); + SlWriteByte((byte)(0x80 | (i >> 8))); } } SlWriteByte(i); @@ -925,7 +925,7 @@ static const ChunkHandler *SlFindChunkHandler(uint32 id) { const ChunkHandler *ch; const ChunkHandler *const *chsc; - for (chsc = _sl.chs; (ch=*chsc++) != NULL;) { + for (chsc = _sl.chs; (ch = *chsc++) != NULL;) { for (;;) { if (ch->id == id) return ch; if (ch->flags & CH_LAST) break; @@ -1030,7 +1030,7 @@ static void WriteNoComp(uint size) static bool InitNoComp() { _sl.bufsize = LZO_SIZE; - _sl.buf = _sl.buf_ori =(byte*)malloc(LZO_SIZE); + _sl.buf = _sl.buf_ori = (byte*)malloc(LZO_SIZE); return true; } diff --git a/src/screenshot.cpp b/src/screenshot.cpp index 3eebc1841..c2903699b 100644 --- a/src/screenshot.cpp +++ b/src/screenshot.cpp @@ -268,7 +268,7 @@ struct PcxHeader { uint32 unused; uint16 xmax, ymax; uint16 hdpi, vdpi; - byte pal_small[16*3]; + byte pal_small[16 * 3]; byte reserved; byte planes; uint16 pitch; diff --git a/src/settings.cpp b/src/settings.cpp index 469e9ce6b..ba3016c16 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1140,15 +1140,15 @@ static int32 CheckInterval(int32 p1) const Patches *ptc = (_game_mode == GM_MENU) ? &_patches_newgame : &_patches; if (p1) { - warning = ( (IS_INT_INSIDE(ptc->servint_trains, 5, 90+1) || ptc->servint_trains == 0) && - (IS_INT_INSIDE(ptc->servint_roadveh, 5, 90+1) || ptc->servint_roadveh == 0) && - (IS_INT_INSIDE(ptc->servint_aircraft, 5, 90+1) || ptc->servint_aircraft == 0) && - (IS_INT_INSIDE(ptc->servint_ships, 5, 90+1) || ptc->servint_ships == 0) ); + warning = ( (IS_INT_INSIDE(ptc->servint_trains, 5, 90 + 1) || ptc->servint_trains == 0) && + (IS_INT_INSIDE(ptc->servint_roadveh, 5, 90 + 1) || ptc->servint_roadveh == 0) && + (IS_INT_INSIDE(ptc->servint_aircraft, 5, 90 + 1) || ptc->servint_aircraft == 0) && + (IS_INT_INSIDE(ptc->servint_ships, 5, 90 + 1) || ptc->servint_ships == 0) ); } else { - warning = ( (IS_INT_INSIDE(ptc->servint_trains, 30, 800+1) || ptc->servint_trains == 0) && - (IS_INT_INSIDE(ptc->servint_roadveh, 30, 800+1) || ptc->servint_roadveh == 0) && - (IS_INT_INSIDE(ptc->servint_aircraft, 30, 800+1) || ptc->servint_aircraft == 0) && - (IS_INT_INSIDE(ptc->servint_ships, 30, 800+1) || ptc->servint_ships == 0) ); + warning = ( (IS_INT_INSIDE(ptc->servint_trains, 30, 800 + 1) || ptc->servint_trains == 0) && + (IS_INT_INSIDE(ptc->servint_roadveh, 30, 800 + 1) || ptc->servint_roadveh == 0) && + (IS_INT_INSIDE(ptc->servint_aircraft, 30, 800 + 1) || ptc->servint_aircraft == 0) && + (IS_INT_INSIDE(ptc->servint_ships, 30, 800 + 1) || ptc->servint_ships == 0) ); } if (!warning) @@ -1280,7 +1280,7 @@ static const SettingDesc _gameopt_settings[] = { * and why not byte for example? */ SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 17, 0, 0, 0, 0, NULL, STR_NULL, NULL, NULL, 0, 3), SDT_GENERAL("diff_custom", SDT_INTLIST, SL_ARR, (SLE_FILE_I16 | SLE_VAR_I32), 0, 0, GameOptions, diff, 18, 0, 0, 0, 0, NULL, STR_NULL, NULL, NULL, 4, SL_MAX_VERSION), - SDT_VAR(GameOptions, diff_level,SLE_UINT8, 0, 0, 0, 0, 3, 0, STR_NULL, NULL), + SDT_VAR(GameOptions, diff_level, SLE_UINT8, 0, 0, 0, 0, 3, 0, STR_NULL, NULL), SDT_OMANY(GameOptions, currency, SLE_UINT8, N, 0, 0, CUSTOM_CURRENCY_ID, "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|ROL|RUR|SIT|SEK|YTL|SKK|BRR|custom", STR_NULL, NULL, NULL), SDT_OMANY(GameOptions, units, SLE_UINT8, N, 0, 1, 2, "imperial|metric|si", STR_NULL, NULL, NULL), SDT_OMANY(GameOptions, town_name, SLE_UINT8, 0, 0, 0, 20, "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovakish|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish|italian|catalan", STR_NULL, NULL, NULL), @@ -1527,7 +1527,7 @@ const SettingDesc _patch_settings[] = { static const SettingDesc _currency_settings[] = { SDT_VAR(CurrencySpec, rate, SLE_UINT16, S, 0, 1, 0, 100, 0, STR_NULL, NULL), SDT_CHR(CurrencySpec, separator, S, 0, ".", STR_NULL, NULL), - SDT_VAR(CurrencySpec, to_euro, SLE_INT32, S, 0, 0, 0,3000, 0, STR_NULL, NULL), + SDT_VAR(CurrencySpec, to_euro, SLE_INT32, S, 0, 0, 0, 3000, 0, STR_NULL, NULL), SDT_STR(CurrencySpec, prefix, SLE_STRBQ, S, 0, NULL, STR_NULL, NULL), SDT_STR(CurrencySpec, suffix, SLE_STRBQ, S, 0, " credits", STR_NULL, NULL), SDT_END() diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 02d0c1f2d..3b67711fc 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -551,7 +551,7 @@ static inline NPFFoundTargetData PerfNPFRouteToStationOrTile(TileIndex tile, Tra * direction in which we are entering the tile */ static Track ChooseShipTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks) { - assert(enterdir>=0 && enterdir<=3); + assert(enterdir >= 0 && enterdir <= 3); if (_patches.yapf.ship_use_yapf) { Trackdir trackdir = YapfChooseShipTrack(v, tile, enterdir, tracks); @@ -654,11 +654,11 @@ static const byte _ship_subcoord[4][6][3] = { }, { { 0, 0, 0}, - { 8,15, 7}, + { 8, 15, 7}, { 0, 0, 0}, - { 8,15, 6}, + { 8, 15, 6}, { 0, 0, 0}, - { 7,15, 0}, + { 7, 15, 0}, } }; @@ -880,7 +880,7 @@ int32 CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) y = TileY(tile) * TILE_SIZE + TILE_SIZE / 2; v->x_pos = x; v->y_pos = y; - v->z_pos = GetSlopeZ(x,y); + v->z_pos = GetSlopeZ(x, y); v->z_height = 6; v->sprite_width = 6; diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp index 48a645016..0e943b40a 100644 --- a/src/ship_gui.cpp +++ b/src/ship_gui.cpp @@ -78,7 +78,7 @@ static void ShipDetailsWndProc(Window *w, WindowEvent *e) { SetDParam(0, v->service_interval); SetDParam(1, v->date_of_last_service); - DrawString(13, 102, _patches.servint_ispercent?STR_SERVICING_INTERVAL_PERCENT:STR_883C_SERVICING_INTERVAL_DAYS, 0); + DrawString(13, 102, _patches.servint_ispercent ? STR_SERVICING_INTERVAL_PERCENT : STR_883C_SERVICING_INTERVAL_DAYS, 0); } DrawShipImage(v, 3, 57, INVALID_VEHICLE); @@ -120,7 +120,7 @@ static void ShipDetailsWndProc(Window *w, WindowEvent *e) mod = _ctrl_pressed? 5 : 10; goto do_change_service_int; case 6: /* decrease int */ - mod = _ctrl_pressed?- 5 : -10; + mod = _ctrl_pressed ? - 5 : -10; do_change_service_int: v = GetVehicle(w->window_number); @@ -157,7 +157,7 @@ static const Widget _ship_details_widgets[] = { static const WindowDesc _ship_details_desc = { WDP_AUTO, WDP_AUTO, 405, 113, - WC_VEHICLE_DETAILS,WC_VEHICLE_VIEW, + WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, _ship_details_widgets, ShipDetailsWndProc @@ -326,7 +326,7 @@ static const Widget _ship_view_widgets[] = { { WWT_PUSHIMGBTN, RESIZE_LR, 14, 232, 249, 32, 49, SPR_SEND_SHIP_TODEPOT, STR_982A_SEND_SHIP_TO_DEPOT}, { WWT_PUSHIMGBTN, RESIZE_LR, 14, 232, 249, 50, 67, SPR_REFIT_VEHICLE, STR_983A_REFIT_CARGO_SHIP_TO_CARRY}, { WWT_PUSHIMGBTN, RESIZE_LR, 14, 232, 249, 68, 85, SPR_SHOW_ORDERS, STR_9828_SHOW_SHIP_S_ORDERS}, -{ WWT_PUSHIMGBTN, RESIZE_LR, 14, 232, 249, 86, 103, SPR_SHOW_VEHICLE_DETAILS,STR_982B_SHOW_SHIP_DETAILS}, +{ WWT_PUSHIMGBTN, RESIZE_LR, 14, 232, 249, 86, 103, SPR_SHOW_VEHICLE_DETAILS, STR_982B_SHOW_SHIP_DETAILS}, { WWT_PUSHIMGBTN, RESIZE_LR, 14, 232, 249, 32, 49, SPR_CLONE_SHIP, STR_CLONE_SHIP_INFO}, { WWT_PANEL, RESIZE_LRB, 14, 232, 249, 104, 103, 0x0, STR_NULL }, { WWT_RESIZEBOX, RESIZE_LRTB, 14, 238, 249, 104, 115, 0x0, STR_NULL }, diff --git a/src/signs.cpp b/src/signs.cpp index ff7517574..db8d42def 100644 --- a/src/signs.cpp +++ b/src/signs.cpp @@ -136,7 +136,7 @@ int32 CmdPlaceSign(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) si->x = x; si->y = y; si->owner = _current_player; // owner of the sign; just eyecandy - si->z = GetSlopeZ(x,y); + si->z = GetSlopeZ(x, y); UpdateSignVirtCoords(si); MarkSignDirty(si); InvalidateWindow(WC_SIGN_LIST, 0); diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 9c6fe88e6..ac5ceadff 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -199,7 +199,7 @@ static bool GenerateStationName(Station *st, TileIndex tile, int flag) Station *s; FOR_ALL_STATIONS(s) { - if (s != st && s->town==t) { + if (s != st && s->town == t) { uint str = M(s->string_id); if (str <= 0x20) { if (str == M(STR_SV_STNAME_FOREST)) @@ -230,7 +230,7 @@ static bool GenerateStationName(Station *st, TileIndex tile, int flag) } /* check close enough to town to get central as name? */ - if (DistanceMax(tile,t->xy) < 8) { + if (DistanceMax(tile, t->xy) < 8) { found = M(STR_SV_STNAME); if (HASBIT(free_names, M(STR_SV_STNAME))) goto done; @@ -272,10 +272,10 @@ static bool GenerateStationName(Station *st, TileIndex tile, int flag) /* check direction compared to town */ { static const int8 _direction_and_table[] = { - ~( (1<xy)) * 2]; } - tmp = free_names & ((1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<6)|(1<<7)|(1<<12)|(1<<26)|(1<<27)|(1<<28)|(1<<29)|(1<<30)); + tmp = free_names & ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 6) | (1 << 7) | (1 << 12) | (1 << 26) | (1 << 27) | (1 << 28) | (1 << 29) | (1 << 30)); if (tmp == 0) { _error_message = STR_3007_TOO_MANY_STATIONS_LOADING; return false; @@ -368,7 +368,7 @@ static void ShowRejectOrAcceptNews(const Station *st, uint num_items, CargoID *c } SetDParam(0, st->index); - AddNewsItem(msg, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_TILE, NT_ACCEPTANCE, 0), st->xy, 0); + AddNewsItem(msg, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT | NF_TILE, NT_ACCEPTANCE, 0), st->xy, 0); } // Get a list of the cargo types being produced around the tile. @@ -646,10 +646,10 @@ int32 CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint invali int flat_z = z; if (tileh != SLOPE_FLAT) { // need to check so the entrance to the station is not pointing at a slope. - if ((invalid_dirs&1 && !(tileh & SLOPE_NE) && (uint)w_cur == w) || - (invalid_dirs&2 && !(tileh & SLOPE_SE) && h_cur == 1) || - (invalid_dirs&4 && !(tileh & SLOPE_SW) && w_cur == 1) || - (invalid_dirs&8 && !(tileh & SLOPE_NW) && (uint)h_cur == h)) { + if ((invalid_dirs & 1 && !(tileh & SLOPE_NE) && (uint)w_cur == w) || + (invalid_dirs & 2 && !(tileh & SLOPE_SE) && h_cur == 1) || + (invalid_dirs & 4 && !(tileh & SLOPE_SW) && w_cur == 1) || + (invalid_dirs & 8 && !(tileh & SLOPE_NW) && (uint)h_cur == h)) { return_cmd_error(STR_0007_FLAT_LAND_REQUIRED); } cost += _price.terraform; @@ -748,7 +748,7 @@ static inline byte *CreateSingle(byte *layout, int n) { int i = n; do *layout++ = 0; while (--i); - layout[((n-1) >> 1)-n] = 2; + layout[((n - 1) >> 1) - n] = 2; return layout; } @@ -757,8 +757,8 @@ static inline byte *CreateMulti(byte *layout, int n, byte b) int i = n; do *layout++ = b; while (--i); if (n > 4) { - layout[0-n] = 0; - layout[n-1-n] = 0; + layout[0 - n] = 0; + layout[n - 1 - n] = 0; } return layout; } @@ -1623,7 +1623,7 @@ static int32 RemoveAirport(Station *st, uint32 flags) DeleteAnimatedTile(tile_cur); DoClearSquare(tile_cur); } - } END_TILE_LOOP(tile_cur, w,h,tile) + } END_TILE_LOOP(tile_cur, w, h, tile) if (flags & DC_EXEC) { for (uint i = 0; i < afc->nof_depots; ++i) { diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index f6193f0c9..e480f6163 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -730,7 +730,7 @@ static bool CheckCommandsMatch(char *a, char *b, const char *name) { ParsedCommandStruct templ; ParsedCommandStruct lang; - int i,j; + int i, j; bool result = true; ExtractCommandString(&templ, b, true); @@ -914,7 +914,7 @@ static void ParseFile(const char *file, bool english) in = fopen(file, "r"); if (in == NULL) fatal("Cannot open file"); _cur_line = 1; - while (fgets(buf, sizeof(buf),in) != NULL) { + while (fgets(buf, sizeof(buf), in) != NULL) { rstrip(buf); HandleString(buf, english); _cur_line++; diff --git a/src/strings.cpp b/src/strings.cpp index d36edc2e7..45bf80de4 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -63,7 +63,7 @@ static inline int64 GetInt64(const int32 **argv) assert(argv); result = (uint32)(*argv)[0] + ((uint64)(uint32)(*argv)[1] << 32); - (*argv)+=2; + (*argv) += 2; return result; } @@ -421,37 +421,37 @@ static int DeterminePluralForm(int32 n) * Used in: * Latvian */ case 3: - return n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2; + return n%10 == 1 && n%100 != 11 ? 0 : n != 0 ? 1 : 2; /* Three forms, special case for one and two * Used in: * Gaelige (Irish) */ case 4: - return n==1 ? 0 : n==2 ? 1 : 2; + return n == 1 ? 0 : n == 2 ? 1 : 2; /* Three forms, special case for numbers ending in 1[2-9] * Used in: * Lithuanian */ case 5: - return n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2; + return n%10 == 1 && n%100 != 11 ? 0 : n%10 >= 2 && (n%100<10 || n%100 >= 20) ? 1 : 2; /* Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4] * Used in: * Croatian, Czech, Russian, Slovak, Ukrainian */ case 6: - return n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; + return n%10 == 1 && n%100 != 11 ? 0 : n%10 >= 2 && n%10 <= 4 && (n%100<10 || n%100 >= 20) ? 1 : 2; /* Three forms, special case for one and some numbers ending in 2, 3, or 4 * Used in: * Polish */ case 7: - return n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; + return n == 1 ? 0 : n%10 >= 2 && n%10 <= 4 && (n%100<10 || n%100 >= 20) ? 1 : 2; /* Four forms, special case for one and all numbers ending in 02, 03, or 04 * Used in: * Slovenian */ case 8: - return n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3; + return n%100 == 1 ? 0 : n%100 == 2 ? 1 : n%100 == 3 || n%100 == 4 ? 2 : 3; } } @@ -459,7 +459,7 @@ static const char *ParseStringChoice(const char *b, uint form, char *dst, int *d { // {Length of each string} {each string} uint n = (byte)*b++; - uint pos,i, mylen=0,mypos=0; + uint pos, i, mylen = 0, mypos = 0; for (i = pos = 0; i != n; i++) { uint len = (byte)*b++; diff --git a/src/table/ai_rail.h b/src/table/ai_rail.h index bbb094728..2b9602abd 100644 --- a/src/table/ai_rail.h +++ b/src/table/ai_rail.h @@ -21,7 +21,7 @@ struct AiDefaultRoadBlock { }; -#define MKHDR(a,b,c,d,e) a,b,c,d,e, +#define MKHDR(a, b, c, d, e) a, b, c, d, e, #define MKDEPOT(a, b, c) {0, a, {b, c}} #define MKSTATION(a, b, c) {1, a, {b, c}} #define MKRAIL(a, b, c) {2, a, {b, c}} @@ -424,17 +424,17 @@ static const AiDefaultRailBlock * const _default_rail_track_data[] = { #undef MKHDR -#define MKHDR(a) a,{ +#define MKHDR(a) a, { static const AiDefaultBlockData _roaddata_ai_0_data[] = { - MKDEPOT(2, -1,1), - MKSTATION(0x2, -1,0), - MKRAIL(0xC, 0,0), - MKRAIL(0x9, 0,1), - MKCLRRAIL(0, 0,-1), - MKCLRRAIL(0, 1,0), - MKCLRRAIL(0, 1,1), - MKCLRRAIL(0, 0,2), + MKDEPOT(2, -1, 1), + MKSTATION(0x2, -1, 0), + MKRAIL(0xC, 0, 0), + MKRAIL(0x9, 0, 1), + MKCLRRAIL(0, 0, -1), + MKCLRRAIL(0, 1, 0), + MKCLRRAIL(0, 1, 1), + MKCLRRAIL(0, 0, 2), MKEND }; @@ -443,14 +443,14 @@ static const AiDefaultRoadBlock _roaddata_ai_0 = { }; static const AiDefaultBlockData _roaddata_ai_1_data[] = { - MKDEPOT(1, 0,-1), - MKSTATION(0x1, 1,-1), - MKRAIL(0x3, 0,0), - MKRAIL(0x9, 1,0), - MKCLRRAIL(0, -1,0), - MKCLRRAIL(0, 0,1), - MKCLRRAIL(0, 1,1), - MKCLRRAIL(0, 2,0), + MKDEPOT(1, 0, -1), + MKSTATION(0x1, 1, -1), + MKRAIL(0x3, 0, 0), + MKRAIL(0x9, 1, 0), + MKCLRRAIL(0, -1, 0), + MKCLRRAIL(0, 0, 1), + MKCLRRAIL(0, 1, 1), + MKCLRRAIL(0, 2, 0), MKEND }; @@ -459,14 +459,14 @@ static const AiDefaultRoadBlock _roaddata_ai_1 = { }; static const AiDefaultBlockData _roaddata_ai_2_data[] = { - MKDEPOT(3, 1,1), - MKSTATION(0x3, 0,1), - MKRAIL(0x6, 0,0), - MKRAIL(0xC, 1,0), - MKCLRRAIL(0, -1,0), - MKCLRRAIL(0, 0,-1), - MKCLRRAIL(0, 1,-1), - MKCLRRAIL(0, 2,0), + MKDEPOT(3, 1, 1), + MKSTATION(0x3, 0, 1), + MKRAIL(0x6, 0, 0), + MKRAIL(0xC, 1, 0), + MKCLRRAIL(0, -1, 0), + MKCLRRAIL(0, 0, -1), + MKCLRRAIL(0, 1, -1), + MKCLRRAIL(0, 2, 0), MKEND }; @@ -475,14 +475,14 @@ static const AiDefaultRoadBlock _roaddata_ai_2 = { }; static const AiDefaultBlockData _roaddata_ai_3_data[] = { - MKDEPOT(0, 1,0), - MKSTATION(0x0, 1,1), - MKRAIL(0x6, 0,0), - MKRAIL(0x3, 0,1), - MKCLRRAIL(0, 0,-1), - MKCLRRAIL(0, -1,0), - MKCLRRAIL(0, -1,1), - MKCLRRAIL(0, 0,2), + MKDEPOT(0, 1, 0), + MKSTATION(0x0, 1, 1), + MKRAIL(0x6, 0, 0), + MKRAIL(0x3, 0, 1), + MKCLRRAIL(0, 0, -1), + MKCLRRAIL(0, -1, 0), + MKCLRRAIL(0, -1, 1), + MKCLRRAIL(0, 0, 2), MKEND }; @@ -491,11 +491,11 @@ static const AiDefaultRoadBlock _roaddata_ai_3 = { }; static const AiDefaultBlockData _roaddata_ai_4_data[] = { - MKSTATION(0x2, -1,0), - MKRAIL(0x8, 0,0), - MKCLRRAIL(0, 0,-1), - MKCLRRAIL(0, 1,0), - MKCLRRAIL(0, 0,1), + MKSTATION(0x2, -1, 0), + MKRAIL(0x8, 0, 0), + MKCLRRAIL(0, 0, -1), + MKCLRRAIL(0, 1, 0), + MKCLRRAIL(0, 0, 1), MKEND }; @@ -504,11 +504,11 @@ static const AiDefaultRoadBlock _roaddata_ai_4 = { }; static const AiDefaultBlockData _roaddata_ai_5_data[] = { - MKSTATION(0x3, 0,1), - MKRAIL(0x4, 0,0), - MKCLRRAIL(0, -1,0), - MKCLRRAIL(0, 0,-1), - MKCLRRAIL(0, 1,0), + MKSTATION(0x3, 0, 1), + MKRAIL(0x4, 0, 0), + MKCLRRAIL(0, -1, 0), + MKCLRRAIL(0, 0, -1), + MKCLRRAIL(0, 1, 0), MKEND }; @@ -517,11 +517,11 @@ static const AiDefaultRoadBlock _roaddata_ai_5 = { }; static const AiDefaultBlockData _roaddata_ai_6_data[] = { - MKSTATION(0x0, 1,1), - MKRAIL(0x2, 0,1), - MKCLRRAIL(0, 0,0), - MKCLRRAIL(0, -1,0), - MKCLRRAIL(0, 0,2), + MKSTATION(0x0, 1, 1), + MKRAIL(0x2, 0, 1), + MKCLRRAIL(0, 0, 0), + MKCLRRAIL(0, -1, 0), + MKCLRRAIL(0, 0, 2), MKEND }; @@ -530,11 +530,11 @@ static const AiDefaultRoadBlock _roaddata_ai_6 = { }; static const AiDefaultBlockData _roaddata_ai_7_data[] = { - MKSTATION(0x1, 1,-1), - MKRAIL(0x1, 1,0), - MKCLRRAIL(0, 0,0), - MKCLRRAIL(0, 1,1), - MKCLRRAIL(0, 2,0), + MKSTATION(0x1, 1, -1), + MKRAIL(0x1, 1, 0), + MKCLRRAIL(0, 0, 0), + MKCLRRAIL(0, 1, 1), + MKCLRRAIL(0, 2, 0), MKEND }; diff --git a/src/table/build_industry.h b/src/table/build_industry.h index d7bfbfd37..1b178b625 100644 --- a/src/table/build_industry.h +++ b/src/table/build_industry.h @@ -5,54 +5,54 @@ #ifndef BUILD_INDUSTRY_H #define BUILD_INDUSTRY_H -#define MK(x,y, m) {{x, y}, m} +#define MK(x, y, m) {{x, y}, m} #define MKEND {{-0x80, 0}, 0} static const IndustryTileTable _tile_table_coal_mine_0[] = { - MK(1,1, 0), - MK(1,2, 2), - MK(0,0, 5), - MK(1,0, 6), - MK(2,0, 3), - MK(2,2, 3), + MK(1, 1, 0), + MK(1, 2, 2), + MK(0, 0, 5), + MK(1, 0, 6), + MK(2, 0, 3), + MK(2, 2, 3), MKEND }; static const IndustryTileTable _tile_table_coal_mine_1[] = { - MK(1,1, 0), - MK(1,2, 2), - MK(2,0, 0), - MK(2,1, 2), - MK(1,0, 3), - MK(0,0, 3), - MK(0,1, 4), - MK(0,2, 4), - MK(2,2, 4), + MK(1, 1, 0), + MK(1, 2, 2), + MK(2, 0, 0), + MK(2, 1, 2), + MK(1, 0, 3), + MK(0, 0, 3), + MK(0, 1, 4), + MK(0, 2, 4), + MK(2, 2, 4), MKEND }; static const IndustryTileTable _tile_table_coal_mine_2[] = { - MK(0,0, 0), - MK(0,1, 2), - MK(0,2, 5), - MK(1,0, 3), - MK(1,1, 3), - MK(1,2, 6), + MK(0, 0, 0), + MK(0, 1, 2), + MK(0, 2, 5), + MK(1, 0, 3), + MK(1, 1, 3), + MK(1, 2, 6), MKEND }; static const IndustryTileTable _tile_table_coal_mine_3[] = { - MK(0,1, 0), - MK(0,2, 2), - MK(0,3, 4), - MK(1,0, 5), - MK(1,1, 0), - MK(1,2, 2), - MK(1,3, 3), - MK(2,0, 6), - MK(2,1, 4), - MK(2,2, 3), + MK(0, 1, 0), + MK(0, 2, 2), + MK(0, 3, 4), + MK(1, 0, 5), + MK(1, 1, 0), + MK(1, 2, 2), + MK(1, 3, 3), + MK(2, 0, 6), + MK(2, 1, 4), + MK(2, 2, 3), MKEND }; @@ -64,36 +64,36 @@ static const IndustryTileTable * const _tile_table_coal_mine[] = { }; static const IndustryTileTable _tile_table_power_station_0[] = { - MK(0,0, 7), - MK(0,1, 9), - MK(1,0, 7), - MK(1,1, 8), - MK(2,0, 7), - MK(2,1, 8), - MK(3,0, 10), - MK(3,1, 10), + MK(0, 0, 7), + MK(0, 1, 9), + MK(1, 0, 7), + MK(1, 1, 8), + MK(2, 0, 7), + MK(2, 1, 8), + MK(3, 0, 10), + MK(3, 1, 10), MKEND }; static const IndustryTileTable _tile_table_power_station_1[] = { - MK(0,1, 7), - MK(0,2, 7), - MK(1,0, 8), - MK(1,1, 8), - MK(1,2, 7), - MK(2,0, 9), - MK(2,1, 10), - MK(2,2, 9), + MK(0, 1, 7), + MK(0, 2, 7), + MK(1, 0, 8), + MK(1, 1, 8), + MK(1, 2, 7), + MK(2, 0, 9), + MK(2, 1, 10), + MK(2, 2, 9), MKEND }; static const IndustryTileTable _tile_table_power_station_2[] = { - MK(0,0, 7), - MK(0,1, 7), - MK(1,0, 9), - MK(1,1, 8), - MK(2,0, 10), - MK(2,1, 9), + MK(0, 0, 7), + MK(0, 1, 7), + MK(1, 0, 9), + MK(1, 1, 8), + MK(2, 0, 10), + MK(2, 1, 9), MKEND }; @@ -104,26 +104,26 @@ static const IndustryTileTable * const _tile_table_power_station[] = { }; static const IndustryTileTable _tile_table_sawmill_0[] = { - MK(1,0, 14), - MK(1,1, 12), - MK(1,2, 11), - MK(2,0, 14), - MK(2,1, 13), - MK(0,0, 15), - MK(0,1, 15), - MK(0,2, 12), + MK(1, 0, 14), + MK(1, 1, 12), + MK(1, 2, 11), + MK(2, 0, 14), + MK(2, 1, 13), + MK(0, 0, 15), + MK(0, 1, 15), + MK(0, 2, 12), MKEND }; static const IndustryTileTable _tile_table_sawmill_1[] = { - MK(0,0, 15), - MK(0,1, 11), - MK(0,2, 14), - MK(1,0, 15), - MK(1,1, 13), - MK(1,2, 12), - MK(2,0, 11), - MK(2,1, 13), + MK(0, 0, 15), + MK(0, 1, 11), + MK(0, 2, 14), + MK(1, 0, 15), + MK(1, 1, 13), + MK(1, 2, 12), + MK(2, 0, 11), + MK(2, 1, 13), MKEND }; @@ -133,51 +133,51 @@ static const IndustryTileTable * const _tile_table_sawmill[] = { }; static const IndustryTileTable _tile_table_forest_0[] = { - MK(0,0, 16), - MK(0,1, 16), - MK(0,2, 16), - MK(0,3, 16), - MK(1,0, 16), - MK(1,1, 16), - MK(1,2, 16), - MK(1,3, 16), - MK(2,0, 16), - MK(2,1, 16), - MK(2,2, 16), - MK(2,3, 16), - MK(3,0, 16), - MK(3,1, 16), - MK(3,2, 16), - MK(3,3, 16), - MK(1,4, 16), - MK(2,4, 16), + MK(0, 0, 16), + MK(0, 1, 16), + MK(0, 2, 16), + MK(0, 3, 16), + MK(1, 0, 16), + MK(1, 1, 16), + MK(1, 2, 16), + MK(1, 3, 16), + MK(2, 0, 16), + MK(2, 1, 16), + MK(2, 2, 16), + MK(2, 3, 16), + MK(3, 0, 16), + MK(3, 1, 16), + MK(3, 2, 16), + MK(3, 3, 16), + MK(1, 4, 16), + MK(2, 4, 16), MKEND }; static const IndustryTileTable _tile_table_forest_1[] = { - MK(0,0, 16), - MK(1,0, 16), - MK(2,0, 16), - MK(3,0, 16), - MK(4,0, 16), - MK(0,1, 16), - MK(1,1, 16), - MK(2,1, 16), - MK(3,1, 16), - MK(4,1, 16), - MK(0,2, 16), - MK(1,2, 16), - MK(2,2, 16), - MK(3,2, 16), - MK(4,2, 16), - MK(0,3, 16), - MK(1,3, 16), - MK(2,3, 16), - MK(3,3, 16), - MK(4,3, 16), - MK(1,4, 16), - MK(2,4, 16), - MK(3,4, 16), + MK(0, 0, 16), + MK(1, 0, 16), + MK(2, 0, 16), + MK(3, 0, 16), + MK(4, 0, 16), + MK(0, 1, 16), + MK(1, 1, 16), + MK(2, 1, 16), + MK(3, 1, 16), + MK(4, 1, 16), + MK(0, 2, 16), + MK(1, 2, 16), + MK(2, 2, 16), + MK(3, 2, 16), + MK(4, 2, 16), + MK(0, 3, 16), + MK(1, 3, 16), + MK(2, 3, 16), + MK(3, 3, 16), + MK(4, 3, 16), + MK(1, 4, 16), + MK(2, 4, 16), + MK(3, 4, 16), MKEND }; @@ -187,40 +187,40 @@ static const IndustryTileTable * const _tile_table_forest[] = { }; static const IndustryTileTable _tile_table_oil_refinery_0[] = { - MK(0,0, 20), - MK(0,1, 21), - MK(0,2, 22), - MK(0,3, 21), - MK(1,0, 20), - MK(1,1, 19), - MK(1,2, 22), - MK(1,3, 20), - MK(2,1, 18), - MK(2,2, 18), - MK(2,3, 18), - MK(3,2, 18), - MK(3,3, 18), - MK(2,0, 23), - MK(3,1, 23), + MK(0, 0, 20), + MK(0, 1, 21), + MK(0, 2, 22), + MK(0, 3, 21), + MK(1, 0, 20), + MK(1, 1, 19), + MK(1, 2, 22), + MK(1, 3, 20), + MK(2, 1, 18), + MK(2, 2, 18), + MK(2, 3, 18), + MK(3, 2, 18), + MK(3, 3, 18), + MK(2, 0, 23), + MK(3, 1, 23), MKEND }; static const IndustryTileTable _tile_table_oil_refinery_1[] = { - MK(0,0, 18), - MK(0,1, 18), - MK(0,2, 21), - MK(0,3, 22), - MK(0,4, 20), - MK(1,0, 18), - MK(1,1, 18), - MK(1,2, 19), - MK(1,3, 20), - MK(2,0, 18), - MK(2,1, 18), - MK(2,2, 19), - MK(2,3, 22), - MK(1,4, 23), - MK(2,4, 23), + MK(0, 0, 18), + MK(0, 1, 18), + MK(0, 2, 21), + MK(0, 3, 22), + MK(0, 4, 20), + MK(1, 0, 18), + MK(1, 1, 18), + MK(1, 2, 19), + MK(1, 3, 20), + MK(2, 0, 18), + MK(2, 1, 18), + MK(2, 2, 19), + MK(2, 3, 22), + MK(1, 4, 23), + MK(2, 4, 23), MKEND }; @@ -230,51 +230,51 @@ static const IndustryTileTable * const _tile_table_oil_refinery[] = { }; static const IndustryTileTable _tile_table_oil_rig_0[] = { - MK(0,0, 24), - MK(0,1, 24), - MK(0,2, 25), - MK(1,0, 26), - MK(1,1, 27), - MK(1,2, 28), - MK(-4,-5, 255), - MK(-4,-4, 255), - MK(-4,-3, 255), - MK(-4,-2, 255), - MK(-4,-1, 255), - MK(-4,0, 255), - MK(-4,1, 255), - MK(-4,2, 255), - MK(-4,3, 255), - MK(-4,4, 255), - MK(-4,5, 255), - MK(-3,5, 255), - MK(-2,5, 255), - MK(-1,5, 255), - MK(0,6, 255), - MK(1,6, 255), - MK(2,6, 255), - MK(3,6, 255), - MK(4,6, 255), - MK(5,6, 255), - MK(5,5, 255), - MK(5,4, 255), - MK(5,3, 255), - MK(5,2, 255), - MK(5,1, 255), - MK(5,0, 255), - MK(5,-1, 255), - MK(5,-2, 255), - MK(5,-3, 255), - MK(5,-4, 255), - MK(4,-4, 255), - MK(3,-4, 255), - MK(2,-4, 255), - MK(1,-4, 255), - MK(0,-4, 255), - MK(-1,-5, 255), - MK(-2,-5, 255), - MK(-3,-5, 255), - MK(2,0, 255), + MK(0, 0, 24), + MK(0, 1, 24), + MK(0, 2, 25), + MK(1, 0, 26), + MK(1, 1, 27), + MK(1, 2, 28), + MK(-4, -5, 255), + MK(-4, -4, 255), + MK(-4, -3, 255), + MK(-4, -2, 255), + MK(-4, -1, 255), + MK(-4, 0, 255), + MK(-4, 1, 255), + MK(-4, 2, 255), + MK(-4, 3, 255), + MK(-4, 4, 255), + MK(-4, 5, 255), + MK(-3, 5, 255), + MK(-2, 5, 255), + MK(-1, 5, 255), + MK(0, 6, 255), + MK(1, 6, 255), + MK(2, 6, 255), + MK(3, 6, 255), + MK(4, 6, 255), + MK(5, 6, 255), + MK(5, 5, 255), + MK(5, 4, 255), + MK(5, 3, 255), + MK(5, 2, 255), + MK(5, 1, 255), + MK(5, 0, 255), + MK(5, -1, 255), + MK(5, -2, 255), + MK(5, -3, 255), + MK(5, -4, 255), + MK(4, -4, 255), + MK(3, -4, 255), + MK(2, -4, 255), + MK(1, -4, 255), + MK(0, -4, 255), + MK(-1, -5, 255), + MK(-2, -5, 255), + MK(-3, -5, 255), + MK(2, 0, 255), MKEND }; @@ -283,34 +283,34 @@ static const IndustryTileTable * const _tile_table_oil_rig[] = { }; static const IndustryTileTable _tile_table_factory_0[] = { - MK(0,0, 39), - MK(0,1, 40), - MK(1,0, 41), - MK(1,1, 42), - MK(0,2, 39), - MK(0,3, 40), - MK(1,2, 41), - MK(1,3, 42), - MK(2,1, 39), - MK(2,2, 40), - MK(3,1, 41), - MK(3,2, 42), + MK(0, 0, 39), + MK(0, 1, 40), + MK(1, 0, 41), + MK(1, 1, 42), + MK(0, 2, 39), + MK(0, 3, 40), + MK(1, 2, 41), + MK(1, 3, 42), + MK(2, 1, 39), + MK(2, 2, 40), + MK(3, 1, 41), + MK(3, 2, 42), MKEND }; static const IndustryTileTable _tile_table_factory_1[] = { - MK(0,0, 39), - MK(0,1, 40), - MK(1,0, 41), - MK(1,1, 42), - MK(2,0, 39), - MK(2,1, 40), - MK(3,0, 41), - MK(3,1, 42), - MK(1,2, 39), - MK(1,3, 40), - MK(2,2, 41), - MK(2,3, 42), + MK(0, 0, 39), + MK(0, 1, 40), + MK(1, 0, 41), + MK(1, 1, 42), + MK(2, 0, 39), + MK(2, 1, 40), + MK(3, 0, 41), + MK(3, 1, 42), + MK(1, 2, 39), + MK(1, 3, 40), + MK(2, 2, 41), + MK(2, 3, 42), MKEND }; @@ -320,34 +320,34 @@ static const IndustryTileTable * const _tile_table_factory[] = { }; static const IndustryTileTable _tile_table_printing_works_0[] = { - MK(0,0, 43), - MK(0,1, 44), - MK(1,0, 45), - MK(1,1, 46), - MK(0,2, 43), - MK(0,3, 44), - MK(1,2, 45), - MK(1,3, 46), - MK(2,1, 43), - MK(2,2, 44), - MK(3,1, 45), - MK(3,2, 46), + MK(0, 0, 43), + MK(0, 1, 44), + MK(1, 0, 45), + MK(1, 1, 46), + MK(0, 2, 43), + MK(0, 3, 44), + MK(1, 2, 45), + MK(1, 3, 46), + MK(2, 1, 43), + MK(2, 2, 44), + MK(3, 1, 45), + MK(3, 2, 46), MKEND }; static const IndustryTileTable _tile_table_printing_works_1[] = { - MK(0,0, 43), - MK(0,1, 44), - MK(1,0, 45), - MK(1,1, 46), - MK(2,0, 43), - MK(2,1, 44), - MK(3,0, 45), - MK(3,1, 46), - MK(1,2, 43), - MK(1,3, 44), - MK(2,2, 45), - MK(2,3, 46), + MK(0, 0, 43), + MK(0, 1, 44), + MK(1, 0, 45), + MK(1, 1, 46), + MK(2, 0, 43), + MK(2, 1, 44), + MK(3, 0, 45), + MK(3, 1, 46), + MK(1, 2, 43), + MK(1, 3, 44), + MK(2, 2, 45), + MK(2, 3, 46), MKEND }; @@ -357,36 +357,36 @@ static const IndustryTileTable * const _tile_table_printing_works[] = { }; static const IndustryTileTable _tile_table_steel_mill_0[] = { - MK(2,1, 52), - MK(2,2, 53), - MK(3,1, 54), - MK(3,2, 55), - MK(0,0, 56), - MK(1,0, 57), - MK(0,1, 56), - MK(1,1, 57), - MK(0,2, 56), - MK(1,2, 57), - MK(2,0, 56), - MK(3,0, 57), + MK(2, 1, 52), + MK(2, 2, 53), + MK(3, 1, 54), + MK(3, 2, 55), + MK(0, 0, 56), + MK(1, 0, 57), + MK(0, 1, 56), + MK(1, 1, 57), + MK(0, 2, 56), + MK(1, 2, 57), + MK(2, 0, 56), + MK(3, 0, 57), MKEND }; static const IndustryTileTable _tile_table_steel_mill_1[] = { - MK(0,0, 52), - MK(0,1, 53), - MK(1,0, 54), - MK(1,1, 55), - MK(2,0, 52), - MK(2,1, 53), - MK(3,0, 54), - MK(3,1, 55), - MK(0,2, 56), - MK(1,2, 57), - MK(2,2, 56), - MK(3,2, 57), - MK(1,3, 56), - MK(2,3, 57), + MK(0, 0, 52), + MK(0, 1, 53), + MK(1, 0, 54), + MK(1, 1, 55), + MK(2, 0, 52), + MK(2, 1, 53), + MK(3, 0, 54), + MK(3, 1, 55), + MK(0, 2, 56), + MK(1, 2, 57), + MK(2, 2, 56), + MK(3, 2, 57), + MK(1, 3, 56), + MK(2, 3, 57), MKEND }; @@ -396,47 +396,47 @@ static const IndustryTileTable * const _tile_table_steel_mill[] = { }; static const IndustryTileTable _tile_table_farm_0[] = { - MK(1,0, 33), - MK(1,1, 34), - MK(1,2, 36), - MK(0,0, 37), - MK(0,1, 37), - MK(0,2, 36), - MK(2,0, 35), - MK(2,1, 38), - MK(2,2, 38), + MK(1, 0, 33), + MK(1, 1, 34), + MK(1, 2, 36), + MK(0, 0, 37), + MK(0, 1, 37), + MK(0, 2, 36), + MK(2, 0, 35), + MK(2, 1, 38), + MK(2, 2, 38), MKEND }; static const IndustryTileTable _tile_table_farm_1[] = { - MK(1,1, 33), - MK(1,2, 34), - MK(0,0, 35), - MK(0,1, 36), - MK(0,2, 36), - MK(0,3, 35), - MK(1,0, 37), - MK(1,3, 38), - MK(2,0, 37), - MK(2,1, 37), - MK(2,2, 38), - MK(2,3, 38), + MK(1, 1, 33), + MK(1, 2, 34), + MK(0, 0, 35), + MK(0, 1, 36), + MK(0, 2, 36), + MK(0, 3, 35), + MK(1, 0, 37), + MK(1, 3, 38), + MK(2, 0, 37), + MK(2, 1, 37), + MK(2, 2, 38), + MK(2, 3, 38), MKEND }; static const IndustryTileTable _tile_table_farm_2[] = { - MK(2,0, 33), - MK(2,1, 34), - MK(0,0, 36), - MK(0,1, 36), - MK(0,2, 37), - MK(0,3, 37), - MK(1,0, 35), - MK(1,1, 38), - MK(1,2, 38), - MK(1,3, 37), - MK(2,2, 37), - MK(2,3, 35), + MK(2, 0, 33), + MK(2, 1, 34), + MK(0, 0, 36), + MK(0, 1, 36), + MK(0, 2, 37), + MK(0, 3, 37), + MK(1, 0, 35), + MK(1, 1, 38), + MK(1, 2, 38), + MK(1, 3, 37), + MK(2, 2, 37), + MK(2, 3, 35), MKEND }; @@ -447,27 +447,27 @@ static const IndustryTileTable * const _tile_table_farm[] = { }; static const IndustryTileTable _tile_table_copper_mine_0[] = { - MK(0,0, 47), - MK(0,1, 49), - MK(0,2, 51), - MK(1,0, 47), - MK(1,1, 49), - MK(1,2, 50), - MK(2,0, 51), - MK(2,1, 51), + MK(0, 0, 47), + MK(0, 1, 49), + MK(0, 2, 51), + MK(1, 0, 47), + MK(1, 1, 49), + MK(1, 2, 50), + MK(2, 0, 51), + MK(2, 1, 51), MKEND }; static const IndustryTileTable _tile_table_copper_mine_1[] = { - MK(0,0, 50), - MK(0,1, 47), - MK(0,2, 49), - MK(1,0, 47), - MK(1,1, 49), - MK(1,2, 51), - MK(2,0, 51), - MK(2,1, 47), - MK(2,2, 49), + MK(0, 0, 50), + MK(0, 1, 47), + MK(0, 2, 49), + MK(1, 0, 47), + MK(1, 1, 49), + MK(1, 2, 51), + MK(2, 0, 51), + MK(2, 1, 47), + MK(2, 2, 49), MKEND }; @@ -477,20 +477,20 @@ static const IndustryTileTable * const _tile_table_copper_mine[] = { }; static const IndustryTileTable _tile_table_oil_well_0[] = { - MK(0,0, 29), - MK(1,0, 29), - MK(2,0, 29), - MK(0,1, 29), - MK(0,2, 29), + MK(0, 0, 29), + MK(1, 0, 29), + MK(2, 0, 29), + MK(0, 1, 29), + MK(0, 2, 29), MKEND }; static const IndustryTileTable _tile_table_oil_well_1[] = { - MK(0,0, 29), - MK(1,0, 29), - MK(1,1, 29), - MK(2,2, 29), - MK(2,3, 29), + MK(0, 0, 29), + MK(1, 0, 29), + MK(1, 1, 29), + MK(2, 2, 29), + MK(2, 3, 29), MKEND }; @@ -500,8 +500,8 @@ static const IndustryTileTable * const _tile_table_oil_well[] = { }; static const IndustryTileTable _tile_table_bank_0[] = { - MK(0,0, 58), - MK(1,0, 59), + MK(0, 0, 58), + MK(1, 0, 59), MKEND }; @@ -510,36 +510,36 @@ static const IndustryTileTable * const _tile_table_bank[] = { }; static const IndustryTileTable _tile_table_food_process_0[] = { - MK(0,0, 60), - MK(1,0, 60), - MK(2,0, 60), - MK(0,1, 60), - MK(1,1, 60), - MK(2,1, 60), - MK(0,2, 61), - MK(1,2, 61), - MK(2,2, 63), - MK(0,3, 62), - MK(1,3, 62), - MK(2,3, 63), + MK(0, 0, 60), + MK(1, 0, 60), + MK(2, 0, 60), + MK(0, 1, 60), + MK(1, 1, 60), + MK(2, 1, 60), + MK(0, 2, 61), + MK(1, 2, 61), + MK(2, 2, 63), + MK(0, 3, 62), + MK(1, 3, 62), + MK(2, 3, 63), MKEND }; static const IndustryTileTable _tile_table_food_process_1[] = { - MK(0,0, 61), - MK(1,0, 60), - MK(2,0, 61), - MK(3,0, 61), - MK(0,1, 62), - MK(1,1, 63), - MK(2,1, 63), - MK(3,1, 63), - MK(0,2, 60), - MK(1,2, 60), - MK(2,2, 60), - MK(3,2, 60), - MK(0,3, 62), - MK(1,3, 62), + MK(0, 0, 61), + MK(1, 0, 60), + MK(2, 0, 61), + MK(3, 0, 61), + MK(0, 1, 62), + MK(1, 1, 63), + MK(2, 1, 63), + MK(3, 1, 63), + MK(0, 2, 60), + MK(1, 2, 60), + MK(2, 2, 60), + MK(3, 2, 60), + MK(0, 3, 62), + MK(1, 3, 62), MKEND }; @@ -549,18 +549,18 @@ static const IndustryTileTable * const _tile_table_food_process[] = { }; static const IndustryTileTable _tile_table_paper_mill_0[] = { - MK(0,0, 64), - MK(1,0, 65), - MK(2,0, 66), - MK(3,0, 67), - MK(0,1, 68), - MK(1,1, 69), - MK(2,1, 67), - MK(3,1, 67), - MK(0,2, 66), - MK(1,2, 71), - MK(2,2, 71), - MK(3,2, 70), + MK(0, 0, 64), + MK(1, 0, 65), + MK(2, 0, 66), + MK(3, 0, 67), + MK(0, 1, 68), + MK(1, 1, 69), + MK(2, 1, 67), + MK(3, 1, 67), + MK(0, 2, 66), + MK(1, 2, 71), + MK(2, 2, 71), + MK(3, 2, 70), MKEND }; @@ -569,22 +569,22 @@ static const IndustryTileTable * const _tile_table_paper_mill[] = { }; static const IndustryTileTable _tile_table_gold_mine_0[] = { - MK(0,0, 72), - MK(0,1, 73), - MK(0,2, 74), - MK(0,3, 75), - MK(1,0, 76), - MK(1,1, 77), - MK(1,2, 78), - MK(1,3, 79), - MK(2,0, 80), - MK(2,1, 81), - MK(2,2, 82), - MK(2,3, 83), - MK(3,0, 84), - MK(3,1, 85), - MK(3,2, 86), - MK(3,3, 87), + MK(0, 0, 72), + MK(0, 1, 73), + MK(0, 2, 74), + MK(0, 3, 75), + MK(1, 0, 76), + MK(1, 1, 77), + MK(1, 2, 78), + MK(1, 3, 79), + MK(2, 0, 80), + MK(2, 1, 81), + MK(2, 2, 82), + MK(2, 3, 83), + MK(3, 0, 84), + MK(3, 1, 85), + MK(3, 2, 86), + MK(3, 3, 87), MKEND }; @@ -593,8 +593,8 @@ static const IndustryTileTable * const _tile_table_gold_mine[] = { }; static const IndustryTileTable _tile_table_bank2_0[] = { - MK(0,0, 89), - MK(1,0, 90), + MK(0, 0, 89), + MK(1, 0, 90), MKEND }; @@ -603,15 +603,15 @@ static const IndustryTileTable * const _tile_table_bank2[] = { }; static const IndustryTileTable _tile_table_diamond_mine_0[] = { - MK(0,0, 91), - MK(0,1, 92), - MK(0,2, 93), - MK(1,0, 94), - MK(1,1, 95), - MK(1,2, 96), - MK(2,0, 97), - MK(2,1, 98), - MK(2,2, 99), + MK(0, 0, 91), + MK(0, 1, 92), + MK(0, 2, 93), + MK(1, 0, 94), + MK(1, 1, 95), + MK(1, 2, 96), + MK(2, 0, 97), + MK(2, 1, 98), + MK(2, 2, 99), MKEND }; @@ -620,22 +620,22 @@ static const IndustryTileTable * const _tile_table_diamond_mine[] = { }; static const IndustryTileTable _tile_table_iron_mine_0[] = { - MK(0,0, 100), - MK(0,1, 101), - MK(0,2, 102), - MK(0,3, 103), - MK(1,0, 104), - MK(1,1, 105), - MK(1,2, 106), - MK(1,3, 107), - MK(2,0, 108), - MK(2,1, 109), - MK(2,2, 110), - MK(2,3, 111), - MK(3,0, 112), - MK(3,1, 113), - MK(3,2, 114), - MK(3,3, 115), + MK(0, 0, 100), + MK(0, 1, 101), + MK(0, 2, 102), + MK(0, 3, 103), + MK(1, 0, 104), + MK(1, 1, 105), + MK(1, 2, 106), + MK(1, 3, 107), + MK(2, 0, 108), + MK(2, 1, 109), + MK(2, 2, 110), + MK(2, 3, 111), + MK(3, 0, 112), + MK(3, 1, 113), + MK(3, 2, 114), + MK(3, 3, 115), MKEND }; @@ -644,26 +644,26 @@ static const IndustryTileTable * const _tile_table_iron_mine[] = { }; static const IndustryTileTable _tile_table_fruit_plantation_0[] = { - MK(0,0, 116), - MK(0,1, 116), - MK(0,2, 116), - MK(0,3, 116), - MK(1,0, 116), - MK(1,1, 116), - MK(1,2, 116), - MK(1,3, 116), - MK(2,0, 116), - MK(2,1, 116), - MK(2,2, 116), - MK(2,3, 116), - MK(3,0, 116), - MK(3,1, 116), - MK(3,2, 116), - MK(3,3, 116), - MK(4,0, 116), - MK(4,1, 116), - MK(4,2, 116), - MK(4,3, 116), + MK(0, 0, 116), + MK(0, 1, 116), + MK(0, 2, 116), + MK(0, 3, 116), + MK(1, 0, 116), + MK(1, 1, 116), + MK(1, 2, 116), + MK(1, 3, 116), + MK(2, 0, 116), + MK(2, 1, 116), + MK(2, 2, 116), + MK(2, 3, 116), + MK(3, 0, 116), + MK(3, 1, 116), + MK(3, 2, 116), + MK(3, 3, 116), + MK(4, 0, 116), + MK(4, 1, 116), + MK(4, 2, 116), + MK(4, 3, 116), MKEND }; @@ -672,26 +672,26 @@ static const IndustryTileTable * const _tile_table_fruit_plantation[] = { }; static const IndustryTileTable _tile_table_rubber_plantation_0[] = { - MK(0,0, 117), - MK(0,1, 117), - MK(0,2, 117), - MK(0,3, 117), - MK(1,0, 117), - MK(1,1, 117), - MK(1,2, 117), - MK(1,3, 117), - MK(2,0, 117), - MK(2,1, 117), - MK(2,2, 117), - MK(2,3, 117), - MK(3,0, 117), - MK(3,1, 117), - MK(3,2, 117), - MK(3,3, 117), - MK(4,0, 117), - MK(4,1, 117), - MK(4,2, 117), - MK(4,3, 117), + MK(0, 0, 117), + MK(0, 1, 117), + MK(0, 2, 117), + MK(0, 3, 117), + MK(1, 0, 117), + MK(1, 1, 117), + MK(1, 2, 117), + MK(1, 3, 117), + MK(2, 0, 117), + MK(2, 1, 117), + MK(2, 2, 117), + MK(2, 3, 117), + MK(3, 0, 117), + MK(3, 1, 117), + MK(3, 2, 117), + MK(3, 3, 117), + MK(4, 0, 117), + MK(4, 1, 117), + MK(4, 2, 117), + MK(4, 3, 117), MKEND }; @@ -700,10 +700,10 @@ static const IndustryTileTable * const _tile_table_rubber_plantation[] = { }; static const IndustryTileTable _tile_table_water_supply_0[] = { - MK(0,0, 118), - MK(0,1, 119), - MK(1,0, 118), - MK(1,1, 119), + MK(0, 0, 118), + MK(0, 1, 119), + MK(1, 0, 118), + MK(1, 1, 119), MKEND }; @@ -712,7 +712,7 @@ static const IndustryTileTable * const _tile_table_water_supply[] = { }; static const IndustryTileTable _tile_table_water_tower_0[] = { - MK(0,0, 120), + MK(0, 0, 120), MKEND }; @@ -721,26 +721,26 @@ static const IndustryTileTable * const _tile_table_water_tower[] = { }; static const IndustryTileTable _tile_table_factory2_0[] = { - MK(0,0, 121), - MK(0,1, 122), - MK(1,0, 123), - MK(1,1, 124), - MK(0,2, 121), - MK(0,3, 122), - MK(1,2, 123), - MK(1,3, 124), + MK(0, 0, 121), + MK(0, 1, 122), + MK(1, 0, 123), + MK(1, 1, 124), + MK(0, 2, 121), + MK(0, 3, 122), + MK(1, 2, 123), + MK(1, 3, 124), MKEND }; static const IndustryTileTable _tile_table_factory2_1[] = { - MK(0,0, 121), - MK(0,1, 122), - MK(1,0, 123), - MK(1,1, 124), - MK(2,0, 121), - MK(2,1, 122), - MK(3,0, 123), - MK(3,1, 124), + MK(0, 0, 121), + MK(0, 1, 122), + MK(1, 0, 123), + MK(1, 1, 124), + MK(2, 0, 121), + MK(2, 1, 122), + MK(3, 0, 123), + MK(3, 1, 124), MKEND }; @@ -750,47 +750,47 @@ static const IndustryTileTable * const _tile_table_factory2[] = { }; static const IndustryTileTable _tile_table_farm2_0[] = { - MK(1,0, 33), - MK(1,1, 34), - MK(1,2, 36), - MK(0,0, 37), - MK(0,1, 37), - MK(0,2, 36), - MK(2,0, 35), - MK(2,1, 38), - MK(2,2, 38), + MK(1, 0, 33), + MK(1, 1, 34), + MK(1, 2, 36), + MK(0, 0, 37), + MK(0, 1, 37), + MK(0, 2, 36), + MK(2, 0, 35), + MK(2, 1, 38), + MK(2, 2, 38), MKEND }; static const IndustryTileTable _tile_table_farm2_1[] = { - MK(1,1, 33), - MK(1,2, 34), - MK(0,0, 35), - MK(0,1, 36), - MK(0,2, 36), - MK(0,3, 35), - MK(1,0, 37), - MK(1,3, 38), - MK(2,0, 37), - MK(2,1, 37), - MK(2,2, 38), - MK(2,3, 38), + MK(1, 1, 33), + MK(1, 2, 34), + MK(0, 0, 35), + MK(0, 1, 36), + MK(0, 2, 36), + MK(0, 3, 35), + MK(1, 0, 37), + MK(1, 3, 38), + MK(2, 0, 37), + MK(2, 1, 37), + MK(2, 2, 38), + MK(2, 3, 38), MKEND }; static const IndustryTileTable _tile_table_farm2_2[] = { - MK(2,0, 33), - MK(2,1, 34), - MK(0,0, 36), - MK(0,1, 36), - MK(0,2, 37), - MK(0,3, 37), - MK(1,0, 35), - MK(1,1, 38), - MK(1,2, 38), - MK(1,3, 37), - MK(2,2, 37), - MK(2,3, 35), + MK(2, 0, 33), + MK(2, 1, 34), + MK(0, 0, 36), + MK(0, 1, 36), + MK(0, 2, 37), + MK(0, 3, 37), + MK(1, 0, 35), + MK(1, 1, 38), + MK(1, 2, 38), + MK(1, 3, 37), + MK(2, 2, 37), + MK(2, 3, 35), MKEND }; @@ -801,10 +801,10 @@ static const IndustryTileTable * const _tile_table_farm2[] = { }; static const IndustryTileTable _tile_table_lumber_mill_0[] = { - MK(0,0, 125), - MK(0,1, 126), - MK(1,0, 127), - MK(1,1, 128), + MK(0, 0, 125), + MK(0, 1, 126), + MK(1, 0, 127), + MK(1, 1, 128), MKEND }; @@ -813,51 +813,51 @@ static const IndustryTileTable * const _tile_table_lumber_mill[] = { }; static const IndustryTileTable _tile_table_cotton_candy_0[] = { - MK(0,0, 129), - MK(0,1, 129), - MK(0,2, 129), - MK(0,3, 129), - MK(1,0, 129), - MK(1,1, 129), - MK(1,2, 129), - MK(1,3, 129), - MK(2,0, 129), - MK(2,1, 129), - MK(2,2, 129), - MK(2,3, 129), - MK(3,0, 129), - MK(3,1, 129), - MK(3,2, 129), - MK(3,3, 129), - MK(1,4, 129), - MK(2,4, 129), + MK(0, 0, 129), + MK(0, 1, 129), + MK(0, 2, 129), + MK(0, 3, 129), + MK(1, 0, 129), + MK(1, 1, 129), + MK(1, 2, 129), + MK(1, 3, 129), + MK(2, 0, 129), + MK(2, 1, 129), + MK(2, 2, 129), + MK(2, 3, 129), + MK(3, 0, 129), + MK(3, 1, 129), + MK(3, 2, 129), + MK(3, 3, 129), + MK(1, 4, 129), + MK(2, 4, 129), MKEND }; static const IndustryTileTable _tile_table_cotton_candy_1[] = { - MK(0,0, 129), - MK(1,0, 129), - MK(2,0, 129), - MK(3,0, 129), - MK(4,0, 129), - MK(0,1, 129), - MK(1,1, 129), - MK(2,1, 129), - MK(3,1, 129), - MK(4,1, 129), - MK(0,2, 129), - MK(1,2, 129), - MK(2,2, 129), - MK(3,2, 129), - MK(4,2, 129), - MK(0,3, 129), - MK(1,3, 129), - MK(2,3, 129), - MK(3,3, 129), - MK(4,3, 129), - MK(1,4, 129), - MK(2,4, 129), - MK(3,4, 129), + MK(0, 0, 129), + MK(1, 0, 129), + MK(2, 0, 129), + MK(3, 0, 129), + MK(4, 0, 129), + MK(0, 1, 129), + MK(1, 1, 129), + MK(2, 1, 129), + MK(3, 1, 129), + MK(4, 1, 129), + MK(0, 2, 129), + MK(1, 2, 129), + MK(2, 2, 129), + MK(3, 2, 129), + MK(4, 2, 129), + MK(0, 3, 129), + MK(1, 3, 129), + MK(2, 3, 129), + MK(3, 3, 129), + MK(4, 3, 129), + MK(1, 4, 129), + MK(2, 4, 129), + MK(3, 4, 129), MKEND }; @@ -867,34 +867,34 @@ static const IndustryTileTable * const _tile_table_cotton_candy[] = { }; static const IndustryTileTable _tile_table_candy_factory_0[] = { - MK(0,0, 131), - MK(0,1, 132), - MK(1,0, 133), - MK(1,1, 134), - MK(0,2, 131), - MK(0,3, 132), - MK(1,2, 133), - MK(1,3, 134), - MK(2,1, 131), - MK(2,2, 132), - MK(3,1, 133), - MK(3,2, 134), + MK(0, 0, 131), + MK(0, 1, 132), + MK(1, 0, 133), + MK(1, 1, 134), + MK(0, 2, 131), + MK(0, 3, 132), + MK(1, 2, 133), + MK(1, 3, 134), + MK(2, 1, 131), + MK(2, 2, 132), + MK(3, 1, 133), + MK(3, 2, 134), MKEND }; static const IndustryTileTable _tile_table_candy_factory_1[] = { - MK(0,0, 131), - MK(0,1, 132), - MK(1,0, 133), - MK(1,1, 134), - MK(2,0, 131), - MK(2,1, 132), - MK(3,0, 133), - MK(3,1, 134), - MK(1,2, 131), - MK(1,3, 132), - MK(2,2, 133), - MK(2,3, 134), + MK(0, 0, 131), + MK(0, 1, 132), + MK(1, 0, 133), + MK(1, 1, 134), + MK(2, 0, 131), + MK(2, 1, 132), + MK(3, 0, 133), + MK(3, 1, 134), + MK(1, 2, 131), + MK(1, 3, 132), + MK(2, 2, 133), + MK(2, 3, 134), MKEND }; @@ -904,26 +904,26 @@ static const IndustryTileTable * const _tile_table_candy_factory[] = { }; static const IndustryTileTable _tile_table_battery_farm_0[] = { - MK(0,0, 135), - MK(0,1, 135), - MK(0,2, 135), - MK(0,3, 135), - MK(1,0, 135), - MK(1,1, 135), - MK(1,2, 135), - MK(1,3, 135), - MK(2,0, 135), - MK(2,1, 135), - MK(2,2, 135), - MK(2,3, 135), - MK(3,0, 135), - MK(3,1, 135), - MK(3,2, 135), - MK(3,3, 135), - MK(4,0, 135), - MK(4,1, 135), - MK(4,2, 135), - MK(4,3, 135), + MK(0, 0, 135), + MK(0, 1, 135), + MK(0, 2, 135), + MK(0, 3, 135), + MK(1, 0, 135), + MK(1, 1, 135), + MK(1, 2, 135), + MK(1, 3, 135), + MK(2, 0, 135), + MK(2, 1, 135), + MK(2, 2, 135), + MK(2, 3, 135), + MK(3, 0, 135), + MK(3, 1, 135), + MK(3, 2, 135), + MK(3, 3, 135), + MK(4, 0, 135), + MK(4, 1, 135), + MK(4, 2, 135), + MK(4, 3, 135), MKEND }; @@ -932,25 +932,25 @@ static const IndustryTileTable * const _tile_table_battery_farm[] = { }; static const IndustryTileTable _tile_table_cola_wells_0[] = { - MK(0,0, 137), - MK(0,1, 137), - MK(0,2, 137), - MK(1,0, 137), - MK(1,1, 137), - MK(1,2, 137), - MK(2,1, 137), - MK(2,2, 137), + MK(0, 0, 137), + MK(0, 1, 137), + MK(0, 2, 137), + MK(1, 0, 137), + MK(1, 1, 137), + MK(1, 2, 137), + MK(2, 1, 137), + MK(2, 2, 137), MKEND }; static const IndustryTileTable _tile_table_cola_wells_1[] = { - MK(0,1, 137), - MK(0,2, 137), - MK(0,3, 137), - MK(1,0, 137), - MK(1,1, 137), - MK(1,2, 137), - MK(2,1, 137), + MK(0, 1, 137), + MK(0, 2, 137), + MK(0, 3, 137), + MK(1, 0, 137), + MK(1, 1, 137), + MK(1, 2, 137), + MK(2, 1, 137), MKEND }; @@ -960,10 +960,10 @@ static const IndustryTileTable * const _tile_table_cola_wells[] = { }; static const IndustryTileTable _tile_table_toy_shop_0[] = { - MK(0,0, 138), - MK(0,1, 139), - MK(1,0, 140), - MK(1,1, 141), + MK(0, 0, 138), + MK(0, 1, 139), + MK(1, 0, 140), + MK(1, 1, 141), MKEND }; @@ -972,14 +972,14 @@ static const IndustryTileTable * const _tile_table_toy_shop[] = { }; static const IndustryTileTable _tile_table_toy_factory_0[] = { - MK(0,0, 147), - MK(0,1, 142), - MK(1,0, 147), - MK(1,1, 143), - MK(2,0, 147), - MK(2,1, 144), - MK(3,0, 146), - MK(3,1, 145), + MK(0, 0, 147), + MK(0, 1, 142), + MK(1, 0, 147), + MK(1, 1, 143), + MK(2, 0, 147), + MK(2, 1, 144), + MK(3, 0, 146), + MK(3, 1, 145), MKEND }; @@ -988,16 +988,16 @@ static const IndustryTileTable * const _tile_table_toy_factory[] = { }; static const IndustryTileTable _tile_table_plastic_fountain_0[] = { - MK(0,0, 148), - MK(0,1, 151), - MK(0,2, 154), + MK(0, 0, 148), + MK(0, 1, 151), + MK(0, 2, 154), MKEND }; static const IndustryTileTable _tile_table_plastic_fountain_1[] = { - MK(0,0, 148), - MK(1,0, 151), - MK(2,0, 154), + MK(0, 0, 148), + MK(1, 0, 151), + MK(2, 0, 154), MKEND }; @@ -1007,10 +1007,10 @@ static const IndustryTileTable * const _tile_table_plastic_fountain[] = { }; static const IndustryTileTable _tile_table_fizzy_drink_0[] = { - MK(0,0, 156), - MK(0,1, 157), - MK(1,0, 158), - MK(1,1, 159), + MK(0, 0, 156), + MK(0, 1, 157), + MK(1, 0, 158), + MK(1, 1, 159), MKEND }; @@ -1019,18 +1019,18 @@ static const IndustryTileTable * const _tile_table_fizzy_drink[] = { }; static const IndustryTileTable _tile_table_bubble_generator_0[] = { - MK(0,0, 163), - MK(0,1, 160), - MK(1,0, 163), - MK(1,1, 161), - MK(2,0, 163), - MK(2,1, 162), - MK(0,2, 163), - MK(0,3, 160), - MK(1,2, 163), - MK(1,3, 161), - MK(2,2, 163), - MK(2,3, 162), + MK(0, 0, 163), + MK(0, 1, 160), + MK(1, 0, 163), + MK(1, 1, 161), + MK(2, 0, 163), + MK(2, 1, 162), + MK(0, 2, 163), + MK(0, 3, 160), + MK(1, 2, 163), + MK(1, 3, 161), + MK(2, 2, 163), + MK(2, 3, 162), MKEND }; @@ -1039,9 +1039,9 @@ static const IndustryTileTable * const _tile_table_bubble_generator[] = { }; static const IndustryTileTable _tile_table_toffee_quarry_0[] = { - MK(0,0, 164), - MK(1,0, 165), - MK(2,0, 166), + MK(0, 0, 164), + MK(1, 0, 165), + MK(2, 0, 166), MKEND }; @@ -1050,14 +1050,14 @@ static const IndustryTileTable * const _tile_table_toffee_quarry[] = { }; static const IndustryTileTable _tile_table_sugar_mine_0[] = { - MK(0,0, 167), - MK(0,1, 168), - MK(1,0, 169), - MK(1,1, 170), - MK(2,0, 171), - MK(2,1, 172), - MK(3,0, 173), - MK(3,1, 174), + MK(0, 0, 167), + MK(0, 1, 168), + MK(1, 0, 169), + MK(1, 1, 170), + MK(2, 0, 171), + MK(2, 1, 172), + MK(3, 0, 173), + MK(3, 1, 174), MKEND }; @@ -1103,7 +1103,7 @@ static const IndustryTileTable * const _tile_table_sugar_mine[] = { * @param s3 text for production down */ -#define MI(tbl, d, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, col,\ +#define MI(tbl, d, ai1, ai2, ai3, ai4, ag1, ag2, ag3, ag4, col, \ c1, c2, c3, proc, p1, r1, p2, r2, m, a1, a2, a3, pr, clim, bev, in, intx, s1, s2, s3) \ {tbl, lengthof(tbl), d, {c1, c2, c3}, proc, {p1, p2}, {r1, r2}, m, \ {a1, a2, a3}, pr, clim, bev, col, in, intx, s1, s2, s3, {ai1, ai2, ai3, ai4}, {ag1, ag2, ag3, ag4}, 0, 0, 0, 0} diff --git a/src/table/namegen.h b/src/table/namegen.h index 456b26aa3..a9cc514e5 100644 --- a/src/table/namegen.h +++ b/src/table/namegen.h @@ -1931,7 +1931,7 @@ static const char *name_czech_suffix[] = { -static const char *name_romanian_real[]= { +static const char *name_romanian_real[] = { "Adjud", "Alba Iulia", "Alexandria", diff --git a/src/table/station_land.h b/src/table/station_land.h index 1bf72f21a..8b703973b 100644 --- a/src/table/station_land.h +++ b/src/table/station_land.h @@ -34,7 +34,7 @@ static const DrawTileSeqStruct _station_display_datas_4[] = { { 0, 0, 0, 16, 5, 7, SPR_RAIL_PLATFORM_PILLARS_X_REAR | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, { 0, 11, 0, 16, 5, 2, SPR_RAIL_PLATFORM_X_FRONT | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, { 0, 0, 16, 16, 16, 10, SPR_RAIL_ROOF_STRUCTURE_X_TILE_A | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, - { 0, 0,(byte)0x80, 0, 0, 0, SPR_RAIL_ROOF_GLASS_X_TILE_A | (1 << PALETTE_MODIFIER_TRANSPARENT), PALETTE_TO_TRANSPARENT }, + { 0, 0, (byte)0x80, 0, 0, 0, SPR_RAIL_ROOF_GLASS_X_TILE_A | (1 << PALETTE_MODIFIER_TRANSPARENT), PALETTE_TO_TRANSPARENT }, TILE_SEQ_END() }; @@ -42,7 +42,7 @@ static const DrawTileSeqStruct _station_display_datas_5[] = { { 0, 0, 0, 5, 16, 2, SPR_RAIL_PLATFORM_PILLARS_Y_REAR | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, { 11, 0, 0, 5, 16, 2, SPR_RAIL_PLATFORM_Y_FRONT | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, { 0, 0, 16, 16, 16, 10, SPR_RAIL_ROOF_STRUCTURE_Y_TILE_A | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, - { 0, 0,(byte)0x80, 0, 0, 0, SPR_RAIL_ROOF_GLASS_Y_TILE_A | (1 << PALETTE_MODIFIER_TRANSPARENT), PALETTE_TO_TRANSPARENT }, + { 0, 0, (byte)0x80, 0, 0, 0, SPR_RAIL_ROOF_GLASS_Y_TILE_A | (1 << PALETTE_MODIFIER_TRANSPARENT), PALETTE_TO_TRANSPARENT }, TILE_SEQ_END() }; @@ -50,7 +50,7 @@ static const DrawTileSeqStruct _station_display_datas_6[] = { { 0, 0, 0, 16, 5, 2, SPR_RAIL_PLATFORM_X_REAR | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, { 0, 11, 0, 16, 5, 2, SPR_RAIL_PLATFORM_PILLARS_X_FRONT | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, { 0, 0, 16, 16, 16, 10, SPR_RAIL_ROOF_STRUCTURE_X_TILE_B | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, - { 0, 0,(byte)0x80, 0, 0, 0, SPR_RAIL_ROOF_GLASS_X_TILE_B | (1 << PALETTE_MODIFIER_TRANSPARENT), PALETTE_TO_TRANSPARENT }, + { 0, 0, (byte)0x80, 0, 0, 0, SPR_RAIL_ROOF_GLASS_X_TILE_B | (1 << PALETTE_MODIFIER_TRANSPARENT), PALETTE_TO_TRANSPARENT }, TILE_SEQ_END() }; @@ -58,7 +58,7 @@ static const DrawTileSeqStruct _station_display_datas_7[] = { { 0, 0, 0, 5, 16, 2, SPR_RAIL_PLATFORM_Y_REAR | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, { 11, 0, 0, 5, 16, 2, SPR_RAIL_PLATFORM_PILLARS_Y_FRONT | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, { 0, 0, 16, 16, 16, 10, SPR_RAIL_ROOF_STRUCTURE_Y_TILE_B | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE }, - { 0, 0,(byte)0x80, 0, 0, 0, SPR_RAIL_ROOF_GLASS_Y_TILE_B | (1 << PALETTE_MODIFIER_TRANSPARENT), PALETTE_TO_TRANSPARENT }, + { 0, 0, (byte)0x80, 0, 0, 0, SPR_RAIL_ROOF_GLASS_Y_TILE_B | (1 << PALETTE_MODIFIER_TRANSPARENT), PALETTE_TO_TRANSPARENT }, TILE_SEQ_END() }; diff --git a/src/table/tree_land.h b/src/table/tree_land.h index 2d039de14..feb2a260f 100644 --- a/src/table/tree_land.h +++ b/src/table/tree_land.h @@ -25,7 +25,7 @@ static const TreePos _tree_layout_xy[][4] = { { { 3, 9 }, { 8, 2 }, { 9, 9 }, { 1, 5 } } }; -static const PalSpriteID _tree_layout_sprite[164+(79-48+1)][4] = { +static const PalSpriteID _tree_layout_sprite[164 + (79 - 48 + 1)][4] = { { { 0x652, PAL_NONE }, { 0x659, PAL_NONE }, { 0x660, PAL_NONE }, { 0x667, PAL_NONE } }, /* 0 */ { { 0x652, PAL_NONE }, { 0x667, PAL_NONE }, { 0x66e, PAL_NONE }, { 0x675, PAL_NONE } }, /* 1 */ { { 0x652, PAL_NONE }, { 0x66e, PAL_NONE }, { 0x659, PAL_NONE }, { 0x675, PAL_NONE } }, /* 2 */ diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 97bd70378..3cf5bd393 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -273,7 +273,7 @@ static const Widget _terraform_widgets[] = { }; static const WindowDesc _terraform_desc = { - WDP_ALIGN_TBR, 22+36, 158, 36, + WDP_ALIGN_TBR, 22 + 36, 158, 36, WC_SCEN_LAND_GEN, WC_NONE, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, _terraform_widgets, diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 05a6640c7..89b5bd1e2 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -246,9 +246,9 @@ static bool IsCloseToTown(TileIndex tile, uint dist) static void MarkTownSignDirty(Town *t) { MarkAllViewportsDirty( - t->sign.left-6, - t->sign.top-3, - t->sign.left+t->sign.width_1*4+12, + t->sign.left - 6, + t->sign.top - 3, + t->sign.left + t->sign.width_1 * 4 + 12, t->sign.top + 45 ); } @@ -530,10 +530,10 @@ static bool IsRoadAllowedHere(TileIndex tile, int dir) no_slope: /* Tile has no slope * Disallow the road if any neighboring tile has a road. */ - if (HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir+1]))), dir^2) || - HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir+3]))), dir^2) || - HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir+1]) + ToTileIndexDiff(_roadblock_tileadd[dir+2]))), dir) || - HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir+3]) + ToTileIndexDiff(_roadblock_tileadd[dir+2]))), dir)) + if (HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir + 1]))), dir ^ 2) || + HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir + 3]))), dir ^ 2) || + HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir + 1]) + ToTileIndexDiff(_roadblock_tileadd[dir + 2]))), dir) || + HASBIT(GetTownRoadMask(TILE_ADD(tile, ToTileIndexDiff(_roadblock_tileadd[dir + 3]) + ToTileIndexDiff(_roadblock_tileadd[dir + 2]))), dir)) return false; /* Otherwise allow */ @@ -644,7 +644,7 @@ static void GrowTownInTile(TileIndex* tile_ptr, RoadBits mask, int block, Town* } rcmd = (RoadBits)((1 << a) + (1 << b)); - } else if (block < 5 && !HASBIT(mask,block^2)) { + } else if (block < 5 && !HASBIT(mask, block ^ 2)) { /* Continue building on a partial road. * Always OK. */ _grow_town_result = 0; @@ -771,7 +771,7 @@ static int GrowTownAtRoad(Town *t, TileIndex tile) /* Select a random bit from the blockmask, walk a step * and continue the search from there. */ - do block = Random() & 3; while (!HASBIT(mask,block)); + do block = Random() & 3; while (!HASBIT(mask, block)); tile += ToTileIndexDiff(_roadblock_tileadd[block]); if (IsTileType(tile, MP_STREET)) { diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 81f0b513d..8a74ae262 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2988,7 +2988,7 @@ static void TrainController(Vehicle *v, bool update_image) } else if (HasSignalOnTrackdir(gp.new_tile, i)) { v->cur_speed = 0; v->subspeed = 0; - v->progress = 255-10; + v->progress = 255 - 10; if (++v->load_unload_time_rem < _patches.wait_twoway_signal * 73) { TileIndex o_tile = gp.new_tile + TileOffsByDiagDir(enterdir); VehicleAtSignalData vasd; diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index 74d3e5d02..a544e560f 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -317,7 +317,7 @@ int32 CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) struct TreeListEnt { SpriteID image; SpriteID pal; - byte x,y; + byte x, y; }; static void DrawTile_Trees(TileInfo *ti) diff --git a/src/variables.h b/src/variables.h index 6747c9816..b33dd646b 100644 --- a/src/variables.h +++ b/src/variables.h @@ -390,8 +390,8 @@ void SetDParamStr(uint n, const char *str); StringID BindCString(const char *str); -#define COPY_IN_DPARAM(offs,src,num) memcpy(_decode_parameters + offs, src, sizeof(uint32) * (num)) -#define COPY_OUT_DPARAM(dst,offs,num) memcpy(dst,_decode_parameters + offs, sizeof(uint32) * (num)) +#define COPY_IN_DPARAM(offs, src, num) memcpy(_decode_parameters + offs, src, sizeof(uint32) * (num)) +#define COPY_OUT_DPARAM(dst, offs, num) memcpy(dst, _decode_parameters + offs, sizeof(uint32) * (num)) #define SET_EXPENSES_TYPE(x) _yearly_expenses_type = x; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index b902014fa..9ce8053e4 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -188,9 +188,9 @@ Vehicle *FindVehicleBetween(TileIndex from, TileIndex to, byte z, bool without_c } FOR_ALL_VEHICLES(veh) { if (without_crashed && (veh->vehstatus & VS_CRASHED) != 0) continue; - if ((veh->type == VEH_TRAIN || veh->type == VEH_ROAD) && (z==0xFF || veh->z_pos == z)) { - if ((veh->x_pos>>4) >= x1 && (veh->x_pos>>4) <= x2 && - (veh->y_pos>>4) >= y1 && (veh->y_pos>>4) <= y2) { + if ((veh->type == VEH_TRAIN || veh->type == VEH_ROAD) && (z == 0xFF || veh->z_pos == z)) { + if ((veh->x_pos >> 4) >= x1 && (veh->x_pos >> 4) <= x2 && + (veh->y_pos >> 4) >= y1 && (veh->y_pos >> 4) <= y2) { return veh; } } @@ -421,7 +421,7 @@ static void UpdateVehiclePosHash(Vehicle* v, int x, int y) int old_x = v->left_coord; int old_y = v->top_coord; - new_hash = (x == INVALID_COORD) ? NULL : &_vehicle_position_hash[GEN_HASH(x,y)]; + new_hash = (x == INVALID_COORD) ? NULL : &_vehicle_position_hash[GEN_HASH(x, y)]; old_hash = (old_x == INVALID_COORD) ? NULL : &_vehicle_position_hash[GEN_HASH(old_x, old_y)]; if (old_hash == new_hash) return; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 03598d927..752b5d011 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -343,16 +343,16 @@ static void VehicleRefitWndProc(Window *w, WindowEvent *e) SetDParam(1, v->unitnumber); DrawWindowWidgets(w); - WP(w,refit_d).cargo = DrawVehicleRefitWindow(WP(w, refit_d).list, WP(w, refit_d).sel, w->vscroll.pos, w->vscroll.cap, w->resize.step_height); + WP(w, refit_d).cargo = DrawVehicleRefitWindow(WP(w, refit_d).list, WP(w, refit_d).sel, w->vscroll.pos, w->vscroll.cap, w->resize.step_height); - if (WP(w,refit_d).cargo != NULL) { + if (WP(w, refit_d).cargo != NULL) { int32 cost; - cost = DoCommand(v->tile, v->index, WP(w,refit_d).cargo->cargo | WP(w,refit_d).cargo->subtype << 8, + cost = DoCommand(v->tile, v->index, WP(w, refit_d).cargo->cargo | WP(w, refit_d).cargo->subtype << 8, DC_QUERY_COST, GetCmdRefitVeh(GetVehicle(w->window_number)->type)); if (!CmdFailed(cost)) { - SetDParam(0, WP(w,refit_d).cargo->cargo); + SetDParam(0, WP(w, refit_d).cargo->cargo); SetDParam(1, _returned_refit_capacity); SetDParam(2, cost); DrawString(2, w->widget[5].top + 1, STR_9840_NEW_CAPACITY_COST_OF_REFIT, 0); @@ -365,12 +365,12 @@ static void VehicleRefitWndProc(Window *w, WindowEvent *e) case 3: { // listbox int y = e->we.click.pt.y - w->widget[3].top; if (y >= 0) { - WP(w,refit_d).sel = (y / (int)w->resize.step_height) + w->vscroll.pos; + WP(w, refit_d).sel = (y / (int)w->resize.step_height) + w->vscroll.pos; SetWindowDirty(w); } } break; case 6: // refit button - if (WP(w,refit_d).cargo != NULL) { + if (WP(w, refit_d).cargo != NULL) { const Vehicle *v = GetVehicle(w->window_number); if (WP(w, refit_d).order == INVALID_VEH_ORDER_ID) { @@ -382,9 +382,9 @@ static void VehicleRefitWndProc(Window *w, WindowEvent *e) case VEH_SHIP: command = CMD_REFIT_SHIP | CMD_MSG(STR_9841_CAN_T_REFIT_SHIP); break; case VEH_AIRCRAFT: command = CMD_REFIT_AIRCRAFT | CMD_MSG(STR_A042_CAN_T_REFIT_AIRCRAFT); break; } - if (DoCommandP(v->tile, v->index, WP(w,refit_d).cargo->cargo | WP(w,refit_d).cargo->subtype << 8, NULL, command)) DeleteWindow(w); + if (DoCommandP(v->tile, v->index, WP(w, refit_d).cargo->cargo | WP(w, refit_d).cargo->subtype << 8, NULL, command)) DeleteWindow(w); } else { - if (DoCommandP(v->tile, v->index, WP(w,refit_d).cargo->cargo | WP(w,refit_d).cargo->subtype << 8 | WP(w, refit_d).order << 16, NULL, CMD_ORDER_REFIT)) DeleteWindow(w); + if (DoCommandP(v->tile, v->index, WP(w, refit_d).cargo->cargo | WP(w, refit_d).cargo->subtype << 8 | WP(w, refit_d).order << 16, NULL, CMD_ORDER_REFIT)) DeleteWindow(w); } } break; @@ -418,7 +418,7 @@ static const Widget _vehicle_refit_widgets[] = { static const WindowDesc _vehicle_refit_desc = { WDP_AUTO, WDP_AUTO, 240, 174, - WC_VEHICLE_REFIT,WC_VEHICLE_VIEW, + WC_VEHICLE_REFIT, WC_VEHICLE_VIEW, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE, _vehicle_refit_widgets, VehicleRefitWndProc, @@ -426,7 +426,7 @@ static const WindowDesc _vehicle_refit_desc = { /** Show the refit window for a vehicle * @param *v The vehicle to show the refit window for -* @param order of the vehicle (?) +* @param order of the vehicle ( ? ) */ void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order) { diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 216b9a14b..3f5df2147 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -45,7 +45,7 @@ static void MakePalette() LOGPALETTE *pal; uint i; - pal = (LOGPALETTE*)alloca(sizeof(LOGPALETTE) + (256-1) * sizeof(PALETTEENTRY)); + pal = (LOGPALETTE*)alloca(sizeof(LOGPALETTE) + (256 - 1) * sizeof(PALETTEENTRY)); pal->palVersion = 0x300; pal->palNumEntries = 256; @@ -653,8 +653,8 @@ static bool AllocateDibSection(int w, int h) _wnd.alloced_bits = NULL; } - bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*256); - memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*256); + bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256); + memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256); bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); if (_wnd.double_size) { diff --git a/src/viewport.cpp b/src/viewport.cpp index f536d09e8..52d189e7d 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2050,7 +2050,7 @@ static bool SwapDirection(HighLightStyle style, TileIndex start_tile, TileIndex * To correctly get the height difference we need the direction we are dragging * in, as well as with what kind of tool we are dragging. For example a horizontal * autorail tool that starts in bottom and ends at the top of a tile will need the -* maximum of SW,S and SE,N corners respectively. This is handled by the lookup table below +* maximum of SW, S and SE, N corners respectively. This is handled by the lookup table below * See _tileoffs_by_dir in map.c for the direction enums if you can't figure out * the values yourself. * @param style HightlightStyle of drag. This includes direction and style (autorail, rect, etc.) @@ -2395,7 +2395,7 @@ bool VpHandlePlaceSizingDrag() e.we.place.userdata = _thd.userdata; /* stop drag mode if the window has been closed */ - w = FindWindowById(_thd.window_class,_thd.window_number); + w = FindWindowById(_thd.window_class, _thd.window_number); if (w == NULL) { ResetObjectToPlace(); return false; diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 85f15b109..67dcb6f50 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -651,7 +651,7 @@ static void FloodVehicle(Vehicle *v) SetDParam(0, pass); AddNewsItem(STR_B006_FLOOD_VEHICLE_DESTROYED, - NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_VEHICLE, NT_ACCIDENT, 0), + NEWS_FLAGS(NM_THIN, NF_VIEWPORT | NF_VEHICLE, NT_ACCIDENT, 0), v->index, 0); CreateEffectVehicleRel(v, 4, 4, 8, EV_EXPLOSION_LARGE); diff --git a/src/win32.cpp b/src/win32.cpp index 7de27bfab..a1829fd03 100644 --- a/src/win32.cpp +++ b/src/win32.cpp @@ -335,7 +335,7 @@ static const TCHAR * const _expand_texts[] = {_T("S&how report >>"), _T("&Hide r static void SetWndSize(HWND wnd, int mode) { - RECT r,r2; + RECT r, r2; int offs; GetWindowRect(wnd, &r); @@ -368,7 +368,7 @@ static bool DoEmergencySave(HWND wnd) return b; } -static INT_PTR CALLBACK CrashDialogFunc(HWND wnd,UINT msg,WPARAM wParam,LPARAM lParam) +static INT_PTR CALLBACK CrashDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_INITDIALOG: { @@ -549,7 +549,7 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep) } { - int i,j; + int i, j; #ifdef _M_AMD64 uint32 *b = (uint32*)ep->ContextRecord->Rsp; #else @@ -557,7 +557,7 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep) #endif for (j = 0; j != 24; j++) { for (i = 0; i != 8; i++) { - if (IsBadReadPtr(b,sizeof(uint32))) { + if (IsBadReadPtr(b, sizeof(uint32))) { output += sprintf(output, " ????????"); //OCR: WAS - , 0); } else { output += sprintf(output, " %.8X", *b); diff --git a/src/window.cpp b/src/window.cpp index 7eaf55d45..bfd600c46 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -235,25 +235,25 @@ static void DrawOverlappedWindow(Window* const *wz, int left, int top, int right bottom > v->top && left < v->left + v->width && top < v->top + v->height) { - if (left < (x=v->left)) { + if (left < (x = v->left)) { DrawOverlappedWindow(wz, left, top, x, bottom); DrawOverlappedWindow(wz, x, top, right, bottom); return; } - if (right > (x=v->left + v->width)) { + if (right > (x = v->left + v->width)) { DrawOverlappedWindow(wz, left, top, x, bottom); DrawOverlappedWindow(wz, x, top, right, bottom); return; } - if (top < (x=v->top)) { + if (top < (x = v->top)) { DrawOverlappedWindow(wz, left, top, right, x); DrawOverlappedWindow(wz, left, x, right, bottom); return; } - if (bottom > (x=v->top + v->height)) { + if (bottom > (x = v->top + v->height)) { DrawOverlappedWindow(wz, left, top, right, x); DrawOverlappedWindow(wz, left, x, right, bottom); return; -- cgit v1.2.3-70-g09d2