diff --git a/src/common/ObjectBase.cpp b/src/common/ObjectBase.cpp index 5886df21..92a4ecd3 100644 --- a/src/common/ObjectBase.cpp +++ b/src/common/ObjectBase.cpp @@ -31,11 +31,11 @@ float CapSideVelocity(float vel) //------------------------------------------------------------------------------ // class Object base class //------------------------------------------------------------------------------ -CObject::CObject(gfxSprite *nspr1, short x, short y) +CObject::CObject(gfxSprite* nspr1, Vec2s pos) : spr(nspr1) { - setXi(x); - setYi(y); + setXi(pos.x); + setYi(pos.y); if (spr) { iw = (short)spr->getWidth(); diff --git a/src/common/ObjectBase.h b/src/common/ObjectBase.h index c54af450..e28fb060 100644 --- a/src/common/ObjectBase.h +++ b/src/common/ObjectBase.h @@ -35,7 +35,7 @@ float CapSideVelocity(float vel); //object base class class CObject { public: - CObject(gfxSprite* nspr, short x, short y); + CObject(gfxSprite* nspr, Vec2s pos); virtual ~CObject() = default; virtual void draw(){}; diff --git a/src/smw/objects/IO_BulletBillCannon.cpp b/src/smw/objects/IO_BulletBillCannon.cpp index e9240576..d2bee45a 100644 --- a/src/smw/objects/IO_BulletBillCannon.cpp +++ b/src/smw/objects/IO_BulletBillCannon.cpp @@ -14,7 +14,7 @@ extern CResourceManager* rm; //------------------------------------------------------------------------------ IO_BulletBillCannon::IO_BulletBillCannon(Vec2s pos, short freq, float vel, bool preview) - : CObject(NULL, pos.x, pos.y) + : CObject(NULL, pos) , m_freq(freq) , m_vel(vel) , m_preview(preview) diff --git a/src/smw/objects/IO_FlameCannon.cpp b/src/smw/objects/IO_FlameCannon.cpp index 394352b0..629ff81a 100644 --- a/src/smw/objects/IO_FlameCannon.cpp +++ b/src/smw/objects/IO_FlameCannon.cpp @@ -13,7 +13,7 @@ extern CResourceManager* rm; // class IO_FlameCannon - shoots a flame //------------------------------------------------------------------------------ IO_FlameCannon::IO_FlameCannon(Vec2s pos, short freq, short direction) - : CObject(NULL, pos.x, pos.y) + : CObject(NULL, pos) , iFreq(freq) , iDirection(direction) { diff --git a/src/smw/objects/blocks/IO_Block.cpp b/src/smw/objects/blocks/IO_Block.cpp index 9858f9ac..575af4c2 100644 --- a/src/smw/objects/blocks/IO_Block.cpp +++ b/src/smw/objects/blocks/IO_Block.cpp @@ -27,7 +27,7 @@ extern CPlayer* GetPlayerFromGlobalID(short iGlobalID); //------------------------------------------------------------------------------ IO_Block::IO_Block(gfxSprite *nspr, Vec2s pos) - : CObject(nspr, pos.x, pos.y) + : CObject(nspr, pos) { objectType = object_block; diff --git a/src/smw/objects/moving/MovingObject.cpp b/src/smw/objects/moving/MovingObject.cpp index ff9ebcf9..33afa0d1 100644 --- a/src/smw/objects/moving/MovingObject.cpp +++ b/src/smw/objects/moving/MovingObject.cpp @@ -29,7 +29,7 @@ extern CPlayer* GetPlayerFromGlobalID(short iGlobalID); // class MovingObject (all moving objects inheirit from this class) //------------------------------------------------------------------------------ IO_MovingObject::IO_MovingObject(gfxSprite* nspr, Vec2s pos, short iNumSpr, short aniSpeed, short iCollisionWidth, short iCollisionHeight, short iCollisionOffsetX, short iCollisionOffsetY, short iAnimationOffsetX, short iAnimationOffsetY, short iAnimationHeight, short iAnimationWidth) - : CObject(nspr, pos.x, pos.y) + : CObject(nspr, pos) { iNumSprites = iNumSpr; diff --git a/src/smw/objects/overmap/OverMapObject.cpp b/src/smw/objects/overmap/OverMapObject.cpp index b0286899..8b53ad24 100644 --- a/src/smw/objects/overmap/OverMapObject.cpp +++ b/src/smw/objects/overmap/OverMapObject.cpp @@ -6,7 +6,7 @@ // class OverMapObject - moving objects that don't collide with map or objects, just player //------------------------------------------------------------------------------ IO_OverMapObject::IO_OverMapObject(gfxSprite* nspr, Vec2s pos, short iNumSpr, short aniSpeed, short iCollisionWidth, short iCollisionHeight, short iCollisionOffsetX, short iCollisionOffsetY, short iAnimationOffsetX, short iAnimationOffsetY, short iAnimationHeight, short iAnimationWidth) - : CObject(nspr, pos.x, pos.y) + : CObject(nspr, pos) { objectType = object_overmap; // movingObjectType = movingobject_none;