From fd98c5d4687f4721826e78a626fead8bec7ac98b Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Thu, 25 Nov 2010 20:52:08 +0000 Subject: Sprite: Rename loadImage to setImage, change image to a pointer, implement setImage --- Sprite.cpp | 4 ++-- Sprite.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Sprite.cpp b/Sprite.cpp index b8a8e72..d87368a 100644 --- a/Sprite.cpp +++ b/Sprite.cpp @@ -26,6 +26,6 @@ bool Sprite::visible() { return isVisible; } -bool Sprite::loadImage(std::string path) { - std::cout << "Sprite::loadImage(): Loading sprite " << path << ".\n"; +bool Sprite::setImage(std::string path) { + image = loadImage(path); } diff --git a/Sprite.h b/Sprite.h index 59a4399..74f9bea 100644 --- a/Sprite.h +++ b/Sprite.h @@ -4,6 +4,7 @@ #include #include "SDL/SDL.h" #include "SDL/SDL_image.h" +#include "intensemarcus.h" class Sprite { public: @@ -20,9 +21,9 @@ class Sprite { bool visible(); // Load in this sprite's image - bool loadImage(std::string path); + bool setImage(std::string path); // This sprite's image - SDL_Surface image; + SDL_Surface *image; protected: // Coordinates -- cgit v1.2.3