diff options
author | Justin Worthe <justin.worthe@entelect.co.za> | 2014-07-31 13:58:22 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@entelect.co.za> | 2014-07-31 13:58:22 +0200 |
commit | 98ba22e7064db57316dfff1ae127feb3dceeb73e (patch) | |
tree | 1f7fe3065f804e491f558650285e8c6d05fc914b /source/presentation/ColourStore.cpp |
Diffstat (limited to 'source/presentation/ColourStore.cpp')
-rw-r--r-- | source/presentation/ColourStore.cpp | 25 |
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; +} |