projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3aa6936
)
Finished -Weffc++ cleanup
author
Ingo Ruhnke
<grumbel@gmx.de>
Tue, 17 Nov 2009 21:43:06 +0000
(21:43 +0000)
committer
Ingo Ruhnke
<grumbel@gmx.de>
Tue, 17 Nov 2009 21:43:06 +0000
(21:43 +0000)
SVN-Revision: 6015
src/math/aatriangle.hpp
patch
|
blob
|
history
src/object/particlesystem.hpp
patch
|
blob
|
history
src/object/particlesystem_interactive.hpp
patch
|
blob
|
history
src/supertux/collision.cpp
patch
|
blob
|
history
diff --git
a/src/math/aatriangle.hpp
b/src/math/aatriangle.hpp
index
c9defc8
..
e37fa8a
100644
(file)
--- 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
#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.
*/
/**
* 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:
{
public:
/** Directions:
@@
-49,15
+49,33
@@
public:
DEFORM_MASK = 0x0070
};
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;
};
int dir;
};
diff --git
a/src/object/particlesystem.hpp
b/src/object/particlesystem.hpp
index
735552c
..
38eac95
100644
(file)
--- a/
src/object/particlesystem.hpp
+++ b/
src/object/particlesystem.hpp
@@
-64,6
+64,10
@@
protected:
Vector pos;
Surface* texture;
Vector pos;
Surface* texture;
+
+ private:
+ Particle(const Particle&);
+ Particle& operator=(const Particle&);
};
float max_particle_size;
};
float max_particle_size;
diff --git
a/src/object/particlesystem_interactive.hpp
b/src/object/particlesystem_interactive.hpp
index
991fff7
..
296b3ff
100644
(file)
--- a/
src/object/particlesystem_interactive.hpp
+++ b/
src/object/particlesystem_interactive.hpp
@@
-57,6
+57,10
@@
protected:
Vector pos;
Surface* texture;
Vector pos;
Surface* texture;
+
+ private:
+ Particle(const Particle&);
+ Particle& operator=(const Particle&);
};
int collision(Particle* particle, Vector movement);
};
int collision(Particle* particle, Vector movement);
diff --git
a/src/supertux/collision.cpp
b/src/supertux/collision.cpp
index
716808d
..
2718a06
100644
(file)
--- a/
src/supertux/collision.cpp
+++ b/
src/supertux/collision.cpp
@@
-19,6
+19,7
@@
#include <algorithm>
#include "math/aatriangle.hpp"
#include <algorithm>
#include "math/aatriangle.hpp"
+#include "math/rect.hpp"
namespace collision {
namespace collision {