From: Florian Forster Date: Sat, 30 Jan 2010 10:08:30 +0000 (+0000) Subject: Bug 100: Flip slopes properly. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0b32a11504344ab2038027a4de9cd775d7f80def;p=supertux.git Bug 100: Flip slopes properly. Resolves #100. Thanks to Matt McCutchen for this patch. SVN-Revision: 6286 --- 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