From b4c33cb3e185a4ba4052fed74a03707dba835fb7 Mon Sep 17 00:00:00 2001 From: Xawotihs Date: Mon, 9 Jan 2012 23:35:50 +0000 Subject: [PATCH] Finally got issue 777 I was wrong, the recursion was not due to weird call order of WGuiList and WGuiMenu at all. It was due to two different problems: 1) there is some code in WGuiMenu to handle keys previously held. I guess it's to be able to go through the options very quickly on PSP. 2) Each PSP generated keys stays held if the corresponding code for release is not called... => Each time we generate some PSP keys press from gesture in the core or in a frontend, we absolutely need to generate the release code corresponding or the core might think that some keys are still held ... That's precisely what was not done by the code handling swipe in filters =). --- JGE/src/qt/corewrapper.cpp | 1 + projects/mtg/Android/build.xml | 108 +++++++++++++++++------------ projects/mtg/qml/QmlWagic/main.qml | 5 +- projects/mtg/src/GameStateShop.cpp | 23 +----- 4 files changed, 69 insertions(+), 68 deletions(-) diff --git a/JGE/src/qt/corewrapper.cpp b/JGE/src/qt/corewrapper.cpp index 87434832c..120c7ad38 100644 --- a/JGE/src/qt/corewrapper.cpp +++ b/JGE/src/qt/corewrapper.cpp @@ -133,6 +133,7 @@ void WagicCore::timerEvent( QTimerEvent* ) m_engine->SetDelta((float)dt / 1000.0f); m_engine->Update((float)dt / 1000.0f); + done(); update(); } diff --git a/projects/mtg/Android/build.xml b/projects/mtg/Android/build.xml index 73c1a0ac6..8a4d8e5ad 100644 --- a/projects/mtg/Android/build.xml +++ b/projects/mtg/Android/build.xml @@ -1,67 +1,85 @@ - + - + It contains the path to the SDK. It should *NOT* be checked into + Version Control Systems. --> + - - + - - + - - - - - - - + This contains project specific properties such as project target, and library + dependencies. Lower level build properties are stored in ant.properties + (or in .classpath for Eclipse projects). - + This file is an integral part of the build system for your + application and should be checked into Version Control Systems. --> + - + - The rules file is imported from - /platforms//templates/android_rules.xml - To customize some build steps for your project: - - copy the content of the main node from android_rules.xml - - paste it in this build.xml below the task. - - disable the import by changing the setup task below to + + + + - + + diff --git a/projects/mtg/qml/QmlWagic/main.qml b/projects/mtg/qml/QmlWagic/main.qml index 69d21f9d0..60da11a20 100644 --- a/projects/mtg/qml/QmlWagic/main.qml +++ b/projects/mtg/qml/QmlWagic/main.qml @@ -137,7 +137,10 @@ Rectangle { } onPressAndHold: { - wagic.doMenu() + if(Math.abs(lastX-mouse.x)<50 && Math.abs(lastY-mouse.y)<50) + { + wagic.doMenu() + } } } function resize(){ diff --git a/projects/mtg/src/GameStateShop.cpp b/projects/mtg/src/GameStateShop.cpp index cd06c0f61..c7f830071 100644 --- a/projects/mtg/src/GameStateShop.cpp +++ b/projects/mtg/src/GameStateShop.cpp @@ -810,28 +810,7 @@ void GameStateShop::ButtonPressed(int controllerId, int controlId) void GameStateShop::OnScroll(int inXVelocity, int inYVelocity) { - if (mStage == STAGE_ASK_ABOUT) - { - bool flickHorizontal = (abs(inXVelocity) > abs(inYVelocity)); - if (flickHorizontal) - { - bool flickRight = inXVelocity > 0 ? true : false; - if (flickRight) - mEngine->HoldKey_NoRepeat(JGE_BTN_RIGHT); - else - mEngine->HoldKey_NoRepeat(JGE_BTN_LEFT); - } - else - { - bool flickUp = inYVelocity < 0 ? true : false; - if (flickUp) - mEngine->HoldKey_NoRepeat(JGE_BTN_UP); - else - mEngine->HoldKey_NoRepeat(JGE_BTN_DOWN); - } - - } - else if (abs(inXVelocity) > 200) + if (abs(inXVelocity) > 200) { bool flickRight = (inXVelocity >= 0); if (flickRight)