mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-02 12:49:13 +01:00
fix(track): the carving scan's near() clashed with the near macro of windows.h on MSVC
This commit is contained in:
@@ -411,7 +411,7 @@ public:
|
|||||||
// the stations near the other rail: where the middle of the head of ours lies across its gauge line within what Across gives where along it,
|
// the stations near the other rail: where the middle of the head of ours lies across its gauge line within what Across gives where along it,
|
||||||
// along it within Along
|
// along it within Along
|
||||||
template <typename Reach>
|
template <typename Reach>
|
||||||
std::vector<std::pair<long, long>> near( carve_rail const &Other, Reach const &Across, glm::dvec2 const &Along, double const Spread ) const {
|
std::vector<std::pair<long, long>> stations_near( carve_rail const &Other, Reach const &Across, glm::dvec2 const &Along, double const Spread ) const {
|
||||||
std::vector<std::pair<long, long>> result;
|
std::vector<std::pair<long, long>> result;
|
||||||
if( empty() ) {
|
if( empty() ) {
|
||||||
return result;
|
return result;
|
||||||
@@ -637,7 +637,7 @@ void trim( carve_rail &Rail, carve_part &Part ) {
|
|||||||
if( false == flangeway_counts( Rail, Part, theirs ) ) {
|
if( false == flangeway_counts( Rail, Part, theirs ) ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto const windows { scan.near( theirs, [&]( double ) { return glm::dvec2 { -flangeway - 0.5 * size.head, 0.5 * size.head }; }, { -nearby, theirs.length + nearby }, flangeway + size.head + nearby ) };
|
auto const windows { scan.stations_near( theirs, [&]( double ) { return glm::dvec2 { -flangeway - 0.5 * size.head, 0.5 * size.head }; }, { -nearby, theirs.length + nearby }, flangeway + size.head + nearby ) };
|
||||||
for( auto const &[ a, b ] : windows ) {
|
for( auto const &[ a, b ] : windows ) {
|
||||||
if( debugging( Rail ) ) {
|
if( debugging( Rail ) ) {
|
||||||
WriteLog( "CARVE F " + rail_name( Rail ) + " part " + std::to_string( Part.from ) + "-" + std::to_string( Part.to ) + " vs " + rail_name( theirs ) + " window " + std::to_string( part_scan::position( a ) ) + "-" + std::to_string( part_scan::position( b ) ) );
|
WriteLog( "CARVE F " + rail_name( Rail ) + " part " + std::to_string( Part.from ) + "-" + std::to_string( Part.to ) + " vs " + rail_name( theirs ) + " window " + std::to_string( part_scan::position( a ) ) + "-" + std::to_string( part_scan::position( b ) ) );
|
||||||
@@ -804,7 +804,7 @@ carved_lines carve( carve_rail &Rail, carve_part &Part ) {
|
|||||||
offsets = { 0.0, 0.0 };
|
offsets = { 0.0, 0.0 };
|
||||||
}
|
}
|
||||||
return glm::dvec2 { offsets.x + theirsize.low - 0.1, offsets.y + theirsize.high + 0.1 }; };
|
return glm::dvec2 { offsets.x + theirsize.low - 0.1, offsets.y + theirsize.high + 0.1 }; };
|
||||||
auto const windows { scan.near( theirs, spread, { -nearby, theirs.length + nearby }, reach ) };
|
auto const windows { scan.stations_near( theirs, spread, { -nearby, theirs.length + nearby }, reach ) };
|
||||||
for( auto const &[ a, b ] : windows ) {
|
for( auto const &[ a, b ] : windows ) {
|
||||||
if( debugging( Rail ) ) {
|
if( debugging( Rail ) ) {
|
||||||
WriteLog( "CARVE O " + rail_name( Rail ) + " part " + std::to_string( Part.from ) + "-" + std::to_string( Part.to ) + " vs " + rail_name( theirs ) + " window " + std::to_string( part_scan::position( a ) ) + "-" + std::to_string( part_scan::position( b ) ) );
|
WriteLog( "CARVE O " + rail_name( Rail ) + " part " + std::to_string( Part.from ) + "-" + std::to_string( Part.to ) + " vs " + rail_name( theirs ) + " window " + std::to_string( part_scan::position( a ) ) + "-" + std::to_string( part_scan::position( b ) ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user