From 4789e0f02665a8cc8cf0b814d65e71d38f88a5f1 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Fri, 29 Jun 2012 23:37:11 +0100 Subject: LURE: Fix engine crash in copy protection screen. Fixes bug #3539031 - "LURE: Crash at Copy Protection Screen". Previously, the code didn't prevent keyboard events with modifiers being used. Since the ascii values for these were outside the 0-9 numeric range, this resulted in an invalid frame number being used and thus the engine aborted at an asertion. --- engines/lure/surface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/lure') diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index 4d63647af5..7af9d665de 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -1349,7 +1349,7 @@ bool CopyProtectionDialog::show() { while (!engine.shouldQuit()) { while (events.pollEvent() && (_charIndex < 4)) { - if (events.type() == Common::EVENT_KEYDOWN) { + if (events.type() == Common::EVENT_KEYDOWN && !(events.event().kbd.flags & Common::KBD_NON_STICKY)) { if ((events.event().kbd.keycode == Common::KEYCODE_BACKSPACE) && (_charIndex > 0)) { // Remove the last number typed --_charIndex; -- cgit v1.2.3 From 335ba979a2e3aab9c1856bf84a18b60ab91de687 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sat, 30 Jun 2012 20:47:29 +0100 Subject: LURE: Fix engine crash in copy protection screen with AZERTY keyboard Fixes bug #3539031 - "LURE: Crash at Copy Protection Screen". This reverts the previous fix which only worked for QWERTY keyboards and made the issue worse for AZERTY keyboards. It now uses the ASCII code instead of the keycode for the sanity check. --- engines/lure/surface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/lure') diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index 7af9d665de..0f13d87fbc 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -1349,7 +1349,7 @@ bool CopyProtectionDialog::show() { while (!engine.shouldQuit()) { while (events.pollEvent() && (_charIndex < 4)) { - if (events.type() == Common::EVENT_KEYDOWN && !(events.event().kbd.flags & Common::KBD_NON_STICKY)) { + if (events.type() == Common::EVENT_KEYDOWN) { if ((events.event().kbd.keycode == Common::KEYCODE_BACKSPACE) && (_charIndex > 0)) { // Remove the last number typed --_charIndex; @@ -1360,8 +1360,8 @@ bool CopyProtectionDialog::show() { (*tmpHotspot)->copyTo(&screen.screen()); screen.update(); - } else if ((events.event().kbd.keycode >= Common::KEYCODE_0) && - (events.event().kbd.keycode <= Common::KEYCODE_9)) { + } else if ((events.event().kbd.ascii >= '0') && + (events.event().kbd.ascii <= '9')) { HotspotsList::iterator tmpHotspot = _hotspots.begin(); for (int i = 0; i < _charIndex + 3; i++) ++tmpHotspot; -- cgit v1.2.3 From 89abab97e3124fa25eb4c7d3e8b38501747a8d17 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 26 Sep 2012 04:17:31 +0200 Subject: JANITORIAL: Remove trailing whitespaces. Powered by: git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//' --- engines/lure/decode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/lure') diff --git a/engines/lure/decode.cpp b/engines/lure/decode.cpp index 1338559534..484126c43f 100644 --- a/engines/lure/decode.cpp +++ b/engines/lure/decode.cpp @@ -255,7 +255,7 @@ MemoryBlock *PictureDecoder::vgaDecode(MemoryBlock *src, uint32 maxOutputSize) { decrCtr(); if (shlCarry()) break; - + AL = dataIn->data()[BP + 3]; } else { decrCtr(); @@ -375,7 +375,7 @@ uint32 AnimationDecoder::decode_data(MemoryBlock *src, MemoryBlock *dest, uint32 // Main loop bool loopFlag = true; while (loopFlag) { - for (;;) { + for (;;) { carry = false; rcl(currData, carry); if (--bitCtr == 0) { -- cgit v1.2.3