diff options
| author | lolbot-iichan | 2019-07-01 02:41:41 +0300 |
|---|---|---|
| committer | Filippos Karapetis | 2019-07-02 08:00:30 +0300 |
| commit | 13dbfbd8d7d03a4463f739775e1d383152d4253b (patch) | |
| tree | d8afca73e582c445f37907a47598e62509baba18 /engines/wintermute/ad | |
| parent | abec0982b9c70f2b88b0744f5abe82b55f6217e8 (diff) | |
| download | scummvm-rg350-13dbfbd8d7d03a4463f739775e1d383152d4253b.tar.gz scummvm-rg350-13dbfbd8d7d03a4463f739775e1d383152d4253b.tar.bz2 scummvm-rg350-13dbfbd8d7d03a4463f739775e1d383152d4253b.zip | |
WINTERMUTE: Fix slider bugs in several games
There is a bug introduced in WME Lite.
Testcase:
1. Download https://github.com/lolbot-iichan/wme_testsuite/tree/master/slider_test/packages
2. Download https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/wmelite/wmelite_10_win.zip
3a. Run game.exe -> Slider moves with the mouse while it is pressed and
released when mouse is released
3b. Run wmelite.exe -> Slider is never released
3c. Run ScummVM -> Slider is never released
Related bugs:
https://bugs.scummvm.org/ticket/6567
https://bugs.scummvm.org/ticket/9861
Reason: slider is a button object that changes it's X until "LeftRelease" event is revieved and breaks the endless loop.
Sample code: https://github.com/lolbot-iichan/wme_testsuite/blob/master/slider_test/data/interface/system/speechvolume.script
However, WME Lite does not send "LeftRelease" events to any objects, if Game object can handle such event, even is game is frozen and UI is shown.
Original code: https://github.com/lolbot-iichan/Wintermute-Engine/blob/master/src/engine_core/wme_ad/AdGame.cpp#L2218
Changed in WME Lite: https://github.com/lolbot-iichan/wmelite/blob/master/src/AdGame.cpp#L2120
This behaviour was introduced in SVN period of wmelite, I believe it was
made on purpose for handling some iOS scenarios at commit #37 mentioned
on page https://code.google.com/archive/p/wmelite/source/default/commits
My proposal is to mark iOS apps as WME_LITE and fill exact WME_1_X_X/WME_LITE versions for all known
games. WME_1_X_X can be seen by right-clicking on main executable and seems to be non-empty for almost all existing WME games.
Diffstat (limited to 'engines/wintermute/ad')
| -rw-r--r-- | engines/wintermute/ad/ad_game.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/wintermute/ad/ad_game.cpp b/engines/wintermute/ad/ad_game.cpp index 088184b0f6..110dfa9678 100644 --- a/engines/wintermute/ad/ad_game.cpp +++ b/engines/wintermute/ad/ad_game.cpp @@ -38,6 +38,7 @@ #include "engines/wintermute/ad/ad_scene.h" #include "engines/wintermute/ad/ad_scene_state.h" #include "engines/wintermute/ad/ad_sentence.h" +#include "engines/wintermute/base/base_engine.h" #include "engines/wintermute/base/base_file_manager.h" #include "engines/wintermute/base/font/base_font.h" #include "engines/wintermute/base/base_object.h" @@ -2173,7 +2174,13 @@ bool AdGame::onMouseLeftUp() { _capturedObject = nullptr; _mouseLeftDown = false; - bool handled = /*_state==GAME_RUNNING &&*/ DID_SUCCEED(applyEvent("LeftRelease")); + bool handled; + if (BaseEngine::instance().getTargetExecutable() < WME_LITE) { + handled = _state==GAME_RUNNING && DID_SUCCEED(applyEvent("LeftRelease")); + } else { + handled = DID_SUCCEED(applyEvent("LeftRelease")); + } + if (!handled) { if (_activeObject != nullptr) { _activeObject->applyEvent("LeftRelease"); |
