aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2008-12-26 08:35:36 +0000
committerJohannes Schickel2008-12-26 08:35:36 +0000
commitfb14701b68d797d4133d6f657d6ca165953e30a3 (patch)
tree818f681ffcd08835d5f1266d5f2faac717d55844 /engines
parent3bbbcc38495ca65f44f6cf13d00bcbb3f4ef406a (diff)
downloadscummvm-rg350-fb14701b68d797d4133d6f657d6ca165953e30a3.tar.gz
scummvm-rg350-fb14701b68d797d4133d6f657d6ca165953e30a3.tar.bz2
scummvm-rg350-fb14701b68d797d4133d6f657d6ca165953e30a3.zip
Cleanup.
svn-id: r35552
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/kyra_v1.cpp2
-rw-r--r--engines/kyra/lol.cpp136
-rw-r--r--engines/kyra/lol.h22
3 files changed, 3 insertions, 157 deletions
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 98bb25be9f..b7b3fc60b7 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -290,7 +290,7 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop) {
break;
}
- if (_debugger->isAttached())
+ if (_debugger && _debugger->isAttached())
_debugger->onFrame();
if (breakLoop)
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 0b1a63ecf6..9dfb7994e1 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -105,138 +105,6 @@ Common::Error LoLEngine::go() {
return Common::kNoError;
}
-#pragma mark - Input
-
-int LoLEngine::checkInput(Button *buttonList, bool mainLoop) {
- debugC(9, kDebugLevelMain, "LoLEngine::checkInput(%p, %d)", (const void*)buttonList, mainLoop);
- updateInput();
-
- int keys = 0;
- int8 mouseWheel = 0;
-
- while (_eventList.size()) {
- Common::Event event = *_eventList.begin();
- bool breakLoop = false;
-
- switch (event.type) {
- case Common::EVENT_KEYDOWN:
- /*if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' &&
- (event.kbd.flags == Common::KBD_CTRL || event.kbd.flags == Common::KBD_ALT) && mainLoop) {
- const char *saveLoadSlot = getSavegameFilename(9 - (event.kbd.keycode - '0') + 990);
-
- if (event.kbd.flags == Common::KBD_CTRL) {
- loadGame(saveLoadSlot);
- _eventList.clear();
- breakLoop = true;
- } else {
- char savegameName[14];
- sprintf(savegameName, "Quicksave %d", event.kbd.keycode - '0');
- saveGame(saveLoadSlot, savegameName);
- }
- } else if (event.kbd.flags == Common::KBD_CTRL) {
- if (event.kbd.keycode == 'd')
- _debugger->attach();
- }*/
- break;
-
- case Common::EVENT_MOUSEMOVE: {
- Common::Point pos = getMousePos();
- _mouseX = pos.x;
- _mouseY = pos.y;
- } break;
-
- case Common::EVENT_LBUTTONDOWN:
- case Common::EVENT_LBUTTONUP: {
- Common::Point pos = getMousePos();
- _mouseX = pos.x;
- _mouseY = pos.y;
- keys = (event.type == Common::EVENT_LBUTTONDOWN ? 199 : (200 | 0x800));
- breakLoop = true;
- } break;
-
- case Common::EVENT_WHEELUP:
- mouseWheel = -1;
- break;
-
- case Common::EVENT_WHEELDOWN:
- mouseWheel = 1;
- break;
-
- default:
- break;
- }
-
- //if (_debugger->isAttached())
- // _debugger->onFrame();
-
- if (breakLoop)
- break;
-
- _eventList.erase(_eventList.begin());
- }
-
- return /*gui_v2()->processButtonList(buttonList, keys | 0x8000, mouseWheel)*/keys;
-}
-
-void LoLEngine::updateInput() {
- Common::Event event;
-
- while (_eventMan->pollEvent(event)) {
- switch (event.type) {
- case Common::EVENT_KEYDOWN:
- if (event.kbd.keycode == '.' || event.kbd.keycode == Common::KEYCODE_ESCAPE)
- _eventList.push_back(Event(event, true));
- else if (event.kbd.keycode == 'q' && event.kbd.flags == Common::KBD_CTRL)
- quitGame();
- else
- _eventList.push_back(event);
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- _eventList.push_back(Event(event, true));
- break;
-
- case Common::EVENT_MOUSEMOVE:
- _screen->updateScreen();
- // fall through
-
- case Common::EVENT_LBUTTONUP:
- case Common::EVENT_WHEELUP:
- case Common::EVENT_WHEELDOWN:
- _eventList.push_back(event);
- break;
-
- default:
- break;
- }
- }
-}
-
-void LoLEngine::removeInputTop() {
- if (!_eventList.empty())
- _eventList.erase(_eventList.begin());
-}
-
-bool LoLEngine::skipFlag() const {
- for (Common::List<Event>::const_iterator i = _eventList.begin(); i != _eventList.end(); ++i) {
- if (i->causedSkip)
- return true;
- }
- return false;
-}
-
-void LoLEngine::resetSkipFlag(bool removeEvent) {
- for (Common::List<Event>::iterator i = _eventList.begin(); i != _eventList.end(); ++i) {
- if (i->causedSkip) {
- if (removeEvent)
- _eventList.erase(i);
- else
- i->causedSkip = false;
- return;
- }
- }
-}
-
#pragma mark - Intro
void LoLEngine::setupPrologueData(bool load) {
@@ -686,7 +554,7 @@ void LoLEngine::selectionCharInfoIntro(char *file) {
}
int LoLEngine::getCharSelection() {
- int inputFlag = checkInput() & 0xCF;
+ int inputFlag = checkInput(0, false) & 0xCF;
removeInputTop();
if (inputFlag == 200) {
@@ -701,7 +569,7 @@ int LoLEngine::getCharSelection() {
}
int LoLEngine::selectionCharAccept() {
- int inputFlag = checkInput() & 0xCF;
+ int inputFlag = checkInput(0, false) & 0xCF;
removeInputTop();
if (inputFlag == 200) {
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index 895f9cddaa..9e5f29902e 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -50,28 +50,6 @@ private:
Common::Error init();
Common::Error go();
- // input
- void updateInput();
- int checkInput(Button *buttonList = 0, bool mainLoop = false);
- void removeInputTop();
-
- int _mouseX, _mouseY;
-
- struct Event {
- Common::Event event;
- bool causedSkip;
-
- Event() : event(), causedSkip(false) {}
- Event(Common::Event e) : event(e), causedSkip(false) {}
- Event(Common::Event e, bool skip) : event(e), causedSkip(skip) {}
-
- operator Common::Event() const { return event; }
- };
- Common::List<Event> _eventList;
-
- virtual bool skipFlag() const;
- virtual void resetSkipFlag(bool removeEvent = true);
-
// intro
void setupPrologueData(bool load);