summaryrefslogtreecommitdiff
path: root/source/presentation/ColourStore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/presentation/ColourStore.cpp')
-rw-r--r--source/presentation/ColourStore.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/presentation/ColourStore.cpp b/source/presentation/ColourStore.cpp
new file mode 100644
index 0000000..e08b6f8
--- /dev/null
+++ b/source/presentation/ColourStore.cpp
@@ -0,0 +1,25 @@
+#include "ColourStore.h"
+
+ColourStore::ColourStore()
+{
+ populateColours();
+}
+
+void ColourStore::populateColours()
+{
+ _colours[BitmapStore::PLAYER] = al_map_rgb(0,255,255);
+ _colours[BitmapStore::ENEMY] = al_map_rgb(255,0,0);
+ _colours[BitmapStore::CHECKPOINT] = al_map_rgb(0,255,0);
+ _colours[BitmapStore::MAZE_WALL] = al_map_rgb(255,255,255);
+ _colours[BitmapStore::MAZE_FLOOR] = al_map_rgb(0,0,0);
+ _transparent = al_map_rgba(0,0,0,0);
+}
+
+ALLEGRO_COLOR ColourStore::getColour(BitmapStore::Image image)
+{
+ if (_colours.find(image) != _colours.end())
+ {
+ return _colours[image];
+ }
+ else return _transparent;
+}