Rally X
ELEN3009 Project by Justin Wernick and David Schneider
|
00001 #include "ColourStore.h" 00002 00003 ColourStore::ColourStore() 00004 { 00005 populateColours(); 00006 } 00007 00008 void ColourStore::populateColours() 00009 { 00010 _colours[BitmapStore::PLAYER] = al_map_rgb(0,255,255); 00011 _colours[BitmapStore::ENEMY] = al_map_rgb(255,0,0); 00012 _colours[BitmapStore::CHECKPOINT] = al_map_rgb(0,255,0); 00013 _colours[BitmapStore::MAZE_WALL] = al_map_rgb(255,255,255); 00014 _colours[BitmapStore::MAZE_FLOOR] = al_map_rgb(0,0,0); 00015 _transparent = al_map_rgba(0,0,0,0); 00016 } 00017 00018 ALLEGRO_COLOR ColourStore::getColour(BitmapStore::Image image) 00019 { 00020 if (_colours.find(image) != _colours.end()) 00021 { 00022 return _colours[image]; 00023 } 00024 else return _transparent; 00025 }