Bug 100: Flip slopes properly.
authorflorianf <florianf@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Sat, 30 Jan 2010 10:08:30 +0000 (10:08 +0000)
committerflorianf <florianf@837edb03-e0f3-0310-88ca-d4d4e8b29345>
Sat, 30 Jan 2010 10:08:30 +0000 (10:08 +0000)
Resolves #100. Thanks to Matt McCutchen for this patch.

git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6286 837edb03-e0f3-0310-88ca-d4d4e8b29345

src/math/aatriangle.hpp
src/supertux/sector.cpp

index e37fa8a..6eea71f 100644 (file)
@@ -49,6 +49,8 @@ public:
     DEFORM_MASK = 0x0070
   };
 
+  static int vertical_flip(int dir);
+
 public:
   AATriangle() :
     p1(),
index 2cbbeb9..e0ebde1 100644 (file)
@@ -990,7 +990,10 @@ Sector::collision_tilemap(collision::Constraints* constraints,
           AATriangle triangle;
           Vector p1(x*32 + solids->get_x_offset(), y*32 + solids->get_y_offset());
           Vector p2((x+1)*32 + solids->get_x_offset(), (y+1)*32 + solids->get_y_offset());
-          triangle = AATriangle(p1, p2, tile->getData());
+          int slope_data = tile->getData();
+          if (solids->get_drawing_effect() == VERTICAL_FLIP)
+            slope_data = AATriangle::vertical_flip(slope_data);
+          triangle = AATriangle(p1, p2, slope_data);
 
           collision::rectangle_aatriangle(constraints, dest, triangle, solids->get_movement());
         } else { // normal rectangular tile