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.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp
index c6aaa73..16f62c4 100644
--- a/pacman-c++/block.cpp
+++ b/pacman-c++/block.cpp
@@ -1,6 +1,7 @@
1#include "block.h" 1#include "block.h"
2#include "constants.h" 2#include "constants.h"
3#include "actor.h" 3#include "actor.h"
4#include "util.h"
4#include <QtDebug> 5#include <QtDebug>
5 6
6QMap<Color::Color, QPixmap> Block::m_pixmaps; 7QMap<Color::Color, QPixmap> Block::m_pixmaps;
@@ -14,7 +15,7 @@ Block::Block(Color::Color color, unsigned int neighbours, QGraphicsItem *parent)
14 15
15 if (m_pixmaps.find(color) == m_pixmaps.end()) 16 if (m_pixmaps.find(color) == m_pixmaps.end())
16 { 17 {
17 unsigned int colid = (color == Color::none) ? 0 : (color >> 1) + 1; 18 unsigned int colid = (color == Color::none) ? 0 : Util::floorLog2(color) + 1;
18 QString pixmapName = ":/" + QString("block%1").arg(colid); 19 QString pixmapName = ":/" + QString("block%1").arg(colid);
19 m_pixmaps[color] = QPixmap(pixmapName); 20 m_pixmaps[color] = QPixmap(pixmapName);
20 } 21 }