From: Jaka K. <lyn...@us...> - 2011-09-05 21:17:36
|
gemrb: Infinity Engine emulator The branch master has been updated via 7fdc589d721f7236d1f91c3fa9ae4c5223bab495 (commit) Summary of changes: gemrb/plugins/SDLVideo/SDLVideo.cpp | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) from 807a306f79c87e8ef9bd928de74259e1bbd1f8b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=7fdc589d721f7236d1f91c3fa9ae4c5223bab495 commit 7fdc589d721f7236d1f91c3fa9ae4c5223bab495 Author: Brad Allred <brada@IT4.local> Date: Sun Sep 4 21:58:12 2011 -0600 made formation rotation possible with touch input. Signed-off-by: Jaka Kranjc <lyn...@us...> diff --git a/gemrb/plugins/SDLVideo/SDLVideo.cpp b/gemrb/plugins/SDLVideo/SDLVideo.cpp index 2f255f6..f259c7a 100644 --- a/gemrb/plugins/SDLVideo/SDLVideo.cpp +++ b/gemrb/plugins/SDLVideo/SDLVideo.cpp @@ -25,6 +25,7 @@ #include "AnimationFactory.h" #include "Audio.h" #include "Game.h" // for GetGlobalTint +#include "GameControl.h" // for TargetMode (contextual information for touch inputs) #include "GameData.h" #include "Interface.h" #include "Palette.h" @@ -304,15 +305,23 @@ int SDLVideoDriver::PollEvents() { SDL_PushEvent(&evtDown); - SDL_Event evtUp; - evtUp.type = SDL_MOUSEBUTTONUP; - evtUp.button = rightMouseUpEvent; - - SDL_PushEvent(&evtUp); - + GameControl* gc = core->GetGameControl(); + if (Evnt->GetMouseFocusedControlType() == IE_GUI_GAMECONTROL && gc && gc->GetTargetMode() == TARGET_MODE_NONE) { + // formation rotation + touchHold = false; + formationRotation = true; + } else { + SDL_Event evtUp; + evtUp.type = SDL_MOUSEBUTTONUP; + evtUp.button = rightMouseUpEvent; + SDL_PushEvent(&evtUp); + } ignoreNextMouseUp = true; touchHoldTime = 0; } + if (formationRotation) { + ignoreNextMouseUp = true; + } while ( SDL_PollEvent(&event) ) { touchHoldTime = 0; @@ -549,6 +558,11 @@ int SDLVideoDriver::PollEvents() { case SDL_FINGERUP://SDL 1.3+ touchHold = false;//even if there are still fingers in contact if (numFingers) numFingers--; + if (formationRotation) { + Evnt->MouseUp( event.tfinger.x, event.tfinger.y, 1 << ( SDL_BUTTON_RIGHT - 1 ), GetModState(SDL_GetModState()) ); + formationRotation = false; + ignoreNextMouseUp = false; + } if (Evnt && numFingers != core->NumFingInfo) { Evnt->KeyRelease( GEM_ALT, 0 ); } @@ -557,6 +571,11 @@ int SDLVideoDriver::PollEvents() { case SDL_MULTIGESTURE://SDL 1.3+ // use this for pinch or rotate gestures. see also SDL_DOLLARGESTURE numFingers = event.mgesture.numFingers; + /* + // perhapps formation rotation should be implemented here as a rotate gesture. + if (Evnt->GetMouseFocusedControlType() == IE_GUI_GAMECONTROL && numFingers == 2) { + } + */ break; /* not user input events */ case SDL_WINDOWEVENT://SDL 1.2 ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |