2011-12-22 13:05:19 +00:00
|
|
|
#include "StdInc.h"
|
|
|
|
#include "Geometries.h"
|
|
|
|
|
2013-03-13 22:01:05 +00:00
|
|
|
#if 0
|
2011-12-22 13:05:19 +00:00
|
|
|
extern SDL_Surface * screen;
|
|
|
|
|
|
|
|
Rect Rect::createCentered( int w, int h )
|
|
|
|
{
|
|
|
|
return Rect(screen->w/2 - w/2, screen->h/2 - h/2, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
Rect Rect::around(const Rect &r, int width /*= 1*/) /*creates rect around another */
|
|
|
|
{
|
|
|
|
return Rect(r.x - width, r.y - width, r.w + width * 2, r.h + width * 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
Rect Rect::centerIn(const Rect &r)
|
|
|
|
{
|
|
|
|
return Rect(r.x + (r.w - w) / 2, r.y + (r.h - h) / 2, w, h);
|
2013-03-13 22:01:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|