]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/Gauge.h
added gauges for health, mana, and ikari displays
[l2e.git] / src / graphics / Gauge.h
diff --git a/src/graphics/Gauge.h b/src/graphics/Gauge.h
new file mode 100644 (file)
index 0000000..dde1db0
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Gauge.h
+ *
+ *  Created on: Aug 7, 2012
+ *      Author: holy
+ */
+
+#ifndef GRAPHICS_GAUGE_H_
+#define GRAPHICS_GAUGE_H_
+
+#include "../geometry/Point.h"
+
+#include <SDL.h>
+
+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) { }
+
+public:
+       int MinWidth() const { return startWidth + endWidth; }
+       int Height() const { return height; }
+       void Draw(SDL_Surface *dest, geometry::Point<int> position, int width, Uint8 level) const;
+
+private:
+       SDL_Surface *surface;
+       int fullX;
+       int fullY;
+       int emptyX;
+       int emptyY;
+       int height;
+       int startWidth;
+       int repeatWidth;
+       int endWidth;
+
+};
+
+}
+
+#endif /* GRAPHICS_GAUGE_H_ */