From 0b32a11504344ab2038027a4de9cd775d7f80def Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 30 Jan 2010 10:08:30 +0000 Subject: [PATCH] Bug 100: Flip slopes properly. Resolves #100. Thanks to Matt McCutchen for this patch. SVN-Revision: 6286 --- src/math/aatriangle.hpp | 2 ++ src/supertux/sector.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/math/aatriangle.hpp b/src/math/aatriangle.hpp index e37fa8afc..6eea71f14 100644 --- a/src/math/aatriangle.hpp +++ b/src/math/aatriangle.hpp @@ -49,6 +49,8 @@ public: DEFORM_MASK = 0x0070 }; + static int vertical_flip(int dir); + public: AATriangle() : p1(), diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index 2cbbeb919..e0ebde1a6 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -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 -- 2.11.0