diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-07 15:50:40 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-07 23:25:01 +0900 |
commit | 664580ffc694a1f9e7ab25d4636ca9696a38d958 (patch) | |
tree | daea2bbeea9cce36e9c8fe66afd1930e397e7ebd /kgoldrunner | |
parent | d62a856cb43f9a527dc936783d18fbfe4cc0d9c2 (diff) | |
download | tdegames-r14.1.4.tar.gz tdegames-r14.1.4.zip |
Replace TRUE/FALSE with boolean values true/falser14.1.4
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 66230b1cca2fa5c95886d8cf708829e4bfac2b10)
Diffstat (limited to 'kgoldrunner')
-rw-r--r-- | kgoldrunner/src/kgoldrunner.cpp | 142 | ||||
-rw-r--r-- | kgoldrunner/src/kgrcanvas.cpp | 14 | ||||
-rw-r--r-- | kgoldrunner/src/kgrdialog.cpp | 52 | ||||
-rw-r--r-- | kgoldrunner/src/kgrfigure.cpp | 154 | ||||
-rw-r--r-- | kgoldrunner/src/kgrgame.cpp | 256 | ||||
-rw-r--r-- | kgoldrunner/src/kgrobject.cpp | 22 | ||||
-rw-r--r-- | kgoldrunner/src/kgrobject.h | 2 |
7 files changed, 321 insertions, 321 deletions
diff --git a/kgoldrunner/src/kgoldrunner.cpp b/kgoldrunner/src/kgoldrunner.cpp index 8d417c8d..28419dc8 100644 --- a/kgoldrunner/src/kgoldrunner.cpp +++ b/kgoldrunner/src/kgoldrunner.cpp @@ -42,12 +42,12 @@ KGoldrunner::KGoldrunner() /******************************************************************************/ // Avoid "saveOK()" check if an error-exit occurs during the file checks. - startupOK = TRUE; + startupOK = true; // Get directory paths for the system levels, user levels and manual. if (! getDirectories()) { fprintf (stderr, "getDirectories() FAILED\n"); - startupOK = FALSE; + startupOK = false; return; // If games directory not found, abort. } @@ -65,7 +65,7 @@ KGoldrunner::KGoldrunner() // Initialise the collections of levels (i.e. the list of games). if (! game->initCollections()) { - startupOK = FALSE; + startupOK = false; return; // If no game files, abort. } @@ -107,7 +107,7 @@ KGoldrunner::KGoldrunner() if (dw > 1024) { // More than 1024x768. view->changeSize (+1); view->changeSize (+1); // Scale 1.75:1. - setUsesBigPixmaps (TRUE); // Use big toolbar buttons. + setUsesBigPixmaps (true); // Use big toolbar buttons. } view->setBaseScale(); // Set scale for level-names. #endif @@ -115,16 +115,16 @@ KGoldrunner::KGoldrunner() makeEditToolbar(); // Uses pixmaps from "view". editToolbar->hide(); - setDockEnabled (DockBottom, FALSE); - setDockEnabled (DockLeft, FALSE); - setDockEnabled (DockRight, FALSE); + setDockEnabled (DockBottom, false); + setDockEnabled (DockLeft, false); + setDockEnabled (DockRight, false); // Make it impossible to turn off the editor toolbar. // Accidentally hiding it would make editing impossible. - setDockMenuEnabled (FALSE); + setDockMenuEnabled (false); // Set mouse control of the hero as the default. - game->setMouseMode (TRUE); + game->setMouseMode (true); // Paint the main widget (title, menu, status bar, blank playfield). show(); @@ -251,7 +251,7 @@ void KGoldrunner::setupActions() 0, game, TQ_SLOT(saveLevelFile()), actionCollection(), "save_edits"); - saveEdits->setEnabled (FALSE); // Nothing to save, yet. + saveEdits->setEnabled (false); // Nothing to save, yet. (void) new TDEAction ( i18n("&Move Level..."), @@ -318,7 +318,7 @@ void KGoldrunner::setupActions() setIceCave-> setExclusiveGroup ("landscapes"); setMidnight-> setExclusiveGroup ("landscapes"); setKDEKool-> setExclusiveGroup ("landscapes"); - setKGoldrunner-> setChecked (TRUE); + setKGoldrunner-> setChecked (true); /**************************************************************************/ /**************************** SETTINGS MENU ****************************/ @@ -343,7 +343,7 @@ void KGoldrunner::setupActions() setMouse-> setExclusiveGroup ("control"); setKeyboard-> setExclusiveGroup ("control"); - setMouse-> setChecked (TRUE); + setMouse-> setChecked (true); // Normal Speed // Beginner Speed @@ -381,7 +381,7 @@ void KGoldrunner::setupActions() nSpeed-> setExclusiveGroup ("speed"); bSpeed-> setExclusiveGroup ("speed"); cSpeed-> setExclusiveGroup ("speed"); - nSpeed-> setChecked (TRUE); + nSpeed-> setChecked (true); // Traditional Rules // KGoldrunner Rules @@ -400,7 +400,7 @@ void KGoldrunner::setupActions() tradRules-> setExclusiveGroup ("rules"); kgrRules-> setExclusiveGroup ("rules"); - tradRules-> setChecked (TRUE); + tradRules-> setChecked (true); // Larger Playing Area // Smaller Playing Area @@ -507,7 +507,7 @@ void KGoldrunner::initStatusBar() int i = statusBar()->fontInfo().pointSize(); statusBar()->setFont (TQFont (s, i, TQFont::Bold)); - statusBar()->setSizeGripEnabled (FALSE); // Use Settings menu ... + statusBar()->setSizeGripEnabled (false); // Use Settings menu ... statusBar()->insertItem ("", ID_LIVES); statusBar()->insertItem ("", ID_SCORE); @@ -518,12 +518,12 @@ void KGoldrunner::initStatusBar() showLives (5); // Start with 5 lives. showScore (0); showLevel (0); - adjustHintAction (FALSE); + adjustHintAction (false); // Set the PAUSE/RESUME key-names into the status bar message. pauseKeys = myPause->shortcut().toString(); pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \""); - gameFreeze (FALSE); + gameFreeze (false); statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes. statusBar()->setItemFixed (ID_SCORE, -1); @@ -646,8 +646,8 @@ void KGoldrunner::lsKDEKool() {view->changeLandscape ("TDE Kool");} // Local slots to set mouse or keyboard control of the hero. -void KGoldrunner::setMouseMode() {game->setMouseMode (TRUE);} -void KGoldrunner::setKeyBoardMode() {game->setMouseMode (FALSE);} +void KGoldrunner::setMouseMode() {game->setMouseMode (true);} +void KGoldrunner::setKeyBoardMode() {game->setMouseMode (false);} // Local slots to set game speed. @@ -661,19 +661,19 @@ void KGoldrunner::decSpeed() {hero->setSpeed (-1);} void KGoldrunner::setTradRules() { - KGrFigure::variableTiming = TRUE; - KGrFigure::alwaysCollectNugget = TRUE; - KGrFigure::runThruHole = TRUE; - KGrFigure::reappearAtTop = TRUE; + KGrFigure::variableTiming = true; + KGrFigure::alwaysCollectNugget = true; + KGrFigure::runThruHole = true; + KGrFigure::reappearAtTop = true; KGrFigure::searchStrategy = LOW; } void KGoldrunner::setKGrRules() { - KGrFigure::variableTiming = FALSE; - KGrFigure::alwaysCollectNugget = FALSE; - KGrFigure::runThruHole = FALSE; - KGrFigure::reappearAtTop = FALSE; + KGrFigure::variableTiming = false; + KGrFigure::alwaysCollectNugget = false; + KGrFigure::runThruHole = false; + KGrFigure::reappearAtTop = false; KGrFigure::searchStrategy = MEDIUM; } @@ -819,7 +819,7 @@ void KGoldrunner::changeCaption(const TQString& text) bool KGoldrunner::getDirectories() { - bool result = TRUE; + bool result = true; // WHERE THINGS ARE: In the KDE 3 environment (Release 3.1.1), application // documentation and data files are in a directory structure given by @@ -850,7 +850,7 @@ bool KGoldrunner::getDirectories() i18n("Cannot find documentation sub-folder 'en/%1/' " "in area '%2' of the TDE folder ($TDEDIRS).") .arg(myDir).arg(dirs->kde_default ("html"))); - // result = FALSE; // Don't abort if the doc is missing. + // result = false; // Don't abort if the doc is missing. } else systemHTMLDir.append ("en/" + myDir + "/"); @@ -862,20 +862,20 @@ bool KGoldrunner::getDirectories() i18n("Cannot find system games sub-folder '%1/system/' " "in area '%2' of the TDE folder ($TDEDIRS).") .arg(myDir).arg(dirs->kde_default ("data"))); - result = FALSE; // ABORT if the games data is missing. + result = false; // ABORT if the games data is missing. } else systemDataDir.append (myDir + "/system/"); // Locate and optionally create directories for user collections and levels. - bool create = TRUE; + bool create = true; userDataDir = dirs->saveLocation ("data", myDir + "/user/", create); if (userDataDir.length() <= 0) { KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create user games sub-folder '%1/user/' " "in area '%2' of the TDE user area ($TDEHOME).") .arg(myDir).arg(dirs->kde_default ("data"))); - // result = FALSE; // Don't abort if user area is missing. + // result = false; // Don't abort if user area is missing. } else { create = dirs->makeDir (userDataDir + "levels/"); @@ -883,7 +883,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create 'levels/' folder in " "sub-folder '%1/user/' in the TDE user area ($TDEHOME).").arg(myDir)); - // result = FALSE; // Don't abort if user area is missing. + // result = false; // Don't abort if user area is missing. } } @@ -896,9 +896,9 @@ bool KGoldrunner::getDirectories() bool KGoldrunner::queryClose () { // Last chance to save: user has clicked "X" widget or menu-Quit. - bool cannotContinue = TRUE; + bool cannotContinue = true; game->saveOK (cannotContinue); - return (TRUE); + return (true); } void KGoldrunner::setKey (KBAction movement) @@ -908,7 +908,7 @@ void KGoldrunner::setKey (KBAction movement) // Using keyboard control can automatically disable mouse control. if (game->inMouseMode()) { // Halt the game while a message is displayed. - game->setMessageFreeze (TRUE); + game->setMessageFreeze (true); switch (KGrMessage::warning (this, i18n("Switch to Keyboard Mode"), i18n("You have pressed a key that can be used to move the " @@ -917,15 +917,15 @@ void KGoldrunner::setKey (KBAction movement) "- like riding a bike rather than walking!"), i18n("Switch to &Keyboard Mode"), i18n("Stay in &Mouse Mode"))) { - case 0: game->setMouseMode (FALSE); // Set internal mouse mode OFF. - setMouse->setChecked (FALSE); // Adjust the Settings menu. - setKeyboard->setChecked (TRUE); + case 0: game->setMouseMode (false); // Set internal mouse mode OFF. + setMouse->setChecked (false); // Adjust the Settings menu. + setKeyboard->setChecked (true); break; case 1: break; } // Unfreeze the game, but only if it was previously unfrozen. - game->setMessageFreeze (FALSE); + game->setMessageFreeze (false); if (game->inMouseMode()) return; // Stay in Mouse Mode. @@ -987,77 +987,77 @@ void KGoldrunner::makeEditToolbar() edenemybg = edenemybg.xForm (w); } - editToolbar = new TDEToolBar (this, TQt::DockTop, TRUE, "Editor", TRUE); + editToolbar = new TDEToolBar (this, TQt::DockTop, true, "Editor", true); // Choose a colour that enhances visibility of the KGoldrunner pixmaps. // editToolbar->setPalette (TQPalette (TQColor (150, 150, 230))); - // editToolbar->setHorizontallyStretchable (TRUE); // Not effective in KDE. + // editToolbar->setHorizontallyStretchable (true); // Not effective in KDE. // All those separators are just to get reasonable visual spacing of the - // pixmaps in KDE. "setHorizontallyStretchable(TRUE)" does it in TQt. + // pixmaps in KDE. "setHorizontallyStretchable(true)" does it in TQt. editToolbar->insertSeparator(); editToolbar->insertButton ("document-new", 0, TQ_SIGNAL(clicked()), game, - TQ_SLOT(createLevel()), TRUE, i18n("&Create a Level")); + TQ_SLOT(createLevel()), true, i18n("&Create a Level")); editToolbar->insertButton ("document-open", 1, TQ_SIGNAL(clicked()), game, - TQ_SLOT(updateLevel()), TRUE, i18n("&Edit Any Level...")); + TQ_SLOT(updateLevel()), true, i18n("&Edit Any Level...")); editToolbar->insertButton ("document-save", 2, TQ_SIGNAL(clicked()), game, - TQ_SLOT(saveLevelFile()),TRUE, i18n("&Save Edits...")); + TQ_SLOT(saveLevelFile()),true, i18n("&Save Edits...")); editToolbar->insertSeparator(); editToolbar->insertSeparator(); editToolbar->insertButton ("ktip", 3, TQ_SIGNAL(clicked()), game, - TQ_SLOT(editNameAndHint()),TRUE,i18n("Edit Name/Hint")); + TQ_SLOT(editNameAndHint()),true,i18n("Edit Name/Hint")); editToolbar->insertSeparator(); editToolbar->insertSeparator(); editToolbar->insertButton (freebg, (int)FREE, TQ_SIGNAL(clicked()), this, - TQ_SLOT(freeSlot()), TRUE, i18n("Empty space")); + TQ_SLOT(freeSlot()), true, i18n("Empty space")); editToolbar->insertSeparator(); editToolbar->insertButton (edherobg, (int)HERO, TQ_SIGNAL(clicked()), this, - TQ_SLOT (edheroSlot()), TRUE, i18n("Hero")); + TQ_SLOT (edheroSlot()), true, i18n("Hero")); editToolbar->insertSeparator(); editToolbar->insertButton (edenemybg, (int)ENEMY, TQ_SIGNAL(clicked()), this, - TQ_SLOT (edenemySlot()), TRUE, i18n("Enemy")); + TQ_SLOT (edenemySlot()), true, i18n("Enemy")); editToolbar->insertSeparator(); editToolbar->insertButton (brickbg, (int)BRICK, TQ_SIGNAL(clicked()), this, - TQ_SLOT (brickSlot()), TRUE, i18n("Brick (can dig)")); + TQ_SLOT (brickSlot()), true, i18n("Brick (can dig)")); editToolbar->insertSeparator(); editToolbar->insertButton (betonbg, (int)BETON, TQ_SIGNAL(clicked()), this, - TQ_SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)")); + TQ_SLOT (betonSlot()), true, i18n("Concrete (cannot dig)")); editToolbar->insertSeparator(); editToolbar->insertButton (fbrickbg, (int)FBRICK, TQ_SIGNAL(clicked()), this, - TQ_SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)")); + TQ_SLOT (fbrickSlot()), true, i18n("Trap (can fall through)")); editToolbar->insertSeparator(); editToolbar->insertButton (ladderbg, (int)LADDER, TQ_SIGNAL(clicked()), this, - TQ_SLOT (ladderSlot()), TRUE, i18n("Ladder")); + TQ_SLOT (ladderSlot()), true, i18n("Ladder")); editToolbar->insertSeparator(); editToolbar->insertButton (hladderbg, (int)HLADDER, TQ_SIGNAL(clicked()), this, - TQ_SLOT (hladderSlot()), TRUE, i18n("Hidden ladder")); + TQ_SLOT (hladderSlot()), true, i18n("Hidden ladder")); editToolbar->insertSeparator(); editToolbar->insertButton (polebg, (int)POLE, TQ_SIGNAL(clicked()), this, - TQ_SLOT (poleSlot()), TRUE, i18n("Pole (or bar)")); + TQ_SLOT (poleSlot()), true, i18n("Pole (or bar)")); editToolbar->insertSeparator(); editToolbar->insertButton (nuggetbg, (int)NUGGET, TQ_SIGNAL(clicked()), this, - TQ_SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); - - editToolbar->setToggle ((int) FREE, TRUE); - editToolbar->setToggle ((int) HERO, TRUE); - editToolbar->setToggle ((int) ENEMY, TRUE); - editToolbar->setToggle ((int) BRICK, TRUE); - editToolbar->setToggle ((int) BETON, TRUE); - editToolbar->setToggle ((int) FBRICK, TRUE); - editToolbar->setToggle ((int) LADDER, TRUE); - editToolbar->setToggle ((int) HLADDER, TRUE); - editToolbar->setToggle ((int) POLE, TRUE); - editToolbar->setToggle ((int) NUGGET, TRUE); + TQ_SLOT (nuggetSlot()), true, i18n("Gold nugget")); + + editToolbar->setToggle ((int) FREE, true); + editToolbar->setToggle ((int) HERO, true); + editToolbar->setToggle ((int) ENEMY, true); + editToolbar->setToggle ((int) BRICK, true); + editToolbar->setToggle ((int) BETON, true); + editToolbar->setToggle ((int) FBRICK, true); + editToolbar->setToggle ((int) LADDER, true); + editToolbar->setToggle ((int) HLADDER, true); + editToolbar->setToggle ((int) POLE, true); + editToolbar->setToggle ((int) NUGGET, true); pressedButton = (int) BRICK; - editToolbar->setButton (pressedButton, TRUE); + editToolbar->setButton (pressedButton, true); } /******************************************************************************/ @@ -1089,9 +1089,9 @@ void KGoldrunner::defaultEditObj() void KGoldrunner::setButton (int btn) { - editToolbar->setButton (pressedButton, FALSE); + editToolbar->setButton (pressedButton, false); pressedButton = btn; - editToolbar->setButton (pressedButton, TRUE); + editToolbar->setButton (pressedButton, true); } #include "kgoldrunner.moc" diff --git a/kgoldrunner/src/kgrcanvas.cpp b/kgoldrunner/src/kgrcanvas.cpp index bd642214..dcb46040 100644 --- a/kgoldrunner/src/kgrcanvas.cpp +++ b/kgoldrunner/src/kgrcanvas.cpp @@ -107,14 +107,14 @@ bool KGrCanvas::changeSize (int d) // Note: Smaller scales lose detail (e.g. the joints in brickwork). KGrMessage::information (this, i18n("Change Size"), i18n("Sorry, you cannot make the play area any smaller.")); - return FALSE; + return false; } if ((d >= 0) && (scaleStep >= 2 * STEP)) { // Note: Larger scales go off the edge of the monitor. KGrMessage::information (this, i18n("Change Size"), i18n("Sorry, you cannot make the play area any larger.")); - return FALSE; + return false; } TQWMatrix wm = worldMatrix(); @@ -140,13 +140,13 @@ bool KGrCanvas::changeSize (int d) int frame = frameWidth()*2; setFixedSize ((FIELDWIDTH + 4) * 4 * scaleStep + frame, (FIELDHEIGHT + 4) * 4 * scaleStep + frame); - return TRUE; + return true; #else KGrMessage::information (this, i18n( "Change Size" ), i18n( "Sorry, you cannot change the size of the playing area. " "That function requires TQt Library version 3 or later." )); - return FALSE; + return false; #endif } @@ -200,7 +200,7 @@ void KGrCanvas::makeTitle () // object does not always display scaled-up fonts cleanly (in TQt 3.1.1). if (title != 0) - title->close (TRUE); // Close and delete previous title. + title->close (true); // Close and delete previous title. title = new TQLabel ("", this); title->setFixedWidth (((FIELDWIDTH * cw + 2 * bw) * scaleStep) / STEP); @@ -257,7 +257,7 @@ void KGrCanvas::makeHeroSprite (int i, int j, int startFrame) i++; j++; heroSprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); heroSprite->setZ (1); - heroSprite->setVisible (TRUE); + heroSprite->setVisible (true); } void KGrCanvas::setHeroVisible (bool newState) @@ -471,7 +471,7 @@ void KGrCanvas::initView() #else enemySprites = new TQPtrList<TQCanvasSprite> (); #endif - enemySprites->setAutoDelete(TRUE); + enemySprites->setAutoDelete(true); } void KGrCanvas::makeTiles () diff --git a/kgoldrunner/src/kgrdialog.cpp b/kgoldrunner/src/kgrdialog.cpp index 4e7a8dba..0cb8a947 100644 --- a/kgoldrunner/src/kgrdialog.cpp +++ b/kgoldrunner/src/kgrdialog.cpp @@ -30,7 +30,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + : TQDialog (parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, @@ -71,7 +71,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, gameInfo->setSpacing (spacing); collnN = new TQLabel ("", gameInfo); // Name of selected collection. TQFont f = collnN->font(); - f.setBold (TRUE); + f.setBold (true); collnN->setFont (f); collnA = new TQPushButton (i18n("More Info"), gameInfo); @@ -143,7 +143,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, #endif // Set the default for the level-number in the scrollbar. - number-> setTracking (TRUE); + number-> setTracking (true); number->setValue (requestedLevel); slSetCollections (defaultGame); @@ -154,8 +154,8 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, case SL_START: // Must start at level 1, but can choose a collection. OKText = i18n("Start Game"); number->setValue (1); - number->setEnabled(FALSE); - display->setEnabled(FALSE); + number->setEnabled(false); + display->setEnabled(false); number->hide(); numberL->hide(); display->hide(); @@ -181,8 +181,8 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, case SL_UPD_GAME: // Can only edit USER collection details. OKText = i18n("Edit Game Info"); number->setValue (1); - number->setEnabled(FALSE); - display->setEnabled(FALSE); + number->setEnabled(false); + display->setEnabled(false); number->hide(); numberL->hide(); display->hide(); @@ -227,7 +227,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, connect (levelNH, TQ_SIGNAL (clicked()), game, TQ_SLOT (editNameAndHint())); } else { - levelNH->setEnabled (FALSE); + levelNH->setEnabled (false); levelNH->hide(); } @@ -275,7 +275,7 @@ void KGrSLDialog::slSetCollections (int cIndex) } // Mark the currently selected collection (or default 0). colln->setCurrentItem (cIndex); - colln->setSelected (cIndex, TRUE); + colln->setSelected (cIndex, true); // Fetch and display information on the selected collection. slColln (cIndex); @@ -293,7 +293,7 @@ void KGrSLDialog::slColln (int i) } // User "highlighted" a new collection (with one click) ... - colln->setSelected (i, TRUE); // One click = selected. + colln->setSelected (i, true); // One click = selected. slCollnIndex = i; int n = slCollnIndex; // Collection selected. int N = defaultGame; // Current collection. @@ -383,7 +383,7 @@ void KGrSLDialog::slUpdate (const TQString & text) { // Move the slider when a valid level number is entered. TQString s = text; - bool ok = FALSE; + bool ok = false; int n = s.toInt (&ok); if (ok) { number->setValue (n); @@ -487,7 +487,7 @@ void KGrSLDialog::slotHelp () #ifdef KGR_PORTABLE KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + : TQDialog (parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, @@ -574,7 +574,7 @@ KGrNHDialog::~KGrNHDialog() KGrECDialog::KGrECDialog (int action, int collnIndex, TQPtrList<KGrCollection> & gamesList, TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + : TQDialog (parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrECDialog::KGrECDialog (int action, int collnIndex, @@ -661,7 +661,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, ecPrefix-> setText (collections.at(defaultGame)->prefix); if (collections.at(defaultGame)->nLevels > 0) { // Collection already has some levels, so cannot change the prefix. - ecPrefix-> setEnabled (FALSE); + ecPrefix-> setEnabled (false); } TQString s; #ifndef KGR_PORTABLE @@ -732,12 +732,12 @@ KGrECDialog::~KGrECDialog() void KGrECDialog::ecSetRules (const char settings) { - ecKGrB-> setChecked (FALSE); - ecTradB-> setChecked (FALSE); + ecKGrB-> setChecked (false); + ecTradB-> setChecked (false); if (settings == 'K') - ecKGrB-> setChecked (TRUE); + ecKGrB-> setChecked (true); else - ecTradB-> setChecked (TRUE); + ecTradB-> setChecked (true); } void KGrECDialog::ecSetKGr () {ecSetRules ('K');} // Radio button slots. @@ -751,7 +751,7 @@ void KGrECDialog::ecSetTrad () {ecSetRules ('T');} KGrLGDialog::KGrLGDialog (TQFile * savedGames, TQPtrList<KGrCollection> & collections, TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + : TQDialog (parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrLGDialog::KGrLGDialog (TQFile * savedGames, @@ -784,9 +784,9 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, #else TQFont f = TDEGlobalSettings::fixedFont(); // KDE version. #endif - f.setFixedPitch (TRUE); + f.setFixedPitch (true); lgList-> setFont (f); - f.setBold (TRUE); + f.setBold (true); lgHeader-> setFont (f); mainLayout-> addWidget (lgHeader); @@ -825,11 +825,11 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, // Read the saved games into the list box. while (! gameText.endData()) { s = gameText.readLine(); // Read in one saved game. - pr = s.left (s.find (" ", 0, FALSE)); // Get the collection prefix. + pr = s.left (s.find (" ", 0, false)); // Get the collection prefix. for (i = 0; i < imax; i++) { // Get the collection name. if (collections.at(i)->prefix == pr) { s = s.insert (0, - collections.at(i)->name.leftJustify (20, ' ', TRUE) + " "); + collections.at(i)->name.leftJustify (20, ' ', true) + " "); break; } } @@ -839,7 +839,7 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, // Mark row 0 (the most recently saved game) as the default selection. lgList-> setCurrentItem (0); - lgList-> setSelected (0, TRUE); + lgList-> setSelected (0, true); lgHighlight = 0; connect (lgList, TQ_SIGNAL (highlighted (int)), this, TQ_SLOT (lgSelect (int))); @@ -911,7 +911,7 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) #ifndef KGR_PORTABLE KMessageBox::information (parent, contents, title); #else - TQDialog * mm = new TQDialog (parent, "wrappedMessage", TRUE, + TQDialog * mm = new TQDialog (parent, "wrappedMessage", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; @@ -951,7 +951,7 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) mle-> setFrameStyle (TQFrame::NoFrame); mle-> setAlignment (AlignLeft); - mle-> setReadOnly (TRUE); + mle-> setReadOnly (true); mle-> setText (contents); #ifndef QT3 diff --git a/kgoldrunner/src/kgrfigure.cpp b/kgoldrunner/src/kgrfigure.cpp index 0707da67..bfe7a6e1 100644 --- a/kgoldrunner/src/kgrfigure.cpp +++ b/kgoldrunner/src/kgrfigure.cpp @@ -36,10 +36,10 @@ KGrFigure :: KGrFigure (int px, int py) } // Initialise the global settings flags. -bool KGrFigure::variableTiming = TRUE; -bool KGrFigure::alwaysCollectNugget = TRUE; -bool KGrFigure::runThruHole = TRUE; -bool KGrFigure::reappearAtTop = TRUE; +bool KGrFigure::variableTiming = true; +bool KGrFigure::alwaysCollectNugget = true; +bool KGrFigure::runThruHole = true; +bool KGrFigure::reappearAtTop = true; SearchStrategy KGrFigure::searchStrategy = LOW; int KGrFigure::herox = 0; @@ -155,7 +155,7 @@ void KGrFigure::walkUp(int WALKDELAY) rely -= STEP; absy -= STEP; } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { // End of 4-step cycle: move up to next cell, if possible. @@ -185,7 +185,7 @@ void KGrFigure::walkDown(int WALKDELAY, int FALLDELAY) rely += STEP; absy += STEP; } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { // End of 4-step cycle: move down to next cell, if possible. @@ -217,7 +217,7 @@ void KGrFigure::walkLeft (int WALKDELAY, int FALLDELAY) relx -= STEP; absx -=STEP; } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { // End of 4-pixmap cycle: start again, in next cell if possible. @@ -249,7 +249,7 @@ void KGrFigure::walkRight(int WALKDELAY, int FALLDELAY) relx += STEP; absx += STEP; // nur vorwärts gehen, wenn es auch möglich ist } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { actualPixmap -= 4; // Schritt war vollendet @@ -277,7 +277,7 @@ void KGrFigure::initFall(int apm, int FALLDELAY) actualPixmap = apm; walkCounter=1; walkTimer->stop(); - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); } void KGrFigure::showFigure () @@ -303,12 +303,12 @@ KGrHero :: KGrHero (KGrCanvas * view, int x, int y) herox = x; heroy = y; - started = FALSE; - mouseMode = TRUE; + started = false; + mouseMode = true; walkCounter = 1; - walkFrozen = FALSE; - fallFrozen = FALSE; + walkFrozen = false; + fallFrozen = false; connect (walkTimer, TQ_SIGNAL (timeout ()), TQ_SLOT (walkTimeDone ())); connect (fallTimer, TQ_SIGNAL (timeout ()), TQ_SLOT (fallTimeDone ())); @@ -380,22 +380,22 @@ void KGrHero::setKey(Direction key) { // Keyboard control of hero: direction is fixed until next key is pressed. // Sets a simulated mouse-pointer above, below, left, right or on the hero. - mouseMode = FALSE; - stopped = FALSE; + mouseMode = false; + stopped = false; switch (key) { case UP: mousex = x; mousey = 0; break; case DOWN: mousex = x; mousey = FIELDHEIGHT + 1; break; case LEFT: mousex = 0; mousey = y; break; case RIGHT: mousex = FIELDWIDTH + 1; mousey = y; break; - case STAND: stopped = TRUE; mousex = x; mousey = y; break; + case STAND: stopped = true; mousex = x; mousey = y; break; } } void KGrHero::setDirection(int i, int j) { // Mouse control of hero: direction is updated continually on a timer. - mouseMode = TRUE; - stopped = FALSE; + mouseMode = true; + stopped = false; mousex = i; mousey = j; } @@ -446,11 +446,11 @@ void KGrHero::setNextDir() void KGrHero::doStep() { if (walkFrozen) { - walkFrozen = FALSE; + walkFrozen = false; walkTimeDone(); } if (fallFrozen) { - fallFrozen = FALSE; + fallFrozen = false; fallTimeDone(); } } @@ -479,7 +479,7 @@ void KGrHero::init(int a,int b) walkTimer->stop(); fallTimer->stop(); walkCounter = 1; - started = FALSE; + started = false; x = mem_x = a; y = mem_y = b; @@ -503,9 +503,9 @@ void KGrHero::init(int a,int b) void KGrHero::start() { - started = TRUE; - walkFrozen = FALSE; - fallFrozen = FALSE; + started = true; + walkFrozen = false; + fallFrozen = false; if (!(canStand()||hangAtPole())) { // Held muss wohl fallen... status = FALLING; @@ -539,7 +539,7 @@ void KGrHero::setSpeed (int gamespeed) void KGrHero::walkTimeDone () { if (! started) return; // Ignore signals from earlier play. - if (KGrObject::frozen) {walkFrozen = TRUE; return; } + if (KGrObject::frozen) {walkFrozen = true; return; } if ((*playfield)[x][y]->whatIam() == BRICK) { emit caughtHero(); // Brick closed over hero. @@ -587,7 +587,7 @@ void KGrHero::walkTimeDone () if (!canStand()&&!hangAtPole()) initFall(FALL1, FALLDELAY); else - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); // This additional showFigure() is to update the hero position after it is // altered by the hero-enemy deadlock fix in standOnEnemy(). Messy, but ... @@ -602,11 +602,11 @@ void KGrHero::walkTimeDone () void KGrHero::fallTimeDone() { if (! started) return; // Ignore signals from earlier play. - if (KGrObject::frozen) {fallFrozen = TRUE; return; } + if (KGrObject::frozen) {fallFrozen = true; return; } if (!standOnEnemy()) { if (walkCounter++ < 4) { // Held fällt vier Positionen - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); rely+=STEP; absy+=STEP; } @@ -617,12 +617,12 @@ void KGrHero::fallTimeDone() absy = y*16; // wird Null und Figur eins runter collectNugget(); // gesetzt. Zeit evtl. Nugget zu nehmen if (! (canStand()||hangAtPole())) { // Held muss wohl weiterfallen. - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); walkCounter = 1; } else { // Held hat Boden (oder Feind) unter den status = STANDING; // Füssen oder hängt an Stange -> steh! - walkTimer->start((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start((WALKDELAY * NSPEED) / speed, true); direction = (actualPixmap == 19) ? RIGHT : LEFT; if ((*playfield)[x][y]->whatIam() == POLE) actualPixmap = (direction == RIGHT)? RIGHTCLIMB1:LEFTCLIMB1; @@ -643,11 +643,11 @@ void KGrHero::fallTimeDone() // else // Reduce jerkiness when descending over a falling enemy. // actualPixmap = (direction == RIGHT)? RIGHTWALK1:LEFTWALK1; - walkTimer->start((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start((WALKDELAY * NSPEED) / speed, true); } else { // Else, freeze hero until enemy moves out of the way. - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); } } if (isInEnemy() && (! standOnEnemy())) @@ -812,9 +812,9 @@ KGrEnemy :: KGrEnemy (KGrCanvas * view, int x, int y) birthX=x; birthY=y; - walkFrozen = FALSE; - fallFrozen = FALSE; - captiveFrozen = FALSE; + walkFrozen = false; + fallFrozen = false; + captiveFrozen = false; captiveTimer = new TQTimer (this); connect (captiveTimer,TQ_SIGNAL(timeout()),TQ_SLOT(captiveTimeDone())); @@ -828,15 +828,15 @@ int KGrEnemy::CAPTIVEDELAY = 0; void KGrEnemy::doStep() { if (walkFrozen) { - walkFrozen = FALSE; + walkFrozen = false; walkTimeDone(); } if (fallFrozen) { - fallFrozen = FALSE; + fallFrozen = false; fallTimeDone(); } if (captiveFrozen) { - captiveFrozen = FALSE; + captiveFrozen = false; captiveTimeDone(); } } @@ -885,7 +885,7 @@ void KGrEnemy::init(int a,int b) void KGrEnemy::walkTimeDone () { - if (KGrObject::frozen) {walkFrozen = TRUE; return; } + if (KGrObject::frozen) {walkFrozen = true; return; } // Check we are alive BEFORE checking for friends being in the way. // Maybe a friend overhead is blocking our escape from a brick. @@ -932,7 +932,7 @@ void KGrEnemy::walkTimeDone () } status = WALKING; // initialisiere die Zählervariablen und walkCounter = 1; // den Timer um den Held weiter - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); // zu jagen + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); // zu jagen startWalk (); } } @@ -953,14 +953,14 @@ void KGrEnemy::walkTimeDone () rely = 0; absy = 16 * y; startWalk (); } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } showFigure(); } void KGrEnemy::fallTimeDone () { - if (KGrObject::frozen) {fallFrozen = TRUE; return; } + if (KGrObject::frozen) {fallFrozen = true; return; } if ((*playfield)[x][y+1]->whatIam() == HOLE) { // wenn Enemy ins Loch fällt ((KGrBrick*)(*playfield)[x][y+1])->useHole(); // reserviere das Loch, damit @@ -990,12 +990,12 @@ void KGrEnemy::fallTimeDone () } if (standOnEnemy()) { // Don't fall into a friend. - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); return; } if (walkCounter++ < 4){ - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); { rely+=STEP; absy+=STEP;} } else { @@ -1003,10 +1003,10 @@ void KGrEnemy::fallTimeDone () if ((*playfield)[x][y]->whatIam() == USEDHOLE) { captiveCounter = 0; status = CAPTIVE; - captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, TRUE); + captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, true); } else if (!(canStand()||hangAtPole())) { - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); walkCounter=1; } else { @@ -1019,7 +1019,7 @@ void KGrEnemy::fallTimeDone () status = WALKING; walkCounter = 1; direction = searchbestway(x,y,herox,heroy); - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); startWalk (); if (!nuggets) collectNugget(); @@ -1031,7 +1031,7 @@ void KGrEnemy::fallTimeDone () void KGrEnemy::captiveTimeDone() { - if (KGrObject::frozen) {captiveFrozen = TRUE; return; } + if (KGrObject::frozen) {captiveFrozen = true; return; } if ((*playfield)[x][y]->whatIam()==BRICK) dieAndReappear(); else @@ -1039,11 +1039,11 @@ void KGrEnemy::captiveTimeDone() status = WALKING; walkCounter = 1; direction = UP; - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); captiveCounter = 0; } else { captiveCounter ++; - captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, TRUE); + captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, true); showFigure(); } } @@ -1055,11 +1055,11 @@ void KGrEnemy::startSearching() if (canStand()||((*playfield)[x][y+1]->whatIam()==USEDHOLE)) { status = WALKING; - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { status = FALLING; - fallTimer->start ((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start ((FALLDELAY * NSPEED) / speed, true); } walkCounter = 1; @@ -1137,7 +1137,7 @@ void KGrEnemy::dieAndReappear() if (reappearAtTop) { // Follow Traditional rules: enemies reappear at top. - looking = TRUE; + looking = true; y = 2; // Randomly look for a free spot in row 2. Limit the number of tries. for (i = 1; ((i <= 3) && looking); i++) { @@ -1145,7 +1145,7 @@ void KGrEnemy::dieAndReappear() switch ((*playfield)[x][2]->whatIam()) { case FREE: case HLADDER: - looking = FALSE; + looking = false; break; default: break; @@ -1160,7 +1160,7 @@ void KGrEnemy::dieAndReappear() switch ((*playfield)[x][y]->whatIam()) { case FREE: case HLADDER: - looking = FALSE; + looking = false; break; default: break; @@ -1540,7 +1540,7 @@ int KGrEnemy::distanceDown (int x, int y, int deltah) int rungs = -1; int exitRung = 0; - bool canGoThru = TRUE; + bool canGoThru = true; char objType; // If there is a way down at (x,y), return its length, else return zero. @@ -1557,7 +1557,7 @@ int KGrEnemy::distanceDown (int x, int y, int deltah) if ((objType == HOLE) && (rungs < 0)) rungs = 0; // Enemy can go SIDEWAYS through a hole. else - canGoThru = FALSE; // Cannot go through here. + canGoThru = false; // Cannot go through here. break; case LADDER: case POLE: // Can go through or stop. @@ -1575,7 +1575,7 @@ int KGrEnemy::distanceDown (int x, int y, int deltah) exitRung = rungs; } else - canGoThru = FALSE; // Should stop at hero's level. + canGoThru = false; // Should stop at hero's level. } break; default: @@ -1603,9 +1603,9 @@ bool KGrEnemy::searchOK (int direction, int x, int y) if (canWalkLR (direction, x, y) > 0) { // Can go into that cell, but check for a fall. if (willNotFall (x+direction, y)) - return TRUE; + return true; } - return FALSE; // Cannot go into and through that cell. + return false; // Cannot go into and through that cell. } int KGrEnemy::canWalkLR (int direction, int x, int y) @@ -1637,7 +1637,7 @@ bool KGrEnemy::willNotFall (int x, int y) switch ( (*playfield)[x][y]->whatIam()) { case LADDER: case POLE: - return TRUE; break; // OK, can hang on ladder or pole. + return true; break; // OK, can hang on ladder or pole. default: break; } @@ -1661,12 +1661,12 @@ bool KGrEnemy::willNotFall (int x, int y) for (c = 0; c < cmax; c++) { enemy = enemies->at(c); if ((enemy->getx()==16*x) && (enemy->gety()==16*(y+1))) - return TRUE; // Standing on a friend. + return true; // Standing on a friend. } - return FALSE; break; // Will fall: there is no floor. + return false; break; // Will fall: there is no floor. default: - return TRUE; break; // OK, will not fall. + return true; break; // OK, will not fall. } } @@ -1733,13 +1733,13 @@ bool KGrEnemy::bumpingFriend() if ((dx >= -32) && (dx < 16) && (dy > -16) && (dy < 16)) { if ((enemy->direction == RIGHT) && (enemy->status == WALKING) && (absx%16==0)) { - return TRUE; + return true; } else if (dx >= -16) { if ((dx > -16) && (enemyId < enemy->enemyId)) - return FALSE; + return false; else - return TRUE; // Wait for the one in front. + return true; // Wait for the one in front. } } break; @@ -1747,13 +1747,13 @@ bool KGrEnemy::bumpingFriend() if ((dx > -16) && (dx < 32) && (dy > -16) && (dy < 16)) { if ((enemy->direction == LEFT) && (enemy->status == WALKING) && (absx%16==0)) { - return TRUE; + return true; } else if (dx <= 16) { if ((dx < 16) && (enemyId < enemy->enemyId)) - return FALSE; + return false; else - return TRUE; // Wait for the one in front. + return true; // Wait for the one in front. } } break; @@ -1761,13 +1761,13 @@ bool KGrEnemy::bumpingFriend() if ((dy >= -32) && (dy < 16) && (dx > -16) && (dx < 16)) { if ((enemy->direction == DOWN) && (enemy->status == WALKING) && (absy%16==0)) { - return TRUE; + return true; } else if (dy >= -16) { if ((dy > -16) && (enemyId < enemy->enemyId)) - return FALSE; + return false; else - return TRUE; // Wait for the one above. + return true; // Wait for the one above. } } break; @@ -1775,13 +1775,13 @@ bool KGrEnemy::bumpingFriend() if ((dy > -16) && (dy < 32) && (dx > -16) && (dx < 16)) { if ((enemy->direction == UP) && (enemy->status == WALKING) && (absy%16==0)) { - return TRUE; + return true; } else if (dy <= 16) { if ((dy < 16) && (enemyId < enemy->enemyId)) - return FALSE; + return false; else - return TRUE; // Wait for the one below. + return true; // Wait for the one below. } } break; @@ -1790,7 +1790,7 @@ bool KGrEnemy::bumpingFriend() } } } - return FALSE; + return false; } KGrEnemy :: ~KGrEnemy () diff --git a/kgoldrunner/src/kgrgame.cpp b/kgoldrunner/src/kgrgame.cpp index 080f55e6..6cc0638c 100644 --- a/kgoldrunner/src/kgrgame.cpp +++ b/kgoldrunner/src/kgrgame.cpp @@ -44,24 +44,24 @@ KGrGame::KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDi userDataDir = theUserDir; // Set the game-editor OFF, but available. - editMode = FALSE; - paintEditObj = FALSE; + editMode = false; + paintEditObj = false; editObj = BRICK; - shouldSave = FALSE; + shouldSave = false; - enemies.setAutoDelete(TRUE); + enemies.setAutoDelete(true); hero = new KGrHero (view, 0, 0); // The hero is born ... Yay !!! hero->setPlayfield (&playfield); - setBlankLevel (TRUE); // Fill the playfield with blank walls. + setBlankLevel (true); // Fill the playfield with blank walls. enemy = NULL; - newLevel = TRUE; // Next level will be a new one. - loading = TRUE; // Stop input until it is loaded. + newLevel = true; // Next level will be a new one. + loading = true; // Stop input until it is loaded. - modalFreeze = FALSE; - messageFreeze = FALSE; + modalFreeze = false; + messageFreeze = false; connect (hero, TQ_SIGNAL (gotNugget(int)), TQ_SLOT (incScore(int))); connect (hero, TQ_SIGNAL (caughtHero()), TQ_SLOT (herosDead())); @@ -74,7 +74,7 @@ KGrGame::KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDi // Get the mouse position every 40 msec. It is used to steer the hero. mouseSampler = new TQTimer (this); connect (mouseSampler, TQ_SIGNAL(timeout()), TQ_SLOT (readMousePos ())); - mouseSampler->start (40, FALSE); + mouseSampler->start (40, false); srand(1); // initialisiere Random-Generator } @@ -104,7 +104,7 @@ void KGrGame::startNextLevel() void KGrGame::startLevel (int startingAt, int requestedLevel) { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } // Use dialog box to select game and level: startingAt = ID_FIRST or ID_ANY. @@ -135,8 +135,8 @@ void KGrGame::herosDead() if (--lives > 0) { // Still some life left, so PAUSE and then re-start the level. emit showLives (lives); - KGrObject::frozen = TRUE; // Freeze the animation and let - dyingTimer->start (1500, TRUE); // the player see what happened. + KGrObject::frozen = true; // Freeze the animation and let + dyingTimer->start (1500, true); // the player see what happened. } else { // Game over: display the "ENDE" screen. @@ -150,10 +150,10 @@ void KGrGame::herosDead() enemies.clear(); // Stop the enemies catching the hero again ... view->deleteEnemySprites(); unfreeze(); // ... NOW we can unfreeze. - newLevel = TRUE; + newLevel = true; level = 0; loadLevel (level); // Display the "ENDE" screen. - newLevel = FALSE; + newLevel = false; } } @@ -165,7 +165,7 @@ void KGrGame::finalBreath() enemyCount = 0; // Hero is dead: re-start the level. loadLevel (level); } - KGrObject::frozen = FALSE; // Unfreeze the game, but don't move yet. + KGrObject::frozen = false; // Unfreeze the game, but don't move yet. } void KGrGame::showHiddenLadders() @@ -204,9 +204,9 @@ void KGrGame::goUpOneLevel() enemyCount = 0; enemies.clear(); view->deleteEnemySprites(); - newLevel = TRUE; + newLevel = true; loadLevel (level); - newLevel = FALSE; + newLevel = false; } void KGrGame::loseNugget() @@ -226,17 +226,17 @@ int KGrGame::getLevel() // Return the current game-level. bool KGrGame::inMouseMode() { - return (mouseMode); // Return TRUE if game is under mouse control. + return (mouseMode); // Return true if game is under mouse control. } bool KGrGame::inEditMode() { - return (editMode); // Return TRUE if the game-editor is active. + return (editMode); // Return true if the game-editor is active. } bool KGrGame::isLoading() { - return (loading); // Return TRUE if a level is being loaded. + return (loading); // Return true if a level is being loaded. } void KGrGame::setMouseMode (bool on_off) @@ -247,33 +247,33 @@ void KGrGame::setMouseMode (bool on_off) void KGrGame::freeze() { if ((! modalFreeze) && (! messageFreeze)) { - emit gameFreeze (TRUE); // Do visual feedback in the GUI. + emit gameFreeze (true); // Do visual feedback in the GUI. } - KGrObject::frozen = TRUE; // Halt the game, by blocking all timer events. + KGrObject::frozen = true; // Halt the game, by blocking all timer events. } void KGrGame::unfreeze() { if ((! modalFreeze) && (! messageFreeze)) { - emit gameFreeze (FALSE);// Do visual feedback in the GUI. + emit gameFreeze (false);// Do visual feedback in the GUI. } - KGrObject::frozen = FALSE; // Restart the game. Because frozen == FALSE, + KGrObject::frozen = false; // Restart the game. Because frozen == false, restart(); // the game goes on running after the next step. } void KGrGame::setMessageFreeze (bool on_off) { if (on_off) { // Freeze the game action during a message. - messageFreeze = FALSE; + messageFreeze = false; if (! KGrObject::frozen) { - messageFreeze = TRUE; + messageFreeze = true; freeze(); } } else { // Unfreeze the game action after a message. if (messageFreeze) { unfreeze(); - messageFreeze = FALSE; + messageFreeze = false; } } } @@ -318,19 +318,19 @@ void KGrGame::setBlankLevel(bool playable) void KGrGame::newGame (const int lev, const int gameIndex) { // Ignore player input from keyboard or mouse while the screen is set up. - loading = TRUE; // "loadLevel (level)" will reset it. + loading = true; // "loadLevel (level)" will reset it. if (editMode) { - emit setEditMenu (FALSE); // Disable edit menu items and toolbar. + emit setEditMenu (false); // Disable edit menu items and toolbar. - editMode = FALSE; - paintEditObj = FALSE; + editMode = false; + paintEditObj = false; editObj = BRICK; - view->setHeroVisible (TRUE); + view->setHeroVisible (true); } - newLevel = TRUE; + newLevel = true; level = lev; collnIndex = gameIndex; collection = collections.at (collnIndex); @@ -348,26 +348,26 @@ void KGrGame::newGame (const int lev, const int gameIndex) enemies.clear(); view->deleteEnemySprites(); - newLevel = TRUE;; + newLevel = true;; loadLevel (level); - newLevel = FALSE; + newLevel = false; } void KGrGame::startTutorial() { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } int i, index; int imax = collections.count(); - bool found = FALSE; + bool found = false; index = 0; for (i = 0; i < imax; i++) { index = i; // Index within owner. if (collections.at(i)->prefix == "tute") { - found = TRUE; + found = true; break; } } @@ -410,7 +410,7 @@ int KGrGame::loadLevel (int levelNo) } // Ignore player input from keyboard or mouse while the screen is set up. - loading = TRUE; + loading = true; nuggets = 0; enemyCount=0; @@ -494,7 +494,7 @@ int KGrGame::loadLevel (int levelNo) connect (view, TQ_SIGNAL(mouseClick(int)), TQ_SLOT(doDig(int))); // Re-enable player input. - loading = FALSE; + loading = false; return 1; } @@ -515,17 +515,17 @@ bool KGrGame::openLevelFile (int levelNo, TQFile & openlevel) i18n("Cannot find file '%1'. Please make sure '%2' has been " "run in the '%3' folder.") .arg(filePath).arg("tar xf levels.tar").arg(systemDataDir.myStr())); - return (FALSE); + return (false); } // �ffne Level zum lesen if (! openlevel.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Level"), i18n("Cannot open file '%1' for read-only.").arg(filePath)); - return (FALSE); + return (false); } - return (TRUE); + return (true); } void KGrGame::changeObject (unsigned char kind, int i, int j) @@ -544,7 +544,7 @@ void KGrGame::changeObject (unsigned char kind, int i, int j) case HERO: createObject(new KGrFree (FREE,i,j,view),FREE,i,j); hero->init(i,j); startI = i; startJ = j; - hero->started = FALSE; + hero->started = false; hero->showFigure(); break; case ENEMY: createObject(new KGrFree (FREE,i,j,view),FREE,i,j); @@ -826,14 +826,14 @@ void KGrGame::saveGame() // Save game ID, score and level. file2.close(); TQDir dir; - dir.rename (file2.name(), file1.name(), TRUE); + dir.rename (file2.name(), file1.name(), true); KGrMessage::information (view, i18n("Save Game"), i18n("Your game has been saved.")); } void KGrGame::loadGame() // Re-load game, score and level. { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } @@ -853,9 +853,9 @@ void KGrGame::loadGame() // Re-load game, score and level. } // Halt the game during the loadGame() dialog. - modalFreeze = FALSE; + modalFreeze = false; if (!KGrObject::frozen) { - modalFreeze = TRUE; + modalFreeze = true; freeze(); } @@ -868,7 +868,7 @@ void KGrGame::loadGame() // Re-load game, score and level. s = lg->getCurrentText(); } - bool found = FALSE; + bool found = false; TQString pr; int lev; int i; @@ -876,14 +876,14 @@ void KGrGame::loadGame() // Re-load game, score and level. if (! s.isNull()) { pr = s.mid (21, 7); // Get the collection prefix. - pr = pr.left (pr.find (" ", 0, FALSE)); + pr = pr.left (pr.find (" ", 0, false)); for (i = 0; i < imax; i++) { // Find the collection. if (collections.at(i)->prefix == pr) { collection = collections.at(i); collnIndex = i; owner = collections.at(i)->owner; - found = TRUE; + found = true; break; } } @@ -906,7 +906,7 @@ void KGrGame::loadGame() // Re-load game, score and level. // Unfreeze the game, but only if it was previously unfrozen. if (modalFreeze) { unfreeze(); - modalFreeze = FALSE; + modalFreeze = false; } delete lg; @@ -918,7 +918,7 @@ void KGrGame::loadGame() // Re-load game, score and level. void KGrGame::checkHighScore() { - bool prevHigh = TRUE; + bool prevHigh = true; TQ_INT16 prevLevel = 0; TQ_INT32 prevScore = 0; TQString thisUser = i18n("Unknown"); @@ -938,7 +938,7 @@ void KGrGame::checkHighScore() if (! high1.exists()) { high1.setName (systemDataDir + "hi_" + collection->prefix + ".dat"); if (! high1.exists()) { - prevHigh = FALSE; + prevHigh = false; } } @@ -953,7 +953,7 @@ void KGrGame::checkHighScore() // Read previous users, levels and scores from the high score file. s1.setDevice (&high1); - bool found = FALSE; + bool found = false; highCount = 0; while (! s1.endData()) { char * prevUser; @@ -966,7 +966,7 @@ void KGrGame::checkHighScore() delete prevDate; highCount++; if (score > prevScore) { - found = TRUE; // We have a high score. + found = true; // We have a high score. break; } } @@ -992,7 +992,7 @@ void KGrGame::checkHighScore() } // Dialog to ask the user to enter their name. - TQDialog * hsn = new TQDialog (view, "hsNameDialog", TRUE, + TQDialog * hsn = new TQDialog (view, "hsNameDialog", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; @@ -1023,7 +1023,7 @@ void KGrGame::checkHighScore() connect (hsnUser, TQ_SIGNAL (returnPressed ()), hsn, TQ_SLOT (accept ())); connect (OK, TQ_SIGNAL (clicked ()), hsn, TQ_SLOT (accept ())); - while (TRUE) { + while (true) { hsn->exec(); thisUser = hsnUser->text(); if (thisUser.length() > 0) @@ -1050,7 +1050,7 @@ void KGrGame::checkHighScore() if (prevHigh) { high1.reset(); - bool scoreRecorded = FALSE; + bool scoreRecorded = false; highCount = 0; while ((! s1.endData()) && (highCount < 10)) { char * prevUser; @@ -1067,7 +1067,7 @@ void KGrGame::checkHighScore() s2 << (TQ_INT16) level; s2 << (TQ_INT32) score; s2 << hsDate.myStr(); - scoreRecorded = TRUE; + scoreRecorded = true; } if (highCount < 10) { highCount++; @@ -1102,7 +1102,7 @@ void KGrGame::checkHighScore() TQDir dir; dir.rename (high2.name(), - userDataDir + "hi_" + collection->prefix + ".dat", TRUE); + userDataDir + "hi_" + collection->prefix + ".dat", true); KGrMessage::information (view, i18n("Save High Score"), i18n("Your high score has been saved.")); @@ -1144,7 +1144,7 @@ void KGrGame::showHighScores() return; } - TQDialog * hs = new TQDialog (view, "hsDialog", TRUE, + TQDialog * hs = new TQDialog (view, "hsDialog", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; @@ -1164,8 +1164,8 @@ void KGrGame::showHighScores() #else TQFont f = TDEGlobalSettings::fixedFont(); // KDE version. #endif - f. setFixedPitch (TRUE); - f. setBold (TRUE); + f. setFixedPitch (true); + f. setBold (true); hsColHeader-> setFont (f); TQLabel * hsLine [10]; @@ -1182,7 +1182,7 @@ void KGrGame::showHighScores() OK-> setAccel (Key_Return); // Set up the format for the high-score lines. - f. setBold (FALSE); + f. setBold (false); TQString line; const char * hsFormat = "%2d. %-30.30s %3d %7ld %s"; @@ -1250,7 +1250,7 @@ void KGrGame::restart() temp = KGrObject::frozen; - KGrObject::frozen = FALSE; // Temporarily restart the game, by re-running + KGrObject::frozen = false; // Temporarily restart the game, by re-running // any timer events that have been blocked. readMousePos(); // Set hero's direction. @@ -1270,7 +1270,7 @@ void KGrGame::restart() ((KGrBrick *)playfield[i][j])->doStep(); } - KGrObject::frozen = temp; // If frozen was TRUE, halt again, which gives a + KGrObject::frozen = temp; // If frozen was true, halt again, which gives a // single-step effect, otherwise go on running. } @@ -1323,7 +1323,7 @@ void KGrGame::showObjectState() void KGrGame::bugFix() { if (KGrObject::frozen) { // Toggle a bug fix on/off dynamically. - KGrObject::bugFixed = (KGrObject::bugFixed) ? FALSE : TRUE; + KGrObject::bugFixed = (KGrObject::bugFixed) ? false : true; printf ("%s", (KGrObject::bugFixed) ? "\n" : ""); printf (">>> Bug fix is %s\n", (KGrObject::bugFixed) ? "ON" : "OFF\n"); } @@ -1332,7 +1332,7 @@ void KGrGame::bugFix() void KGrGame::startLogging() { if (KGrObject::frozen) { // Toggle logging on/off dynamically. - KGrObject::logging = (KGrObject::logging) ? FALSE : TRUE; + KGrObject::logging = (KGrObject::logging) ? false : true; printf ("%s", (KGrObject::logging) ? "\n" : ""); printf (">>> Logging is %s\n", (KGrObject::logging) ? "ON" : "OFF\n"); } @@ -1351,7 +1351,7 @@ void KGrGame::createLevel() { int i, j; - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } @@ -1364,7 +1364,7 @@ void KGrGame::createLevel() } // Ignore player input from keyboard or mouse while the screen is set up. - loading = TRUE; + loading = true; level = 0; initEdit(); @@ -1392,7 +1392,7 @@ void KGrGame::createLevel() } // Re-enable player input. - loading = FALSE; + loading = false; view->updateCanvas(); // Show the edit area. view->update(); // Show the level name. @@ -1400,7 +1400,7 @@ void KGrGame::createLevel() void KGrGame::updateLevel() { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } @@ -1429,7 +1429,7 @@ void KGrGame::updateLevel() void KGrGame::updateNext() { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } level++; @@ -1445,7 +1445,7 @@ void KGrGame::loadEditLevel (int lev) return; // Ignore player input from keyboard or mouse while the screen is set up. - loading = TRUE; + loading = true; level = lev; initEdit(); @@ -1498,7 +1498,7 @@ void KGrGame::loadEditLevel (int lev) showEditLevel(); // Reconnect signals. // Re-enable player input. - loading = FALSE; + loading = false; } void KGrGame::editNameAndHint() @@ -1512,7 +1512,7 @@ void KGrGame::editNameAndHint() if (nh->exec() == TQDialog::Accepted) { levelName = nh->getName(); levelHint = nh->getHint(); - shouldSave = TRUE; + shouldSave = true; } delete nh; @@ -1530,7 +1530,7 @@ bool KGrGame::saveLevelFile() if (! editMode) { KGrMessage::information (view, i18n("Save Level"), i18n("Inappropriate action: you are not editing a level.")); - return (FALSE); + return (false); } // Save the current collection index. @@ -1548,7 +1548,7 @@ bool KGrGame::saveLevelFile() // Pop up dialog box, which could change the collection or level or both. selectedLevel = selectLevel (action, selectedLevel); if (selectedLevel == 0) - return (FALSE); + return (false); // Get the new collection (if changed). int n = collnIndex; @@ -1559,10 +1559,10 @@ bool KGrGame::saveLevelFile() if ((action == SL_SAVE) && (n == N) && (selectedLevel == level)) { // This is a normal edit: the old file is to be re-written. - isNew = FALSE; + isNew = false; } else { - isNew = TRUE; + isNew = true; // Check if the file is to be inserted in or appended to the collection. if (levelFile.exists()) { switch (KGrMessage::warning (view, i18n("Save Level"), @@ -1572,10 +1572,10 @@ bool KGrGame::saveLevelFile() case 0: if (! reNumberLevels (n, selectedLevel, collections.at(n)->nLevels, +1)) { - return (FALSE); + return (false); } break; - case 1: return (FALSE); + case 1: return (false); break; } } @@ -1585,7 +1585,7 @@ bool KGrGame::saveLevelFile() if (! levelFile.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Level"), i18n("Cannot open file '%1' for output.").arg(filePath)); - return (FALSE); + return (false); } // Save the level. @@ -1622,7 +1622,7 @@ bool KGrGame::saveLevelFile() } levelFile.close (); - shouldSave = FALSE; + shouldSave = false; if (isNew) { collections.at(n)->nLevels++; @@ -1633,7 +1633,7 @@ bool KGrGame::saveLevelFile() emit showLevel (level); view->setTitle (getTitle()); // Display new title. view->updateCanvas(); // Show the edit area. - return (TRUE); + return (true); } void KGrGame::moveLevelFile () @@ -1690,7 +1690,7 @@ void KGrGame::moveLevelFile () filePath1 = getFilePath (USER, collections.at(fromC), fromL); filePath2 = filePath1; filePath2 = filePath2.append (".tmp"); - dir.rename (filePath1, filePath2, TRUE); + dir.rename (filePath1, filePath2, true); if (toC == fromC) { // Same collection. if (toL < fromL) { // Decrease level. @@ -1725,7 +1725,7 @@ void KGrGame::moveLevelFile () // Rename the saved "fromL" file to become "toL". filePath1 = getFilePath (USER, collections.at(toC), toL); - dir.rename (filePath2, filePath1, TRUE); + dir.rename (filePath2, filePath1, true); level = toL; collection = collections.at(toC); @@ -1801,9 +1801,9 @@ void KGrGame::deleteLevelFile () enemyCount = 0; // Load level in play mode. enemies.clear(); view->deleteEnemySprites(); - newLevel = TRUE;; + newLevel = true;; loadLevel (level); - newLevel = FALSE; + newLevel = false; } else { createLevel(); // No levels left in collection. @@ -1855,10 +1855,10 @@ void KGrGame::editCollection (int action) continue; } - bool allAlpha = TRUE; + bool allAlpha = true; for (int i = 0; i < len; i++) { if (! isalpha(ecPrefix.myChar(i))) { - allAlpha = FALSE; + allAlpha = false; break; } } @@ -1869,13 +1869,13 @@ void KGrGame::editCollection (int action) continue; } - bool duplicatePrefix = FALSE; + bool duplicatePrefix = false; KGrCollection * c; int imax = collections.count(); for (int i = 0; i < imax; i++) { c = collections.at(i); if ((c->prefix == ecPrefix) && (i != n)) { - duplicatePrefix = TRUE; + duplicatePrefix = true; break; } } @@ -1921,7 +1921,7 @@ bool KGrGame::saveOK (bool exiting) bool result; TQString option2 = i18n("&Go on editing"); - result = TRUE; + result = true; if (editMode) { if (exiting) { // If window is closing, @@ -1930,14 +1930,14 @@ bool KGrGame::saveOK (bool exiting) for (j = 1; j <= FIELDHEIGHT; j++) for (i = 1; i <= FIELDWIDTH; i++) { // Check cell changes. if ((shouldSave) || (editObjArray[i][j] != lastSaveArray[i][j])) { - // If shouldSave == TRUE, level name or hint was edited. + // If shouldSave == true, level name or hint was edited. switch (KGrMessage::warning (view, i18n("Editor"), i18n("You have not saved your work. Do " "you want to save it now?"), i18n("&Save"), i18n("&Don't Save"), option2)) { case 0: result = saveLevelFile(); break;// Save and continue. - case 1: shouldSave = FALSE; break; // Continue: don't save. - case 2: result = FALSE; break; // Go back to editing. + case 1: shouldSave = false; break; // Continue: don't save. + case 2: result = false; break; // Go back to editing. } return (result); } @@ -1950,15 +1950,15 @@ void KGrGame::initEdit() { if (! editMode) { - editMode = TRUE; - emit setEditMenu (TRUE); // Enable edit menu items and toolbar. + editMode = true; + emit setEditMenu (true); // Enable edit menu items and toolbar. // We were previously in play mode: stop the hero running or falling. hero->init (1, 1); - view->setHeroVisible (FALSE); + view->setHeroVisible (false); } - paintEditObj = FALSE; + paintEditObj = false; // Set the default object and button. editObj = BRICK; @@ -1977,12 +1977,12 @@ void KGrGame::initEdit() emit showScore (0); deleteLevel(); - setBlankLevel(FALSE); // Fill playfield with Editable objects. + setBlankLevel(false); // Fill playfield with Editable objects. view->setTitle (getTitle());// Show title of level. view->updateCanvas(); // Show the edit area. - shouldSave = FALSE; // Used to flag editing of name or hint. + shouldSave = false; // Used to flag editing of name or hint. } void KGrGame::deleteLevel() @@ -2058,16 +2058,16 @@ bool KGrGame::reNumberLevels (int cIndex, int first, int last, int inc) while (i != n) { file1 = getFilePath (USER, collections.at(cIndex), i); file2 = getFilePath (USER, collections.at(cIndex), i - step); - if (! dir.rename (file1, file2, TRUE)) { // Allow absolute paths. + if (! dir.rename (file1, file2, true)) { // Allow absolute paths. KGrMessage::information (view, i18n("Save Level"), i18n("Cannot rename file '%1' to '%2'.") .arg(file1).arg(file2)); - return (FALSE); + return (false); } i = i + step; } - return (TRUE); + return (true); } void KGrGame::setLevel (int lev) @@ -2092,7 +2092,7 @@ void KGrGame::doEdit (int button) switch (button) { case TQt::LeftButton: case TQt::RightButton: - paintEditObj = TRUE; + paintEditObj = true; insertEditObj (i, j); view->updateCanvas(); oldI = i; @@ -2115,7 +2115,7 @@ void KGrGame::endEdit (int button) switch (button) { case TQt::LeftButton: case TQt::RightButton: - paintEditObj = FALSE; + paintEditObj = false; if ((i != oldI) || (j != oldJ)) { insertEditObj (i, j); view->updateCanvas(); @@ -2135,9 +2135,9 @@ int KGrGame::selectLevel (int action, int requestedLevel) int selectedLevel = 0; // 0 = no selection (Cancel) or invalid. // Halt the game during the dialog. - modalFreeze = FALSE; + modalFreeze = false; if (! KGrObject::frozen) { - modalFreeze = TRUE; + modalFreeze = true; freeze(); } @@ -2199,7 +2199,7 @@ int KGrGame::selectLevel (int action, int requestedLevel) // Unfreeze the game, but only if it was previously unfrozen. if (modalFreeze) { unfreeze(); - modalFreeze = FALSE; + modalFreeze = false; } delete sl; @@ -2210,11 +2210,11 @@ bool KGrGame::ownerOK (Owner o) { // Check that this owner has at least one collection. KGrCollection * c; - bool OK = FALSE; + bool OK = false; for (c = collections.first(); c != 0; c = collections.next()) { if (c->owner == o) { - OK = TRUE; + OK = true; break; } } @@ -2335,10 +2335,10 @@ void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". bool KGrGame::initCollections () { // Initialise the list of collections of levels (i.e. the list of games). - collections.setAutoDelete(TRUE); + collections.setAutoDelete(true); owner = SYSTEM; // Use system levels initially. if (! loadCollections (SYSTEM)) // Load system collections list. - return (FALSE); // If no collections, abort. + return (false); // If no collections, abort. loadCollections (USER); // Load user collections list. // If none, don't worry. @@ -2349,7 +2349,7 @@ bool KGrGame::initCollections () collection = collections.at (collnIndex); level = 1; // Default start is at level 1. - return (TRUE); + return (true); } void KGrGame::mapCollections() @@ -2401,7 +2401,7 @@ void KGrGame::mapCollections() // Get the name of the file found on disk. fileName1 = file->fileName(); - while (TRUE) { + while (true) { // Work out what the file name should be, based on the level no. fileName2.setNum (lev); // Convert to TQString. fileName2 = fileName2.rightJustify (3,'0'); // Add zeros. @@ -2459,13 +2459,13 @@ bool KGrGame::loadCollections (Owner o) i18n("Cannot find game info file '%1'.") .arg(filePath)); } - return (FALSE); + return (false); } if (! c.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Game Info"), i18n("Cannot open file '%1' for read-only.").arg(filePath)); - return (FALSE); + return (false); } TQCString line = ""; @@ -2515,14 +2515,14 @@ bool KGrGame::loadCollections (Owner o) i18n("Format error in game info file '%1'.") .arg(filePath)); c.close(); - return (FALSE); + return (false); } line = ""; } } c.close(); - return (TRUE); + return (true); } bool KGrGame::saveCollections (Owner o) @@ -2532,7 +2532,7 @@ bool KGrGame::saveCollections (Owner o) if (o != USER) { KGrMessage::information (view, i18n("Save Game Info"), i18n("You can only modify user games.")); - return (FALSE); + return (false); } filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; @@ -2543,7 +2543,7 @@ bool KGrGame::saveCollections (Owner o) if (! c.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game Info"), i18n("Cannot open file '%1' for output.").arg(filePath)); - return (FALSE); + return (false); } // Save the collections. @@ -2581,7 +2581,7 @@ bool KGrGame::saveCollections (Owner o) } c.close(); - return (TRUE); + return (true); } /******************************************************************************/ @@ -2591,12 +2591,12 @@ bool KGrGame::saveCollections (Owner o) void KGrGame::myMessage (TQWidget * parent, TQString title, TQString contents) { // Halt the game while the message is displayed. - setMessageFreeze (TRUE); + setMessageFreeze (true); KGrMessage::wrapped (parent, title, contents); // Unfreeze the game, but only if it was previously unfrozen. - setMessageFreeze (FALSE); + setMessageFreeze (false); } /******************************************************************************/ diff --git a/kgoldrunner/src/kgrobject.cpp b/kgoldrunner/src/kgrobject.cpp index 4152770b..8b4e7229 100644 --- a/kgoldrunner/src/kgrobject.cpp +++ b/kgoldrunner/src/kgrobject.cpp @@ -26,18 +26,18 @@ KGrObject::KGrObject (char objType) { iamA = objType; searchValue = 0; - blocker = FALSE; + blocker = false; if ((objType == BRICK) || (objType == BETON) || (objType == FBRICK)) { - blocker = TRUE; + blocker = true; } xpos = 0; ypos = 0; objectView = NULL; } -bool KGrObject::frozen = FALSE; // Initialise game as running, not halted. -bool KGrObject::bugFixed = FALSE;// Initialise game with dynamic bug-fix OFF. -bool KGrObject::logging = FALSE;// Initialise game with log printing OFF. +bool KGrObject::frozen = false; // Initialise game as running, not halted. +bool KGrObject::bugFixed = false;// Initialise game with dynamic bug-fix OFF. +bool KGrObject::logging = false;// Initialise game with log printing OFF. char KGrObject::whatIam () { @@ -103,7 +103,7 @@ KGrBrick::KGrBrick (char objType, int i, int j, KGrCanvas * view) ypos = j; objectView = view; dig_counter = 0; - holeFrozen = FALSE; + holeFrozen = false; iamA = BRICK; timer = new TQTimer (this); connect (timer, TQ_SIGNAL (timeout ()), TQ_SLOT (timeDone ())); @@ -116,12 +116,12 @@ void KGrBrick::dig (void) iamA = HOLE; objectView->paintCell (xpos, ypos, BRICK, dig_counter); objectView->updateCanvas(); - timer->start ((DIGDELAY * NSPEED) / speed, TRUE); + timer->start ((DIGDELAY * NSPEED) / speed, true); } void KGrBrick::doStep() { if (holeFrozen) { - holeFrozen = FALSE; + holeFrozen = false; timeDone(); } } @@ -137,19 +137,19 @@ void KGrBrick::showState (int i, int j) void KGrBrick::timeDone () { - if (KGrObject::frozen) {holeFrozen = TRUE; return;} + if (KGrObject::frozen) {holeFrozen = true; return;} // When the hole is complete, we need a longer delay. if (dig_counter == 5) { hole_counter--; if (hole_counter > 0) { - timer->start ((DIGDELAY * NSPEED) / speed, TRUE); + timer->start ((DIGDELAY * NSPEED) / speed, true); return; } } if (dig_counter < 9) { dig_counter++; - timer->start ((DIGDELAY * NSPEED) / speed, TRUE); + timer->start ((DIGDELAY * NSPEED) / speed, true); if (dig_counter >= 8) iamA = BRICK; } diff --git a/kgoldrunner/src/kgrobject.h b/kgoldrunner/src/kgrobject.h index 2ac41b3a..648b4344 100644 --- a/kgoldrunner/src/kgrobject.h +++ b/kgoldrunner/src/kgrobject.h @@ -41,7 +41,7 @@ public: char whatIam(); int searchValue; - bool blocker; // Beton or Brick -> TRUE + bool blocker; // Beton or Brick -> true void showState (int, int); protected: |