diff options
author | Oliver Kiehl | 2002-12-07 13:05:58 +0000 |
---|---|---|
committer | Oliver Kiehl | 2002-12-07 13:05:58 +0000 |
commit | 5f756f5cca3945e54ce432a9cda1b53d3a1042c0 (patch) | |
tree | 4cb7a85f417cbf95ecbafadb3ff8f6a4495e5fea /simon | |
parent | f73d710eb3cf3939d7b6f5a1897da681fd2e7520 (diff) | |
download | scummvm-rg350-5f756f5cca3945e54ce432a9cda1b53d3a1042c0.tar.gz scummvm-rg350-5f756f5cca3945e54ce432a9cda1b53d3a1042c0.tar.bz2 scummvm-rg350-5f756f5cca3945e54ce432a9cda1b53d3a1042c0.zip |
fixed speach getting turned off
added <escape> to skip cutscenes
cleanup
svn-id: r5867
Diffstat (limited to 'simon')
-rw-r--r-- | simon/items.cpp | 19 | ||||
-rw-r--r-- | simon/simon.cpp | 98 |
2 files changed, 71 insertions, 46 deletions
diff --git a/simon/items.cpp b/simon/items.cpp index f3c2c40b22..08561d7356 100644 --- a/simon/items.cpp +++ b/simon/items.cpp @@ -1370,21 +1370,20 @@ void SimonState::o_177() void SimonState::o_quit_if_user_presses_y() { - OSystem::Event event; - for (;;) { - _system->poll_event(&event); - if (event.event_code == OSystem::EVENT_KEYDOWN) { - // FIXME Arisme : better than being blocked ? - if (event.kbd.keycode == 'y' || - event.kbd.keycode == 'o' || /* french */ - event.kbd.keycode == 'j' /* german I guess :) */) + delay(1); + switch (_key_pressed) { + case 'y': + case 'o': // french + case 'j': // german _system->quit(); - else if (event.kbd.keycode == 'n') break; + + case 'n': + goto get_out; } - delay(10); } +get_out:; } void SimonState::o_unk_137(uint fcs_index) diff --git a/simon/simon.cpp b/simon/simon.cpp index 39c11f69cd..bbf5978d4e 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -3058,6 +3058,51 @@ bool SimonState::has_vgastruct_with_id(uint16 id, uint16 file) void SimonState::processSpecialKeys() { + switch (_key_pressed) { + case 27: // escape + _exit_cutscene = true; + break; + + case 't': + _vk_t_toggle ^= 1; + break; + + case '+': + midi.set_volume(midi.get_volume() + 16); + break; + + case '-': + midi.set_volume(midi.get_volume() - 16); + break; + + case 'm': + midi.pause(_music_paused ^= 1); + break; + + case 's': + _sound->effectsPause(_effects_paused ^= 1); + break; + + case 'b': + _sound->ambientPause(_ambient_paused ^= 1); + break; + + case 'r': + if (_debugMode) + _start_mainscript ^= 1; + break; + + case 'o': + if (_debugMode) + _continous_mainscript ^= 1; + break; + + case 'v': + if (_debugMode) + _continous_vgascript ^= 1; + } + + _key_pressed = 0; } static const byte _simon1_cursor[256] = { @@ -4524,49 +4569,30 @@ void SimonState::delay(uint amount) while (_system->poll_event(&event)) { switch (event.event_code) { case OSystem::EVENT_KEYDOWN: + if (event.kbd.flags==OSystem::KBD_CTRL) { + if (event.kbd.keycode == 'f') + _fast_mode ^= 1; + } + _key_pressed = (byte)event.kbd.ascii; + break; - if (event.kbd.ascii == 't') { - _vk_t_toggle ^= 1; - } else if (event.kbd.ascii == '+') { - midi.set_volume(midi.get_volume() + 16); - } else if (event.kbd.ascii == '-') { - midi.set_volume(midi.get_volume() - 16); - } else if (event.kbd.ascii == 'm') { - midi.pause(_music_paused ^= 1); - } else if (event.kbd.ascii == 's') { - _sound->effectsPause(_effects_paused ^= 1); - } else if (event.kbd.ascii == 'b') { - _sound->ambientPause(_ambient_paused ^= 1); - } else if (event.kbd.flags==OSystem::KBD_CTRL) { - if (event.kbd.keycode == 'f') - _fast_mode ^= 1; - } else if (_debugMode) { - if (event.kbd.ascii == 'r') { - _start_mainscript ^= 1; - } else if (event.kbd.ascii == 'o') { - _continous_mainscript ^= 1; - } else if (event.kbd.ascii == 'v') - _continous_vgascript ^= 1; - } - _key_pressed = (byte)event.kbd.ascii; - break; case OSystem::EVENT_MOUSEMOVE: - _sdl_mouse_x = event.mouse.x; - _sdl_mouse_y = event.mouse.y; - _mouse_pos_changed = true; - break; + _sdl_mouse_x = event.mouse.x; + _sdl_mouse_y = event.mouse.y; + _mouse_pos_changed = true; + break; - case OSystem::EVENT_LBUTTONDOWN: - _left_button_down++; + case OSystem::EVENT_LBUTTONDOWN: + _left_button_down++; #ifdef _WIN32_WCE - _sdl_mouse_x = event.mouse.x; - _sdl_mouse_y = event.mouse.y; + _sdl_mouse_x = event.mouse.x; + _sdl_mouse_y = event.mouse.y; #endif - break; + break; case OSystem::EVENT_RBUTTONDOWN: - _exit_cutscene = true; - break; + _exit_cutscene = true; + break; } } |