]> git.localhorst.tv Git - l2e.git/blob - src/graphics/Gauge.h
added gauges for health, mana, and ikari displays
[l2e.git] / src / graphics / Gauge.h
1 /*
2  * Gauge.h
3  *
4  *  Created on: Aug 7, 2012
5  *      Author: holy
6  */
7
8 #ifndef GRAPHICS_GAUGE_H_
9 #define GRAPHICS_GAUGE_H_
10
11 #include "../geometry/Point.h"
12
13 #include <SDL.h>
14
15 namespace graphics {
16
17 class Gauge {
18
19 public:
20         Gauge(SDL_Surface *s, int fullX, int fullY, int emptyX, int emptyY, int height, int startWidth, int repeatWidth, int endWidth)
21         : surface(s), fullX(fullX), fullY(fullY), emptyX(emptyX), emptyY(emptyY), height(height), startWidth(startWidth), repeatWidth(repeatWidth), endWidth(endWidth) { }
22
23 public:
24         int MinWidth() const { return startWidth + endWidth; }
25         int Height() const { return height; }
26         void Draw(SDL_Surface *dest, geometry::Point<int> position, int width, Uint8 level) const;
27
28 private:
29         SDL_Surface *surface;
30         int fullX;
31         int fullY;
32         int emptyX;
33         int emptyY;
34         int height;
35         int startWidth;
36         int repeatWidth;
37         int endWidth;
38
39 };
40
41 }
42
43 #endif /* GRAPHICS_GAUGE_H_ */