JANITORIAL: Replace (x ? false : true) by !(x).

This commit is contained in:
Christoph Mallon 2012-03-13 10:40:41 +01:00 committed by Alyssa Milburn
parent 337d5da913
commit 75efdd2d84
17 changed files with 24 additions and 24 deletions

View File

@ -1175,7 +1175,7 @@ void TownsPC98_AudioDriver::loadMusicData(uint8 *data, bool loadPaused) {
_patches = src_a + 4;
_finishedChannelsFlag = _finishedSSGFlag = _finishedRhythmFlag = 0;
_musicPlaying = (loadPaused ? false : true);
_musicPlaying = !loadPaused;
}
void TownsPC98_AudioDriver::loadSoundEffectData(uint8 *data, uint8 trackNum) {

View File

@ -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) {

View File

@ -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]) {

View File

@ -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) {

View File

@ -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];

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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:

View File

@ -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));

View File

@ -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;
}

View File

@ -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;

View File

@ -1010,7 +1010,7 @@ bool OptionsDialog::loadMusicDeviceSetting(PopUpWidget *popup, Common::String se
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
if (setting.empty() ? (preferredType == d->getMusicType()) : (drv == d->getCompleteId())) {
popup->setSelectedTag(d->getHandle());
return popup->getSelected() == -1 ? false : true;
return popup->getSelected() != -1;
}
}
}