From: Daniel Karbach Date: Tue, 28 Aug 2012 19:21:44 +0000 (+0200) Subject: made Sprite default constructible X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=908e0b6a2a9c3266da902eccd668f54ee0b94895;hp=107b78b720db69ad402c09c0b1d9beb3b88a1952;p=l2e.git made Sprite default constructible --- diff --git a/src/graphics/Sprite.h b/src/graphics/Sprite.h index f6f3b7b..2af95f8 100644 --- a/src/graphics/Sprite.h +++ b/src/graphics/Sprite.h @@ -17,6 +17,7 @@ namespace graphics { class Sprite { public: + Sprite() : surface(0), size(64, 64), offset() { } Sprite(SDL_Surface *s, int width, int height, int xOffset = 0, int yOffset = 0) : surface(s), size(width, height), offset(xOffset, yOffset) { } @@ -37,6 +38,11 @@ public: Draw(dest, position + offset, col, row); } +public: + void SetSurface(SDL_Surface *s) { surface = s; } + void SetSize(const geometry::Vector &s) { size = s; } + void SetOffset(const geometry::Vector &o) { offset = o; } + private: SDL_Surface *surface; geometry::Vector size;