Browse Source

Merge branch 'dev' of github.com:oxygine/oxygine-framework into dev

dmuratshin 9 years ago
parent
commit
0b4aa1549c

+ 1 - 1
examples/Demo/src/TestAlphaHitTest.h

@@ -27,7 +27,7 @@ public:
 
 
         sprite->addEventListener(TouchEvent::OVER, CLOSURE(this, &TestAlphaHitTest::onEvent));
         sprite->addEventListener(TouchEvent::OVER, CLOSURE(this, &TestAlphaHitTest::onEvent));
         sprite->addEventListener(TouchEvent::OUT, CLOSURE(this, &TestAlphaHitTest::onEvent));
         sprite->addEventListener(TouchEvent::OUT, CLOSURE(this, &TestAlphaHitTest::onEvent));
-        sprite->setInputChildrenEnabled(false);
+        sprite->setTouchChildrenEnabled(false);
 
 
         txt = new TextField;
         txt = new TextField;
         txt->attachTo(content);
         txt->attachTo(content);

+ 2 - 2
examples/Demo/src/TestDrag.h

@@ -51,7 +51,7 @@ public:
         contacts = new Actor;
         contacts = new Actor;
         contacts->attachTo(content);
         contacts->attachTo(content);
         contacts->setPriority(10000);
         contacts->setPriority(10000);
-        contacts->setInputChildrenEnabled(false);
+        contacts->setTouchChildrenEnabled(false);
     }
     }
 
 
     void doUpdate(const UpdateState& us)
     void doUpdate(const UpdateState& us)
@@ -205,7 +205,7 @@ public:
             dragging->attachTo(ball->getParent());
             dragging->attachTo(ball->getParent());
             dragging->setColor(Color::Red);
             dragging->setColor(Color::Red);
             dragging->setAnchor(0, 0);
             dragging->setAnchor(0, 0);
-            dragging->setInputEnabled(false);
+            dragging->setTouchEnabled(false);
             drag.start(touchedBy, dragging.get(), dragging->getSize() / 2);
             drag.start(touchedBy, dragging.get(), dragging->getSize() / 2);
         }
         }
     }
     }

+ 2 - 2
examples/Demo/src/TestInputText.h

@@ -12,8 +12,8 @@ public:
     TextWithBackground(const string& defText)
     TextWithBackground(const string& defText)
     {
     {
         text = new TextField;
         text = new TextField;
-        //Don't handle input events on this Actor
-        text->setInputEnabled(false);
+        //Don't handle touch events on this Actor
+        text->setTouchEnabled(false);
 
 
         TextStyle style;
         TextStyle style;
         style.color = Color::Black;
         style.color = Color::Black;

+ 2 - 2
examples/Demo/src/TestPerf.h

@@ -28,8 +28,8 @@ public:
         toggle dr[] = {toggle("driver=null", 0, new VideoDriverNull), toggle("driver=default", 0, 0)};
         toggle dr[] = {toggle("driver=null", 0, new VideoDriverNull), toggle("driver=default", 0, 0)};
         addToggle("driver", dr, 2);
         addToggle("driver", dr, 2);
 
 
-        content->setInputEnabled(false);
-        content->setInputChildrenEnabled(false);
+        content->setTouchEnabled(false);
+        content->setTouchChildrenEnabled(false);
     }
     }
 
 
     void toggleClicked(string id, const toggle* data)
     void toggleClicked(string id, const toggle* data)

+ 1 - 1
examples/Demo/src/test.cpp

@@ -23,7 +23,7 @@ void Test::init()
     //Load logo from oxygine server
     //Load logo from oxygine server
     spWebImage sp = new WebImage;
     spWebImage sp = new WebImage;
     sp->load("http://oxygine.org/test/logo.png");
     sp->load("http://oxygine.org/test/logo.png");
-    sp->setInputEnabled(false);
+    sp->setTouchEnabled(false);
     sp->attachTo(getStage());
     sp->attachTo(getStage());
     sp->setPriority(10);
     sp->setPriority(10);
     sp->setAlpha(128);
     sp->setAlpha(128);

+ 1 - 1
examples/Match3/src/Board.cpp

@@ -36,7 +36,7 @@ void Board::init(int w, int h)
     _view->setSize(_size.x * JewelSize.x, _size.y * JewelSize.y);
     _view->setSize(_size.x * JewelSize.x, _size.y * JewelSize.y);
 
 
     _view->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &Board::touched));
     _view->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &Board::touched));
-    _view->setInputChildrenEnabled(false);
+    _view->setTouchChildrenEnabled(false);
 
 
     _view->setCallbackDoUpdate(CLOSURE(this, &Board::update));
     _view->setCallbackDoUpdate(CLOSURE(this, &Board::update));
 }
 }

+ 2 - 2
oxygine/src/Actor.cpp

@@ -1158,8 +1158,8 @@ namespace oxygine
         setAttrV2(node, "size", getSize(), Vector2(0, 0));
         setAttrV2(node, "size", getSize(), Vector2(0, 0));
         setAttr(node, "rotation", getRotation(), 0.0f);
         setAttr(node, "rotation", getRotation(), 0.0f);
         setAttr(node, "visible", getVisible(), true);
         setAttr(node, "visible", getVisible(), true);
-        setAttr(node, "input", getInputEnabled(), true);
-        setAttr(node, "inputch", getInputChildrenEnabled(), true);
+        setAttr(node, "input", getTouchEnabled(), true);
+        setAttr(node, "inputch", getTouchChildrenEnabled(), true);
         setAttr(node, "alpha", getAlpha(), (unsigned char)255);
         setAttr(node, "alpha", getAlpha(), (unsigned char)255);
         setAttrV2(node, "anchor", getAnchor(), Vector2(0, 0));
         setAttrV2(node, "anchor", getAnchor(), Vector2(0, 0));
 
 

+ 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);