From 183fbc9fff36e8b675e166cd3fe1297ed16e57b2 Mon Sep 17 00:00:00 2001 From: Ivan Hernandez Date: Wed, 23 Dec 2009 13:52:44 -0600 Subject: [PATCH] Added the basic background class and added more aplicable comments to previous classes. --- Background.cpp | 8 ++++++++ Background.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Background.cpp create mode 100644 Background.h diff --git a/Background.cpp b/Background.cpp new file mode 100644 index 0000000..3b72594 --- /dev/null +++ b/Background.cpp @@ -0,0 +1,8 @@ +#include "Background.h" + +Background::Background(std::string name, std::string filename):_name(name){ + /** \todo Implememnt the constructor that gets image sizes and puts it together so that background can be used correctly. */ +} +void Background::draw(){ + /** \todo implement draw for background scrolling and otherwise. */ +} diff --git a/Background.h b/Background.h new file mode 100644 index 0000000..05f5467 --- /dev/null +++ b/Background.h @@ -0,0 +1,29 @@ +#include "Game.h"// for size of game window +#include "fns.h" +#include +#include + +/** + The Background + + This class is tasked with the following: + - loading the background + - drawing the background + */ + +class Background{ + private: + std::string _name; + SizeD _imageSize; + /** \todo _sections;//if needed */ + SDL_Surface *mScreen; + + public: + Background(std::string name, std::string filename); + void draw();/**< Draw background. */ + std::string getName(){ return _name; }/** Returns name. */ + void setName(std::string name){ _name = name; }/** Set Name. */ + SizeD size(){ return _imageSize;}/** returns image size */ + +}; + -- 2.11.0