diff options
author | Christoph Mallon | 2012-03-13 10:40:41 +0100 |
---|---|---|
committer | Alyssa Milburn | 2012-03-13 15:43:36 +0100 |
commit | 75efdd2d84e21f5d3d01afcc89d61289ae87e4a2 (patch) | |
tree | f62ab385a4a0a483b894f91709dc7764bcec79ab /engines | |
parent | 337d5da913477889e9b2312ecce02e52c5ddf803 (diff) | |
download | scummvm-rg350-75efdd2d84e21f5d3d01afcc89d61289ae87e4a2.tar.gz scummvm-rg350-75efdd2d84e21f5d3d01afcc89d61289ae87e4a2.tar.bz2 scummvm-rg350-75efdd2d84e21f5d3d01afcc89d61289ae87e4a2.zip |
JANITORIAL: Replace (x ? false : true) by !(x).
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/eobcommon.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/gui_eob.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/screen_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sequences_hof.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/sprites_lol.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/timer_eob.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/vqa.cpp | 2 | ||||
-rw-r--r-- | engines/lastexpress/entities/chapters.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kmenu.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/controls16.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/menu.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/paint16.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/gfx_towns.cpp | 4 | ||||
-rw-r--r-- | engines/sword25/kernel/inputpersistenceblock.cpp | 2 | ||||
-rw-r--r-- | engines/sword25/script/luabindhelper.h | 2 |
15 files changed, 22 insertions, 22 deletions
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp index 1489e4f1f5..a63f123258 100644 --- a/engines/kyra/eobcommon.cpp +++ b/engines/kyra/eobcommon.cpp @@ -2066,7 +2066,7 @@ bool EoBCoreEngine::characterAttackHitTest(int charIndex, int monsterIndex, int s = CLIP(s, 1, 20); - return s < m ? false : true; + return s >= m; } bool EoBCoreEngine::monsterAttackHitTest(EoBMonsterInPlay *m, int charIndex) { @@ -2300,7 +2300,7 @@ bool EoBCoreEngine::trySavingThrow(void *target, int hpModifier, int level, int s -= constMod[c->constitutionCur]; } - return rollDice(1, 20) < s ? false : true; + return rollDice(1, 20) >= s; } bool EoBCoreEngine::specialAttackSavingThrow(int charIndex, int type) { diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp index e8e69d5b1f..76e4f0dba9 100644 --- a/engines/kyra/gui_eob.cpp +++ b/engines/kyra/gui_eob.cpp @@ -1876,7 +1876,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8 processButton(buttonList); if (v6 && buttonList->buttonCallback) - runLoop = ((*buttonList->buttonCallback.get())(buttonList)) ? false : true; + runLoop = !(*buttonList->buttonCallback.get())(buttonList); if ((flgs2 & 2) && (flgs & 0x20)) runLoop = false; @@ -2331,7 +2331,7 @@ bool GUI_EoB::confirmDialogue2(int dim, int id, int deflt) { _screen->setFont(of); _screen->setScreenDim(od); - return newHighlight ? false : true; + return newHighlight == 0; } void GUI_EoB::messageDialogue(int dim, int id, int buttonTextCol) { @@ -3548,7 +3548,7 @@ bool GUI_EoB::confirmDialogue(int id) { _vm->removeInputTop(); if (inputFlag == _vm->_keyMap[Common::KEYCODE_KP5] || inputFlag == _vm->_keyMap[Common::KEYCODE_SPACE] || inputFlag == _vm->_keyMap[Common::KEYCODE_RETURN]) { - result = lastHighlight ? false : true; + result = lastHighlight == 0; inputFlag = 0x8021 + lastHighlight; runLoop = false; } else if (inputFlag == _vm->_keyMap[Common::KEYCODE_KP4] || inputFlag == _vm->_keyMap[Common::KEYCODE_LEFT] || inputFlag == _vm->_keyMap[Common::KEYCODE_KP6] || inputFlag == _vm->_keyMap[Common::KEYCODE_RIGHT]) { diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp index dde22498eb..7d4b064e2a 100644 --- a/engines/kyra/screen_v2.cpp +++ b/engines/kyra/screen_v2.cpp @@ -365,7 +365,7 @@ bool Screen_v2::calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, i } } - return (w1 == -1) ? false : true; + return w1 != -1; } void Screen_v2::checkedPageUpdate(int srcPage, int dstPage) { diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index 686c3c9320..f2abfb81dc 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -32,7 +32,7 @@ namespace Kyra { void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) { seq_init(); - bool allowSkip = (!(_flags.isDemo && !_flags.isTalkie) && (startSeq == kSequenceTitle)) ? false : true; + bool allowSkip = (_flags.isDemo && !_flags.isTalkie) || startSeq != kSequenceTitle; if (endSeq == -1) endSeq = startSeq; @@ -74,7 +74,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) { _seqFrameCounter = 0; _seqStartTime = _system->getMillis(); - allowSkip = (!(_flags.isDemo && !_flags.isTalkie) && (seqNum == kSequenceTitle)) ? false : true; + allowSkip = (_flags.isDemo && !_flags.isTalkie) || seqNum != kSequenceTitle; Sequence cseq = _sequences->seq[seqNum]; SeqProc cb = _callbackS[seqNum]; diff --git a/engines/kyra/sprites_lol.cpp b/engines/kyra/sprites_lol.cpp index 5a05d81a22..a07abd4580 100644 --- a/engines/kyra/sprites_lol.cpp +++ b/engines/kyra/sprites_lol.cpp @@ -248,7 +248,7 @@ bool LoLEngine::updateMonsterAdjustBlocks(LoLMonster *monster) { int16 fx2 = 0; setLevelShapesDim(x2 + dims[y2], fx1, fx2, 13); - return (fx1 >= fx2) ? false : true; + return fx1 < fx2; } void LoLEngine::placeMonster(LoLMonster *monster, uint16 x, uint16 y) { @@ -1447,7 +1447,7 @@ void LoLEngine::rearrangeAttackingMonster(LoLMonster *monster) { uint16 mx = monster->x; uint16 my = monster->y; uint16 *c = (t & 1) ? &my : &mx; - bool centered = (*c & 0x7f) ? false : true; + bool centered = (*c & 0x7f) == 0; bool posFlag = true; if (monster->properties->maxWidth <= 63) { diff --git a/engines/kyra/timer_eob.cpp b/engines/kyra/timer_eob.cpp index de1becfa72..766fe453ab 100644 --- a/engines/kyra/timer_eob.cpp +++ b/engines/kyra/timer_eob.cpp @@ -186,7 +186,7 @@ void EoBCoreEngine::timerProcessFlyingObjects(int timerNum) { if (!fo->enable) continue; - bool endFlight = fo->distance ? false : true; + bool endFlight = fo->distance == 0; uint8 pos = dirPosIndex[(fo->direction << 2) + (fo->curPos & 3)]; uint16 bl = fo->curBlock; diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 04455ae307..471e83c9ed 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -395,7 +395,7 @@ void VQAMovie::displayFrame(uint frameNum) { if (frameNum >= _header.numFrames || !_opened) return; - bool foundSound = _stream ? false : true; + bool foundSound = !_stream; bool foundFrame = false; uint i; diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp index 96e08ba808..4ef2dc50e8 100644 --- a/engines/lastexpress/entities/chapters.cpp +++ b/engines/lastexpress/entities/chapters.cpp @@ -1805,7 +1805,7 @@ void Chapters::enterExitHelper(bool isEnteringStation) { getObjects()->update(kObjectHandleOutsideLeft, kEntityPlayer, kObjectLocation1, kCursorNormal, isEnteringStation ? kCursorNormal : kCursorHand); getObjects()->update(kObjectHandleOutsideRight, kEntityPlayer, kObjectLocation1, kCursorNormal, isEnteringStation ? kCursorNormal : kCursorHand); - getProgress().isTrainRunning = isEnteringStation ? false : true; + getProgress().isTrainRunning = !isEnteringStation; if (isEnteringStation) { ENTITY_PARAM(0, 2) = 1; diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index 02aa1d3ece..05ba7005d7 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -94,7 +94,7 @@ reg_t kDrawMenuBar(EngineState *s, int argc, reg_t *argv) { reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv) { reg_t eventObject = argv[0]; - bool pauseSound = argc > 1 ? (argv[1].isNull() ? false : true) : true; + bool pauseSound = argc <= 1 || !argv[1].isNull(); return g_sci->_gfxMenu->kernelSelect(eventObject, pauseSound); } diff --git a/engines/sci/graphics/controls16.cpp b/engines/sci/graphics/controls16.cpp index ab54e468d1..7c09969717 100644 --- a/engines/sci/graphics/controls16.cpp +++ b/engines/sci/graphics/controls16.cpp @@ -297,7 +297,7 @@ void GfxControls16::kernelDrawButton(Common::Rect rect, reg_t obj, const char *t _paint16->eraseRect(rect); _paint16->frameRect(rect); rect.grow(-2); - _ports->textGreyedOutput(style & 1 ? false : true); + _ports->textGreyedOutput(!(style & SCI_CONTROLS_STYLE_ENABLED)); _text16->Box(text, false, rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId); _ports->textGreyedOutput(false); rect.grow(1); diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 673729784f..47f34cf99d 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -286,7 +286,7 @@ void GfxMenu::kernelSetAttribute(uint16 menuId, uint16 itemId, uint16 attributeI switch (attributeId) { case SCI_MENU_ATTRIBUTE_ENABLED: - itemEntry->enabled = value.isNull() ? false : true; + itemEntry->enabled = !value.isNull(); break; case SCI_MENU_ATTRIBUTE_SAID: itemEntry->saidVmPtr = value; @@ -606,7 +606,7 @@ void GfxMenu::drawMenu(uint16 oldMenuId, uint16 newMenuId) { listItemEntry = *listItemIterator; if (listItemEntry->menuId == newMenuId) { if (!listItemEntry->separatorLine) { - _ports->textGreyedOutput(listItemEntry->enabled ? false : true); + _ports->textGreyedOutput(!listItemEntry->enabled); _ports->moveTo(_menuRect.left, topPos); _text16->DrawString(listItemEntry->textSplit.c_str()); _ports->moveTo(_menuRect.right - listItemEntry->textRightAlignedWidth - 5, topPos); diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index 23177dfc7b..c951f3349d 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -513,7 +513,7 @@ reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) { argc--; argv++; break; case SCI_DISPLAY_SETGREYEDOUTPUT: - _ports->textGreyedOutput(argv[0].isNull() ? false : true); + _ports->textGreyedOutput(!argv[0].isNull()); argc--; argv++; break; case SCI_DISPLAY_SETFONT: diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index 8bffcab4a0..f86a4e56d5 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -271,7 +271,7 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void l->enabled = true; _layers[0].onBottom = true; - _layers[1].onBottom = _layers[0].enabled ? false : true; + _layers[1].onBottom = !_layers[0].enabled; l->ready = true; } @@ -424,7 +424,7 @@ void TownsScreen::toggleLayers(int flag) { _layers[0].enabled = (flag & 1) ? true : false; _layers[0].onBottom = true; _layers[1].enabled = (flag & 2) ? true : false; - _layers[1].onBottom = _layers[0].enabled ? false : true; + _layers[1].onBottom = !_layers[0].enabled; _dirtyRects.clear(); _dirtyRects.push_back(Common::Rect(_width - 1, _height - 1)); diff --git a/engines/sword25/kernel/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp index cdce539c31..0fe5d88b80 100644 --- a/engines/sword25/kernel/inputpersistenceblock.cpp +++ b/engines/sword25/kernel/inputpersistenceblock.cpp @@ -86,7 +86,7 @@ void InputPersistenceBlock::read(bool &value) { if (checkMarker(BOOL_MARKER)) { uint uintBool = READ_LE_UINT32(_iter); _iter += 4; - value = uintBool == 0 ? false : true; + value = uintBool != 0; } else { value = false; } diff --git a/engines/sword25/script/luabindhelper.h b/engines/sword25/script/luabindhelper.h index 0cb6d37bdc..5223d4440e 100644 --- a/engines/sword25/script/luabindhelper.h +++ b/engines/sword25/script/luabindhelper.h @@ -40,7 +40,7 @@ namespace Sword25 { #define lua_pushbooleancpp(L, b) (lua_pushboolean(L, b ? 1 : 0)) -#define lua_tobooleancpp(L, i) (lua_toboolean(L, i) == 0 ? false : true) +#define lua_tobooleancpp(L, i) (lua_toboolean(L, i) != 0) struct lua_constant_reg { const char *Name; |