Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/aircraft_cmd.cpp # src/blitter/32bpp_anim.cpp # src/cargopacket.cpp # src/cheat_gui.cpp # src/company_cmd.cpp # src/company_gui.cpp # src/core/pool_func.hpp # src/date.cpp # src/economy.cpp # src/error_gui.cpp # src/ground_vehicle.cpp # src/ground_vehicle.hpp # src/group_gui.cpp # src/industry_cmd.cpp # src/lang/dutch.txt # src/lang/french.txt # src/lang/german.txt # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/mcf.cpp # src/network/network_content.cpp # src/network/network_server.cpp # src/network/network_udp.cpp # src/newgrf_engine.cpp # src/newgrf_station.cpp # src/order_cmd.cpp # src/order_gui.cpp # src/pathfinder/follow_track.hpp # src/pathfinder/yapf/yapf_common.hpp # src/saveload/saveload.cpp # src/settings_gui.cpp # src/station_cmd.cpp # src/station_kdtree.h # src/string_func.h # src/table/settings.ini # src/tgp.cpp # src/timetable_cmd.cpp # src/timetable_gui.cpp # src/toolbar_gui.cpp # src/town_cmd.cpp # src/train_cmd.cpp # src/train_gui.cpp # src/tree_gui.cpp # src/tunnelbridge_cmd.cpp # src/vehicle.cpp # src/vehicle_gui.cpp # src/video/sdl2_v.cpp # src/video/sdl_v.cpp # src/video/win32_v.cpp # src/viewport.cpp # src/viewport_sprite_sorter_sse4.cpp # src/window.cpp
This commit is contained in:
@@ -493,7 +493,7 @@ public:
|
||||
/* Check for speed limit imposed by railtype */
|
||||
if (IsRailTT()) {
|
||||
uint16 rail_speed = GetRailTypeInfo(GetRailTypeByTrack(m_old_tile, TrackdirToTrack(m_old_td)))->max_speed;
|
||||
if (rail_speed > 0) max_speed = min(max_speed, rail_speed);
|
||||
if (rail_speed > 0) max_speed = std::min<int>(max_speed, rail_speed);
|
||||
}
|
||||
|
||||
/* if min speed was requested, return it */
|
||||
|
@@ -118,7 +118,7 @@ static uint NPFDistanceTrack(TileIndex t0, TileIndex t1)
|
||||
const uint dx = Delta(TileX(t0), TileX(t1));
|
||||
const uint dy = Delta(TileY(t0), TileY(t1));
|
||||
|
||||
const uint straightTracks = 2 * min(dx, dy); // The number of straight (not full length) tracks
|
||||
const uint straightTracks = 2 * std::min(dx, dy); // The number of straight (not full length) tracks
|
||||
/* OPTIMISATION:
|
||||
* Original: diagTracks = max(dx, dy) - min(dx,dy);
|
||||
* Proof:
|
||||
|
@@ -71,7 +71,7 @@ protected:
|
||||
int p2 = Yapf().PfGetSettings().rail_look_ahead_signal_p2;
|
||||
int *pen = m_sig_look_ahead_costs.GrowSizeNC(Yapf().PfGetSettings().rail_look_ahead_max_signals);
|
||||
for (int i = 0; i < (int) Yapf().PfGetSettings().rail_look_ahead_max_signals; i++) {
|
||||
pen[i] = max<int>(0, p0 + i * (p1 + i * p2));
|
||||
pen[i] = std::max<int>(0, p0 + i * (p1 + i * p2));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -204,7 +204,7 @@ public:
|
||||
int y2 = 2 * TileY(m_destTile);
|
||||
int dx = abs(x1 - x2);
|
||||
int dy = abs(y1 - y2);
|
||||
int dmin = min(dx, dy);
|
||||
int dmin = std::min(dx, dy);
|
||||
int dxy = abs(dx - dy);
|
||||
int d = dmin * YAPF_TILE_CORNER_LENGTH + (dxy - 1) * (YAPF_TILE_LENGTH / 2);
|
||||
n.m_estimate = n.m_cost + d;
|
||||
@@ -221,11 +221,11 @@ public:
|
||||
int y2 = 2 * TileY(m_destTile);
|
||||
int dx = abs(x1 - x2) + d_adjust;
|
||||
int dy = abs(y1 - y2);
|
||||
int dmin = min(dx, dy) + d_adjust; // up to 2x track exit dir tile offsets in opposite directions
|
||||
int dmin = std::min(dx, dy) + d_adjust; // up to 2x track exit dir tile offsets in opposite directions
|
||||
int dxy = abs(dx - dy) + d_adjust; // "
|
||||
return dmin * YAPF_TILE_CORNER_LENGTH + (dxy - 1) * (YAPF_TILE_LENGTH / 2);
|
||||
};
|
||||
return max<int>(0, calculate_distance_cost(prev_tile, 8) - calculate_distance_cost(cur_tile, 0));
|
||||
return std::max<int>(0, calculate_distance_cost(prev_tile, 8) - calculate_distance_cost(cur_tile, 0));
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -341,7 +341,7 @@ public:
|
||||
int y2 = 2 * TileY(m_destTile);
|
||||
int dx = abs(x1 - x2);
|
||||
int dy = abs(y1 - y2);
|
||||
int dmin = min(dx, dy);
|
||||
int dmin = std::min(dx, dy);
|
||||
int dxy = abs(dx - dy);
|
||||
int d = dmin * YAPF_TILE_CORNER_LENGTH + (dxy - 1) * (YAPF_TILE_LENGTH / 2);
|
||||
n.m_estimate = n.m_cost + d;
|
||||
|
@@ -89,7 +89,7 @@ public:
|
||||
int y2 = 2 * TileY(m_destTile);
|
||||
int dx = abs(x1 - x2);
|
||||
int dy = abs(y1 - y2);
|
||||
int dmin = min(dx, dy);
|
||||
int dmin = std::min(dx, dy);
|
||||
int dxy = abs(dx - dy);
|
||||
int d = dmin * YAPF_TILE_CORNER_LENGTH + (dxy - 1) * (YAPF_TILE_LENGTH / 2);
|
||||
n.m_estimate = n.m_cost + d;
|
||||
|
Reference in New Issue
Block a user