diff options
| author | manuel <manuel@mausz.at> | 2011-04-12 21:53:36 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-12 21:53:36 +0200 |
| commit | c910e2267d3af30f10b9c659b2d9f9349c596e0d (patch) | |
| tree | c6b531b4d70faa0d88b0f86e81180f30e99b3060 /pacman-c++/actor.cpp | |
| parent | cfbd1b80e7e1f89861c96e6d802a3fe11df00929 (diff) | |
| download | foop-c910e2267d3af30f10b9c659b2d9f9349c596e0d.tar.gz foop-c910e2267d3af30f10b9c659b2d9f9349c596e0d.tar.bz2 foop-c910e2267d3af30f10b9c659b2d9f9349c596e0d.zip | |
remove animationmanager (for now?)
Diffstat (limited to 'pacman-c++/actor.cpp')
| -rw-r--r-- | pacman-c++/actor.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp index 7b77851..6ca981c 100644 --- a/pacman-c++/actor.cpp +++ b/pacman-c++/actor.cpp | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include "actor.h" | 1 | #include "actor.h" |
| 2 | #include "animationmanager.h" | ||
| 3 | #include <QtCore/QPropertyAnimation> | 2 | #include <QtCore/QPropertyAnimation> |
| 4 | #include <QtCore/QVariantAnimation> | 3 | #include <QtCore/QVariantAnimation> |
| 5 | #include <QDebug> | 4 | #include <QDebug> |
| @@ -122,7 +121,7 @@ void Actor::move(Actor::Movement direction) | |||
| 122 | if (Constants::server) | 121 | if (Constants::server) |
| 123 | return moveByServer(direction); | 122 | return moveByServer(direction); |
| 124 | 123 | ||
| 125 | /* stop current animation */ | 124 | /* stop current animation if direction changed */ |
| 126 | if (direction != m_direction) | 125 | if (direction != m_direction) |
| 127 | { | 126 | { |
| 128 | /* hide all pictures */ | 127 | /* hide all pictures */ |
| @@ -130,10 +129,7 @@ void Actor::move(Actor::Movement direction) | |||
| 130 | m_images.at(i)->setVisible(false); | 129 | m_images.at(i)->setVisible(false); |
| 131 | 130 | ||
| 132 | if (m_eating[m_direction] != NULL) | 131 | if (m_eating[m_direction] != NULL) |
| 133 | { | ||
| 134 | m_eating[m_direction]->stop(); | 132 | m_eating[m_direction]->stop(); |
| 135 | //AnimationManager::self()->unregisterAnimation(m_eating[m_direction]); | ||
| 136 | } | ||
| 137 | } | 133 | } |
| 138 | 134 | ||
| 139 | QPointF endpos(0, 0); | 135 | QPointF endpos(0, 0); |
| @@ -165,7 +161,7 @@ void Actor::move(Actor::Movement direction) | |||
| 165 | } | 161 | } |
| 166 | setPos(pos() + endpos); | 162 | setPos(pos() + endpos); |
| 167 | 163 | ||
| 168 | /* start new animation */ | 164 | /* start new animation if direction changed */ |
| 169 | if (direction != m_direction) | 165 | if (direction != m_direction) |
| 170 | { | 166 | { |
| 171 | if (direction == Actor::None) | 167 | if (direction == Actor::None) |
| @@ -174,24 +170,9 @@ void Actor::move(Actor::Movement direction) | |||
| 174 | m_eating[direction]->start(); | 170 | m_eating[direction]->start(); |
| 175 | } | 171 | } |
| 176 | 172 | ||
| 173 | /* start moving animation */ | ||
| 177 | if (direction != Actor::None) | 174 | if (direction != Actor::None) |
| 178 | { | ||
| 179 | //if (m_local && m_player->isWorking() && m_player->state() != Phonon::PlayingState) | ||
| 180 | // m_player->play(); | ||
| 181 | m_moving->start(); | 175 | m_moving->start(); |
| 182 | } | ||
| 183 | else if (direction != m_direction) | ||
| 184 | { | ||
| 185 | //if (m_local && m_player->isWorking() && m_player->state() != Phonon::PausedState) | ||
| 186 | // m_player->pause(); | ||
| 187 | } | ||
| 188 | |||
| 189 | if (direction == Actor::None) | ||
| 190 | { | ||
| 191 | //TODO | ||
| 192 | qDebug() << "pause"; | ||
| 193 | //m_wakaPlayer->pause(); | ||
| 194 | } | ||
| 195 | 176 | ||
| 196 | m_direction = direction; | 177 | m_direction = direction; |
| 197 | } | 178 | } |
