Commit b8bf0b60 authored by Gerhard Stein's avatar Gerhard Stein

Fixed major bounding box issues putting correct datatypes

parent 8a58449c
......@@ -34,16 +34,16 @@ const int COLISION_RES = (1<<STC);
// The bouncing box used by the object which is used to determine the collisions
struct BoundingBox
{
unsigned int x1, x2, y1, y2;
BoundingBox(unsigned int l_x1 = 0, unsigned int l_x2 = 0,
unsigned int l_y1 = 0, unsigned int l_y2 = 0 ) :
int x1, x2, y1, y2;
BoundingBox(int l_x1 = 0, int l_x2 = 0,
int l_y1 = 0, int l_y2 = 0 ) :
x1(l_x1), x2(l_x2),
y1(l_y1), y2(l_y2) {}
void operator()(const unsigned int l_x1,
const unsigned int l_y1,
const unsigned int l_x2,
const unsigned int l_y2 )
void operator()(const int l_x1,
const int l_y1,
const int l_x2,
const int l_y2 )
{
x1 = l_x1; x2 = l_x2;
y1 = l_y1; y2 = l_y2;
......
......@@ -274,7 +274,7 @@ void CSprite::applyTranslucency(Uint8 value)
///
// Getters and Setters
///
void CSprite::setBoundingBoxCoordinates( Uint16 bboxx1, Uint16 bboxy1, Uint16 bboxx2, Uint16 bboxy2 )
void CSprite::setBoundingBoxCoordinates( Sint32 bboxx1, Sint32 bboxy1, Sint32 bboxx2, Sint32 bboxy2 )
{
m_bboxX1 = bboxx1;
m_bboxY1 = bboxy1;
......
......@@ -30,8 +30,8 @@ public:
bool loadHQSprite( const std::string& filename );
void setSize(Uint8 w, Uint8 h) { m_xsize = w; m_ysize = h; }
void setOffset(Uint16 x, Uint16 y) { m_xoffset = x; m_yoffset = y; }
void setBoundingBoxCoordinates( Uint16 bboxx1, Uint16 bboxy1, Uint16 bboxx2, Uint16 bboxy2 );
void setOffset(Sint16 x, Sint16 y) { m_xoffset = x; m_yoffset = y; }
void setBoundingBoxCoordinates( Sint32 bboxx1, Sint32 bboxy1, Sint32 bboxx2, Sint32 bboxy2 );
SDL_Surface *getSDLSurface() { return mpSurface.get(); }
SDL_Surface *getSDLMaskSurface() { return mpMasksurface.get(); }
......@@ -48,15 +48,15 @@ public:
void setHeight(Uint8 h) { m_ysize=h; };
// bounding box for hit detection
Uint32 m_bboxX1, m_bboxY1;
Uint32 m_bboxX2, m_bboxY2;
Sint32 m_bboxX1, m_bboxY1;
Sint32 m_bboxX2, m_bboxY2;
private:
SmartPointer<SDL_Surface> mpSurface;
SmartPointer<SDL_Surface> mpMasksurface;
Uint8 m_xsize, m_ysize;
Uint16 m_xoffset, m_yoffset;
Sint16 m_xoffset, m_yoffset;
Uint8 m_alpha;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment