aboutsummaryrefslogtreecommitdiff
path: root/sword2/speech.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-05-09 13:32:04 +0000
committerTorbjörn Andersson2004-05-09 13:32:04 +0000
commitfc970b3c75fd64f399a4c22222d7e295825184c9 (patch)
tree92998da511ba26705bbdc7cbe161e32bb9e031b6 /sword2/speech.cpp
parent577600537c2e3cfdacb4e53ccfdab7e06b55a0ed (diff)
downloadscummvm-rg350-fc970b3c75fd64f399a4c22222d7e295825184c9.tar.gz
scummvm-rg350-fc970b3c75fd64f399a4c22222d7e295825184c9.tar.bz2
scummvm-rg350-fc970b3c75fd64f399a4c22222d7e295825184c9.zip
Removed the buffering of mouse and keyboard events. I don't think any of
our other engines do this, so there is little reason for BS2 to. I did add a filtering mechanism so that mouse button releases and scroll wheeling is ignored during normal gameplay, but I don't know if that was necessary either. Since this left little more than an empty husk where the Input class used to be, I've eliminated that class and buried its remains in Sword2Engine. svn-id: r13812
Diffstat (limited to 'sword2/speech.cpp')
-rw-r--r--sword2/speech.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/sword2/speech.cpp b/sword2/speech.cpp
index 73e5c060eb..6f7937574c 100644
--- a/sword2/speech.cpp
+++ b/sword2/speech.cpp
@@ -135,11 +135,11 @@ int32 Logic::fnChoose(int32 *params) {
}
// The menu is there - we're just waiting for a click. We only care
- // about left clicks and ignore mouse releases.
+ // about left clicks.
- MouseEvent *me = _vm->_input->mouseEvent();
+ MouseEvent *me = _vm->mouseEvent();
- if (!me || !(me->buttons & RD_LEFTBUTTONDOWN) || _vm->_input->_mouseY < 400)
+ if (!me || !(me->buttons & RD_LEFTBUTTONDOWN) || _vm->_mouseY < 400)
return IR_REPEAT;
// Check for click on a menu.
@@ -200,7 +200,7 @@ int32 Logic::fnEndConversation(int32 *params) {
_vm->_graphics->hideMenu(RDMENU_BOTTOM);
- if (_vm->_input->_mouseY > 399) {
+ if (_vm->_mouseY > 399) {
// Will wait for cursor to move off the bottom menu
_vm->_mouseMode = MOUSE_holding;
}
@@ -995,8 +995,8 @@ int32 Logic::fnISpeak(int32 *params) {
// So that we can go to the options panel while text & speech is
// being tested
- if (_scriptVars[SYSTEM_TESTING_TEXT] == 0 || _vm->_input->_mouseY > 0) {
- MouseEvent *me = _vm->_input->mouseEvent();
+ if (_scriptVars[SYSTEM_TESTING_TEXT] == 0 || _vm->_mouseY > 0) {
+ MouseEvent *me = _vm->mouseEvent();
// Note that we now have TWO click-delays - one for LEFT
// button, one for RIGHT BUTTON
@@ -1004,7 +1004,7 @@ int32 Logic::fnISpeak(int32 *params) {
if ((!_leftClickDelay && me && (me->buttons & RD_LEFTBUTTONDOWN)) ||
(!_rightClickDelay && me && (me->buttons & RD_RIGHTBUTTONDOWN))) {
// Mouse click, after click_delay has expired -> end
- // the speech. We ignore mouse releases
+ // the speech.
// if testing text & speech
if (_scriptVars[SYSTEM_TESTING_TEXT]) {
@@ -1018,10 +1018,6 @@ int32 Logic::fnISpeak(int32 *params) {
}
}
- // Trash anything that's buffered
- while (_vm->_input->mouseEvent())
- ;
-
speechFinished = true;
// if speech sample playing, halt it prematurely