From: grumbel Date: Tue, 17 Nov 2009 21:43:06 +0000 (+0000) Subject: Finished -Weffc++ cleanup X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2d10cee0e6e7a8af1ae4aace0b0c56f9b4bf9164;p=supertux.git Finished -Weffc++ cleanup git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6015 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- diff --git a/src/math/aatriangle.hpp b/src/math/aatriangle.hpp index c9defc8db..e37fa8afc 100644 --- a/src/math/aatriangle.hpp +++ b/src/math/aatriangle.hpp @@ -17,13 +17,13 @@ #ifndef HEADER_SUPERTUX_MATH_AATRIANGLE_HPP #define HEADER_SUPERTUX_MATH_AATRIANGLE_HPP -#include "math/rect.hpp" +#include "math/vector.hpp" /** * An axis-aligned triangle (ie. a triangle where 2 sides are parallel to the x- * and y-axis. */ -class AATriangle : public Rect // FIXME: yuck +class AATriangle { public: /** Directions: @@ -49,15 +49,33 @@ public: DEFORM_MASK = 0x0070 }; - AATriangle() - : dir(SOUTHWEST) +public: + AATriangle() : + p1(), + p2(), + dir(SOUTHWEST) + { + } + AATriangle(const Vector& v1, const Vector& v2, int newdir) : + p1(v1), + p2(v2), + dir(newdir) { } - AATriangle(const Vector& v1, const Vector& v2, int newdir) - : Rect(v1, v2), dir(newdir) + + float get_width() const { + return p2.x - p1.x; } + float get_height() const + { + return p2.y - p1.y; + } + +public: + Vector p1; + Vector p2; int dir; }; diff --git a/src/object/particlesystem.hpp b/src/object/particlesystem.hpp index 735552c21..38eac9526 100644 --- a/src/object/particlesystem.hpp +++ b/src/object/particlesystem.hpp @@ -64,6 +64,10 @@ protected: Vector pos; Surface* texture; + + private: + Particle(const Particle&); + Particle& operator=(const Particle&); }; float max_particle_size; diff --git a/src/object/particlesystem_interactive.hpp b/src/object/particlesystem_interactive.hpp index 991fff74d..296b3ff59 100644 --- a/src/object/particlesystem_interactive.hpp +++ b/src/object/particlesystem_interactive.hpp @@ -57,6 +57,10 @@ protected: Vector pos; Surface* texture; + + private: + Particle(const Particle&); + Particle& operator=(const Particle&); }; int collision(Particle* particle, Vector movement); diff --git a/src/supertux/collision.cpp b/src/supertux/collision.cpp index 716808d02..2718a0673 100644 --- a/src/supertux/collision.cpp +++ b/src/supertux/collision.cpp @@ -19,6 +19,7 @@ #include #include "math/aatriangle.hpp" +#include "math/rect.hpp" namespace collision {