diff options
| author | manuel <manuel@mausz.at> | 2011-04-05 01:29:33 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-05 01:29:33 +0200 |
| commit | 4232f8450d896068713d988cf5541835c3818682 (patch) | |
| tree | 470916a3e1978419d41115eb1e87a0928769e03c /pacman-c++/block.cpp | |
| parent | 3dba415cd9741874cdaf0781d7e725808c8a2b8d (diff) | |
| download | foop-4232f8450d896068713d988cf5541835c3818682.tar.gz foop-4232f8450d896068713d988cf5541835c3818682.tar.bz2 foop-4232f8450d896068713d988cf5541835c3818682.zip | |
- we love ogg, we hate mp3/wav
- a lot of coding style/intent fix
- add constant.h to pro files
Diffstat (limited to 'pacman-c++/block.cpp')
| -rw-r--r-- | pacman-c++/block.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pacman-c++/block.cpp b/pacman-c++/block.cpp index 9d57578..6383b3a 100644 --- a/pacman-c++/block.cpp +++ b/pacman-c++/block.cpp | |||
| @@ -1,18 +1,17 @@ | |||
| 1 | #include "block.h" | 1 | #include "block.h" |
| 2 | |||
| 3 | #include <QtGui> | ||
| 4 | |||
| 5 | #include "constants.h" | 2 | #include "constants.h" |
| 3 | #include <QtGui> | ||
| 6 | 4 | ||
| 7 | std::map<Color, QPixmap> Block::m_pixmaps; | 5 | std::map<Color, QPixmap> Block::m_pixmaps; |
| 8 | 6 | ||
| 9 | Block::Block(Color color, QGraphicsItem *parent) | 7 | Block::Block(Color color, QGraphicsItem *parent) |
| 10 | : PixmapItem(parent) | 8 | : PixmapItem(parent) |
| 11 | { | 9 | { |
| 12 | if (m_pixmaps.find(color) == m_pixmaps.end()) { | 10 | if (m_pixmaps.find(color) == m_pixmaps.end()) |
| 11 | { | ||
| 13 | QString pixmapName = ":/" + QString("block%1").arg(color); | 12 | QString pixmapName = ":/" + QString("block%1").arg(color); |
| 14 | m_pixmaps[color] = QPixmap( pixmapName ); | 13 | m_pixmaps[color] = QPixmap(pixmapName); |
| 15 | } | 14 | } |
| 16 | setPixmap( m_pixmaps.find(color)->second ); | 15 | setPixmap(m_pixmaps.find(color)->second); |
| 17 | qDebug() << "loading block w color: " << color; | 16 | qDebug() << "loading block w color: " << color; |
| 18 | } | 17 | } |
