From aa958425f88c6a16b2b688eed421c69f120dd734 Mon Sep 17 00:00:00 2001
From: Nick Gasson <nick@nickg.me.uk>
Date: Thu, 11 Jun 2009 19:36:58 +0100
Subject: [PATCH] Points working without rotation

---
 maps/points.xml |  2 +-
 src/Points.cpp  | 25 +++++++++++++++++++++----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/maps/points.xml b/maps/points.xml
index eb4f373..8c316e5 100644
--- a/maps/points.xml
+++ b/maps/points.xml
@@ -2,7 +2,7 @@
 <map width="64" height="64">
 <name>No Name</name>
 
-<start x="21" y="14" dirX="-1" dirY="0"/>
+<start x="37" y="15" dirX="-1" dirY="0"/>
 
 <heightmap>maps/points.bin</heightmap>
 
diff --git a/src/Points.cpp b/src/Points.cpp
index 6f4e812..dd047e0 100644
--- a/src/Points.cpp
+++ b/src/Points.cpp
@@ -176,7 +176,7 @@ void Points::transform(const track::TravelToken& aToken, double aDelta) const
 
       float xTrans, yTrans;
       
-      if ((myAxis == -axis::X && aToken.direction == axis::X)) {
+      if (myAxis == -axis::X && aToken.direction == axis::X) {
          xTrans = aDelta - 2.0f;
 
          if (amReflected)
@@ -184,7 +184,7 @@ void Points::transform(const track::TravelToken& aToken, double aDelta) const
          else
             yTrans = -hypTanCurveFunc(3.0f - aDelta);
       }
-      else if ((myAxis == axis::X && aToken.direction == -axis::X)) {
+      else if (myAxis == axis::X && aToken.direction == -axis::X) {
          xTrans = 3.0f - aDelta;
          
          if (amReflected)
@@ -192,12 +192,29 @@ void Points::transform(const track::TravelToken& aToken, double aDelta) const
          else
             yTrans = hypTanCurveFunc(3.0f - aDelta);
       }
+      if (myAxis == -axis::Y && aToken.direction == axis::Y) {
+         if (amReflected)
+            xTrans = -hypTanCurveFunc(3.0f - aDelta);
+         else
+            xTrans = hypTanCurveFunc(3.0f - aDelta);
+         
+         yTrans = aDelta - 2.0f;
+      }
+      else if (myAxis == axis::Y && aToken.direction == -axis::Y) {
+         if (amReflected)
+            xTrans = hypTanCurveFunc(3.0f - aDelta);
+         else
+            xTrans = -hypTanCurveFunc(3.0f - aDelta);
+         
+         yTrans = 3.0f - aDelta;
+      }
       else
          assert(false);
 
-      
-
       glTranslatef(myX + xTrans, 0.0f, myY + yTrans);
+      
+      if (myAxis == axis::Y || myAxis == -axis::Y)
+         glRotated(-90.0, 0.0, 1.0, 0.0);
    }
    else
       assert(false);
-- 
2.39.5