diff options
Diffstat (limited to 'pacman-c++/block.cpp')
| -rw-r--r-- | pacman-c++/block.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp index 11c2a32..d5435f3 100644 --- a/pacman-c++/block.cpp +++ b/pacman-c++/block.cpp | |||
| @@ -4,5 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | Block::Block(Actor::Type type) | 5 | Block::Block(Actor::Type type) |
| 6 | { | 6 | { |
| 7 | setPixmap(QPixmap(":/" + QString("block%1").arg(type))); | 7 | if (m_pixmaps.find(type) == m_pixmaps.end()) { |
| 8 | QString pixmapName = ":/" + QString("block%1").arg(type); | ||
| 9 | m_pixmaps[type] = QPixmap( pixmapName ); | ||
| 10 | } | ||
| 11 | setPixmap( m_pixmaps.find(type)->second ); | ||
| 8 | } | 12 | } |
