From 6dc8b50817fe5da8550c245db755f7014402c62a Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 6 Apr 2011 14:32:09 +0200 Subject: some minor cleanup --- pacman-c++/mainwidget.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'pacman-c++/mainwidget.cpp') diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index 743b57e..e9b4cc3 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp @@ -11,21 +11,21 @@ MainWidget::MainWidget() setFocusPolicy(Qt::StrongFocus); QVBoxLayout *layout = new QVBoxLayout(this); - QHBoxLayout *m_scoreLayout = new QHBoxLayout(); - for (unsigned int i=1; i<4; ++i) { + for (unsigned int i = 1; i < 4; ++i) + { QGroupBox *scoreBoxI = new QGroupBox(QString("Spieler %1").arg(i), this); m_scoreLayout->addWidget(scoreBoxI); QGridLayout *playerLayout = new QGridLayout(); scoreBoxI->setLayout(playerLayout); - playerLayout->addWidget( new QLabel("Rundenpunkte:", this), 0, 0); - playerLayout->addWidget( new QLabel("Gesamtpunkte:", this), 1, 0); + playerLayout->addWidget(new QLabel("Rundenpunkte:", this), 0, 0); + playerLayout->addWidget(new QLabel("Gesamtpunkte:", this), 1, 0); - playerLayout->addWidget( new QLabel("", this), 0, 1); - playerLayout->addWidget( new QLabel("", this), 1, 1); + playerLayout->addWidget(new QLabel("", this), 0, 1); + playerLayout->addWidget(new QLabel("", this), 1, 1); m_playerScoreLayouts.append(playerLayout); } @@ -50,7 +50,7 @@ MainWidget::MainWidget() void MainWidget::updateScore() { - QMapIterator i(m_actors); + QMapIterator i(m_actors); while (i.hasNext()) { i.next(); int id = i.key() - 1; @@ -83,19 +83,21 @@ transmission::map_t createDummyMap() } } - map[4][3] |= green; - map[4][3] |= transmission::block; + map[0][0] |= Color::none ^ transmission::block; + map[0][1] |= Color::none ^ transmission::block; + map[0][2] |= Color::none ^ transmission::block; + map[1][0] |= Color::none ^ transmission::block; + map[2][0] |= Color::none ^ transmission::block; + + map[4][3] |= Color::green ^ transmission::block; - map[5][3] |= noColor; - map[5][3] |= transmission::block; - map[6][3] |= noColor; - map[6][3] |= transmission::block; - map[7][3] |= red; - map[7][3] |= transmission::block; + map[5][3] |= Color::none ^ transmission::block; + map[6][3] |= Color::none ^ transmission::block; + map[7][3] |= Color::red ^ transmission::block; map[7][5] |= transmission::bonuspoint; - map[5][5] |= blue; + map[5][5] |= Color::blue; map[5][5] |= transmission::pacman; map[5][5] |= transmission::direction_left; @@ -115,7 +117,7 @@ void MainWidget::loadDummyMap() continue; qDebug() << "not 0 at x=" << x << ", y=" << y << ", val=" << cur; - Color color = static_cast(cur & transmission::color_mask); + Color::Color color = static_cast(cur & transmission::color_mask); qDebug() << "col=" << color; PixmapItem *item = 0; -- cgit v1.2.3