diff options
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 | } |
