BoxSizer to Sizer
This commit is contained in:
@@ -16,7 +16,7 @@ Vector2::Vector2( const SDL_Rect& copy )
|
||||
y = float(copy.y);
|
||||
}
|
||||
|
||||
Vector2& Vector2::operator=( const SDL_Rect& copy )
|
||||
Vector2& Vector2::operator = ( const SDL_Rect& copy )
|
||||
{
|
||||
x = float(copy.x);
|
||||
y = float(copy.y);
|
||||
@@ -30,7 +30,7 @@ Vector2::Vector2( const iVector2& copy )
|
||||
y = float(copy.y);
|
||||
}
|
||||
|
||||
Vector2& Vector2::operator=( const iVector2& copy )
|
||||
Vector2& Vector2::operator = ( const iVector2& copy )
|
||||
{
|
||||
x = float(copy.x);
|
||||
y = float(copy.y);
|
||||
|
||||
@@ -16,11 +16,11 @@ namespace MathEngine {
|
||||
|
||||
Vector2( const SDL_Rect& copy );
|
||||
|
||||
Vector2& operator=( const SDL_Rect& copy );
|
||||
Vector2& operator = ( const SDL_Rect& copy );
|
||||
|
||||
Vector2( const iVector2& copy );
|
||||
|
||||
Vector2& operator=( const iVector2& copy );
|
||||
Vector2& operator = ( const iVector2& copy );
|
||||
|
||||
float x;
|
||||
float y;
|
||||
|
||||
@@ -17,7 +17,7 @@ Vector3::Vector3( const SDL_Rect& copy )
|
||||
z = float(copy.w);
|
||||
}
|
||||
|
||||
Vector3& Vector3::operator=( const SDL_Rect& copy )
|
||||
Vector3& Vector3::operator = ( const SDL_Rect& copy )
|
||||
{
|
||||
x = float(copy.x);
|
||||
y = float(copy.y);
|
||||
@@ -33,7 +33,7 @@ Vector3::Vector3( const iVector3& copy )
|
||||
z = float(copy.z);
|
||||
}
|
||||
|
||||
Vector3& Vector3::operator=( const iVector3& copy )
|
||||
Vector3& Vector3::operator = ( const iVector3& copy )
|
||||
{
|
||||
x = float(copy.x);
|
||||
y = float(copy.y);
|
||||
|
||||
@@ -19,11 +19,11 @@ namespace MathEngine {
|
||||
|
||||
Vector3( const SDL_Rect& copy );
|
||||
|
||||
Vector3& operator=( const SDL_Rect& copy );
|
||||
Vector3& operator = ( const SDL_Rect& copy );
|
||||
|
||||
Vector3( const iVector3& copy );
|
||||
|
||||
Vector3& operator=( const iVector3& copy );
|
||||
Vector3& operator = ( const iVector3& copy );
|
||||
|
||||
float z;
|
||||
};/// END STRUCT DEFINITION Vector3
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
using MathEngine::Vector4;
|
||||
using MathEngine::iVector4;
|
||||
|
||||
Vector4::Vector4( const float X /*= 0.0f*/, const float Y /*= 0.0f*/, const float Z /*= 0.0f*/, const float W /*= 0.0f*/)
|
||||
Vector4::Vector4( const float X /*= 0.0f*/, const float Y /*= 0.0f*/, const float Z /*= 0.0f*/, const float W /*= 0.0f*/ )
|
||||
: Vector3( X, Y, Z ), w(W)
|
||||
{}
|
||||
|
||||
@@ -17,7 +17,7 @@ Vector4::Vector4( const SDL_Rect& copy )
|
||||
w = float(copy.h);
|
||||
}
|
||||
|
||||
Vector4& Vector4::operator=( const SDL_Rect& copy )
|
||||
Vector4& Vector4::operator = ( const SDL_Rect& copy )
|
||||
{
|
||||
x = float(copy.x);
|
||||
y = float(copy.y);
|
||||
@@ -35,7 +35,7 @@ Vector4::Vector4( const iVector4& copy )
|
||||
w = float(copy.w);
|
||||
}
|
||||
|
||||
Vector4& Vector4::operator=( const iVector4& copy )
|
||||
Vector4& Vector4::operator = ( const iVector4& copy )
|
||||
{
|
||||
x = float(copy.x);
|
||||
y = float(copy.y);
|
||||
|
||||
@@ -19,15 +19,11 @@ namespace MathEngine {
|
||||
|
||||
Vector4( const SDL_Rect& copy );
|
||||
|
||||
Vector4& operator=( const SDL_Rect& copy );
|
||||
|
||||
bool operator==(const SDL_Rect& other) const;
|
||||
Vector4& operator = ( const SDL_Rect& copy );
|
||||
|
||||
Vector4( const iVector4& copy );
|
||||
|
||||
Vector4& operator=( const iVector4& copy );
|
||||
|
||||
bool operator==(const Vector4& other) const;
|
||||
Vector4& operator = ( const iVector4& copy );
|
||||
|
||||
float w;
|
||||
};/// END STRUCT DEFINITION Vector4
|
||||
|
||||
@@ -18,31 +18,31 @@ cCollision::~cCollision()
|
||||
/*static*/ const bool cCollision::BoundingBox( const SDL_Rect& a, const SDL_Rect& b )
|
||||
{
|
||||
if ((b.x + b.w) < a.x)
|
||||
return false; //just checking if their
|
||||
return false; /// just checking if their
|
||||
if ((a.x + a.w) < b.x )
|
||||
return false; //bounding boxes even touch
|
||||
return false; /// bounding boxes even touch
|
||||
|
||||
if ((b.y + b.h) < a.y)
|
||||
return false;
|
||||
if ((a.y + a.h) < b.y)
|
||||
return false;
|
||||
|
||||
return true; //bounding boxes intersect
|
||||
return true; /// bounding boxes intersect
|
||||
}
|
||||
|
||||
/*static*/ const bool cCollision::BoundingBox( const Vector4& a, const Vector4& b )
|
||||
{
|
||||
if ((b.x + b.z) < a.x)
|
||||
return false; //just checking if their
|
||||
return false; /// just checking if their
|
||||
if ((a.x + a.z) < b.x )
|
||||
return false; //bounding boxes even touch
|
||||
return false; /// bounding boxes even touch
|
||||
|
||||
if ((b.y + b.w) < a.y)
|
||||
return false;
|
||||
if ((a.y + a.w) < b.y)
|
||||
return false;
|
||||
|
||||
return true; //bounding boxes intersect
|
||||
return true; /// bounding boxes intersect
|
||||
}
|
||||
|
||||
/*static*/ const bool cCollision::BoundingBox( const SDL_Rect& a, const Vector4& b )
|
||||
@@ -60,16 +60,16 @@ cCollision::~cCollision()
|
||||
/*static*/ const bool cCollision::BoundingBox( const iVector4& a, const iVector4& b )
|
||||
{
|
||||
if ((b.x + b.z) < a.x)
|
||||
return false; //just checking if their
|
||||
return false; /// just checking if their
|
||||
if ((a.x + a.z) < b.x )
|
||||
return false; //bounding boxes even touch
|
||||
return false; /// bounding boxes even touch
|
||||
|
||||
if ((b.y + b.w) < a.y)
|
||||
return false;
|
||||
if ((a.y + a.w) < b.y)
|
||||
return false;
|
||||
|
||||
return true; //bounding boxes intersect
|
||||
return true; /// bounding boxes intersect
|
||||
}
|
||||
|
||||
/*static*/ const bool cCollision::BoundingBox( const SDL_Rect& a, const iVector4& b )
|
||||
@@ -102,16 +102,16 @@ cCollision::~cCollision()
|
||||
rtn.x = 0.0f;
|
||||
rtn.y = 0.0f;
|
||||
|
||||
//Check if left side of b is inside of a
|
||||
/// Check if left side of b is inside of a
|
||||
if (b.x < a.x)
|
||||
rtn.x = (float)(b.x - a.x);
|
||||
//Check if right side of b is inside of a
|
||||
/// Check if right side of b is inside of a
|
||||
if ((b.x + b.w) > (a.x + a.w))
|
||||
rtn.x = (float)((b.x + b.w) - (a.x + a.w));
|
||||
//Check if top side of b is inside of a
|
||||
/// Check if top side of b is inside of a
|
||||
if (b.y < a.y)
|
||||
rtn.y = (float)(b.y - a.y);
|
||||
//Check if botton side of b is inside of a
|
||||
/// Check if bottom side of b is inside of a
|
||||
if ((b.y + b.h) > (a.y + a.h))
|
||||
rtn.y = (float)((b.y + b.h) - (a.y + a.h));
|
||||
|
||||
@@ -124,16 +124,16 @@ cCollision::~cCollision()
|
||||
rtn.x = 0.0f;
|
||||
rtn.y = 0.0f;
|
||||
|
||||
//Check if left side of b is inside of a
|
||||
/// Check if left side of b is inside of a
|
||||
if (b.x < a.x)
|
||||
rtn.x = a.x - b.x;
|
||||
//Check if right side of b is inside of a
|
||||
/// Check if right side of b is inside of a
|
||||
if ((b.x + b.z) > (a.x + a.z))
|
||||
rtn.x = (a.x + a.z) - (b.x + b.z);
|
||||
//Check if top side of b is inside of a
|
||||
/// Check if top side of b is inside of a
|
||||
if (b.y < a.y)
|
||||
rtn.y = a.y - b.y;
|
||||
//Check if botton side of b is inside of a
|
||||
/// Check if bottom side of b is inside of a
|
||||
if ((b.y + b.w) > (a.y + a.w))
|
||||
rtn.y = (a.y + a.w) - (b.y + b.w);
|
||||
|
||||
@@ -160,16 +160,16 @@ cCollision::~cCollision()
|
||||
rtn.x = 0;
|
||||
rtn.y = 0;
|
||||
|
||||
//Check if left side of b is inside of a
|
||||
/// Check if left side of b is inside of a
|
||||
if (b.x < a.x)
|
||||
rtn.x = b.x - a.x;
|
||||
//Check if right side of b is inside of a
|
||||
/// Check if right side of b is inside of a
|
||||
if ((b.x + b.z) > (a.x + a.z))
|
||||
rtn.x = (b.x + b.z) - (a.x + a.z);
|
||||
//Check if top side of b is inside of a
|
||||
/// Check if top side of b is inside of a
|
||||
if (b.y < a.y)
|
||||
rtn.y = b.y - a.y;
|
||||
//Check if botton side of b is inside of a
|
||||
/// Check if bottom side of b is inside of a
|
||||
if ((b.y + b.w) > (a.y + a.w))
|
||||
rtn.y = (b.y + b.w) - (a.y + a.w);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ iVector2& iVector2::operator += ( const SDL_Rect& other )
|
||||
return *this;
|
||||
}
|
||||
|
||||
iVector2& iVector2::operator -= (const iVector2& other)
|
||||
iVector2& iVector2::operator -= ( const iVector2& other )
|
||||
{
|
||||
x -= int(other.x);
|
||||
y -= int(other.y);
|
||||
@@ -82,7 +82,7 @@ iVector2& iVector2::operator -= (const iVector2& other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
iVector2& iVector2::operator -= (const SDL_Rect& other)
|
||||
iVector2& iVector2::operator -= ( const SDL_Rect& other )
|
||||
{
|
||||
x -= int(other.x);
|
||||
y -= int(other.y);
|
||||
@@ -90,7 +90,7 @@ iVector2& iVector2::operator -= (const SDL_Rect& other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
iVector2 operator + (const iVector2& lhs, const iVector2& rhs)
|
||||
iVector2 operator + ( const iVector2& lhs, const iVector2& rhs )
|
||||
{
|
||||
iVector2 rs = lhs;
|
||||
rs += rhs;
|
||||
|
||||
@@ -25,15 +25,12 @@ namespace MathEngine {
|
||||
iVector2& operator += ( const iVector2& other );
|
||||
iVector2& operator += ( const SDL_Rect& other );
|
||||
|
||||
iVector2& operator -= (const iVector2& other);
|
||||
iVector2& operator -= (const SDL_Rect& other);
|
||||
|
||||
iVector2& operator + ( const iVector2& other );
|
||||
iVector2& operator + ( const SDL_Rect& other );
|
||||
iVector2& operator -= ( const iVector2& other );
|
||||
iVector2& operator -= ( const SDL_Rect& other );
|
||||
|
||||
int x;
|
||||
int y;
|
||||
};/// END STRUCT DEFINITION iVector2
|
||||
}/// END NAMESPACE DEFINITION MathEngine
|
||||
MathEngine::iVector2 operator + (const MathEngine::iVector2& lhs, const MathEngine::iVector2& rhs);
|
||||
MathEngine::iVector2 operator + ( const MathEngine::iVector2& lhs, const MathEngine::iVector2& rhs );
|
||||
#endif/// END IFNDEF _IVECTOR2_HPP_
|
||||
@@ -21,7 +21,7 @@ iVector3::iVector3( const SDL_Rect& copy )
|
||||
z = int(copy.w);
|
||||
}
|
||||
|
||||
iVector3& iVector3::operator=( const SDL_Rect& copy )
|
||||
iVector3& iVector3::operator = ( const SDL_Rect& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
@@ -30,7 +30,7 @@ iVector3& iVector3::operator=( const SDL_Rect& copy )
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool iVector3::operator==( const SDL_Rect& other ) const
|
||||
bool iVector3::operator == ( const SDL_Rect& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if ( x == other.x )
|
||||
@@ -47,7 +47,7 @@ iVector3::iVector3( const Vector3& copy )
|
||||
z = int(copy.z);
|
||||
}
|
||||
|
||||
iVector3& iVector3::operator=( const Vector3& copy )
|
||||
iVector3& iVector3::operator = ( const Vector3& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
@@ -56,7 +56,7 @@ iVector3& iVector3::operator=( const Vector3& copy )
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool iVector3::operator==( const iVector3& other ) const
|
||||
bool iVector3::operator == ( const iVector3& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if ( x == other.x )
|
||||
|
||||
@@ -21,15 +21,15 @@ namespace MathEngine {
|
||||
|
||||
iVector3( const SDL_Rect& copy );
|
||||
|
||||
iVector3& operator=( const SDL_Rect& copy );
|
||||
iVector3& operator = ( const SDL_Rect& copy );
|
||||
|
||||
bool operator==( const SDL_Rect& other ) const;
|
||||
bool operator == ( const SDL_Rect& other ) const;
|
||||
|
||||
iVector3( const Vector3& copy );
|
||||
|
||||
iVector3& operator=( const Vector3& copy );
|
||||
iVector3& operator = ( const Vector3& copy );
|
||||
|
||||
bool operator==( const iVector3& other ) const;
|
||||
bool operator == ( const iVector3& other ) const;
|
||||
|
||||
int z;
|
||||
};/// END STRUCT DEFINITION iVector3
|
||||
|
||||
@@ -26,7 +26,7 @@ iVector4::iVector4( const SDL_Rect& copy )
|
||||
w = int(copy.h);
|
||||
}
|
||||
|
||||
iVector4& iVector4::operator=( const SDL_Rect& copy )
|
||||
iVector4& iVector4::operator = ( const SDL_Rect& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
@@ -36,7 +36,7 @@ iVector4& iVector4::operator=( const SDL_Rect& copy )
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool iVector4::operator==( const SDL_Rect& other ) const
|
||||
bool iVector4::operator == ( const SDL_Rect& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if ( x == other.x )
|
||||
@@ -55,7 +55,7 @@ iVector4::iVector4( const Vector4& copy )
|
||||
w = int(copy.w);
|
||||
}
|
||||
|
||||
iVector4& iVector4::operator=( const Vector4& copy )
|
||||
iVector4& iVector4::operator = ( const Vector4& copy )
|
||||
{
|
||||
x = int(copy.x);
|
||||
y = int(copy.y);
|
||||
@@ -65,7 +65,7 @@ iVector4& iVector4::operator=( const Vector4& copy )
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool iVector4::operator==( const iVector4& other ) const
|
||||
bool iVector4::operator == ( const iVector4& other ) const
|
||||
{
|
||||
bool rtn = false;
|
||||
if ( x == other.x )
|
||||
|
||||
@@ -23,15 +23,15 @@ namespace MathEngine {
|
||||
|
||||
iVector4( const SDL_Rect& copy );
|
||||
|
||||
iVector4& operator=( const SDL_Rect& copy );
|
||||
iVector4& operator = ( const SDL_Rect& copy );
|
||||
|
||||
bool operator==( const SDL_Rect& other ) const;
|
||||
bool operator == ( const SDL_Rect& other ) const;
|
||||
|
||||
iVector4( const Vector4& copy );
|
||||
|
||||
iVector4& operator=( const Vector4& copy );
|
||||
iVector4& operator = ( const Vector4& copy );
|
||||
|
||||
bool operator==( const iVector4& other ) const;
|
||||
bool operator == ( const iVector4& other ) const;
|
||||
|
||||
int w;
|
||||
};/// END STRUCT DEFINITION iVector4
|
||||
|
||||
Reference in New Issue
Block a user