Browse Source

Fixed Geometry:flip

Alex Szpakowski 12 years ago
parent
commit
38b7e19914
2 changed files with 8 additions and 1 deletions
  1. 7 0
      src/modules/graphics/Geometry.cpp
  2. 1 1
      src/modules/graphics/opengl/Canvas.cpp

+ 7 - 0
src/modules/graphics/Geometry.cpp

@@ -133,6 +133,13 @@ void Geometry::setVertex(size_t i, const vertex &v)
 
 void Geometry::flip(bool x, bool y)
 {
+	for (size_t i = 0; i < polygon.size(); ++i)
+	{
+		vertex &v = polygon[i];
+		if (x) v.x = x_max + x_min - v.x;
+		if (y) v.y = y_max + y_min - v.y;
+	}
+
 	for (size_t i = 0; i < vertexCount; ++i)
 	{
 		vertex &v = vertexArray[i];

+ 1 - 1
src/modules/graphics/opengl/Canvas.cpp

@@ -65,7 +65,7 @@ struct FramebufferStrategy
 	/**
 	 * @param[in] canvases List of canvases to attach
 	 **/
-	virtual void setAttachments(const std::vector<Canvas *> &canvases) { (void)canvases; }
+	virtual void setAttachments(const std::vector<Canvas *> &) {}
 
 	/// stop using all additional attached canvases
 	virtual void setAttachments() {}