From 98ba22e7064db57316dfff1ae127feb3dceeb73e Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Thu, 31 Jul 2014 13:58:22 +0200 Subject: Initial commit --- source/presentation/ColourStore.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 source/presentation/ColourStore.cpp (limited to 'source/presentation/ColourStore.cpp') 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; +} -- cgit v1.2.3