Browse Source

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

dmuratshin 9 years ago
parent
commit
bb901d3d44

+ 6 - 12
oxygine/src/Box9Sprite.cpp

@@ -97,28 +97,22 @@ namespace oxygine
             float scaleFactor = resanim->getScaleFactor();
 
             pugi::xml_attribute attr = resanim->getAttribute("guideX1");
-            if (!attr.empty())
-                _guideX[0] = attr.as_float() * scaleFactor;
+            _guideX[0] = attr.as_float(0) * scaleFactor;
 
             attr = resanim->getAttribute("guideX2");
-            if (!attr.empty())
-                _guideX[1] = attr.as_float() * scaleFactor;
+            _guideX[1] = attr.as_float(0) * scaleFactor;
 
             attr = resanim->getAttribute("guideY1");
-            if (!attr.empty())
-                _guideY[0] = attr.as_float() * scaleFactor;
+            _guideY[0] = attr.as_float(0) * scaleFactor;
 
             attr = resanim->getAttribute("guideY2");
-            if (!attr.empty())
-                _guideY[1] = attr.as_float() * scaleFactor;
+            _guideY[1] = attr.as_float(0) * scaleFactor;
 
             attr = resanim->getAttribute("vertical");
-            if (!attr.empty())
-                _vertMode = (StretchMode)attr.as_uint();
+            _vertMode = (StretchMode)attr.as_uint(STRETCHING);
 
             attr = resanim->getAttribute("horizontal");
-            if (!attr.empty())
-                _horzMode = (StretchMode)attr.as_uint();
+            _horzMode = (StretchMode)attr.as_uint(STRETCHING);
         }
         _Sprite::animFrameChanged(f);
     }

+ 5 - 4
oxygine/src/PostProcess.cpp

@@ -56,8 +56,8 @@ namespace oxygine
 
         file::buffer vs_blit;
         file::buffer fs_blit;
-        file::read("pp_blit_vs.glsl", vs_blit);
-        file::read("pp_blit_fs.glsl", fs_blit);
+        zp.read("system/pp_blit_vs.glsl", vs_blit);
+        zp.read("system/pp_blit_fs.glsl", fs_blit);
 
         vs_blit.push_back(0);
         fs_blit.push_back(0);
@@ -398,7 +398,7 @@ namespace oxygine
 
     TweenPostProcess::~TweenPostProcess()
     {
-        if (_actor)
+        if (_actor && _actor->getMaterial())
             _actor->setMaterial(_prevMaterial);
     }
 
@@ -432,7 +432,8 @@ namespace oxygine
 
     void TweenPostProcess::done(Actor& actor)
     {
-        _actor->setMaterial(_prevMaterial);
+        if (_actor->getMaterial())
+            _actor->setMaterial(_prevMaterial);
     }
 
 }

+ 3 - 0
oxygine/src/Sprite.cpp

@@ -78,6 +78,9 @@ namespace oxygine
         if (!Actor::isOn(localPosition))
             return false;
 
+        if (_extendedIsOn)
+            return true;
+
         const HitTestData& ad = _frame.getHitTestData();
         if (!ad.data)
             return true;

+ 2 - 1
oxygine/src/TweenOutline.cpp

@@ -95,7 +95,8 @@ namespace oxygine
             pass(rt, rc, rt2, rc);
 
 
-            int alpha = lerp(255, 0, _progress);
+            int alpha = lerp(0, 255, _progress);
+            //log::messageln("tween alpha %d", alpha);
 
             Color c = _color.withAlpha(alpha).premultiplied();
 

+ 1 - 1
oxygine/src/res/ResAtlas.cpp

@@ -46,7 +46,7 @@ namespace oxygine
     {
         if (_hook)
         {
-            _hook(file, nt, load_context);
+            _hook(file, nt, linearFilter, clamp2edge, load_context);
             return;
         }
 

+ 4 - 1
oxygine/src/res/ResAtlas.h

@@ -55,6 +55,9 @@ namespace oxygine
         atlasses _atlasses;
     };
 
-    typedef void(*load_texture_hook)(const std::string& file, spNativeTexture nt, LoadResourcesContext* load_context);
+    typedef void(*load_texture_hook)(const std::string& file, spNativeTexture nt, bool linearFilter, bool clamp2edge, LoadResourcesContext* load_context);
     void set_load_texture_hook(load_texture_hook);
+
+    class LoadResourcesContext;
+    void load_texture_internal(const std::string& file, spNativeTexture nt, bool linearFilter, bool clamp2edge, LoadResourcesContext* load_context);
 }