From 05af20afc4881f827704c3bcb6399db133be327b Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 28 Mar 2010 12:47:07 +0100 Subject: [PATCH] Fix rendering of crossover track --- src/CrossoverTrack.cpp | 7 ++++++- src/StraightTrack.cpp | 9 +++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/CrossoverTrack.cpp b/src/CrossoverTrack.cpp index f60cb98..e8459e4 100644 --- a/src/CrossoverTrack.cpp +++ b/src/CrossoverTrack.cpp @@ -18,6 +18,7 @@ #include "ITrackSegment.hpp" #include "TrackCommon.hpp" #include "XMLBuilder.hpp" +#include "ILogger.hpp" #include #include @@ -72,8 +73,10 @@ void CrossoverTrack::render() const static_cast(myX), height, static_cast(myY)); - + // Render the y-going rails and sleepers + glPushMatrix(); + renderStraightRail(); glRotated(90.0, 0.0, 1.0, 0.0); @@ -102,6 +105,8 @@ void CrossoverTrack::render() const } glPopMatrix(); + + glPopMatrix(); } void CrossoverTrack::setOrigin(int x, int y, float h ) diff --git a/src/StraightTrack.cpp b/src/StraightTrack.cpp index e410c5b..d7b67d7 100644 --- a/src/StraightTrack.cpp +++ b/src/StraightTrack.cpp @@ -129,16 +129,13 @@ void StraightTrack::transform(const track::TravelToken& aToken, ITrackSegmentPtr StraightTrack::mergeExit(Point where, track::Direction dir) { -#if 0 +#if 1 debug() << "mergeExit where=" << where << " dir=" << dir - << " me=" << origin; + << " me=" << origin + << " mydir=" << direction; #endif - // See if this is already a valid exit - if (isValidDirection(dir) && where == origin) - return shared_from_this(); - // See if we can make this a crossover track if (direction != dir && where == origin) return makeCrossoverTrack(); -- 2.39.2