aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-03-17 15:44:26 +0000
committerTorbjörn Andersson2007-03-17 15:44:26 +0000
commit53624376b4d614689695d1ea56c1052cd0e7ad12 (patch)
treec98fc0e637f6634d270ae0b6e5311852e3634811 /engines/sword1
parente72455c215a1deebe235d18e7efbe55f76d8f2da (diff)
downloadscummvm-rg350-53624376b4d614689695d1ea56c1052cd0e7ad12.tar.gz
scummvm-rg350-53624376b4d614689695d1ea56c1052cd0e7ad12.tar.bz2
scummvm-rg350-53624376b4d614689695d1ea56c1052cd0e7ad12.zip
Applied my re-revised patch #1487149 ("Simplified keyboard repeat"), with
Fingolfin's blessings. Keyboard repeat is now handled by the event manager, rather than by individual engines. Since this can cause problems with some engines (see the AGI engine), the extra "key down" events are marked as "synthetic", so that they can be ignored if necessary. svn-id: r26170
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/control.cpp17
-rw-r--r--engines/sword1/control.h2
2 files changed, 0 insertions, 19 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index 9a4b2fe46a..ec612ce1fc 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -42,11 +42,6 @@
namespace Sword1 {
-enum {
- kKeyRepeatInitialDelay = 400,
- kKeyRepeatSustainDelay = 100
-};
-
enum LangStrings {
STR_PAUSED = 0,
STR_INSERT_CD_A,
@@ -171,8 +166,6 @@ Control::Control(Common::SaveFileManager *saveFileMan, ResMan *pResMan, ObjectMa
_music = pMusic;
_sound = pSound;
_lStrings = _languageStrings + SwordEngine::_systemVars.language * 20;
- _keyRepeat = 0;
- _keyRepeatTime = 0;
_selectedButton = 255;
}
@@ -1053,15 +1046,9 @@ void Control::delay(uint32 msecs) {
_keyPressed = 8;
else
_keyPressed = (byte)event.kbd.ascii;
- _keyRepeatTime = now + kKeyRepeatInitialDelay;
- _keyRepeat = _keyPressed;
// we skip the rest of the delay and return immediately
// to handle keyboard input
return;
- case OSystem::EVENT_KEYUP:
- _keyRepeatTime = 0;
- _keyRepeat = 0;
- break;
case OSystem::EVENT_MOUSEMOVE:
_mouseX = event.mouse.x;
_mouseY = event.mouse.y;
@@ -1093,10 +1080,6 @@ void Control::delay(uint32 msecs) {
break;
}
}
- if (_keyRepeatTime && now > _keyRepeatTime) {
- _keyRepeatTime += kKeyRepeatSustainDelay;
- _keyPressed = _keyRepeat;
- }
_system->updateScreen();
_system->delayMillis(10);
diff --git a/engines/sword1/control.h b/engines/sword1/control.h
index 686783012a..8cacbfb0b8 100644
--- a/engines/sword1/control.h
+++ b/engines/sword1/control.h
@@ -139,8 +139,6 @@ private:
uint8 *_font, *_redFont;
uint8 *_screenBuf;
uint8 _keyPressed;
- uint8 _keyRepeat;
- uint32 _keyRepeatTime;
void delay(uint32 msecs);
uint16 _mouseX, _mouseY, _mouseState;
bool _mouseDown;