diff options
| author | totycro <totycro@unknown-horizons.org> | 2011-04-19 22:29:30 +0200 |
|---|---|---|
| committer | totycro <totycro@unknown-horizons.org> | 2011-04-19 22:29:30 +0200 |
| commit | 2d7ef3fd487e9c9f05cadd42ca6916487f391b79 (patch) | |
| tree | f0bb1c74b8809cb9eb27b3e7821a337a50dcd0dd /pacman-c++ | |
| parent | 7a5e71759c00b2c77f7ee3287c366dd1b48b81ca (diff) | |
| download | foop-2d7ef3fd487e9c9f05cadd42ca6916487f391b79.tar.gz foop-2d7ef3fd487e9c9f05cadd42ca6916487f391b79.tar.bz2 foop-2d7ef3fd487e9c9f05cadd42ca6916487f391b79.zip | |
Removed unnecessary code
Diffstat (limited to 'pacman-c++')
| -rw-r--r-- | pacman-c++/sceneholder.cpp | 3 | ||||
| -rw-r--r-- | pacman-c++/server.cpp | 32 |
2 files changed, 2 insertions, 33 deletions
diff --git a/pacman-c++/sceneholder.cpp b/pacman-c++/sceneholder.cpp index 37db691..feef033 100644 --- a/pacman-c++/sceneholder.cpp +++ b/pacman-c++/sceneholder.cpp | |||
| @@ -57,9 +57,8 @@ void SceneHolder::updateMap(const Transmission::map_t& map, const unsigned int x | |||
| 57 | { | 57 | { |
| 58 | GameEntity *oldItem = visualMap[x][y]; | 58 | GameEntity *oldItem = visualMap[x][y]; |
| 59 | /* special handling for purging field | 59 | /* special handling for purging field |
| 60 | * remove elements (in case it's not an actor) | ||
| 61 | */ | 60 | */ |
| 62 | if (oldItem != NULL && qgraphicsitem_cast<Actor *>(oldItem) == NULL) | 61 | if (oldItem != NULL) |
| 63 | { | 62 | { |
| 64 | visualMap[x][y] = NULL; | 63 | visualMap[x][y] = NULL; |
| 65 | Actor *actor = NULL; | 64 | Actor *actor = NULL; |
diff --git a/pacman-c++/server.cpp b/pacman-c++/server.cpp index 1c3caf9..e13682b 100644 --- a/pacman-c++/server.cpp +++ b/pacman-c++/server.cpp | |||
| @@ -178,7 +178,7 @@ QPoint Server::addRandomPoint(Transmission::map_t map, Transmission::field_t typ | |||
| 178 | } | 178 | } |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | /* remove actors possitions from list | 181 | /* remove actors positions from list |
| 182 | * performance would be better if actors would be listed in visualMap too | 182 | * performance would be better if actors would be listed in visualMap too |
| 183 | * but this isn't possible that easily. see comment in updateMap(map) | 183 | * but this isn't possible that easily. see comment in updateMap(map) |
| 184 | */ | 184 | */ |
| @@ -508,41 +508,11 @@ void Server::onRoundFinished() | |||
| 508 | void Server::initRoundMap(bool firstPacket) | 508 | void Server::initRoundMap(bool firstPacket) |
| 509 | { | 509 | { |
| 510 | disconnect(this, SIGNAL(allPointsRemoved()), this, SLOT(onRoundFinished())); | 510 | disconnect(this, SIGNAL(allPointsRemoved()), this, SLOT(onRoundFinished())); |
| 511 | if (!firstPacket) { | ||
| 512 | // clear old map | ||
| 513 | for (unsigned int i=0; i<visualMap.size(); ++i) { | ||
| 514 | for (unsigned int j=0; j<visualMap[0].size(); ++j) { | ||
| 515 | GameEntity *e = visualMap[i][j]; | ||
| 516 | if (e != NULL) { | ||
| 517 | if (qgraphicsitem_cast<Actor *>(e) == NULL) { | ||
| 518 | removeItem(e); | ||
| 519 | delete e; | ||
| 520 | } | ||
| 521 | } | ||
| 522 | visualMap[i][j] = 0; | ||
| 523 | } | ||
| 524 | } | ||
| 525 | } | ||
| 526 | 511 | ||
| 527 | // create new map | 512 | // create new map |
| 528 | Transmission::map_t map = Util::createDemoMap(); | 513 | Transmission::map_t map = Util::createDemoMap(); |
| 529 | // add content | 514 | // add content |
| 530 | Util::placeActors(map, m_maxplayers, Color::order); | 515 | Util::placeActors(map, m_maxplayers, Color::order); |
| 531 | /* | ||
| 532 | if (!firstPacket) { | ||
| 533 | for (unsigned int i=0; i<Constants::map_size.width; ++i) { | ||
| 534 | for (unsigned int j=0; j<Constants::map_size.height; ++j) { | ||
| 535 | if (map[i][j] & Transmission::pacman) { | ||
| 536 | Color::Color color = static_cast<Color::Color>(map[i][j] & Transmission::color_mask); | ||
| 537 | Actor *actor = m_actors.value(color, NULL); | ||
| 538 | qDebug() << "setting actor to " << i << j << mapPositionToCoord(i, j); | ||
| 539 | actor->setPos(mapPositionToCoord(i, j)); | ||
| 540 | } | ||
| 541 | } | ||
| 542 | } | ||
| 543 | } | ||
| 544 | */ | ||
| 545 | |||
| 546 | Util::fillPoints(map); | 516 | Util::fillPoints(map); |
| 547 | 517 | ||
| 548 | /* save positions of blocks for later usage */ | 518 | /* save positions of blocks for later usage */ |
