aboutsummaryrefslogtreecommitdiff
path: root/engines/touche/touche.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/touche/touche.cpp')
-rw-r--r--engines/touche/touche.cpp52
1 files changed, 22 insertions, 30 deletions
diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp
index d1d7528517..a39517fe32 100644
--- a/engines/touche/touche.cpp
+++ b/engines/touche/touche.cpp
@@ -95,7 +95,7 @@ int ToucheEngine::init() {
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, Audio::Mixer::kMaxMixerVolume);
return 0;
}
@@ -111,7 +111,7 @@ int ToucheEngine::go() {
res_deallocateTables();
res_closeDataFile();
- return _eventMan->shouldRTL();
+ return 0;
}
void ToucheEngine::restart() {
@@ -234,13 +234,6 @@ Common::Point ToucheEngine::getMousePos() const {
return _eventMan->getMousePos();
}
-void ToucheEngine::syncSoundSettings() {
- readConfigurationSettings();
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
-}
-
void ToucheEngine::mainLoop() {
restart();
@@ -252,13 +245,10 @@ void ToucheEngine::mainLoop() {
_inp_rightMouseButtonPressed = false;
if (ConfMan.hasKey("save_slot")) {
- int saveSlot = ConfMan.getInt("save_slot");
- if (saveSlot >= 0 && saveSlot <= 99) {
- loadGameState(saveSlot);
- _newEpisodeNum = 0;
- resetSortedKeyCharsTable();
- showCursor(true);
- }
+ loadGameState(ConfMan.getInt("save_slot"));
+ _newEpisodeNum = 0;
+ resetSortedKeyCharsTable();
+ showCursor(true);
} else {
_newEpisodeNum = ConfMan.getInt("boot_param");
if (_newEpisodeNum == 0) {
@@ -268,7 +258,7 @@ void ToucheEngine::mainLoop() {
}
uint32 frameTimeStamp = _system->getMillis();
- for (uint32 cycleCounter = 0; !quit(); ++cycleCounter) {
+ for (uint32 cycleCounter = 0; _flagsTable[611] == 0; ++cycleCounter) {
if ((cycleCounter % 3) == 0) {
runCycle();
}
@@ -297,6 +287,9 @@ void ToucheEngine::processEvents(bool handleKeyEvents) {
Common::Event event;
while (_eventMan->pollEvent(event)) {
switch (event.type) {
+ case Common::EVENT_QUIT:
+ _flagsTable[611] = 1;
+ break;
case Common::EVENT_KEYDOWN:
if (!handleKeyEvents) {
break;
@@ -304,8 +297,7 @@ void ToucheEngine::processEvents(bool handleKeyEvents) {
_flagsTable[600] = event.kbd.keycode;
if (event.kbd.keycode == Common::KEYCODE_ESCAPE) {
if (_displayQuitDialog) {
- if (displayQuitDialog())
- quitGame();
+ _flagsTable[611] = displayQuitDialog();
}
} else if (event.kbd.keycode == Common::KEYCODE_F5) {
if (_flagsTable[618] == 0 && !_hideInventoryTexts) {
@@ -1837,7 +1829,7 @@ int ToucheEngine::handleActionMenuUnderCursor(const int16 *actions, int offs, in
_menuRedrawCounter = 2;
Common::Rect rect(0, y, kScreenWidth, y + h);
i = -1;
- while (_inp_rightMouseButtonPressed && !quit()) {
+ while (_inp_rightMouseButtonPressed && _flagsTable[611] == 0) {
Common::Point mousePos = getMousePos();
if (rect.contains(mousePos)) {
int c = (mousePos.y - y) / kTextHeight;
@@ -2700,10 +2692,10 @@ bool ToucheEngine::sortPointsData(int num1, int num2) {
const int md2 = _programWalkTable[num1].point2;
_programPointsTable[md2].order = 0;
}
- bool quitLoop = false;
+ bool quit = false;
int order = 1;
- while (!quitLoop) {
- quitLoop = true;
+ while (!quit) {
+ quit = true;
for (uint i = 0; i < _programWalkTable.size(); ++i) {
const int md1 = _programWalkTable[i].point1;
const int md2 = _programWalkTable[i].point2;
@@ -2711,11 +2703,11 @@ bool ToucheEngine::sortPointsData(int num1, int num2) {
assert((md2 & 0x4000) == 0);
if (_programPointsTable[md1].order == order - 1 && _programPointsTable[md2].order > order) {
_programPointsTable[md2].order = order;
- quitLoop = false;
+ quit = false;
}
if (_programPointsTable[md2].order == order - 1 && _programPointsTable[md1].order > order) {
_programPointsTable[md1].order = order;
- quitLoop = false;
+ quit = false;
}
}
}
@@ -2947,9 +2939,9 @@ void ToucheEngine::markWalkPoints(int keyChar) {
resetPointsData(0);
if (pointsDataNum != -1) {
_programPointsTable[pointsDataNum].order = 1;
- bool quitLoop = false;
- while (!quitLoop) {
- quitLoop = true;
+ bool quit = false;
+ while (!quit) {
+ quit = true;
for (uint i = 0; i < _programWalkTable.size(); ++i) {
int16 md1 = _programWalkTable[i].point1;
int16 md2 = _programWalkTable[i].point2;
@@ -2957,11 +2949,11 @@ void ToucheEngine::markWalkPoints(int keyChar) {
assert((md2 & 0x4000) == 0);
if (_programPointsTable[md1].order != 0 && _programPointsTable[md2].order == 0) {
_programPointsTable[md2].order = 1;
- quitLoop = false;
+ quit = false;
}
if (_programPointsTable[md2].order != 0 && _programPointsTable[md1].order == 0) {
_programPointsTable[md1].order = 1;
- quitLoop = false;
+ quit = false;
}
}
}