From 1c803669fcc596bc0c4f2f2f261adc5334faa357 Mon Sep 17 00:00:00 2001 From: Ivan Hernandez Date: Sun, 12 Jul 2009 16:38:04 -0500 Subject: [PATCH] Sprite no longer has updateBG or clearBG and Game now hides mouse. --- Game.cpp | 4 ++-- Level.cpp | 6 ------ Sprite.cpp | 25 ------------------------- Sprite.h | 2 -- 4 files changed, 2 insertions(+), 35 deletions(-) diff --git a/Game.cpp b/Game.cpp index 20518f5..e2679b2 100644 --- a/Game.cpp +++ b/Game.cpp @@ -14,7 +14,7 @@ Game::Game() : mCurrentLevel(0), mScreen(0) // Set 800x600 video mode mScreen = SDL_SetVideoMode(640, 468, 32, SDL_SWSURFACE); if (!mScreen) { - printf ("Couldn't set 800x600 32b video mode: %s\n", SDL_GetError ()); + printf ("Couldn't set video mode: %s\n", SDL_GetError ()); exit (2); } @@ -26,7 +26,7 @@ Game::Game() : mCurrentLevel(0), mScreen(0) // To see prcisely what this toggle does, just comment the line and recompile // the code... SDL_EnableKeyRepeat(25, 20); - + SDL_ShowCursor(0); // Create the first level mLevels.push_back(new Level(mScreen)); } diff --git a/Level.cpp b/Level.cpp index 5f48855..6b78004 100644 --- a/Level.cpp +++ b/Level.cpp @@ -87,12 +87,6 @@ void Level::drawScene() void Level::DrawSprites() { for (size_t i=0; iclearBG(); - } - for (size_t i=0; iupdateBG(); - } - for (size_t i=0; idraw(); } } diff --git a/Sprite.cpp b/Sprite.cpp index a035574..cfc09ec 100644 --- a/Sprite.cpp +++ b/Sprite.cpp @@ -20,31 +20,6 @@ Sprite::Sprite(SDL_Surface *screen, std::string name, Animation *anim) : } } -void Sprite::clearBG() -{ - if(mDrawn ==1) - { - SDL_Rect dest; - dest.x = mOldX; - dest.y = mOldY; - dest.w = mSpriteAnimation->mW; - dest.h = mSpriteAnimation->mH; - SDL_BlitSurface(mBackReplacement,NULL,mScreen,&dest); - } -} - -void Sprite::updateBG() -{ - SDL_Rect srcrect; - srcrect.w = mSpriteAnimation->mW; - srcrect.h = mSpriteAnimation->mH; - srcrect.x = mX; - srcrect.y = mY; - mOldX = mX; - mOldY = mY; - SDL_BlitSurface(mScreen,&srcrect,mBackReplacement,NULL); -} - void Sprite::draw() { if(mAnimating ==1) diff --git a/Sprite.h b/Sprite.h index b187f7f..18f0dc9 100644 --- a/Sprite.h +++ b/Sprite.h @@ -8,8 +8,6 @@ class Sprite public: Sprite(SDL_Surface *screen, std::string name, Animation *anim); void draw(); - void clearBG(); - void updateBG(); void setFrame(int frame) { mFrame = frame; } int getFrame() { return mFrame; } void setSpeed(float speed) {mSpeed = speed;} -- 2.11.0