summaryrefslogtreecommitdiff
path: root/noncore/games/bounce/game.cpp
authoralwin <alwin>2004-03-02 12:21:11 (UTC)
committer alwin <alwin>2004-03-02 12:21:11 (UTC)
commitb6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (side-by-side diff)
treed3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/games/bounce/game.cpp
parent0d59c780513da78033f4d9040475dee9db0256d4 (diff)
downloadopie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/games/bounce/game.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/bounce/game.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/games/bounce/game.cpp b/noncore/games/bounce/game.cpp
index c07f453..1f1f8cd 100644
--- a/noncore/games/bounce/game.cpp
+++ b/noncore/games/bounce/game.cpp
@@ -300,55 +300,55 @@ JezzGame::JezzGame( int ballNum, QWidget *parent, const char *name )
m_ballPixmaps->image(n)->setOffset( 0, 0 );
m_arrowPixmaps = new QCanvasPixmapArray( path + "arrow%1.png", 2 );
for ( unsigned n=0; n < m_arrowPixmaps->count(); n++ )
m_arrowPixmaps->image(n)->setOffset( 0, 0 );
QPixmap tiles( path + "tiles.png" );
// create field
m_field = new JezzField( tiles, this, "m_field" );
m_field->resize( TILE_SIZE*FIELD_WIDTH, TILE_SIZE*FIELD_HEIGHT );
for ( int x=0; x<FIELD_WIDTH; x++ )
m_field->setTile( x, 0, TILE_BORDER );
for ( int y=1; y<FIELD_HEIGHT-1; y++ )
{
m_field->setTile( 0, y, TILE_BORDER );
for ( int x=1; x<FIELD_WIDTH-1; x++ )
m_field->setTile( x, y, TILE_FREE );
m_field->setTile( FIELD_WIDTH-1, y, TILE_BORDER );
}
for ( int x=0; x<FIELD_WIDTH; x++ )
m_field->setTile( x, FIELD_HEIGHT-1, TILE_BORDER );
- connect( m_field, SIGNAL(ballCollision(Ball *, int, int, int)), this, SLOT(ballCollision(Ball *, int, int, int)) );
+ connect( m_field, SIGNAL(ballCollision(Ball*,int,int,int)), this, SLOT(ballCollision(Ball*,int,int,int)) );
// create view
m_view = new JezzView( m_field, this, "m_view" );
m_view->move( 0, 0 );
m_view->adjustSize();
- connect( m_view, SIGNAL(buildWall(int, int, bool)), this, SLOT(buildWall(int, int, bool)) );
+ connect( m_view, SIGNAL(buildWall(int,int,bool)), this, SLOT(buildWall(int,int,bool)) );
// create balls
for ( int n=0; n<ballNum; n++ )
{
Ball *ball = new Ball( m_ballPixmaps, m_field );
m_balls.append( ball );
ball->setVelocity( ((rand() & 1)*2-1)*2, ((rand() & 1)*2-1)*2 );
ball->setFrame( rand() % 25 );
ball->move( 4*TILE_SIZE + ( rand() - 50 ) % ( (FIELD_WIDTH-8)*TILE_SIZE ),
4*TILE_SIZE + rand() % ( (FIELD_HEIGHT-8)*TILE_SIZE ) );
ball->show();
}
// create arrow
arrow = new Arrow( m_arrowPixmaps, m_field );
arrow->show();
// create text label
m_text = new QCanvasText( m_field );
// create game clock
m_clock = new QTimer( this );
connect( m_clock, SIGNAL(timeout()), this, SLOT(tick()) );
m_clock->start( GAME_DELAY );
@@ -504,59 +504,59 @@ void JezzGame::ballCollision( Ball*, int, int, int tile )
}
void JezzGame::buildWall( int x, int y, bool vertical )
{
if ( !m_running ) return;
if ( m_field->tile(x, y)==TILE_FREE )
{
// check whether there is a ball at the moment
QCanvasItemList cols = m_field->collisions( QRect(x*TILE_SIZE, y*TILE_SIZE, TILE_SIZE, TILE_SIZE) );
if ( cols.count()>0 )
{
//kdDebug() << "Direct collision" << endl;
emit ballCollision( (Ball*)cols.first(), x, y, TILE_WALLUP );
return;
}
// start walls
if ( !m_wall1 )
{
m_wall1 = new Wall( m_field, x, y,
vertical? Wall::Up : Wall::Left,
vertical? TILE_WALLUP : TILE_WALLLEFT,
this, "m_wall1" );
- connect( m_wall1, SIGNAL(finished(Wall *, int)),
- this, SLOT(wallFinished(Wall *, int)) ); }
+ connect( m_wall1, SIGNAL(finished(Wall*,int)),
+ this, SLOT(wallFinished(Wall*,int)) ); }
if ( !m_wall2 )
{
m_wall2 = new Wall( m_field, x, y,
vertical? Wall::Down: Wall::Right,
vertical? TILE_WALLDOWN : TILE_WALLRIGHT,
this, "m_wall2" );
- connect( m_wall2, SIGNAL(finished(Wall *, int)),
- this, SLOT(wallFinished(Wall *, int)) );
+ connect( m_wall2, SIGNAL(finished(Wall*,int)),
+ this, SLOT(wallFinished(Wall*,int)) );
}
}
}
void JezzGame::wallFinished( Wall *wall, int tile )
{
if ( tile==TILE_WALLEND )
{
if ( m_wall1 )
{
m_wall1->fill( false );
delete m_wall1;
m_wall1 = 0;
}
if ( m_wall2 )
{
m_wall2->fill( false );
delete m_wall2;
m_wall2 = 0;
}
} else
{
if ( m_wall1==wall && m_wall1 )