aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-07-15 13:02:42 +0530
committerEugene Sandulenko2019-09-03 17:17:21 +0200
commit4876064372a8e639c2dedda6845ebd2afec92bd9 (patch)
tree7dbcb739e107e57424837b61c8eec6eddec669e0
parent68b2e9adff5eb3dda5cb8bf788264b08a900e7cb (diff)
downloadscummvm-rg350-4876064372a8e639c2dedda6845ebd2afec92bd9.tar.gz
scummvm-rg350-4876064372a8e639c2dedda6845ebd2afec92bd9.tar.bz2
scummvm-rg350-4876064372a8e639c2dedda6845ebd2afec92bd9.zip
HDB: Unstub the Quit functionality
-rw-r--r--engines/hdb/hdb.cpp8
-rw-r--r--engines/hdb/hdb.h2
-rw-r--r--engines/hdb/input.cpp5
-rw-r--r--engines/hdb/menu.cpp2
4 files changed, 12 insertions, 5 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index 4bbff5b0ea..47e1175974 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -87,6 +87,11 @@ HDBGame::~HDBGame() {
DebugMan.clearAllDebugChannels();
}
+bool HDBGame::hasFeature(Engine::EngineFeature f) const {
+ warning("FIXME: quitGame() exits the application, instead of RTL");
+ return (f == kSupportsRTL);
+}
+
bool HDBGame::init() {
/*
Game Subsystem Initializations
@@ -871,9 +876,6 @@ Common::Error HDBGame::run() {
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
switch (event.type) {
- case Common::EVENT_QUIT:
- case Common::EVENT_RTL:
- break;
case Common::EVENT_MOUSEMOVE:
_input->updateMouse(event.mouse.x, event.mouse.y);
break;
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index f1efd10bb4..77e7610dcc 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -131,6 +131,8 @@ public:
HDBGame(OSystem *syst, const ADGameDescription *gameDesc);
~HDBGame();
+ virtual bool hasFeature(Engine::EngineFeature f) const;
+
virtual Common::Error run();
// Detection related members;
diff --git a/engines/hdb/input.cpp b/engines/hdb/input.cpp
index aef6ecf6e3..a49e6a25f1 100644
--- a/engines/hdb/input.cpp
+++ b/engines/hdb/input.cpp
@@ -319,7 +319,10 @@ void Input::updateMouseButtons(int l, int m, int r) {
void Input::updateKeys(Common::Event event, bool keyDown) {
- debug(9, "STUB: updateKeys: Check for Quit key");
+ if (keyDown && event.kbd.keycode == _keyQuit) {
+ g_hdb->quitGame();
+ return;
+ }
uint16 buttons = getButtons();
diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp
index 97415066a5..6ea70ea823 100644
--- a/engines/hdb/menu.cpp
+++ b/engines/hdb/menu.cpp
@@ -1253,7 +1253,7 @@ void Menu::processInput(int x, int y) {
} else if (_quitTimer < g_hdb->getTimeSlice()) {
if (x >= kQuitYesX1 && x <= kQuitYesX2 && y > kQuitYesY1 && y < kQuitYesY2) {
writeConfig();
- warning("STUB: End game: Call Destroy()");
+ g_hdb->quitGame();
}
}
}