Skip to content

Commit

Permalink
Use Vec2 for the object base class constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatyas committed Sep 20, 2024
1 parent 71afd89 commit 4d980e2
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/common/ObjectBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/common/ObjectBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(){};
Expand Down
2 changes: 1 addition & 1 deletion src/smw/objects/IO_BulletBillCannon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/smw/objects/IO_FlameCannon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/smw/objects/blocks/IO_Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/smw/objects/moving/MovingObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/smw/objects/overmap/OverMapObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4d980e2

Please sign in to comment.