summaryrefslogtreecommitdiffstats
path: root/pacman-c++/block.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/block.cpp')
-rw-r--r--pacman-c++/block.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp
index 7cb77cc..c168c00 100644
--- a/pacman-c++/block.cpp
+++ b/pacman-c++/block.cpp
@@ -9,12 +9,13 @@ Block::Block(Color::Color color, unsigned int neighbours, QGraphicsItem *parent)
9{ 9{
10 if (m_pixmaps.find(color) == m_pixmaps.end()) 10 if (m_pixmaps.find(color) == m_pixmaps.end())
11 { 11 {
12 QString pixmapName = ":/" + QString("block%1").arg(color); 12 unsigned int colid = (color == Color::none) ? 0 : (color >> 1) + 1;
13 QString pixmapName = ":/" + QString("block%1").arg(colid);
13 m_pixmaps[color] = QPixmap(pixmapName); 14 m_pixmaps[color] = QPixmap(pixmapName);
14 } 15 }
15 setPixmap(m_pixmaps.find(color).value()); 16 setPixmap(m_pixmaps.find(color).value());
16 setNeighbours(neighbours); 17 setNeighbours(neighbours);
17 qDebug() << "loading block w color: " << color; 18 //qDebug() << "loading block w color: " << color;
18} 19}
19 20
20void Block::setNeighbours(unsigned int neighbours) 21void Block::setNeighbours(unsigned int neighbours)