summaryrefslogtreecommitdiff
path: root/noncore/games/bounce/game.cpp
Unidiff
Diffstat (limited to 'noncore/games/bounce/game.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/bounce/game.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/noncore/games/bounce/game.cpp b/noncore/games/bounce/game.cpp
index 1f1f8cd..bbd3d0b 100644
--- a/noncore/games/bounce/game.cpp
+++ b/noncore/games/bounce/game.cpp
@@ -8,29 +8,36 @@
8 * 8 *
9 * This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public 14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the Free 15 * License along with this program; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */ 17 */
18 18
19 19
20#include <stdlib.h> 20#include "game.h"
21#include <qtimer.h> 21
22/* OPIE */
23#include <opie2/odebug.h>
22#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25using namespace Opie::Core;
23 26
24#include "game.h" 27/* QT */
28#include <qtimer.h>
29
30/* STD */
31#include <stdlib.h>
25 32
26#define TILE_SIZE 9 33#define TILE_SIZE 9
27 34
28#define TILE_FIRST ((FIELD_WIDTH-2)*(FIELD_HEIGHT-2)) 35#define TILE_FIRST ((FIELD_WIDTH-2)*(FIELD_HEIGHT-2))
29#define TILE_FREE (TILE_FIRST + 0) 36#define TILE_FREE (TILE_FIRST + 0)
30#define TILE_BORDER (TILE_FIRST + 1) 37#define TILE_BORDER (TILE_FIRST + 1)
31#define TILE_WALLEND (TILE_FIRST + 2) 38#define TILE_WALLEND (TILE_FIRST + 2)
32#define TILE_WALLUP (TILE_FIRST + 3) 39#define TILE_WALLUP (TILE_FIRST + 3)
33#define TILE_WALLDOWN (TILE_FIRST + 4) 40#define TILE_WALLDOWN (TILE_FIRST + 4)
34#define TILE_WALLLEFT (TILE_FIRST + 5) 41#define TILE_WALLLEFT (TILE_FIRST + 5)
35#define TILE_WALLRIGHT (TILE_FIRST + 6) 42#define TILE_WALLRIGHT (TILE_FIRST + 6)
36 43
@@ -358,25 +365,25 @@ JezzGame::JezzGame( int ballNum, QWidget *parent, const char *name )
358} 365}
359 366
360JezzGame::~JezzGame() 367JezzGame::~JezzGame()
361{ 368{
362 m_balls.clear(); 369 m_balls.clear();
363 delete m_view; 370 delete m_view;
364 delete m_field; 371 delete m_field;
365 delete m_ballPixmaps; 372 delete m_ballPixmaps;
366} 373}
367 374
368void JezzGame::display( QString text, int size ) 375void JezzGame::display( QString text, int size )
369{ 376{
370 qDebug("This function \"display\" shouldn't be called!!!"); 377 odebug << "This function \"display\" shouldn't be called!!!" << oendl;
371 if ( !text.isEmpty() ) 378 if ( !text.isEmpty() )
372 { 379 {
373 QFont font( "Helvetica", size, QFont::Bold ); 380 QFont font( "Helvetica", size, QFont::Bold );
374 font.setStyleHint( QFont::Helvetica ); 381 font.setStyleHint( QFont::Helvetica );
375 m_text->setFont( font ); 382 m_text->setFont( font );
376 m_text->setText( text ); 383 m_text->setText( text );
377 384
378 QRect size = m_text->boundingRect(); 385 QRect size = m_text->boundingRect();
379 m_text->move( ( FIELD_WIDTH*TILE_SIZE - size.width() ) / 2, 386 m_text->move( ( FIELD_WIDTH*TILE_SIZE - size.width() ) / 2,
380 ( FIELD_HEIGHT*TILE_SIZE - size.height() ) / 2 ); 387 ( FIELD_HEIGHT*TILE_SIZE - size.height() ) / 2 );
381 388
382 m_text->show(); 389 m_text->show();