aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2003-12-11 02:09:18 +0000
committerTravis Howell2003-12-11 02:09:18 +0000
commit44eadc398c175c1f167cecaadd7349b46146021a (patch)
tree1d0794d7af610b16419a38bcb1bfb53dc2bd2da0 /simon
parentf82a23771c95a7e70b4bc85c48d515853e289516 (diff)
downloadscummvm-rg350-44eadc398c175c1f167cecaadd7349b46146021a.tar.gz
scummvm-rg350-44eadc398c175c1f167cecaadd7349b46146021a.tar.bz2
scummvm-rg350-44eadc398c175c1f167cecaadd7349b46146021a.zip
Add some WIP quick load/save keys code for simon 1/2. currently disabled.
svn-id: r11560
Diffstat (limited to 'simon')
-rw-r--r--simon/simon.cpp41
-rw-r--r--simon/simon.h3
2 files changed, 43 insertions, 1 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 5be62dc1ac..938aea8e35 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -29,6 +29,8 @@
#include "common/config-manager.h"
#include "common/file.h"
+#include "gui/message.h"
+
#include "simon/simon.h"
#include "simon/intern.h"
#include "simon/vga.h"
@@ -471,6 +473,10 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_dump_file = 0;
+ _saveLoadFlag = 0;
+ _saveLoadSlot = 0;
+ memset(_saveLoadName, 0, sizeof(_saveLoadName));
+
_saveload_row_curpos = 0;
_num_savegame_rows = 0;
_savedialog_flag = false;
@@ -4787,7 +4793,40 @@ void SimonEngine::delay(uint amount) {
while (_system->poll_event(&event)) {
switch (event.event_code) {
case OSystem::EVENT_KEYDOWN:
- if (event.kbd.flags==OSystem::KBD_CTRL) {
+ // First attempt at quick load/save keys support
+ // For some reason Simon often walks into a location when loading
+ // and sometimes Simon isn't shown until he is moved.
+
+/* if (event.kbd.keycode >= '0' && event.kbd.keycode<='9'
+ && (event.kbd.flags == OSystem::KBD_ALT ||
+ event.kbd.flags == OSystem::KBD_CTRL)) {
+ _saveLoadSlot = event.kbd.keycode - '0';
+
+ sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot);
+ _saveLoadFlag = (event.kbd.flags == OSystem::KBD_ALT) ? 1 : 2;
+
+ // We should only allow a load or save when it was possible in original
+ // This stops load/save during cutscenes
+ // But can still load/save during converstation
+ // TODO: Add dialog to confirm game was saved.
+ if (!_lock_counter) {
+ if (_saveLoadFlag == 2) {
+ Subroutine *sub;
+ load_game(_saveLoadSlot);
+ // Redraw Inventory
+ lock();
+ fcs_unk_proc_1(2, getItem1Ptr(), 0, 0);
+ unlock();
+ // Reset engine?
+ sub = getSubroutineByID(7);
+ startSubroutine(sub);
+ } else {
+ save_game(_saveLoadSlot, _saveLoadName);
+ }
+ _saveLoadFlag = 0;
+ }
+*/
+ if (event.kbd.flags == OSystem::KBD_CTRL) {
if (event.kbd.keycode == 'f')
_fast_mode ^= 1;
}
diff --git a/simon/simon.h b/simon/simon.h
index 198cf5752b..d276e0c857 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -351,6 +351,9 @@ protected:
bool _save_or_load;
bool _saveload_flag;
+ byte _saveLoadFlag, _saveLoadSlot;
+ char _saveLoadName[32];
+
int _sdl_mouse_x, _sdl_mouse_y;
byte *_sdl_buf_3;