From 43061892c7c9d341bacb7c679444f2885bd56907 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 11 Apr 2011 02:24:48 +0200 Subject: - make use of my_color (still TODO: pre-game dialog (with intro music) + display own color first in scoreboard) - remove some audio debugging noice --- pacman-c++/sceneholder.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'pacman-c++/sceneholder.cpp') diff --git a/pacman-c++/sceneholder.cpp b/pacman-c++/sceneholder.cpp index 0236470..0a65d19 100644 --- a/pacman-c++/sceneholder.cpp +++ b/pacman-c++/sceneholder.cpp @@ -8,7 +8,8 @@ #include "point.h" #include "util.h" -SceneHolder::SceneHolder(QWidget* parent): QWidget(parent) +SceneHolder::SceneHolder(QWidget* parent) + : QWidget(parent), m_color(Color::none) { m_scene = new QGraphicsScene(0, 0, Constants::map_size_pixel.width, Constants::map_size_pixel.height, this); m_scene->setBackgroundBrush(Qt::black); @@ -27,11 +28,8 @@ void SceneHolder::updateMap(const Transmission::map_t& map) const Transmission::field_t &cur = map[x][y]; if (cur == Transmission::none) continue; - //qDebug() << "not 0 at x=" << x << ", y=" << y << ", val=" << cur; Color::Color color = static_cast(cur & Transmission::color_mask); - //qDebug() << "col=" << color; - PixmapItem* item = NULL; if (cur == Transmission::none) { @@ -74,8 +72,7 @@ void SceneHolder::updateMap(const Transmission::map_t& map) Actor *actor = m_actors.value(color, NULL); if (actor == NULL) { - //qDebug() << "new actor of col" << color; - actor = new Actor(color, (color == Color::red)); //TODO: red = local for testing + actor = new Actor(color, (color == m_color)); m_actors[color] = actor; m_scene->addItem(actor); actor->setPos(mapPositionToCoord(x, y)); -- cgit v1.2.3