BoxSizer to Sizer

This commit is contained in:
2018-08-15 22:04:06 -04:00
parent 353dc21750
commit bd3c111fa1
67 changed files with 369 additions and 308 deletions
@@ -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);