Преглед изворни кода

Created a new Platform.cpp source file and moved some of the common Platform methods from platform-specific source files into this source file to prevent duplication of code.
Added a new Game::resize event that is fired once after the game window is created and then again whenever the game window changes size.
Added support for a new "resizable" property in the game.config/window, to specify whether you want a resizable window border (for platforms that support this). Currently only the Windows platform checks this flag, but Mac and Linux will follow soon.

Steve Grenier пре 13 година
родитељ
комит
6febb8d0e4

+ 1 - 0
gameplay/CMakeLists.txt

@@ -156,6 +156,7 @@ set(GAMEPLAY_SRC
     src/Plane.h
     src/Plane.inl
     src/Platform.h
+    src/Platform.cpp
     src/PlatformAndroid.cpp
     src/PlatformBlackBerry.cpp
     src/PlatformLinux.cpp

+ 1 - 0
gameplay/android/jni/Android.mk

@@ -87,6 +87,7 @@ LOCAL_SRC_FILES := \
     PhysicsVehicle.cpp \
     PhysicsVehicleWheel.cpp \
     Plane.cpp \
+    Platform.cpp \
     PlatformAndroid.cpp \
     Properties.cpp \
     Quaternion.cpp \

+ 1 - 0
gameplay/gameplay.vcxproj

@@ -292,6 +292,7 @@
     <ClCompile Include="src\PhysicsVehicle.cpp" />
     <ClCompile Include="src\PhysicsVehicleWheel.cpp" />
     <ClCompile Include="src\Plane.cpp" />
+    <ClCompile Include="src\Platform.cpp" />
     <ClCompile Include="src\PlatformAndroid.cpp" />
     <ClCompile Include="src\PlatformBlackBerry.cpp" />
     <ClCompile Include="src\PlatformLinux.cpp" />

+ 3 - 0
gameplay/gameplay.vcxproj.filters

@@ -840,6 +840,9 @@
     <ClCompile Include="src\lua\lua_HeightField.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
+    <ClCompile Include="src\Platform.cpp">
+      <Filter>src</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="src\Animation.h">

+ 9 - 0
gameplay/src/Game.cpp

@@ -86,6 +86,7 @@ int Game::run()
         shutdown();
         return -2;
     }
+
     return 0;
 }
 
@@ -286,9 +287,13 @@ void Game::frame()
 {
     if (!_initialized)
     {
+        // Perform lazy first time initialization
         initialize();
         _scriptController->initializeGame();
         _initialized = true;
+
+        // Fire first game resize event
+        resized(_width, _height);
     }
 
 	static double lastFrameTime = Game::getGameTime();
@@ -464,6 +469,10 @@ bool Game::mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta)
     return false;
 }
 
+void Game::resized(unsigned int width, unsigned int height)
+{
+}
+
 bool Game::isGestureSupported(Gesture::GestureEvent evt)
 {
     return Platform::isGestureSupported(evt);

+ 11 - 0
gameplay/src/Game.h

@@ -316,6 +316,17 @@ public:
      */
     virtual bool mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta);
     
+    /**
+     * Called when the game window has been resized.
+     *
+     * This method is called once the game window is created with its initial size
+     * and then again any time the game window changes size.
+     *
+     * @param width The new game window width.
+     * @param height The new game window height.
+     */
+    virtual void resized(unsigned int width, unsigned int height);
+
     /** 
      * Gets whether the current platform supports mouse input.
      *

+ 67 - 0
gameplay/src/Platform.cpp

@@ -0,0 +1,67 @@
+// Implementation of base platform-agnostic platform functionality.
+#include "Base.h"
+#include "Platform.h"
+#include "Game.h"
+#include "ScriptController.h"
+
+namespace gameplay
+{
+
+void Platform::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
+{
+    if (!Form::touchEventInternal(evt, x, y, contactIndex))
+    {
+        Game::getInstance()->touchEvent(evt, x, y, contactIndex);
+        Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex);
+    }
+}
+
+void Platform::keyEventInternal(Keyboard::KeyEvent evt, int key)
+{
+    if (!Form::keyEventInternal(evt, key))
+    {
+        Game::getInstance()->keyEvent(evt, key);
+        Game::getInstance()->getScriptController()->keyEvent(evt, key);
+    }
+}
+
+bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta)
+{
+    if (Form::mouseEventInternal(evt, x, y, wheelDelta))
+    {
+        return true;
+    }
+    else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta))
+    {
+        return true;
+    }
+    else
+    {
+        return Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta);
+    }
+}
+
+void Platform::resizeEventInternal(unsigned int width, unsigned int height)
+{
+    // Update the width and height of the game
+    Game* game = Game::getInstance();
+    if (game->_width != width || game->_height != height)
+    {
+        game->_width = width;
+        game->_height = height;
+        game->resized(width, height);
+    }
+}
+
+void Platform::gamepadEventConnectedInternal(GamepadHandle handle,  unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount,
+                                             unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString)
+{
+    Gamepad::add(handle, buttonCount, joystickCount, triggerCount, vendorId, productId, vendorString, productString);
+}
+
+void Platform::gamepadEventDisconnectedInternal(GamepadHandle handle)
+{
+    Gamepad::remove(handle);
+}
+
+}

+ 7 - 0
gameplay/src/Platform.h

@@ -285,6 +285,13 @@ public:
      */
     static bool mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta);
 
