Browse Source

removed deprecated Input::event_platform
it was replaced with core::getDispatcher and core::EVENT_SYSTEM

dmuratshin 9 years ago
parent
commit
ed7da85510

+ 1 - 1
oxygine/src/DebugActor.cpp

@@ -299,7 +299,7 @@ namespace oxygine
 #ifdef __APPLE__
 #ifdef __APPLE__
         size_t mem;
         size_t mem;
         iosGetMemoryUsage(mem);
         iosGetMemoryUsage(mem);
-        s << "memory=" << mem/1024 << "kb ";
+        s << "memory=" << mem / 1024 << "kb ";
 #endif
 #endif
         //s << "\nlisteners=" << getStage()->getListenersCount() << "";
         //s << "\nlisteners=" << getStage()->getListenersCount() << "";
 
 

+ 1 - 6
oxygine/src/Input.h

@@ -12,7 +12,7 @@ namespace oxygine
 
 
     const int MAX_TOUCHES = 8;
     const int MAX_TOUCHES = 8;
 
 
-    class Input: public EventDispatcher
+    class Input: public Object
     {
     {
     public:
     public:
         static Input instance;
         static Input instance;
@@ -20,11 +20,6 @@ namespace oxygine
         Input();
         Input();
         ~Input();
         ~Input();
 
 
-        enum
-        {
-            event_platform = sysEventID('I', 'P', 'L')
-        };
-
         void cleanup();
         void cleanup();
 
 
         /**id should be in range [1, MAX_TOUCHES]*/
         /**id should be in range [1, MAX_TOUCHES]*/

+ 4 - 4
oxygine/src/InputText.cpp

@@ -1,7 +1,7 @@
 #include "InputText.h"
 #include "InputText.h"
 #include "TextField.h"
 #include "TextField.h"
 #include "utils/stringUtils.h"
 #include "utils/stringUtils.h"
-#include "Input.h"
+#include "core/oxygine.h"
 
 
 #ifndef __S3E__
 #ifndef __S3E__
 #include "SDL_keyboard.h"
 #include "SDL_keyboard.h"
@@ -49,7 +49,7 @@ namespace oxygine
 
 
         _textActor = ta;
         _textActor = ta;
 
 
-        Input::instance.addEventListener(Input::event_platform, CLOSURE(this, &InputText::_onPlatform));
+        core::getDispatcher()->addEventListener(core::EVENT_SYSTEM, CLOSURE(this, &InputText::_onSysEvent));
 
 
 #ifndef __S3E__
 #ifndef __S3E__
         SDL_StartTextInput();
         SDL_StartTextInput();
@@ -89,7 +89,7 @@ namespace oxygine
 #ifndef __S3E__
 #ifndef __S3E__
         SDL_StopTextInput();
         SDL_StopTextInput();
 #endif
 #endif
-        Input::instance.removeEventListeners(this);
+        core::getDispatcher()->removeEventListeners(this);
 
 
         _active = 0;
         _active = 0;
         _textActor = 0;
         _textActor = 0;
@@ -97,7 +97,7 @@ namespace oxygine
         releaseRef();
         releaseRef();
     }
     }
 
 
-    void InputText::_onPlatform(Event* event)
+    void InputText::_onSysEvent(Event* event)
     {
     {
 #ifndef __S3E__
 #ifndef __S3E__
         _onSDLEvent((SDL_Event*)event->userData);
         _onSDLEvent((SDL_Event*)event->userData);

+ 1 - 1
oxygine/src/InputText.h

@@ -40,7 +40,7 @@ namespace oxygine
         void updateText();
         void updateText();
         static InputText* _active;
         static InputText* _active;
 
 
-        void _onPlatform(Event* event);
+        void _onSysEvent(Event* event);
 
 
 #ifndef __S3E__
 #ifndef __S3E__
         int _onSDLEvent(SDL_Event* event);
         int _onSDLEvent(SDL_Event* event);

+ 2 - 2
oxygine/src/core/ios/ios.h

@@ -12,6 +12,6 @@ namespace oxygine
     class MemoryTexture;
     class MemoryTexture;
 
 
     bool nsImageLoad(MemoryTexture& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format);
     bool nsImageLoad(MemoryTexture& mt, void* pData, int nDatalen, bool premultiplied, TextureFormat format);
-    
-    void iosGetMemoryUsage(size_t &a);
+
+    void iosGetMemoryUsage(size_t& a);
 }
 }

+ 0 - 8
oxygine/src/core/oxygine.cpp

@@ -589,14 +589,6 @@ namespace oxygine
             if (!stage)
             if (!stage)
                 stage = getStage();
                 stage = getStage();
 
 
-            //deprecated
-            {
-                Event ev(Input::event_platform);
-                ev.userData = &event;
-                Input::instance.dispatchEvent(&ev);
-            }
-
-
             Event ev(EVENT_SYSTEM);
             Event ev(EVENT_SYSTEM);
             ev.userData = &event;
             ev.userData = &event;
             _dispatcher->dispatchEvent(&ev);
             _dispatcher->dispatchEvent(&ev);