diff options
| author | totycro <totycro@unknown-horizons.org> | 2011-04-04 22:02:31 +0200 |
|---|---|---|
| committer | totycro <totycro@unknown-horizons.org> | 2011-04-04 22:02:31 +0200 |
| commit | eef1d8ea60e3797ba261ebfe61a7d1e165069ed4 (patch) | |
| tree | c10e397f58af5dafd0d450bb104fb3122bb611e2 /pacman-c++/block.cpp | |
| parent | 47ae4a32e6e81dabbd2784a4b3c9c4ad68076a50 (diff) | |
| download | foop-eef1d8ea60e3797ba261ebfe61a7d1e165069ed4.tar.gz foop-eef1d8ea60e3797ba261ebfe61a7d1e165069ed4.tar.bz2 foop-eef1d8ea60e3797ba261ebfe61a7d1e165069ed4.zip | |
Use only 1 color format for everything
Simple map parsing for Blocks and Bonus points
Diffstat (limited to 'pacman-c++/block.cpp')
| -rw-r--r-- | pacman-c++/block.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp index d5435f3..4240dd4 100644 --- a/pacman-c++/block.cpp +++ b/pacman-c++/block.cpp | |||
| @@ -1,12 +1,17 @@ | |||
| 1 | #include "block.h" | 1 | #include "block.h" |
| 2 | 2 | ||
| 3 | #include <Qt> | 3 | #include <QtGui> |
| 4 | 4 | ||
| 5 | Block::Block(Actor::Type type) | 5 | #include "constants.h" |
| 6 | |||
| 7 | std::map<Color, QPixmap> Block::m_pixmaps; | ||
| 8 | |||
| 9 | Block::Block(Color color) | ||
| 6 | { | 10 | { |
| 7 | if (m_pixmaps.find(type) == m_pixmaps.end()) { | 11 | if (m_pixmaps.find(color) == m_pixmaps.end()) { |
| 8 | QString pixmapName = ":/" + QString("block%1").arg(type); | 12 | QString pixmapName = ":/" + QString("block%1").arg(color); |
| 9 | m_pixmaps[type] = QPixmap( pixmapName ); | 13 | m_pixmaps[color] = QPixmap( pixmapName ); |
| 10 | } | 14 | } |
| 11 | setPixmap( m_pixmaps.find(type)->second ); | 15 | setPixmap( m_pixmaps.find(color)->second ); |
| 16 | qDebug() << "loading block w color: " << color; | ||
| 12 | } | 17 | } |
