From dbeba838ea813b620ec571265c8ea417403fc81c Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 12 Apr 2011 14:45:24 +0200 Subject: make the server a non gui application this required a lot of reorganization: - don't create ANY pixmaps. that requires QtGui - don't create and QtWidgets - thus SceneHolder is now a QGraphisScene itself - and MainWidgets is a QWidget having SceneHolder as member variable --- pacman-c++/actor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pacman-c++/actor.cpp') 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) : PixmapItem(parent), m_color(color), m_direction(Actor::None), m_local(local), m_player(NULL), m_roundPoints(0), m_gamePoints(0) { - m_pix = ":/" + QString("actor%1").arg((m_color >> 1) + 1); /* DON'T set any pixmap here. we've a pixmap in the animation * but we need a sprite for the collision detection */ @@ -21,6 +20,13 @@ Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent) /* higher player "over" lower player */ setZValue(m_color * 10); + /* rest of the ctor is only for clients */ + if (Constants::server) + return; + + /* our actor pixmap. created after server part */ + m_pix = ":/" + QString("actor%1").arg((m_color >> 1) + 1); + /* setup icon for player */ m_icon.setPixmap(m_pix); m_icon.setSprite(Constants::sprite_margin, Constants::sprite_margin, Constants::field_size.width, Constants::field_size.height); -- cgit v1.2.3