diff options
Diffstat (limited to 'pacman-c++/actor.cpp')
| -rw-r--r-- | pacman-c++/actor.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp index bb062ea..baf6dca 100644 --- a/pacman-c++/actor.cpp +++ b/pacman-c++/actor.cpp | |||
| @@ -13,7 +13,6 @@ Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent) | |||
| 13 | : PixmapItem(parent), m_color(color), m_direction(Actor::None), m_local(local), | 13 | : PixmapItem(parent), m_color(color), m_direction(Actor::None), m_local(local), |
| 14 | m_player(NULL), m_roundPoints(0), m_gamePoints(0) | 14 | m_player(NULL), m_roundPoints(0), m_gamePoints(0) |
| 15 | { | 15 | { |
| 16 | m_pix = ":/" + QString("actor%1").arg((m_color >> 1) + 1); | ||
| 17 | /* DON'T set any pixmap here. we've a pixmap in the animation | 16 | /* DON'T set any pixmap here. we've a pixmap in the animation |
| 18 | * but we need a sprite for the collision detection | 17 | * but we need a sprite for the collision detection |
| 19 | */ | 18 | */ |
| @@ -21,6 +20,13 @@ Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent) | |||
| 21 | /* higher player "over" lower player */ | 20 | /* higher player "over" lower player */ |
| 22 | setZValue(m_color * 10); | 21 | setZValue(m_color * 10); |
| 23 | 22 | ||
| 23 | /* rest of the ctor is only for clients */ | ||
| 24 | if (Constants::server) | ||
| 25 | return; | ||
| 26 | |||
| 27 | /* our actor pixmap. created after server part */ | ||
| 28 | m_pix = ":/" + QString("actor%1").arg((m_color >> 1) + 1); | ||
| 29 | |||
| 24 | /* setup icon for player */ | 30 | /* setup icon for player */ |
| 25 | m_icon.setPixmap(m_pix); | 31 | m_icon.setPixmap(m_pix); |
| 26 | m_icon.setSprite(Constants::sprite_margin, Constants::sprite_margin, Constants::field_size.width, Constants::field_size.height); | 32 | m_icon.setSprite(Constants::sprite_margin, Constants::sprite_margin, Constants::field_size.width, Constants::field_size.height); |
