diff options
author | Thierry Crozat | 2017-07-08 12:41:22 +0100 |
---|---|---|
committer | Thierry Crozat | 2017-07-08 12:55:11 +0100 |
commit | 6ff927bff745d1a5977b556b62840858bbb695e1 (patch) | |
tree | 34d14fcb37fdbe4ba289685555d9a67c2d3fef38 /engines/sword1/control.cpp | |
parent | f59269006c0c7ff42cea4fe106eef2a111d06d64 (diff) | |
download | scummvm-rg350-6ff927bff745d1a5977b556b62840858bbb695e1.tar.gz scummvm-rg350-6ff927bff745d1a5977b556b62840858bbb695e1.tar.bz2 scummvm-rg350-6ff927bff745d1a5977b556b62840858bbb695e1.zip |
SWORD1: Use booleans for _systemVars speech and subtitles flags
The were defined as uint8 and the code was inconsistent in the
way they were handled, for example setting them to 1 in some
places and to true in others. It was working but relying on implicit
conversions both ways between 1 and true.
Diffstat (limited to 'engines/sword1/control.cpp')
-rw-r--r-- | engines/sword1/control.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index c9b4f9f6c2..0384e685b3 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -410,7 +410,7 @@ uint8 Control::runPanel() { ConfMan.setInt("sfx_volume", (int)((volR + volL) / 2)); ConfMan.setInt("sfx_balance", volToBalance(volL, volR)); - ConfMan.setBool("subtitles", SwordEngine::_systemVars.showText == 1); + ConfMan.setBool("subtitles", SwordEngine::_systemVars.showText); ConfMan.flushToDisk(); } @@ -503,8 +503,8 @@ uint8 Control::handleButtonClick(uint8 id, uint8 mode, uint8 *retVal) { (id == BUTTON_DONE) || (id == BUTTON_VOLUME_PANEL)) return id; else if (id == BUTTON_TEXT) { - SwordEngine::_systemVars.showText ^= 1; - _buttons[5]->setSelected(SwordEngine::_systemVars.showText); + SwordEngine::_systemVars.showText = !SwordEngine::_systemVars.showText; + _buttons[5]->setSelected(SwordEngine::_systemVars.showText ? 1 : 0); } else if (id == BUTTON_QUIT) { if (getConfirm(_lStrings[STR_QUIT])) Engine::quitGame(); @@ -566,7 +566,7 @@ void Control::setupMainPanel() { createButtons(_deathButtons, 3); else { createButtons(_panelButtons, 7); - _buttons[5]->setSelected(SwordEngine::_systemVars.showText); + _buttons[5]->setSelected(SwordEngine::_systemVars.showText ? 1 : 0); } if (SwordEngine::_systemVars.controlPanelMode == CP_THEEND) // end of game |