From 908e0b6a2a9c3266da902eccd668f54ee0b94895 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Tue, 28 Aug 2012 21:21:44 +0200 Subject: [PATCH] made Sprite default constructible --- src/graphics/Sprite.h | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.39.2