//Game Sprite.cpp #include "GameSprite.h" namespace Turbulence { /** * Function: Constructor * Purpose: **/ GameSprite::GameSprite(HTEXTURE texture, float height, float width) { mWidth = width; mHeight = height; mpSprite = new hgeSprite(texture, 0, 0, width, height); } /** * Function: Copy Constructor * Purpose: **/ GameSprite::GameSprite(const Turbulence::GameSprite &gamesprite) { *this = gamesprite; } /** * Function: Destructor * Purpose: **/ GameSprite::~GameSprite() { delete mpSprite; } /** * Function: Overloaded = Operator * Purpose: **/ GameSprite& GameSprite::operator =(const GameSprite &gamesprite) { delete mpSprite; mpSprite = gamesprite.mpSprite; mWidth = gamesprite.mWidth; mHeight = gamesprite.mHeight; mScale[0] = gamesprite.mScale[0]; mScale[1] = gamesprite.mScale[1]; mRotation = gamesprite.mRotation; mPosition = gamesprite.mPosition; return *this; } /** * Function: Initialize * Purpose: Initializes Sprite **/ void GameSprite::Initialize(hgeVector position, float rotation) { mScale[0] = 1.0f; mScale[1] = 1.0f; mRotation = rotation; mPosition = position; mpSprite->SetBlendMode(BLEND_DEFAULT_Z); mpSprite->SetHotSpot(0, 0); } void GameSprite::Draw() { mpSprite->RenderEx(mPosition.x, mPosition.y, mRotation, mScale[0], mScale[1]); } }