Cleanup: Treat booleans as booleans, not integers. (I hope I didn't mess up,

because that would cause some nasty regressions...)

svn-id: r50643
This commit is contained in:
Torbjörn Andersson 2010-07-04 07:32:12 +00:00
parent db01417447
commit dde6dabac9
8 changed files with 50 additions and 46 deletions

View File

@ -202,19 +202,19 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_scanFlag = false;
_scriptVar2 = 0;
_runScriptReturn1 = 0;
_skipVgaWait = 0;
_noParentNotify = 0;
_beardLoaded = 0;
_litBoxFlag = 0;
_mortalFlag = 0;
_runScriptReturn1 = false;
_skipVgaWait = false;
_noParentNotify = false;
_beardLoaded = false;
_litBoxFlag = false;
_mortalFlag = false;
_displayFlag = 0;
_syncFlag2 = 0;
_inCallBack = 0;
_cepeFlag = 0;
_fastMode = 0;
_syncFlag2 = false;
_inCallBack = false;
_cepeFlag = false;
_fastMode = false;
_backFlag = 0;
_backFlag = false;
_debugMode = 0;
_dumpScripts = false;
@ -631,9 +631,11 @@ Common::Error AGOSEngine::init() {
if (ConfMan.hasKey("sfx_mute") && ConfMan.getBool("sfx_mute") == 1) {
if (getGameId() == GID_SIMON1DOS)
_midi._enable_sfx ^= 1;
else
_sound->effectsPause(_effectsPaused ^= 1);
_midi._enable_sfx = !_midi._enable_sfx;
else {
_effectsPaused = !_effectsPaused;
_sound->effectsPause(_effectsPaused);
}
}
_copyProtection = ConfMan.getBool("copy_protection");
@ -648,7 +650,7 @@ Common::Error AGOSEngine::init() {
if (getGameType() == GType_SIMON1) {
// English and German versions don't have full subtitles
if (_language == Common::EN_ANY || _language == Common::DE_DEU)
if (_language == Common::EN_ANY || _language == Common::DE_DEU)
_subtitles = false;
// Other versions require speech to be enabled
else

View File

@ -393,7 +393,7 @@ protected:
Common::Point _mouseOld;
byte *_mouseData;
byte _animatePointer;
bool _animatePointer;
byte _maxCursorWidth, _maxCursorHeight;
byte _mouseAnim, _mouseAnimMax, _mouseCursor;
byte _currentMouseAnim, _currentMouseCursor;

View File

@ -459,7 +459,7 @@ void AGOSEngine_Simon1::handleMouseMoved() {
_leftButtonDown = false;
x = 1;
} else {
if (_litBoxFlag == 0 && _needHitAreaRecalc == 0)
if (!_litBoxFlag && _needHitAreaRecalc == 0)
goto get_out;
}
@ -473,7 +473,7 @@ get_out:
drawMousePointer();
_needHitAreaRecalc = 0;
_litBoxFlag = 0;
_litBoxFlag = false;
}
void AGOSEngine_PN::handleMouseMoved() {
@ -538,7 +538,7 @@ void AGOSEngine_PN::handleMouseMoved() {
drawMousePointer();
_needHitAreaRecalc = 0;
_litBoxFlag = 0;
_litBoxFlag = false;
}
void AGOSEngine::handleMouseMoved() {
@ -610,7 +610,7 @@ void AGOSEngine::handleMouseMoved() {
_oneClick = 0;
x = 1;
} else {
if (_litBoxFlag == 0 && _needHitAreaRecalc == 0)
if (!_litBoxFlag && _needHitAreaRecalc == 0)
goto get_out;
}
@ -622,7 +622,7 @@ get_out:
drawMousePointer();
_needHitAreaRecalc = 0;
_litBoxFlag = 0;
_litBoxFlag = false;
}
void AGOSEngine::mouseOff() {
@ -706,10 +706,10 @@ void AGOSEngine_Feeble::drawMousePointer() {
uint cursor;
int image, offs;
if (_animatePointer != 0) {
if (_animatePointer) {
if (getBitFlag(99)) {
_mouseToggle ^= 1;
if (_mouseToggle != 0)
_mouseToggle = !_mouseToggle;
if (_mouseToggle)
_mouseAnim++;
} else {
_mouseAnim++;
@ -720,7 +720,7 @@ void AGOSEngine_Feeble::drawMousePointer() {
cursor = _mouseCursor;
if (_animatePointer == 0 && getBitFlag(99)) {
if (!_animatePointer && getBitFlag(99)) {
_mouseAnim = 1;
cursor = 6;
} else if (_mouseCursor != 5 && getBitFlag(72)) {

View File

@ -176,9 +176,9 @@ void AGOSEngine::animateSprites() {
_windowNum = 4;
_backFlag = 1;
_backFlag = true;
drawImage(&state);
_backFlag = 0;
_backFlag = false;
_vgaSpriteChanged++;
}
@ -451,14 +451,14 @@ void AGOSEngine::restoreBackGround() {
state.paletteMod = 0;
state.flags = kDFNonTrans;
_backFlag = 1;
_backFlag = true;
drawImage(&state);
if (getGameType() != GType_SIMON1 && getGameType() != GType_SIMON2) {
animTable->srcPtr = 0;
}
}
_backFlag = 0;
_backFlag = false;
if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
AnimTable *animTableTmp;

View File

@ -481,7 +481,7 @@ void AGOSEngine::delay(uint amount) {
_aboutDialog = new GUI::AboutDialog();
_aboutDialog->runModal();
} else if (event.kbd.keycode == Common::KEYCODE_f) {
_fastMode ^= 1;
_fastMode = !_fastMode;
} else if (event.kbd.keycode == Common::KEYCODE_d) {
_debugger->attach();
} else if (event.kbd.keycode == Common::KEYCODE_s) {
@ -568,7 +568,7 @@ void AGOSEngine_Feeble::timerProc() {
_videoLockOut |= 2;
if (!(_videoLockOut & 0x10)) {
_syncFlag2 ^= 1;
_syncFlag2 = !_syncFlag2;
if (!_syncFlag2) {
processVgaEvents();
} else {
@ -637,7 +637,7 @@ void AGOSEngine_PN::timerProc() {
processVgaEvents();
processVgaEvents();
_cepeFlag ^= 1;
_cepeFlag = !_cepeFlag;
if (!_cepeFlag)
processVgaEvents();
}
@ -663,7 +663,7 @@ void AGOSEngine::timerProc() {
if (!(_videoLockOut & 0x10)) {
processVgaEvents();
processVgaEvents();
_cepeFlag ^= 1;
_cepeFlag = !_cepeFlag;
if (!_cepeFlag)
processVgaEvents();
}

View File

@ -730,7 +730,7 @@ void AGOSEngine_Simon1::drawImage(VC10_state *state) {
state->paletteMod = 208;
}
if (_backFlag == 1) {
if (_backFlag) {
drawBackGroundImage(state);
} else if (state->flags & kDFMasked) {
drawMaskedImage(state);
@ -947,7 +947,7 @@ void AGOSEngine::drawImage(VC10_state *state) {
if (getGameType() == GType_ELVIRA2 && getPlatform() == Common::kPlatformAtariST && yoffs > 133)
state->palette = 208;
if (_backFlag == 1) {
if (_backFlag) {
drawBackGroundImage(state);
} else {
drawVertImage(state);
@ -1351,7 +1351,7 @@ void AGOSEngine::setWindowImage(uint16 mode, uint16 vgaSpriteId, bool specialCas
if (getGameType() == GType_FF || getGameType() == GType_PP) {
fillBackGroundFromBack();
_syncFlag2 = 1;
_syncFlag2 = true;
} else {
_copyScnFlag = 2;
_vgaSpriteChanged++;

View File

@ -99,7 +99,7 @@ void AGOSEngine::setup_cond_c_helper() {
animMax = 9;
}
_animatePointer = 0;
_animatePointer = false;
_mouseCursor = cursor;
_mouseAnimMax = animMax;
_mouseAnim = 1;
@ -574,13 +574,13 @@ bool AGOSEngine::processSpecialKeys() {
if (getGameType() == GType_FF || (getGameType() == GType_SIMON2 && (getFeatures() & GF_TALKIE)) ||
((getFeatures() & GF_TALKIE) && _language != Common::EN_ANY && _language != Common::DE_DEU)) {
if (_speech)
_subtitles ^= 1;
_subtitles = !_subtitles;
}
break;
case 'v':
if (getGameType() == GType_FF || (getGameType() == GType_SIMON2 && (getFeatures() & GF_TALKIE))) {
if (_subtitles)
_speech ^= 1;
_speech = !_speech;
}
break;
case '+':
@ -598,7 +598,7 @@ bool AGOSEngine::processSpecialKeys() {
syncSoundSettings();
break;
case 'm':
_musicPaused ^= 1;
_musicPaused = !_musicPaused;
if (_midiEnabled) {
_midi.pause(_musicPaused);
}
@ -606,14 +606,16 @@ bool AGOSEngine::processSpecialKeys() {
break;
case 's':
if (getGameId() == GID_SIMON1DOS) {
_midi._enable_sfx ^= 1;
_midi._enable_sfx = !_midi._enable_sfx;
} else {
_sound->effectsPause(_effectsPaused ^= 1);
_effectsPaused = !_effectsPaused;
_sound->effectsPause(_effectsPaused);
}
break;
case 'b':
if (getGameType() == GType_SIMON2) {
_sound->ambientPause(_ambientPaused ^= 1);
_ambientPaused = !_ambientPaused;
_sound->ambientPause(_ambientPaused);
}
break;
default:

View File

@ -207,7 +207,7 @@ static const char *const czech_verb_prep_names[] = {
void AGOSEngine_Feeble::clearName() {
stopAnimateSimon2(2, 6);
_lastNameOn = NULL;
_animatePointer = 0;
_animatePointer = false;
_mouseAnim = 1;
return;
}
@ -898,7 +898,7 @@ void AGOSEngine::displayName(HitArea *ha) {
if (getBitFlag(99))
_animatePointer = ((ha->flags & kBFTextBox) == 0);
else
_animatePointer = 1;
_animatePointer = true;
if (!getBitFlag(73))
return;
@ -933,7 +933,7 @@ void AGOSEngine_Feeble::invertBox(HitArea *ha, bool state) {
_mouseCursor = _oldMouseCursor;
} else if (_mouseCursor != 18) {
_oldMouseCursor = _mouseCursor;
_animatePointer = 0;
_animatePointer = false;
_oldMouseAnimMax = _mouseAnimMax;
_mouseAnimMax = 2;
_mouseCursor = 18;