From 1e9fa8e06de5da7fcc268e9cccb2d6b21c5f53a3 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 20 Jul 2024 20:15:52 +0900 Subject: Rename graphics class nt* related files to equivalent tq* (part 2) Signed-off-by: Michele Calgaro --- doc/html/t11-cannon-cpp.html | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'doc/html/t11-cannon-cpp.html') diff --git a/doc/html/t11-cannon-cpp.html b/doc/html/t11-cannon-cpp.html index f76366d67..3f57acda8 100644 --- a/doc/html/t11-cannon-cpp.html +++ b/doc/html/t11-cannon-cpp.html @@ -41,7 +41,7 @@ body { background: #ffffff; color: black; } #include "cannon.h" #include <tqtimer.h> #include <tqpainter.h> -#include <ntqpixmap.h> +#include <tqpixmap.h> #include <math.h> @@ -99,28 +99,28 @@ void CannonField::shoot() void CannonField::moveShot() { - TQRegion r( shotRect() ); + TQRegion r( shotRect() ); timerCount++; - TQRect shotR = shotRect(); + TQRect shotR = shotRect(); - if ( shotR.x() > width() || shotR.y() > height() ) + if ( shotR.x() > width() || shotR.y() > height() ) autoShootTimer->stop(); else - r = r.unite( TQRegion( shotR ) ); + r = r.unite( TQRegion( shotR ) ); repaint( r ); } void CannonField::paintEvent( TQPaintEvent *e ) { - TQRect updateR = e->rect(); + TQRect updateR = e->rect(); TQPainter p( this ); - if ( updateR.intersects( cannonRect() ) ) + if ( updateR.intersects( cannonRect() ) ) paintCannon( &p ); if ( autoShootTimer->isActive() && - updateR.intersects( shotRect() ) ) + updateR.intersects( shotRect() ) ) paintShot( &p ); } @@ -133,32 +133,32 @@ void CannonField::paintShot( TQPainte } -const TQRect barrelRect(33, -4, 15, 8); +const TQRect barrelRect(33, -4, 15, 8); void CannonField::paintCannon( TQPainter *p ) { - TQRect cr = cannonRect(); - TQPixmap pix( cr.size() ); - pix.fill( this, cr.topLeft() ); + TQRect cr = cannonRect(); + TQPixmap pix( cr.size() ); + pix.fill( this, cr.topLeft() ); TQPainter tmp( &pix ); tmp.setBrush( blue ); tmp.setPen( NoPen ); - tmp.translate( 0, pix.height() - 1 ); + tmp.translate( 0, pix.height() - 1 ); tmp.drawPie( TQRect( -35,-35, 70, 70 ), 0, 90*16 ); tmp.rotate( -ang ); tmp.drawRect( barrelRect ); tmp.end(); - p->drawPixmap( cr.topLeft(), pix ); + p->drawPixmap( cr.topLeft(), pix ); } TQRect CannonField::cannonRect() const { - TQRect r( 0, 0, 50, 50 ); - r.moveBottomLeft( rect().bottomLeft() ); + TQRect r( 0, 0, 50, 50 ); + r.moveBottomLeft( rect().bottomLeft() ); return r; } @@ -173,13 +173,13 @@ TQRect CannonField::shotRect() const double velx = velocity*cos( radians ); double vely = velocity*sin( radians ); - double x0 = ( barrelRect.right() + 5 )*cos(radians); - double y0 = ( barrelRect.right() + 5 )*sin(radians); + double x0 = ( barrelRect.right() + 5 )*cos(radians); + double y0 = ( barrelRect.right() + 5 )*sin(radians); double x = x0 + velx*time; double y = y0 + vely*time - 0.5*gravity*time*time; - TQRect r = TQRect( 0, 0, 6, 6 ); - r.moveCenter( TQPoint( tqRound(x), height() - 1 - tqRound(y) ) ); + TQRect r = TQRect( 0, 0, 6, 6 ); + r.moveCenter( TQPoint( tqRound(x), height() - 1 - tqRound(y) ) ); return r; } -- cgit v1.2.1