+    /**
+     * Internal method used only from static code in various platform implementation.
+     *
+     * @script{ignore}
+     */
+    static void resizeEventInternal(unsigned int width, unsigned int height);
+
    /**
      * Internal method used only from static code in various platform implementation.
      *

+ 0 - 45
gameplay/src/PlatformAndroid.cpp

@@ -1253,51 +1253,6 @@ void Platform::displayKeyboard(bool display)
         __displayKeyboard = false;
 }
 
-void Platform::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
-{
-    if (!Form::touchEventInternal(evt, x, y, contactIndex))
-    {
-        Game::getInstance()->touchEvent(evt, x, y, contactIndex);
-        Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex);
-    }
-}
-
-void Platform::keyEventInternal(Keyboard::KeyEvent evt, int key)
-{
-    if (!Form::keyEventInternal(evt, key))
-    {
-        Game::getInstance()->keyEvent(evt, key);
-        Game::getInstance()->getScriptController()->keyEvent(evt, key);
-    }
-}
-
-bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta)
-{
-    if (Form::mouseEventInternal(evt, x, y, wheelDelta))
-    {
-        return true;
-    }
-    else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta))
-    {
-        return true;
-    }
-    else
-    {
-        return Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta);
-    }
-}
-
-void Platform::gamepadEventConnectedInternal(GamepadHandle handle,  unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount,
-                                             unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString)
-{
-    Gamepad::add(handle, buttonCount, joystickCount, triggerCount, vendorId, productId, vendorString, productString);
-}
-
-void Platform::gamepadEventDisconnectedInternal(GamepadHandle handle)
-{
-    Gamepad::remove(handle);
-}
-
 void Platform::shutdownInternal()
 {
     Game::getInstance()->shutdown();

+ 0 - 45
gameplay/src/PlatformBlackBerry.cpp

@@ -1508,51 +1508,6 @@ void Platform::displayKeyboard(bool display)
         virtualkeyboard_hide();
 }
 
-void Platform::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
-{
-    if (!Form::touchEventInternal(evt, x, y, contactIndex))
-    {
-        Game::getInstance()->touchEvent(evt, x, y, contactIndex);
-        Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex);
-    }
-}
-
-void Platform::keyEventInternal(Keyboard::KeyEvent evt, int key)
-{
-    if (!Form::keyEventInternal(evt, key))
-    {
-        Game::getInstance()->keyEvent(evt, key);
-        Game::getInstance()->getScriptController()->keyEvent(evt, key);
-    }
-}
-
-bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta)
-{
-    if (Form::mouseEventInternal(evt, x, y, wheelDelta))
-    {
-        return true;
-    }
-    else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta))
-    {
-        return true;
-    }
-    else
-    {
-        return Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta);
-    }
-}
-
-void Platform::gamepadEventConnectedInternal(GamepadHandle handle,  unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount,
-                                             unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString)
-{
-    Gamepad::add(handle, buttonCount, joystickCount, triggerCount, vendorId, productId, vendorString, productString);
-}
-
-void Platform::gamepadEventDisconnectedInternal(GamepadHandle handle)
-{
-    Gamepad::remove(handle);
-}
-
 void Platform::shutdownInternal()
 {
     Game::getInstance()->shutdown();

+ 0 - 45
gameplay/src/PlatformLinux.cpp

@@ -1505,51 +1505,6 @@ namespace gameplay
         // not supported
     }
 
-    void Platform::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
-    {
-        if (!Form::touchEventInternal(evt, x, y, contactIndex))
-        {
-            Game::getInstance()->touchEvent(evt, x, y, contactIndex);
-            Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex);
-        }
-    }
-
-    void Platform::keyEventInternal(Keyboard::KeyEvent evt, int key)
-    {
-        if (!Form::keyEventInternal(evt, key))
-        {
-            Game::getInstance()->keyEvent(evt, key);
-            Game::getInstance()->getScriptController()->keyEvent(evt, key);
-        }
-    }
-
-    bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta)
-    {
-        if (Form::mouseEventInternal(evt, x, y, wheelDelta))
-        {
-            return true;
-        }
-        else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta))
-        {
-            return true;
-        }
-        else
-        {
-            return Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta);
-        }
-    }
-    
-        void Platform::gamepadEventConnectedInternal(GamepadHandle handle,  unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount,
-                unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString)
-        {
-            Gamepad::add(handle, buttonCount, joystickCount, triggerCount, vendorId, productId, vendorString, productString);
-        }
-
-    void Platform::gamepadEventDisconnectedInternal(GamepadHandle handle)
-    {
-        Gamepad::remove(handle);
-    }
-
     void Platform::shutdownInternal()
     {
         closeAllGamepads();

+ 32 - 57
gameplay/src/PlatformMacOSX.mm

@@ -972,10 +972,12 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
 
 - (void) mouse: (Mouse::MouseEvent) mouseEvent orTouchEvent: (Touch::TouchEvent) touchEvent x: (float) x y: (float) y s: (int) s 
 {
+    [__view->gameLock lock];
     if (!gameplay::Platform::mouseEventInternal(mouseEvent, x, y, s))
     {
         gameplay::Platform::touchEventInternal(touchEvent, x, y, 0);
     }
+    [__view->gameLock unlock];
 }
 
 - (void) mouseDown: (NSEvent*) event
@@ -1024,7 +1026,9 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
         y = __height - point.y;
     }
     
+    [__view->gameLock lock];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_MOVE, point.x, y, 0);
+    [__view->gameLock unlock];
 }
 
 - (void) mouseDragged: (NSEvent*) event
@@ -1043,7 +1047,9 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
     __lx = point.x;
     __ly = __height - point.y;
     
+    [__view->gameLock lock];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_PRESS_RIGHT_BUTTON, point.x, __height - point.y, 0);
+    [__view->gameLock unlock];
 }
 
 - (void) rightMouseUp: (NSEvent*) event
@@ -1051,7 +1057,9 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
     __rightMouseDown = false;
     NSPoint point = [event locationInWindow];
     
+    [__view->gameLock lock];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_RELEASE_RIGHT_BUTTON, point.x, __height - point.y, 0);
+    [__view->gameLock unlock];
 }
 
 - (void) rightMouseDragged: (NSEvent*) event
@@ -1074,27 +1082,38 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
     
     // In right-mouse case, whether __rightMouseDown is true or false
     // this should not matter, mouse move is still occuring
+    [__view->gameLock lock];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_MOVE, point.x, __height - point.y, 0);
+    [__view->gameLock unlock];
 }
 
 - (void)otherMouseDown: (NSEvent*) event 
 {
     __otherMouseDown = true;
     NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
+
+    [__view->gameLock lock];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_PRESS_MIDDLE_BUTTON, point.x, __height - point.y, 0);
+    [__view->gameLock unlock];
 }
 
 - (void)otherMouseUp: (NSEvent*) event 
 {
     __otherMouseDown = false;
     NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
+
+    [__view->gameLock lock];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_RELEASE_MIDDLE_BUTTON, point.x, __height - point.y, 0);
+    [__view->gameLock unlock];
 }
 
 - (void)otherMouseDragged: (NSEvent*) event 
 {
     NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
+
+    [__view->gameLock lock];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_MOVE, point.x, __height - point.y, 0);
+    [__view->gameLock unlock];
 }
 
 - (void) mouseEntered: (NSEvent*)event
@@ -1105,7 +1124,10 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime
 - (void)scrollWheel: (NSEvent*) event 
 {
     NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
+
+    [__view->gameLock lock];
     gameplay::Platform::mouseEventInternal(Mouse::MOUSE_WHEEL, point.x, __height - point.y, (int)([event deltaY] * 10.0f));
+    [__view->gameLock unlock];
 }
 
 - (void) mouseExited: (NSEvent*)event
@@ -1441,6 +1463,8 @@ int getUnicode(int key)
 {
     unsigned int keyCode = [event keyCode];
     unsigned int flags = [event modifierFlags];
+
+    [__view->gameLock lock];
     switch (keyCode) 
     {
         case 0x39:
@@ -1471,6 +1495,7 @@ int getUnicode(int key)
             gameplay::Platform::keyEventInternal((flags & NSCommandKeyMask) ? Keyboard::KEY_PRESS : Keyboard::KEY_RELEASE, Keyboard::KEY_HYPER);
             break;
     }
+    [__view->gameLock unlock];
 }
 
 - (void) keyDown: (NSEvent*) event
@@ -1478,6 +1503,8 @@ int getUnicode(int key)
     if ([event isARepeat] == NO)
     {
         int key = getKey([event keyCode], [event modifierFlags]);
+
+        [__view->gameLock lock];
         gameplay::Platform::keyEventInternal(Keyboard::KEY_PRESS, key);
         
         int character = getUnicode(key);
@@ -1485,12 +1512,16 @@ int getUnicode(int key)
         {
             gameplay::Platform::keyEventInternal(Keyboard::KEY_CHAR, character);
         }
+
+        [__view->gameLock unlock];
     }
 }
 
 - (void) keyUp: (NSEvent*) event
-{    
+{
+    [__view->gameLock lock];
     gameplay::Platform::keyEventInternal(Keyboard::KEY_RELEASE, getKey([event keyCode], [event modifierFlags]));
+    [__view->gameLock unlock];
 }
 
 // Gesture support for Mac OS X Trackpads
@@ -1848,62 +1879,6 @@ void Platform::displayKeyboard(bool display)
     // Do nothing.
 }
 
-void Platform::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
-{
-    [__view->gameLock lock];
-    if (!Form::touchEventInternal(evt, x, y, contactIndex))
-    {
-        Game::getInstance()->touchEvent(evt, x, y, contactIndex);
-        Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex);
-    }
-    [__view->gameLock unlock];
-}
-    
-void Platform::keyEventInternal(Keyboard::KeyEvent evt, int key)
-{
-    [__view->gameLock lock];
-    if (!Form::keyEventInternal(evt, key))
-    {
-        Game::getInstance()->keyEvent(evt, key);
-        Game::getInstance()->getScriptController()->keyEvent(evt, key);
-    }
-    [__view->gameLock unlock];
-}
-
-bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta)
-{
-    [__view->gameLock lock];
-    
-    bool result;
-    if (Form::mouseEventInternal(evt, x, y, wheelDelta))
-    {
-        result = true;
-    }
-    else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta))
-    {
-        result = true;
-    }
-    else
-    {
-        result = Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta);
-    }
-    
-    [__view->gameLock unlock];
-    
-    return result;
-}
-    
-void Platform::gamepadEventConnectedInternal(GamepadHandle handle,  unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount,
-                                             unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString)
-{
-    Gamepad::add(handle, buttonCount, joystickCount, triggerCount, vendorId, productId, vendorString, productString);
-}
-
-void Platform::gamepadEventDisconnectedInternal(GamepadHandle handle)
-{
-    Gamepad::remove(handle);
-}
-
 void Platform::shutdownInternal()
 {
     Game::getInstance()->shutdown();

+ 26 - 47
gameplay/src/PlatformWindows.cpp

@@ -502,6 +502,11 @@ LRESULT CALLBACK __WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
     case WM_KILLFOCUS:
         break;
+
+    case WM_SIZE:
+        // Window was resized.
+        gameplay::Platform::resizeEventInternal((unsigned int)(short)LOWORD(lParam), (unsigned int)(short)HIWORD(lParam));
+        break;
     }
     
     return DefWindowProc(hwnd, msg, wParam, lParam); 
@@ -516,6 +521,7 @@ struct WindowCreationParams
     RECT rect;
     std::wstring windowName;
     bool fullscreen;
+    bool resizable;
     int samples;
 };
 
@@ -552,6 +558,7 @@ Platform::~Platform()
 bool createWindow(WindowCreationParams* params, HWND* hwnd, HDC* hdc)
 {
     bool fullscreen = false;
+    bool resizable = false;
     RECT rect = { CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT };
     std::wstring windowName;
     if (params)
@@ -559,11 +566,25 @@ bool createWindow(WindowCreationParams* params, HWND* hwnd, HDC* hdc)
         windowName = params->windowName;
         memcpy(&rect, &params->rect, sizeof(RECT));
         fullscreen = params->fullscreen;
+        resizable = params->resizable;
     }
 
     // Set the window style.
-    DWORD style   = (fullscreen ? WS_POPUP : WS_POPUP | WS_BORDER | WS_CAPTION | WS_SYSMENU) | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
-    DWORD styleEx = (fullscreen ? WS_EX_APPWINDOW : WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
+    DWORD style, styleEx;
+    if (fullscreen)
+    {
+        style = WS_POPUP;
+        styleEx = WS_EX_APPWINDOW;
+    }
+    else
+    {
+        if (resizable)
+            style = WS_OVERLAPPEDWINDOW;
+        else
+            style = WS_POPUP | WS_BORDER | WS_CAPTION | WS_SYSMENU;
+        styleEx = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
+    }
+    style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
 
     // Adjust the window rectangle so the client size is the requested size.
     AdjustWindowRectEx(&rect, style, FALSE, styleEx);
@@ -766,6 +787,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
     // Read window settings from config.
     WindowCreationParams params;
     params.fullscreen = false;
+    params.resizable = false;
     params.rect.left = 0;
     params.rect.top = 0;
     params.rect.right = 0;
@@ -789,6 +811,8 @@ Platform* Platform::create(Game* game, void* attachToWindow)
 
             // Read fullscreen state.
             params.fullscreen = config->getBool("fullscreen");
+            // Read resizable state.
+            params.resizable = config->getBool("resizable");
             // Read multisampling state.
             params.samples = config->getInt("samples");
 
@@ -1276,51 +1300,6 @@ void Platform::pollGamepadState(Gamepad* gamepad)
 }
 #endif
 
-void Platform::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
-{
-    if (!Form::touchEventInternal(evt, x, y, contactIndex))
-    {
-        Game::getInstance()->touchEvent(evt, x, y, contactIndex);
-        Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex);
-    }
-}
-
-void Platform::keyEventInternal(Keyboard::KeyEvent evt, int key)
-{
-    if (!Form::keyEventInternal(evt, key))
-    {
-        Game::getInstance()->keyEvent(evt, key);
-        Game::getInstance()->getScriptController()->keyEvent(evt, key);
-    }
-}
-
-bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta)
-{
-    if (Form::mouseEventInternal(evt, x, y, wheelDelta))
-    {
-        return true;
-    }
-    else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta))
-    {
-        return true;
-    }
-    else
-    {
-        return Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta);
-    }
-}
-
-void Platform::gamepadEventConnectedInternal(GamepadHandle handle,  unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount,
-                                             unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString)
-{
-    Gamepad::add(handle, buttonCount, joystickCount, triggerCount, vendorId, productId, vendorString, productString);
-}
-
-void Platform::gamepadEventDisconnectedInternal(GamepadHandle handle)
-{
-    Gamepad::remove(handle);
-}
-
 void Platform::shutdownInternal()
 {
     Game::getInstance()->shutdown();

+ 0 - 45
gameplay/src/PlatformiOS.mm

@@ -1444,51 +1444,6 @@ void Platform::displayKeyboard(bool display)
         }
     }
 }
-    
-void Platform::touchEventInternal(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex)
-{
-    if (!Form::touchEventInternal(evt, x, y, contactIndex))
-    {
-        Game::getInstance()->touchEvent(evt, x, y, contactIndex);
-        Game::getInstance()->getScriptController()->touchEvent(evt, x, y, contactIndex);
-    }
-}
-    
-void Platform::keyEventInternal(Keyboard::KeyEvent evt, int key)
-{
-    if (!Form::keyEventInternal(evt, key))
-    {
-        Game::getInstance()->keyEvent(evt, key);
-        Game::getInstance()->getScriptController()->keyEvent(evt, key);
-    }
-}
-
-bool Platform::mouseEventInternal(Mouse::MouseEvent evt, int x, int y, int wheelDelta)
-{
-    if (Form::mouseEventInternal(evt, x, y, wheelDelta))
-    {
-        return true;
-    }
-    else if (Game::getInstance()->mouseEvent(evt, x, y, wheelDelta))
-    {
-        return true;
-    }
-    else
-    {
-        return Game::getInstance()->getScriptController()->mouseEvent(evt, x, y, wheelDelta);
-    }
-}
-
-void Platform::gamepadEventConnectedInternal(GamepadHandle handle,  unsigned int buttonCount, unsigned int joystickCount, unsigned int triggerCount,
-                                             unsigned int vendorId, unsigned int productId, const char* vendorString, const char* productString)
-{
-    Gamepad::add(handle, buttonCount, joystickCount, triggerCount, vendorId, productId, vendorString, productString);
-}
-
-void Platform::gamepadEventDisconnectedInternal(GamepadHandle handle)
-{
-    Gamepad::remove(handle);
-}
 
 void Platform::shutdownInternal()
 {