diff options
Diffstat (limited to 'ksnake/rattler.cpp')
-rw-r--r-- | ksnake/rattler.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/ksnake/rattler.cpp b/ksnake/rattler.cpp index 8bea1c0c..1085d6f8 100644 --- a/ksnake/rattler.cpp +++ b/ksnake/rattler.cpp @@ -25,28 +25,28 @@ #include "rattler.h" -#include <qtimer.h> -#include <qlabel.h> +#include <tqtimer.h> +#include <tqlabel.h> #include <kapplication.h> #include <kstdgameaction.h> #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> -#include <qbitarray.h> +#include <tqbitarray.h> #include <kstandarddirs.h> #include "level.h" #include "basket.h" #include "settings.h" -QBitArray gameState(5); -QLabel *label = 0; +TQBitArray gameState(5); +TQLabel *label = 0; int speed[4] = { 130, 95, 55, 40 }; -Rattler::Rattler( QWidget *parent, const char *name ) - : QWidget( parent, name ) +Rattler::Rattler( TQWidget *parent, const char *name ) + : TQWidget( parent, name ) { - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); numBalls = Settings::balls(); ballsAI = Settings::ballsAI(); @@ -61,22 +61,22 @@ Rattler::Rattler( QWidget *parent, const char *name ) basket = new Basket(board, pix); samy = new SamySnake(board, pix); - computerSnakes = new QPtrList<CompuSnake>; + computerSnakes = new TQPtrList<CompuSnake>; computerSnakes->setAutoDelete( true ); - balls = new QPtrList<Ball>; + balls = new TQPtrList<Ball>; balls->setAutoDelete( true ); - connect( samy, SIGNAL(closeGate(int)), this, SLOT(closeGate(int))); - connect( samy, SIGNAL(score(bool, int)), this, SLOT(scoring(bool,int))); - connect( samy, SIGNAL(goingOut()), this, SLOT(speedUp())); - connect( basket, SIGNAL(openGate()), this, SLOT(openGate())); + connect( samy, TQT_SIGNAL(closeGate(int)), this, TQT_SLOT(closeGate(int))); + connect( samy, TQT_SIGNAL(score(bool, int)), this, TQT_SLOT(scoring(bool,int))); + connect( samy, TQT_SIGNAL(goingOut()), this, TQT_SLOT(speedUp())); + connect( basket, TQT_SIGNAL(openGate()), this, TQT_SLOT(openGate())); gameState.fill(false); gameState.setBit(Demo); timerCount = 0; - QTimer::singleShot( 2000, this, SLOT(demo()) ); // Why wait? + TQTimer::singleShot( 2000, this, TQT_SLOT(demo()) ); // Why wait? backgroundPixmaps = KGlobal::dirs()->findAllResources("appdata", "backgrounds/*.png"); @@ -106,13 +106,13 @@ void Rattler::loadSettings(){ reloadRoomPixmap(); } -void Rattler::paintEvent( QPaintEvent *e) +void Rattler::paintEvent( TQPaintEvent *e) { - QRect rect = e->rect(); + TQRect rect = e->rect(); if (rect.isEmpty()) return; - QPixmap levelPix = pix->levelPix(); + TQPixmap levelPix = pix->levelPix(); basket->repaint(true); @@ -120,7 +120,7 @@ void Rattler::paintEvent( QPaintEvent *e) &levelPix, rect.x(), rect.y(), rect.width(), rect.height()); } -void Rattler::timerEvent( QTimerEvent * ) +void Rattler::timerEvent( TQTimerEvent * ) { timerCount++; @@ -157,11 +157,11 @@ void Rattler::timerEvent( QTimerEvent * ) else if (state == out) levelUp(); - QPixmap levelPix = pix->levelPix(); + TQPixmap levelPix = pix->levelPix(); bitBlt(this, 0, 0, &levelPix, 0, 0, rect().width(), rect().height()); } -void Rattler::keyPressEvent( QKeyEvent *k ) +void Rattler::keyPressEvent( TQKeyEvent *k ) { if (gameState.testBit(Paused)) return; @@ -190,7 +190,7 @@ void Rattler::keyPressEvent( QKeyEvent *k ) k->accept(); } -void Rattler::mousePressEvent( QMouseEvent *e ) +void Rattler::mousePressEvent( TQMouseEvent *e ) { if (gameState.testBit(Paused)) return; @@ -310,12 +310,12 @@ void Rattler::pause() KAction* tempPauseAction = KStdGameAction::pause(); - label = new QLabel(this); - label->setFont( QFont( "Times", 14, QFont::Bold ) ); + label = new TQLabel(this); + label->setFont( TQFont( "Times", 14, TQFont::Bold ) ); label->setText(i18n("Game Paused\n Press %1 to resume\n") .arg(tempPauseAction->shortcutText())); label->setAlignment( AlignCenter ); - label->setFrameStyle( QFrame::Panel | QFrame::Raised ); + label->setFrameStyle( TQFrame::Panel | TQFrame::Raised ); label->setGeometry(182, 206, 198, 80); label->show(); @@ -345,7 +345,7 @@ void Rattler::restartDemo() return; int r = 50000+ (kapp->random() % 30000); - QTimer::singleShot( r, this, SLOT(restartDemo()) ); + TQTimer::singleShot( r, this, TQT_SLOT(restartDemo()) ); stop(); level->create(Intro); @@ -364,7 +364,7 @@ void Rattler::demo() stop(); - QTimer::singleShot( 60000, this, SLOT(restartDemo()) ); + TQTimer::singleShot( 60000, this, TQT_SLOT(restartDemo()) ); gameState.fill(false); gameState.setBit(Init); gameState.setBit(Demo); @@ -414,7 +414,7 @@ void Rattler::restart() cleanLabel(); repaint(); - QTimer::singleShot( 2000, this, SLOT(showRoom()) ); + TQTimer::singleShot( 2000, this, TQT_SLOT(showRoom()) ); } void Rattler::newTry() @@ -427,7 +427,7 @@ void Rattler::newTry() level->create(GameOver); pix->initRoomPixmap(); repaint(); - QTimer::singleShot( 5000, this, SLOT(demo()) ); + TQTimer::singleShot( 5000, this, TQT_SLOT(demo()) ); emit setScore(points); return; } @@ -440,7 +440,7 @@ void Rattler::newTry() pix->initRoomPixmap(); init(true); repaint(); - QTimer::singleShot( 1000, this, SLOT(run()) ); + TQTimer::singleShot( 1000, this, TQT_SLOT(run()) ); } void Rattler::levelUp() @@ -458,7 +458,7 @@ void Rattler::levelUp() pix->initRoomPixmap(); repaint(); - QTimer::singleShot( 2000, this, SLOT(showRoom()) ); + TQTimer::singleShot( 2000, this, TQT_SLOT(showRoom()) ); } /* this slot is called by the progressBar when value() == 0 @@ -494,7 +494,7 @@ void Rattler::showRoom() pix->initRoomPixmap(); init(true); repaint(); - QTimer::singleShot( 1000, this, SLOT(run()) ); + TQTimer::singleShot( 1000, this, TQT_SLOT(run()) ); } void Rattler::init(bool play) @@ -557,10 +557,10 @@ void Rattler::restartComputerSnakes(bool play) as = new KillerCompuSnake(board, pix); break; } - connect( as, SIGNAL(closeGate(int)), this, SLOT(closeGate(int))); - connect( as, SIGNAL(restartTimer()), this, SLOT(restartTimer())); - connect( as, SIGNAL(score(bool, int)), this, SLOT(scoring(bool,int))); - connect( as, SIGNAL(killed()), this, SLOT(killedComputerSnake())); + connect( as, TQT_SIGNAL(closeGate(int)), this, TQT_SLOT(closeGate(int))); + connect( as, TQT_SIGNAL(restartTimer()), this, TQT_SLOT(restartTimer())); + connect( as, TQT_SIGNAL(score(bool, int)), this, TQT_SLOT(scoring(bool,int))); + connect( as, TQT_SIGNAL(killed()), this, TQT_SLOT(killedComputerSnake())); computerSnakes->append(as); } } @@ -614,7 +614,7 @@ void Rattler::setBallsAI(int i) ballsAI = i; } -void Rattler::resizeEvent( QResizeEvent * ) +void Rattler::resizeEvent( TQResizeEvent * ) { pix->initPixmaps(); pix->initBrickPixmap(); @@ -643,10 +643,10 @@ void Rattler::setCompuSnakes(int i) as = new KillerCompuSnake(board, pix); break; } - connect( as, SIGNAL(closeGate(int)), this, SLOT(closeGate(int))); - connect( as, SIGNAL(restartTimer()), this, SLOT(restartTimer())); - connect( as, SIGNAL(score(bool, int)), this, SLOT(scoring(bool,int))); - connect( as, SIGNAL(killed()), this, SLOT(killedComputerSnake())); + connect( as, TQT_SIGNAL(closeGate(int)), this, TQT_SLOT(closeGate(int))); + connect( as, TQT_SIGNAL(restartTimer()), this, TQT_SLOT(restartTimer())); + connect( as, TQT_SIGNAL(score(bool, int)), this, TQT_SLOT(scoring(bool,int))); + connect( as, TQT_SIGNAL(killed()), this, TQT_SLOT(killedComputerSnake())); computerSnakes->append(as); i--; } |