summaryrefslogtreecommitdiffstats
path: root/pacman-c++/sceneholder.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-12 14:45:24 +0200
committermanuel <manuel@mausz.at>2011-04-12 14:45:24 +0200
commitdbeba838ea813b620ec571265c8ea417403fc81c (patch)
treecf085b766ba8dad8146190dc7f438160b839feb4 /pacman-c++/sceneholder.h
parentb695f67ef718724144a3a5c4be42be373b0f691f (diff)
downloadfoop-dbeba838ea813b620ec571265c8ea417403fc81c.tar.gz
foop-dbeba838ea813b620ec571265c8ea417403fc81c.tar.bz2
foop-dbeba838ea813b620ec571265c8ea417403fc81c.zip
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
Diffstat (limited to 'pacman-c++/sceneholder.h')
-rw-r--r--pacman-c++/sceneholder.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/pacman-c++/sceneholder.h b/pacman-c++/sceneholder.h
index ccb2a42..61cff3e 100644
--- a/pacman-c++/sceneholder.h
+++ b/pacman-c++/sceneholder.h
@@ -1,30 +1,30 @@
1#ifndef SCENEHOLDER_H 1#ifndef SCENEHOLDER_H
2#define SCENEHOLDER_H 2#define SCENEHOLDER_H
3 3
4#include <QtGui>
5
6#include "constants.h" 4#include "constants.h"
5#include <QtGui>
7 6
8class PixmapItem; 7class PixmapItem;
9class Actor; 8class Actor;
10 9
11class SceneHolder 10class SceneHolder
12 : public QWidget 11 : public QGraphicsScene
13{ 12{
14 Q_OBJECT 13 Q_OBJECT
15 14
16public: 15public:
17 SceneHolder(QWidget* parent = 0); 16 SceneHolder(QObject *parent = 0);
18 virtual ~SceneHolder() 17 virtual ~SceneHolder()
19 {}; 18 {};
20 unsigned int pointsLeft(); 19 unsigned int pointsLeft();
20 void updateMap(const Transmission::map_t& map);
21 void setColor(Color::Color color = Color::none);
22 Color::Color color();
21 23
22private slots: 24private slots:
23 void decrementPoints(); 25 void decrementPoints();
24 26
25protected: 27protected:
26 virtual void updateMap(const Transmission::map_t& map);
27
28 /* data conversion */ 28 /* data conversion */
29 QPoint mapPositionToCoord(unsigned int x, unsigned int y); 29 QPoint mapPositionToCoord(unsigned int x, unsigned int y);
30 QPoint mapPositionToCoord(QPoint point); 30 QPoint mapPositionToCoord(QPoint point);
@@ -42,8 +42,6 @@ protected:
42 42
43 /* points left before round ends */ 43 /* points left before round ends */
44 unsigned int m_pointsLeft; 44 unsigned int m_pointsLeft;
45
46 QGraphicsScene *m_scene;
47}; 45};
48 46
49#endif // SCENEHOLDER_H 47#endif // SCENEHOLDER_H