From 5035ea3e5616578fc406998e7850c55e5f4d13a6 Mon Sep 17 00:00:00 2001 From: totycro Date: Wed, 6 Apr 2011 15:25:58 +0200 Subject: merge --- pacman-c++/mainwidget.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'pacman-c++/mainwidget.cpp') diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index fe1ba9c..bf049f2 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp @@ -39,17 +39,17 @@ Transmission::map_t createDummyMap() map[2][1] |= Color::none ^ Transmission::block; map[4][3] |= Color::green ^ 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] |= Color::blue; map[5][5] |= Transmission::pacman; map[5][5] |= Transmission::direction_left; - + return map; } @@ -63,7 +63,7 @@ MainWidget::MainWidget() void MainWidget::createGui() { setFocusPolicy(Qt::StrongFocus); - + QVBoxLayout *layout = new QVBoxLayout(this); QHBoxLayout *m_scoreLayout = new QHBoxLayout(); @@ -71,28 +71,28 @@ void MainWidget::createGui() { 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("", this), 0, 1); playerLayout->addWidget(new QLabel("", this), 1, 1); m_playerScoreLayouts.append(playerLayout); } - + m_scene = new QGraphicsScene(0, 0, Constants::map_size_pixel.width, Constants::map_size_pixel.height, this); m_scene->setBackgroundBrush(Qt::black); - + QGraphicsView *window = new QGraphicsView(m_scene, this); window->setFrameStyle(0); window->setAlignment(Qt::AlignLeft | Qt::AlignTop); //window->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); //window->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - + layout->addLayout(m_scoreLayout); layout->addWidget(window); @@ -119,7 +119,6 @@ void MainWidget::updateScore() } } - void MainWidget::updateMap(const Transmission::map_t& map) { for (unsigned int x = 0; x < Constants::map_size.width; ++x) @@ -130,7 +129,7 @@ void MainWidget::updateMap(const Transmission::map_t& map) if (cur == 0) continue; qDebug() << "not 0 at x=" << x << ", y=" << y << ", val=" << cur; - + Color::Color color = static_cast(cur & Transmission::color_mask); qDebug() << "col=" << color; @@ -240,6 +239,6 @@ void MainWidget::keyReleaseEvent(QKeyEvent* event) // current key got released // if this is false, a key got released which has already // been replaced by a different key, so this case is disregarded - currentKey = 0; + currentKey = 0; } } -- cgit v1.2.3