summaryrefslogtreecommitdiffstats
path: root/pacman-c++/mainwidget.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-07 00:02:36 +0200
committermanuel <manuel@mausz.at>2011-04-07 00:02:36 +0200
commitc1413464930fa82073800a6c58334099bbef370b (patch)
tree53e3c33ac245f8531f858783d7da5e8b94ddd858 /pacman-c++/mainwidget.cpp
parentf2a7c8baea93aeffaddc8474e3b4d1a2d58d2516 (diff)
downloadfoop-c1413464930fa82073800a6c58334099bbef370b.tar.gz
foop-c1413464930fa82073800a6c58334099bbef370b.tar.bz2
foop-c1413464930fa82073800a6c58334099bbef370b.zip
adding normal points
Diffstat (limited to 'pacman-c++/mainwidget.cpp')
-rw-r--r--pacman-c++/mainwidget.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp
index 6ee7b7a..d0b2ad7 100644
--- a/pacman-c++/mainwidget.cpp
+++ b/pacman-c++/mainwidget.cpp
@@ -3,6 +3,7 @@
3#include "actor.h" 3#include "actor.h"
4#include "block.h" 4#include "block.h"
5#include "bonuspoint.h" 5#include "bonuspoint.h"
6#include "point.h"
6#include "constants.h" 7#include "constants.h"
7 8
8// temporary 9// temporary
@@ -18,7 +19,7 @@ Transmission::map_t createDummyMap()
18 for (unsigned int y = 0; y < Constants::map_size.height; ++y) 19 for (unsigned int y = 0; y < Constants::map_size.height; ++y)
19 { 20 {
20 Transmission::field_t &cur = map[x][y]; 21 Transmission::field_t &cur = map[x][y];
21 cur = 0; 22 cur = Transmission::none;
22 } 23 }
23 } 24 }
24 25
@@ -189,6 +190,16 @@ Transmission::map_t createDummyMap()
189 map[17][15] |= Transmission::pacman; 190 map[17][15] |= Transmission::pacman;
190 map[17][15] |= Transmission::direction_left; 191 map[17][15] |= Transmission::direction_left;
191 192
193 for (unsigned int x = 0; x < Constants::map_size.width; ++x)
194 {
195 for (unsigned int y = 0; y < Constants::map_size.height; ++y)
196 {
197 Transmission::field_t &cur = map[x][y];
198 if (cur == Transmission::none)
199 cur |= Transmission::point;
200 }
201 }
202
192 return map; 203 return map;
193} 204}
194 205
@@ -275,7 +286,7 @@ void MainWidget::updateMap(const Transmission::map_t& map)
275 for (unsigned int y = 0; y < Constants::map_size.height; ++y) 286 for (unsigned int y = 0; y < Constants::map_size.height; ++y)
276 { 287 {
277 const Transmission::field_t &cur = map[x][y]; 288 const Transmission::field_t &cur = map[x][y];
278 if (cur == 0) 289 if (cur == Transmission::none)
279 continue; 290 continue;
280 //qDebug() << "not 0 at x=" << x << ", y=" << y << ", val=" << cur; 291 //qDebug() << "not 0 at x=" << x << ", y=" << y << ", val=" << cur;
281 292
@@ -302,6 +313,8 @@ void MainWidget::updateMap(const Transmission::map_t& map)
302 } 313 }
303 else if (cur & Transmission::bonuspoint) 314 else if (cur & Transmission::bonuspoint)
304 item = new BonusPoint(); 315 item = new BonusPoint();
316 else if (cur & Transmission::point)
317 item = new Point();
305 else if (cur & Transmission::pacman) 318 else if (cur & Transmission::pacman)
306 { 319 {
307 Actor *actor = m_actors.value(color, NULL); 320 Actor *actor = m_actors.value(color, NULL);