diff options
| author | manuel <manuel@mausz.at> | 2011-04-12 14:45:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-12 14:45:24 +0200 |
| commit | dbeba838ea813b620ec571265c8ea417403fc81c (patch) | |
| tree | cf085b766ba8dad8146190dc7f438160b839feb4 /pacman-c++/sceneholder.h | |
| parent | b695f67ef718724144a3a5c4be42be373b0f691f (diff) | |
| download | foop-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.h | 14 |
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 | ||
| 8 | class PixmapItem; | 7 | class PixmapItem; |
| 9 | class Actor; | 8 | class Actor; |
| 10 | 9 | ||
| 11 | class SceneHolder | 10 | class SceneHolder |
| 12 | : public QWidget | 11 | : public QGraphicsScene |
| 13 | { | 12 | { |
| 14 | Q_OBJECT | 13 | Q_OBJECT |
| 15 | 14 | ||
| 16 | public: | 15 | public: |
| 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 | ||
| 22 | private slots: | 24 | private slots: |
| 23 | void decrementPoints(); | 25 | void decrementPoints(); |
| 24 | 26 | ||
| 25 | protected: | 27 | protected: |
| 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 |
