diff options
| author | manuel <manuel@mausz.at> | 2011-04-11 02:24:48 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-11 02:24:48 +0200 |
| commit | 43061892c7c9d341bacb7c679444f2885bd56907 (patch) | |
| tree | faae1880915c23f85901fa4f0ef7f2e5465681ec /pacman-c++/sceneholder.cpp | |
| parent | 57e3e48eb558b73077c2b5b4e531ee1cd75b0fbf (diff) | |
| download | foop-43061892c7c9d341bacb7c679444f2885bd56907.tar.gz foop-43061892c7c9d341bacb7c679444f2885bd56907.tar.bz2 foop-43061892c7c9d341bacb7c679444f2885bd56907.zip | |
- make use of my_color (still TODO: pre-game dialog (with intro music) + display own color first in scoreboard)
- remove some audio debugging noice
Diffstat (limited to 'pacman-c++/sceneholder.cpp')
| -rw-r--r-- | pacman-c++/sceneholder.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
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 @@ | |||
| 8 | #include "point.h" | 8 | #include "point.h" |
| 9 | #include "util.h" | 9 | #include "util.h" |
| 10 | 10 | ||
| 11 | SceneHolder::SceneHolder(QWidget* parent): QWidget(parent) | 11 | SceneHolder::SceneHolder(QWidget* parent) |
| 12 | : QWidget(parent), m_color(Color::none) | ||
| 12 | { | 13 | { |
| 13 | m_scene = new QGraphicsScene(0, 0, Constants::map_size_pixel.width, Constants::map_size_pixel.height, this); | 14 | m_scene = new QGraphicsScene(0, 0, Constants::map_size_pixel.width, Constants::map_size_pixel.height, this); |
| 14 | m_scene->setBackgroundBrush(Qt::black); | 15 | m_scene->setBackgroundBrush(Qt::black); |
| @@ -27,11 +28,8 @@ void SceneHolder::updateMap(const Transmission::map_t& map) | |||
| 27 | const Transmission::field_t &cur = map[x][y]; | 28 | const Transmission::field_t &cur = map[x][y]; |
| 28 | if (cur == Transmission::none) | 29 | if (cur == Transmission::none) |
| 29 | continue; | 30 | continue; |
| 30 | //qDebug() << "not 0 at x=" << x << ", y=" << y << ", val=" << cur; | ||
| 31 | 31 | ||
| 32 | Color::Color color = static_cast<Color::Color>(cur & Transmission::color_mask); | 32 | Color::Color color = static_cast<Color::Color>(cur & Transmission::color_mask); |
| 33 | //qDebug() << "col=" << color; | ||
| 34 | |||
| 35 | PixmapItem* item = NULL; | 33 | PixmapItem* item = NULL; |
| 36 | if (cur == Transmission::none) | 34 | if (cur == Transmission::none) |
| 37 | { | 35 | { |
| @@ -74,8 +72,7 @@ void SceneHolder::updateMap(const Transmission::map_t& map) | |||
| 74 | Actor *actor = m_actors.value(color, NULL); | 72 | Actor *actor = m_actors.value(color, NULL); |
| 75 | if (actor == NULL) | 73 | if (actor == NULL) |
| 76 | { | 74 | { |
| 77 | //qDebug() << "new actor of col" << color; | 75 | actor = new Actor(color, (color == m_color)); |
| 78 | actor = new Actor(color, (color == Color::red)); //TODO: red = local for testing | ||
| 79 | m_actors[color] = actor; | 76 | m_actors[color] = actor; |
| 80 | m_scene->addItem(actor); | 77 | m_scene->addItem(actor); |
| 81 | actor->setPos(mapPositionToCoord(x, y)); | 78 | actor->setPos(mapPositionToCoord(x, y)); |
