Explorar el Código

Merge branch 'master' into dev

dmuratshin hace 10 años
padre
commit
8504ed2a97

+ 3 - 1
examples/Demo/src/TestDrag.h

@@ -97,7 +97,9 @@ public:
     {
         spSprite actor = safeSpCast<Sprite>(event->currentTarget);
 
-        actor->removeTween(actor->getTween("color"));
+        spTween t = actor->getTween("color", ep_ignore_error);
+        if (t)
+            actor->removeTween(t);
         actor->setColor(Color::White);
     }
 };

+ 5 - 2
oxygine/src/STDMaterial.cpp

@@ -64,8 +64,11 @@ namespace oxygine
                                    int(clippedRect.size.x + 0.01f),
                                    int(clippedRect.size.y + 0.01f));
 
-                Point vp_size = core::getDisplaySize();
-                gl_rect.pos.y = vp_size.y - gl_rect.getBottom();
+                if (!_renderer->getDriver()->getRenderTarget())
+                {
+                    Point vp_size = core::getDisplaySize();
+                    gl_rect.pos.y = vp_size.y - gl_rect.getBottom();
+                }
 
                 _renderer->getDriver()->setScissorRect(&gl_rect);
             }

+ 7 - 2
oxygine/src/core/VideoDriver.cpp

@@ -35,6 +35,11 @@ namespace oxygine
         return false;
     }
 
+    spNativeTexture VideoDriverNull::getRenderTarget() const
+    {
+        return _rt;
+    }
+
     const VertexDeclaration*    VideoDriverNull::getVertexDeclaration(bvertex_format bf) const
     {
         return IVideoDriver::instance->getVertexDeclaration(bf);
@@ -49,9 +54,9 @@ namespace oxygine
     {
 
     }
-    void VideoDriverNull::setRenderTarget(spNativeTexture)
+    void VideoDriverNull::setRenderTarget(spNativeTexture rt)
     {
-
+        _rt = rt;
     }
     void VideoDriverNull::setShaderProgram(ShaderProgram*)
     {

+ 8 - 3
oxygine/src/core/VideoDriver.h

@@ -71,9 +71,10 @@ namespace oxygine
         virtual void draw(PRIMITIVE_TYPE pt, const VertexDeclaration* decl, const void* verticesData, unsigned int verticesDataSize) = 0;
         virtual void draw(PRIMITIVE_TYPE pt, const VertexDeclaration* decl, const void* verticesData, unsigned int verticesDataSize, const void* indicesData, unsigned int numIndices, bool indicesShortType) = 0;
 
-        virtual void    getStats(Stats& s) const = 0;
-        virtual void    getViewport(Rect& r) const = 0;
-        virtual bool    getScissorRect(Rect&) const = 0;
+        virtual void            getStats(Stats& s) const = 0;
+        virtual void            getViewport(Rect& r) const = 0;
+        virtual bool            getScissorRect(Rect&) const = 0;
+        virtual spNativeTexture getRenderTarget() const = 0;
         virtual const VertexDeclaration* getVertexDeclaration(bvertex_format) const = 0;
 
         virtual void setScissorRect(const Rect*) = 0;
@@ -109,6 +110,8 @@ namespace oxygine
         void getStats(Stats& s) const;
         void getViewport(Rect& r) const;
         bool getScissorRect(Rect&) const;
+        spNativeTexture getRenderTarget() const;
+
         const VertexDeclaration*    getVertexDeclaration(bvertex_format) const;
 
         void draw(PRIMITIVE_TYPE pt, const VertexDeclaration* decl, const void* verticesData, unsigned int verticesDataSize) {}
@@ -135,6 +138,8 @@ namespace oxygine
 
         void reset() {}
         void restore() {}
+
+        spNativeTexture _rt;
     };
 
 }

+ 6 - 0
oxygine/src/core/gl/VideoDriverGL.cpp

@@ -101,6 +101,11 @@ namespace oxygine
         return scrTest ? true : false;
     }
 
+    spNativeTexture VideoDriverGL::getRenderTarget() const
+    {
+        return _rt;
+    }
+
     const VertexDeclarationGL* VideoDriverGL::getVertexDeclaration(bvertex_format fmt) const
     {
         return _vdeclarations.get(fmt);
@@ -130,6 +135,7 @@ namespace oxygine
 
     void VideoDriverGL::setRenderTarget(spNativeTexture rt)
     {
+        _rt = rt;
         if (!rt)
         {
             oxglBindFramebuffer(GL_FRAMEBUFFER, _prevFBO);

+ 2 - 0
oxygine/src/core/gl/VideoDriverGL.h

@@ -18,6 +18,7 @@ namespace oxygine
         void    getStats(Stats& s) const;
         void    getViewport(Rect& r) const;
         bool    getScissorRect(Rect&) const;
+        spNativeTexture getRenderTarget() const;
         const VertexDeclarationGL*  getVertexDeclaration(bvertex_format) const;
 
         void setScissorRect(const Rect*);
@@ -36,6 +37,7 @@ namespace oxygine
 
         void _begin(const Rect& viewport, const Color* clearColor);
         GLint _prevFBO;
+        spNativeTexture _rt;
 
         mutable VertexDeclarations<VertexDeclarationGL> _vdeclarations;
         bool _traceStats;

+ 1 - 1
oxygine/src/core/oxygine.cpp

@@ -860,7 +860,7 @@ namespace oxygine
         va_end(args);
     }
 
-    bool    isNetworkAvaible()
+    bool    isNetworkAvailable()
     {
 #if __S3E__
         return s3eSocketGetInt(S3E_SOCKET_NETWORK_AVAILABLE) == 1;

+ 1 - 1
oxygine/src/core/oxygine.h

@@ -28,7 +28,7 @@ namespace oxygine
     int64           getTimeUTCMS();
 
     /** is any network connection available?*/
-    bool            isNetworkAvaible();
+    bool            isNetworkAvailable();
 
     /**returns locale. ISO 639-1 */
     std::string     getLanguage();