- more memory cleanup

This commit is contained in:
Mark Vejvoda
2010-09-07 21:01:22 +00:00
parent 63cf199322
commit 958184e018
12 changed files with 118 additions and 31 deletions

View File

@@ -33,6 +33,7 @@ class Vec2{
public:
T x;
T y;
public:
Vec2(){
};
@@ -52,6 +53,11 @@ public:
this->x= v.x;
this->y= v.y;
}
template<typename S>
explicit Vec2(Vec2<S> &v){
this->x= v.x;
this->y= v.y;
}
Vec2(T x, T y){
this->x= x;
@@ -66,6 +72,12 @@ public:
return reinterpret_cast<const T*>(this);
}
Vec2<T> & operator=(const Vec2<T> &v) {
this->x= v.x;
this->y= v.y;
return *this;
}
bool operator ==(const Vec2<T> &v) const{
return x==v.x && y==v.y;
}
@@ -201,6 +213,13 @@ public:
this->z= v.z;
}
template<typename S>
explicit Vec3(Vec3<S> &v){
this->x= v.x;
this->y= v.y;
this->z= v.z;
}
Vec3(T x, T y, T z){
this->x= x;
this->y= y;
@@ -221,6 +240,13 @@ public:
return reinterpret_cast<const T*>(this);
}
Vec3<T> & operator=(const Vec3<T> &v) {
this->x= v.x;
this->y= v.y;
this->z= v.z;
return *this;
}
bool operator ==(const Vec3<T> &v) const{
return x==v.x && y==v.y && z==v.z;
}
@@ -387,6 +413,14 @@ public:
this->w= v.w;
}
template<typename S>
explicit Vec4(Vec4<S> &v){
this->x= v.x;
this->y= v.y;
this->z= v.z;
this->w= v.w;
}
Vec4(T x, T y, T z, T w){
this->x= x;
this->y= y;
@@ -416,6 +450,14 @@ public:
return reinterpret_cast<const T*>(this);
}
Vec4<T> & operator=(const Vec4<T> &v) {
this->x= v.x;
this->y= v.y;
this->z= v.z;
this->w= v.w;
return *this;
}
bool operator ==(const Vec4<T> &v) const{
return x==v.x && y==v.y && z==v.z && w==v.w;
}