Merge branch 'feature/sdl2'
[supertux.git] / src / object / anchor_point.cpp
index ad7db40..2499c9e 100644 (file)
@@ -21,7 +21,7 @@
 #include <stdexcept>
 #include <sstream>
 
-#include "math/rect.hpp"
+#include "math/rectf.hpp"
 #include "util/log.hpp"
 
 std::string anchor_point_to_string(AnchorPoint point)
@@ -76,7 +76,7 @@ AnchorPoint string_to_anchor_point(const std::string& str)
   throw std::runtime_error(msg.str());
 }
 
-Vector get_anchor_pos(const Rect& rect, AnchorPoint point)
+Vector get_anchor_pos(const Rectf& rect, AnchorPoint point)
 {
   Vector result;
 
@@ -91,9 +91,6 @@ Vector get_anchor_pos(const Rect& rect, AnchorPoint point)
       result.x = rect.get_right();
       break;
     default:
-#ifndef NDEBUG
-      throw std::runtime_error("Invalid anchor point found");
-#endif
       log_warning << "Invalid anchor point found" << std::endl;
       result.x = rect.get_left();
       break;
@@ -110,9 +107,6 @@ Vector get_anchor_pos(const Rect& rect, AnchorPoint point)
       result.y = rect.get_bottom();
       break;
     default:
-#ifndef NDEBUG
-      throw std::runtime_error("Invalid anchor point found");
-#endif
       log_warning << "Invalid anchor point found" << std::endl;
       result.y = rect.get_top();
       break;
@@ -121,7 +115,7 @@ Vector get_anchor_pos(const Rect& rect, AnchorPoint point)
   return result;
 }
 
-Vector get_anchor_pos(const Rect& destrect, float width, float height,
+Vector get_anchor_pos(const Rectf& destrect, float width, float height,
                       AnchorPoint point)
 {
   Vector result;
@@ -137,9 +131,6 @@ Vector get_anchor_pos(const Rect& destrect, float width, float height,
       result.x = destrect.get_right() - width;
       break;
     default:
-#ifndef NDEBUG
-      throw std::runtime_error("Invalid anchor point found");
-#endif
       log_warning << "Invalid anchor point found" << std::endl;
       result.x = destrect.get_left();
       break;
@@ -156,9 +147,6 @@ Vector get_anchor_pos(const Rect& destrect, float width, float height,
       result.y = destrect.get_bottom() - height;
       break;
     default:
-#ifndef NDEBUG
-      throw std::runtime_error("Invalid anchor point found");
-#endif
       log_warning << "Invalid anchor point found" << std::endl;
       result.y = destrect.get_top();
       break;