summaryrefslogtreecommitdiffstats
path: root/pacman-c++/sceneholder.cpp
diff options
context:
space:
mode:
authortotycro <totycro@unknown-horizons.org>2011-04-09 15:38:52 +0200
committertotycro <totycro@unknown-horizons.org>2011-04-09 15:38:52 +0200
commit64a02ded2453082fe13e8a8b408933e8fada131c (patch)
tree8ad71a72377cf094a699d21482a282297420b07d /pacman-c++/sceneholder.cpp
parentb0d6e4fcf33d21b24d2e9bbf7c5abf2065f0a4b3 (diff)
downloadfoop-64a02ded2453082fe13e8a8b408933e8fada131c.tar.gz
foop-64a02ded2453082fe13e8a8b408933e8fada131c.tar.bz2
foop-64a02ded2453082fe13e8a8b408933e8fada131c.zip
hackishly disabled audio for srv
made test movement work
Diffstat (limited to 'pacman-c++/sceneholder.cpp')
-rw-r--r--pacman-c++/sceneholder.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/pacman-c++/sceneholder.cpp b/pacman-c++/sceneholder.cpp
index ba9cc97..dbc3ca5 100644
--- a/pacman-c++/sceneholder.cpp
+++ b/pacman-c++/sceneholder.cpp
@@ -34,7 +34,16 @@ void SceneHolder::updateMap(const Transmission::map_t& map)
34 //qDebug() << "col=" << color; 34 //qDebug() << "col=" << color;
35 35
36 PixmapItem* item = NULL; 36 PixmapItem* item = NULL;
37 if (cur & Transmission::block) 37 if (cur == 0) { // no update
38 } else if (cur & Transmission::empty) {
39 PixmapItem* oldItem = visualMap[x][y];
40 // remove elements (in case it's not an actor)
41 if (oldItem != NULL && dynamic_cast<Actor*>(item) == 0) {
42 m_scene->removeItem(oldItem);
43 visualMap[x][y] = NULL;
44 delete oldItem;
45 }
46 } else if (cur & Transmission::block)
38 { 47 {
39 unsigned int neighbours = Block::None; 48 unsigned int neighbours = Block::None;
40 // check left side 49 // check left side
@@ -71,8 +80,10 @@ void SceneHolder::updateMap(const Transmission::map_t& map)
71 Util::transmissionMovementToActor(cur & Transmission::direction_mask); 80 Util::transmissionMovementToActor(cur & Transmission::direction_mask);
72 //actor->move(direction, mapPositionToCoord(x, y)); 81 //actor->move(direction, mapPositionToCoord(x, y));
73 } 82 }
74 else 83 else {
84 qDebug() << "abort at " << cur;
75 Q_ASSERT(false); 85 Q_ASSERT(false);
86 }
76 87
77 if (item != NULL) 88 if (item != NULL)
78 { 89 {