summaryrefslogtreecommitdiff
path: root/noncore/games/bounce
authorzecke <zecke>2004-09-10 11:14:02 (UTC)
committer zecke <zecke>2004-09-10 11:14:02 (UTC)
commitb8baf551919868737c6f56a05e6efa1bad4d97ac (patch) (unidiff)
tree402c587e55356aff7f13990e1efcf57775bb9670 /noncore/games/bounce
parent046bff8abb6727f5522748a2dc8a259d27b5979b (diff)
downloadopie-b8baf551919868737c6f56a05e6efa1bad4d97ac.zip
opie-b8baf551919868737c6f56a05e6efa1bad4d97ac.tar.gz
opie-b8baf551919868737c6f56a05e6efa1bad4d97ac.tar.bz2
Remove unused parameter
Diffstat (limited to 'noncore/games/bounce') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/bounce/game.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/noncore/games/bounce/game.cpp b/noncore/games/bounce/game.cpp
index bbd3d0b..5ef9f15 100644
--- a/noncore/games/bounce/game.cpp
+++ b/noncore/games/bounce/game.cpp
@@ -27,13 +27,13 @@ using namespace Opie::Core;
27/* QT */ 27/* QT */
28#include <qtimer.h> 28#include <qtimer.h>
29 29
30/* STD */ 30/* STD */
31#include <stdlib.h> 31#include <stdlib.h>
32 32
33#define TILE_SIZE 9 33#define TILE_SIZE 9
34 34
35#define TILE_FIRST ((FIELD_WIDTH-2)*(FIELD_HEIGHT-2)) 35#define TILE_FIRST ((FIELD_WIDTH-2)*(FIELD_HEIGHT-2))
36#define TILE_FREE (TILE_FIRST + 0) 36#define TILE_FREE (TILE_FIRST + 0)
37#define TILE_BORDER (TILE_FIRST + 1) 37#define TILE_BORDER (TILE_FIRST + 1)
38#define TILE_WALLEND (TILE_FIRST + 2) 38#define TILE_WALLEND (TILE_FIRST + 2)
39#define TILE_WALLUP (TILE_FIRST + 3) 39#define TILE_WALLUP (TILE_FIRST + 3)
@@ -64,13 +64,13 @@ void Arrow::update()
64 64
65void Arrow::changeDirection() 65void Arrow::changeDirection()
66{ 66{
67 m_vertical = ! m_vertical; 67 m_vertical = ! m_vertical;
68 update(); 68 update();
69} 69}
70 70
71 71
72Ball::Ball(QCanvasPixmapArray* array, QCanvas* canvas) 72Ball::Ball(QCanvasPixmapArray* array, QCanvas* canvas)
73 : QCanvasSprite( array, canvas ), m_animDelay( 0 ), m_soundDelay( MS2TICKS(BALL_ANIM_DELAY)/2 ) 73 : QCanvasSprite( array, canvas ), m_animDelay( 0 ), m_soundDelay( MS2TICKS(BALL_ANIM_DELAY)/2 )
74{ 74{
75} 75}
76 76
@@ -97,13 +97,13 @@ void Ball::advance(int stage)
97 if ( collide(xVelocity(), 0) ) reflectX = true; 97 if ( collide(xVelocity(), 0) ) reflectX = true;
98 if ( collide(0, yVelocity()) ) reflectY = true; 98 if ( collide(0, yVelocity()) ) reflectY = true;
99 if ( !reflectX && !reflectY && collide(xVelocity(), yVelocity()) ) reflectX = reflectY = true; 99 if ( !reflectX && !reflectY && collide(xVelocity(), yVelocity()) ) reflectX = reflectY = true;
100 100
101 // emit collision 101 // emit collision
102 QRect r = boundingRect(); 102 QRect r = boundingRect();
103 r.moveBy( xVelocity(), yVelocity() ); 103 r.moveBy( static_cast<int>(xVelocity()), static_cast<int>( yVelocity() ) );
104 JezzField* field = (JezzField *)canvas(); 104 JezzField* field = (JezzField *)canvas();
105 105
106 int ul = field->tile( r.left() / TILE_SIZE, r.top() / TILE_SIZE ); 106 int ul = field->tile( r.left() / TILE_SIZE, r.top() / TILE_SIZE );
107 int ur = field->tile( r.right() / TILE_SIZE, r.top() / TILE_SIZE ); 107 int ur = field->tile( r.right() / TILE_SIZE, r.top() / TILE_SIZE );
108 int bl = field->tile( r.left() / TILE_SIZE, r.bottom() / TILE_SIZE ); 108 int bl = field->tile( r.left() / TILE_SIZE, r.bottom() / TILE_SIZE );
109 int br = field->tile( r.right() / TILE_SIZE, r.bottom() / TILE_SIZE ); 109 int br = field->tile( r.right() / TILE_SIZE, r.bottom() / TILE_SIZE );
@@ -122,13 +122,13 @@ void Ball::advance(int stage)
122 QCanvasSprite::advance( stage ); 122 QCanvasSprite::advance( stage );
123} 123}
124 124
125bool Ball::collide( double dx, double dy ) 125bool Ball::collide( double dx, double dy )
126{ 126{
127 QRect r = boundingRect(); 127 QRect r = boundingRect();
128 r.moveBy( dx, dy ); 128 r.moveBy( static_cast<int>( dx ), static_cast<int>( dy ) );
129 JezzField* field = (JezzField *)canvas(); 129 JezzField* field = (JezzField *)canvas();
130 130
131 int ul = field->tile( r.left() / TILE_SIZE, r.top() / TILE_SIZE ); 131 int ul = field->tile( r.left() / TILE_SIZE, r.top() / TILE_SIZE );
132 int ur = field->tile( r.right() / TILE_SIZE, r.top() / TILE_SIZE ); 132 int ur = field->tile( r.right() / TILE_SIZE, r.top() / TILE_SIZE );
133 int bl = field->tile( r.left() / TILE_SIZE, r.bottom() / TILE_SIZE ); 133 int bl = field->tile( r.left() / TILE_SIZE, r.bottom() / TILE_SIZE );
134 int br = field->tile( r.right() / TILE_SIZE, r.bottom() / TILE_SIZE ); 134 int br = field->tile( r.right() / TILE_SIZE, r.bottom() / TILE_SIZE );
@@ -296,13 +296,13 @@ void JezzView::changeCursor()
296/*************************************************************************/ 296/*************************************************************************/
297 297
298JezzGame::JezzGame( int ballNum, QWidget *parent, const char *name ) 298JezzGame::JezzGame( int ballNum, QWidget *parent, const char *name )
299 : QWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ), 299 : QWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ),
300 m_text( 0 ), m_running( false ), m_percent( 0 ), m_pictured( false ) 300 m_text( 0 ), m_running( false ), m_percent( 0 ), m_pictured( false )
301{ 301{
302 QString path = QPEApplication::qpeDir()+"pics/bounce/"; 302 QString path = QPEApplication::qpeDir()+"pics/bounce/";
303 303
304 // load gfx 304 // load gfx
305 m_ballPixmaps = new QCanvasPixmapArray( path + "ball%1.png", 25 ); 305 m_ballPixmaps = new QCanvasPixmapArray( path + "ball%1.png", 25 );
306 for ( unsigned n=0; n < m_ballPixmaps->count(); n++ ) 306 for ( unsigned n=0; n < m_ballPixmaps->count(); n++ )
307 m_ballPixmaps->image(n)->setOffset( 0, 0 ); 307 m_ballPixmaps->image(n)->setOffset( 0, 0 );
308 308
@@ -344,13 +344,13 @@ JezzGame::JezzGame( int ballNum, QWidget *parent, const char *name )
344 ball->setVelocity( ((rand() & 1)*2-1)*2, ((rand() & 1)*2-1)*2 ); 344 ball->setVelocity( ((rand() & 1)*2-1)*2, ((rand() & 1)*2-1)*2 );
345 ball->setFrame( rand() % 25 ); 345 ball->setFrame( rand() % 25 );
346 ball->move( 4*TILE_SIZE + ( rand() - 50 ) % ( (FIELD_WIDTH-8)*TILE_SIZE ), 346 ball->move( 4*TILE_SIZE + ( rand() - 50 ) % ( (FIELD_WIDTH-8)*TILE_SIZE ),
347 4*TILE_SIZE + rand() % ( (FIELD_HEIGHT-8)*TILE_SIZE ) ); 347 4*TILE_SIZE + rand() % ( (FIELD_HEIGHT-8)*TILE_SIZE ) );
348 ball->show(); 348 ball->show();
349 } 349 }
350 350
351 // create arrow 351 // create arrow
352 arrow = new Arrow( m_arrowPixmaps, m_field ); 352 arrow = new Arrow( m_arrowPixmaps, m_field );
353 arrow->show(); 353 arrow->show();
354 354
355 // create text label 355 // create text label
356 m_text = new QCanvasText( m_field ); 356 m_text = new QCanvasText( m_field );
@@ -371,13 +371,13 @@ JezzGame::~JezzGame()
371 delete m_field; 371 delete m_field;
372 delete m_ballPixmaps; 372 delete m_ballPixmaps;
373} 373}
374 374
375void JezzGame::display( QString text, int size ) 375void JezzGame::display( QString text, int size )
376{ 376{
377 odebug << "This function \"display\" shouldn't be called!!!" << oendl; 377 odebug << "This function \"display\" shouldn't be called!!!" << oendl;
378 if ( !text.isEmpty() ) 378 if ( !text.isEmpty() )
379 { 379 {
380 QFont font( "Helvetica", size, QFont::Bold ); 380 QFont font( "Helvetica", size, QFont::Bold );
381 font.setStyleHint( QFont::Helvetica ); 381 font.setStyleHint( QFont::Helvetica );
382 m_text->setFont( font ); 382 m_text->setFont( font );
383 m_text->setText( text ); 383 m_text->setText( text );
@@ -410,13 +410,14 @@ void JezzGame::makeBlack()
410 for ( int y=0; y<FIELD_HEIGHT; y++ ) 410 for ( int y=0; y<FIELD_HEIGHT; y++ )
411 for ( int x=0; x<FIELD_WIDTH; x++ ) 411 for ( int x=0; x<FIELD_WIDTH; x++ )
412 m_buf[x][y] = m_field->tile( x, y ); 412 m_buf[x][y] = m_field->tile( x, y );
413 413
414 // fill areas that contains a ball 414 // fill areas that contains a ball
415 for ( Ball *ball=m_balls.first(); ball!=0; ball=m_balls.next() ) 415 for ( Ball *ball=m_balls.first(); ball!=0; ball=m_balls.next() )
416 fill( ball->x()/TILE_SIZE, ball->y()/TILE_SIZE ); 416 fill( static_cast<int>( ball->x()/TILE_SIZE ),
417 static_cast<int>( ball->y()/TILE_SIZE ) );
417 418
418 // areas still free can be blacked now 419 // areas still free can be blacked now
419 for ( int y=0; y<FIELD_HEIGHT; y++ ) 420 for ( int y=0; y<FIELD_HEIGHT; y++ )
420 for ( int x=0; x<FIELD_WIDTH; x++ ) 421 for ( int x=0; x<FIELD_WIDTH; x++ )
421 { 422 {
422 if ( m_buf[x][y]==TILE_FREE ) 423 if ( m_buf[x][y]==TILE_FREE )