diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-05-30 14:27:29 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-06-25 16:29:01 +0900 |
commit | a7f1e6e2552d9cdbb3d76bff089db522248b9a24 (patch) | |
tree | 2e6dd07698083df817163d572443aaf6fdd26651 /tutorial/t14/cannon.cpp | |
parent | 2584dba8aabfa2db8297dcfa258d33545ed6af43 (diff) | |
download | tqt-a7f1e6e2552d9cdbb3d76bff089db522248b9a24.tar.gz tqt-a7f1e6e2552d9cdbb3d76bff089db522248b9a24.zip |
Replace TRUE/FALSE with boolean values true/false - part 1
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tutorial/t14/cannon.cpp')
-rw-r--r-- | tutorial/t14/cannon.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tutorial/t14/cannon.cpp b/tutorial/t14/cannon.cpp index b20d5592a..39588c0f4 100644 --- a/tutorial/t14/cannon.cpp +++ b/tutorial/t14/cannon.cpp @@ -26,8 +26,8 @@ CannonField::CannonField( TQWidget *parent, const char *name ) shoot_ang = 0; shoot_f = 0; target = TQPoint( 0, 0 ); - gameEnded = FALSE; - barrelPressed = FALSE; + gameEnded = false; + barrelPressed = false; setPalette( TQPalette( TQColor( 250, 250, 200) ) ); newTarget(); } @@ -42,7 +42,7 @@ void CannonField::setAngle( int degrees ) if ( ang == degrees ) return; ang = degrees; - repaint( cannonRect(), FALSE ); + repaint( cannonRect(), false ); emit angleChanged( ang ); } @@ -66,15 +66,15 @@ void CannonField::shoot() shoot_ang = ang; shoot_f = f; autoShootTimer->start( 50 ); - emit canShoot( FALSE ); + emit canShoot( false ); } void CannonField::newTarget() { - static bool first_time = TRUE; + static bool first_time = true; if ( first_time ) { - first_time = FALSE; + first_time = false; TQTime midnight( 0, 0, 0 ); srand( midnight.secsTo(TQTime::currentTime()) ); } @@ -90,7 +90,7 @@ void CannonField::setGameOver() return; if ( isShooting() ) autoShootTimer->stop(); - gameEnded = TRUE; + gameEnded = true; repaint(); } @@ -98,9 +98,9 @@ void CannonField::restartGame() { if ( isShooting() ) autoShootTimer->stop(); - gameEnded = FALSE; + gameEnded = false; repaint(); - emit canShoot( TRUE ); + emit canShoot( true ); } void CannonField::moveShot() @@ -113,12 +113,12 @@ void CannonField::moveShot() if ( shotR.intersects( targetRect() ) ) { autoShootTimer->stop(); emit hit(); - emit canShoot( TRUE ); + emit canShoot( true ); } else if ( shotR.x() > width() || shotR.y() > height() || shotR.intersects(barrierRect()) ) { autoShootTimer->stop(); emit missed(); - emit canShoot( TRUE ); + emit canShoot( true ); } else { r = r.unite( TQRegion( shotR ) ); } @@ -132,7 +132,7 @@ void CannonField::mousePressEvent( TQMouseEvent *e ) if ( e->button() != LeftButton ) return; if ( barrelHit( e->pos() ) ) - barrelPressed = TRUE; + barrelPressed = true; } @@ -153,7 +153,7 @@ void CannonField::mouseMoveEvent( TQMouseEvent *e ) void CannonField::mouseReleaseEvent( TQMouseEvent *e ) { if ( e->button() == LeftButton ) - barrelPressed = FALSE; + barrelPressed = false; } |