diff options
Diffstat (limited to 'pacman-c++/block.cpp')
| -rw-r--r-- | pacman-c++/block.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp index 9d57578..6383b3a 100644 --- a/pacman-c++/block.cpp +++ b/pacman-c++/block.cpp | |||
| @@ -1,18 +1,17 @@ | |||
| 1 | #include "block.h" | 1 | #include "block.h" |
| 2 | |||
| 3 | #include <QtGui> | ||
| 4 | |||
| 5 | #include "constants.h" | 2 | #include "constants.h" |
| 3 | #include <QtGui> | ||
| 6 | 4 | ||
| 7 | std::map<Color, QPixmap> Block::m_pixmaps; | 5 | std::map<Color, QPixmap> Block::m_pixmaps; |
| 8 | 6 | ||
| 9 | Block::Block(Color color, QGraphicsItem *parent) | 7 | Block::Block(Color color, QGraphicsItem *parent) |
| 10 | : PixmapItem(parent) | 8 | : PixmapItem(parent) |
| 11 | { | 9 | { |
| 12 | if (m_pixmaps.find(color) == m_pixmaps.end()) { | 10 | if (m_pixmaps.find(color) == m_pixmaps.end()) |
| 11 | { | ||
| 13 | QString pixmapName = ":/" + QString("block%1").arg(color); | 12 | QString pixmapName = ":/" + QString("block%1").arg(color); |
| 14 | m_pixmaps[color] = QPixmap( pixmapName ); | 13 | m_pixmaps[color] = QPixmap(pixmapName); |
| 15 | } | 14 | } |
| 16 | setPixmap( m_pixmaps.find(color)->second ); | 15 | setPixmap(m_pixmaps.find(color)->second); |
| 17 | qDebug() << "loading block w color: " << color; | 16 | qDebug() << "loading block w color: " << color; |
| 18 | } | 17 | } |
