summaryrefslogtreecommitdiffstats
path: root/kbounce/game.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
commit838baf3f99ec5ab81b063eb5449a3381d860f377 (patch)
treedd31abcfde08ca92e4623b8f50b3d762a87c997a /kbounce/game.cpp
parent2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff)
downloadtdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz
tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbounce/game.cpp')
-rw-r--r--kbounce/game.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/kbounce/game.cpp b/kbounce/game.cpp
index 0c5f1e2d..84cfae2f 100644
--- a/kbounce/game.cpp
+++ b/kbounce/game.cpp
@@ -136,8 +136,8 @@ bool Ball::collide( double dx, double dy )
/*************************************************************************/
-Wall::Wall( JezzField *field, int x, int y, Direction dir, int tile, TQObject *parent, const char *name )
- : TQObject( parent, name ), m_dir( dir ), m_field( field ), m_startX( x ), m_startY( y ),
+Wall::Wall( JezzField *field, int x, int y, Direction dir, int tile, TQObject *tqparent, const char *name )
+ : TQObject( tqparent, name ), m_dir( dir ), m_field( field ), m_startX( x ), m_startY( y ),
m_tile( tile ), m_delay( MS2TICKS(WALL_DELAY)/2 ), m_active( true )
{
//kdDebug(12008) << "Wall::Wall" << endl;
@@ -236,8 +236,8 @@ void Wall::fill( bool black )
/*************************************************************************/
-JezzField::JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent, const char* name )
- : TQCanvas( parent, name ), m_tiles( tiles )
+JezzField::JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* tqparent, const char* name )
+ : TQCanvas( tqparent, name ), m_tiles( tiles )
{
setPixmaps( tiles, background );
}
@@ -314,8 +314,8 @@ void JezzField::setPixmaps( const TQPixmap &tiles, const TQPixmap &background )
/*************************************************************************/
-JezzView::JezzView(TQCanvas* viewing, TQWidget* parent, const char* name, WFlags f)
- : TQCanvasView( viewing, parent, name, f ), m_vertical( false )
+JezzView::JezzView(TQCanvas* viewing, TQWidget* tqparent, const char* name, WFlags f)
+ : TQCanvasView( viewing, tqparent, name, f ), m_vertical( false )
{
setResizePolicy( AutoOne );
setHScrollBarMode( AlwaysOff );
@@ -326,13 +326,13 @@ JezzView::JezzView(TQCanvas* viewing, TQWidget* parent, const char* name, WFlags
void JezzView::viewportMouseReleaseEvent( TQMouseEvent *ev )
{
- if ( ev->button() & RightButton )
+ if ( ev->button() & Qt::RightButton )
{
m_vertical = !m_vertical;
if ( m_vertical ) setCursor( sizeVerCursor ); else setCursor( sizeHorCursor );
}
- if ( ev->button() & LeftButton )
+ if ( ev->button() & Qt::LeftButton )
{
emit buildWall( ev->x()/TILE_SIZE, ev->y()/TILE_SIZE, m_vertical );
}
@@ -340,8 +340,8 @@ void JezzView::viewportMouseReleaseEvent( TQMouseEvent *ev )
/*************************************************************************/
-JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, const char *name )
- : TQWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ),
+JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name ), m_wall1( 0 ), m_wall2( 0 ),
m_text( 0 ), m_running( false ), m_percent( 0 ), m_pictured( false )
{
TQString path = kapp->dirs()->findResourceDir( "data", "kbounce/pics/ball0000.png" ) + "kbounce/pics/";
@@ -363,7 +363,7 @@ JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, c
"kbounce/sounds/";
// create field
- m_field = new JezzField( tiles, background, this, "m_field" );
+ m_field = new JezzField( tiles, background, TQT_TQOBJECT(this), "m_field" );
m_field->resize( TILE_SIZE*FIELD_WIDTH, TILE_SIZE*FIELD_HEIGHT );
for ( int x=0; x<FIELD_WIDTH; x++ )
@@ -406,7 +406,7 @@ JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, c
connect( m_clock, TQT_SIGNAL(timeout()), this, TQT_SLOT(tick()) );
m_clock->start( GAME_DELAY );
- // setup geometry
+ // setup tqgeometry
setFixedSize( m_view->size() );
}
@@ -500,7 +500,7 @@ void JezzGame::makeBlack()
}
m_field->update();
- m_view->repaint();
+ m_view->tqrepaint();
// count percent value of occupied area
int p = percent();
@@ -586,7 +586,7 @@ void JezzGame::ballCollision( Ball */*ball*/, int /*x*/, int /*y*/, int tile )
// update view
m_field->update();
- m_view->repaint();
+ m_view->tqrepaint();
// send death msg
emit died();
@@ -617,7 +617,7 @@ void JezzGame::buildWall( int x, int y, bool vertical )
m_wall1 = new Wall( m_field, x, y,
vertical? Wall::Up : Wall::Left,
vertical? TILE_WALLUP : TILE_WALLLEFT,
- this, "m_wall1" );
+ TQT_TQOBJECT(this), "m_wall1" );
connect( m_wall1, TQT_SIGNAL(finished(Wall *, int)),
this, TQT_SLOT(wallFinished(Wall *, int)) ); }
@@ -626,7 +626,7 @@ void JezzGame::buildWall( int x, int y, bool vertical )
m_wall2 = new Wall( m_field, x, y,
vertical? Wall::Down: Wall::Right,
vertical? TILE_WALLDOWN : TILE_WALLRIGHT,
- this, "m_wall2" );
+ TQT_TQOBJECT(this), "m_wall2" );
connect( m_wall2, TQT_SIGNAL(finished(Wall *, int)),
this, TQT_SLOT(wallFinished(Wall *, int)) );
}
@@ -671,7 +671,7 @@ void JezzGame::wallFinished( Wall *wall, int tile )
}
m_field->update();
- m_view->repaint();
+ m_view->tqrepaint();
makeBlack();
}