From a438c9135e1b9b58d3648247c1015815911cc60d Mon Sep 17 00:00:00 2001 From: "techdragon.nguyen@gmail.com" Date: Thu, 26 Jan 2012 14:54:17 +0000 Subject: [PATCH] vs 2010 update for deck editor changes as well as SDL update --- JGE/include/JGui.h | 8 ++++---- JGE/src/SDLmain.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/JGE/include/JGui.h b/JGE/include/JGui.h index a2f8d845b..ade8faa23 100644 --- a/JGE/include/JGui.h +++ b/JGE/include/JGui.h @@ -110,10 +110,10 @@ public: virtual void Update(float dt); virtual bool CheckUserInput(JButton key); - void Add(JGuiObject* ctrl, bool isButton = false); - void RemoveAt(int i, bool isButton = false); - void Remove(int id); - void Remove(JGuiObject* ctrl); + virtual void Add(JGuiObject* ctrl, bool isButton = false); + virtual void RemoveAt(int i, bool isButton = false); + virtual void Remove(int id); + virtual void Remove(JGuiObject* ctrl); void SetActionButton(JButton button); void SetStyle(int style); diff --git a/JGE/src/SDLmain.cpp b/JGE/src/SDLmain.cpp index e7b0ac972..d1b2af01c 100644 --- a/JGE/src/SDLmain.cpp +++ b/JGE/src/SDLmain.cpp @@ -17,7 +17,7 @@ #include "DebugRoutines.h" #include #include - +#include #if (defined FORCE_GLES) #undef GL_ES_VERSION_2_0 @@ -253,7 +253,9 @@ public: case SDL_JOYBALLMOTION: DebugTrace("Flick gesture detected, x: " << Event->jball.xrel << ", y: " << Event->jball.yrel); - g_engine->Scroll(Event->jball.xrel, Event->jball.yrel); + int magnitude = static_cast(sqrt( powf( Event->jball.xrel, 2) + powf( Event->jball.yrel, 2))); + + g_engine->Scroll(Event->jball.xrel, Event->jball.yrel, magnitude); break; } }