From 9ab0c3e066b2c0b48daed461e80c7bb22bc6803f Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 14 Apr 2011 23:29:50 +0200 Subject: fix wrong left shift which fixes the invisible fourth player :) --- pacman-c++/block.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pacman-c++/block.cpp') 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 @@ #include "block.h" #include "constants.h" #include "actor.h" +#include "util.h" #include QMap Block::m_pixmaps; @@ -14,7 +15,7 @@ Block::Block(Color::Color color, unsigned int neighbours, QGraphicsItem *parent) if (m_pixmaps.find(color) == m_pixmaps.end()) { - unsigned int colid = (color == Color::none) ? 0 : (color >> 1) + 1; + unsigned int colid = (color == Color::none) ? 0 : Util::floorLog2(color) + 1; QString pixmapName = ":/" + QString("block%1").arg(colid); m_pixmaps[color] = QPixmap(pixmapName); } -- cgit v1.2.3