aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-28 01:04:28 +0200
committerFilippos Karapetis2015-12-28 01:04:28 +0200
commit5c75ac98981512133b888743779fae383200be44 (patch)
tree1b88513620bab582ac37747eee9f1b624611d5ff /engines/lab
parent1688a1b239294b6cd9fe21ca4d2f5bd929c450dd (diff)
downloadscummvm-rg350-5c75ac98981512133b888743779fae383200be44.tar.gz
scummvm-rg350-5c75ac98981512133b888743779fae383200be44.tar.bz2
scummvm-rg350-5c75ac98981512133b888743779fae383200be44.zip
LAB: Fix loading from the GMM and warping to rooms from the console
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/console.cpp7
-rw-r--r--engines/lab/eventman.h6
-rw-r--r--engines/lab/lab.cpp5
-rw-r--r--engines/lab/lab.h2
4 files changed, 20 insertions, 0 deletions
diff --git a/engines/lab/console.cpp b/engines/lab/console.cpp
index 12eafd3789..35e29f2920 100644
--- a/engines/lab/console.cpp
+++ b/engines/lab/console.cpp
@@ -24,6 +24,8 @@
#include "lab/lab.h"
#include "lab/console.h"
+#include "lab/dispman.h"
+#include "lab/eventman.h"
#include "lab/processroom.h"
#include "lab/resource.h"
@@ -47,6 +49,11 @@ bool Console::Cmd_Scene(int argc, const char **argv) {
}
_vm->_roomNum = atoi(argv[1]);
+ _vm->_curFileName = " ";
+ _vm->_closeDataPtr = nullptr;
+ _vm->_mainDisplay = true;
+ _vm->_followingCrumbs = false;
+ _vm->_event->simulateLeftClick();
return false;
}
diff --git a/engines/lab/eventman.h b/engines/lab/eventman.h
index cb91b12a76..c282f5106f 100644
--- a/engines/lab/eventman.h
+++ b/engines/lab/eventman.h
@@ -121,6 +121,12 @@ public:
void setMousePos(Common::Point pos);
void updateMouse();
Common::Point updateAndGetMousePos();
+
+ /**
+ * Simulates a left click for the game main loop, when a game is
+ * loaded or when the user teleports to a scene
+ */
+ void simulateLeftClick() { _leftClick = true; }
};
} // End of namespace Lab
diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp
index 70af5e8605..905f09c106 100644
--- a/engines/lab/lab.cpp
+++ b/engines/lab/lab.cpp
@@ -245,6 +245,11 @@ void LabEngine::updateEvents() {
Common::Error LabEngine::loadGameState(int slot) {
bool result = loadGame(slot);
+ _curFileName = " ";
+ _closeDataPtr = nullptr;
+ _mainDisplay = true;
+ _followingCrumbs = false;
+ _event->simulateLeftClick();
return (result) ? Common::kNoError : Common::kUserCanceled;
}
diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index af80c904d1..2c3a723f3e 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -121,6 +121,8 @@ enum MessageClass {
};
class LabEngine : public Engine {
+ friend class Console;
+
private:
bool _interfaceOff;
bool _isCrumbWaiting;