X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FGauge.h;h=82b8952603f92850772137ae9ca7d14ff435f93e;hb=63e55846d4043f96ee1bdb95f0631b07d5f57c28;hp=fd81877e0e0828ff0c32dbf7eec20d0166c10aba;hpb=0542849dfccfec1ce1477265fa0fee2401a8fb23;p=l2e.git diff --git a/src/graphics/Gauge.h b/src/graphics/Gauge.h index fd81877..82b8952 100644 --- a/src/graphics/Gauge.h +++ b/src/graphics/Gauge.h @@ -17,20 +17,29 @@ namespace graphics { class Gauge { public: - Gauge(SDL_Surface *s, int fullX, int fullY, int emptyX, int emptyY, int height, int startWidth, int repeatWidth, int endWidth) - : surface(s), fullX(fullX), fullY(fullY), emptyX(emptyX), emptyY(emptyY), height(height), startWidth(startWidth), repeatWidth(repeatWidth), endWidth(endWidth) { } + explicit Gauge(SDL_Surface *s = 0, int fullX = 0, int fullY = 0, int emptyX = 0, int emptyY = 0, int height = 1, int startWidth = 0, int repeatWidth = 1, int endWidth = 0) + : surface(s), fullOffset(fullX, fullY), emptyOffset(emptyX, emptyY), height(height), startWidth(startWidth), repeatWidth(repeatWidth), endWidth(endWidth) { } public: int MinWidth() const { return startWidth + endWidth; } int Height() const { return height; } void Draw(SDL_Surface *dest, const geometry::Vector &position, int width, Uint8 fill) const; +public: + void SetSurface(SDL_Surface *s) { surface = s; } + void SetFullOffset(const geometry::Vector &o) { fullOffset = o; } + void SetEmptyOffset(const geometry::Vector &o) { emptyOffset = o; } + void SetHeight(int h) { height = h; } + void SetStartWidth(int w) { startWidth = w; } + void SetRepeatWidth(int w) { repeatWidth = w; } + void SetEndWidth(int w) { endWidth = w; } + + static void CreateTypeDescription(); + private: SDL_Surface *surface; - int fullX; - int fullY; - int emptyX; - int emptyY; + geometry::Vector fullOffset; + geometry::Vector emptyOffset; int height; int startWidth; int repeatWidth;