Browse Source

- fixed cliprect
- tween anim default ResAnim

dmuratshin 9 years ago
parent
commit
9901668432
4 changed files with 12 additions and 3 deletions
  1. 3 1
      oxygine/src/STDMaterial.cpp
  2. 5 1
      oxygine/src/TweenAnim.cpp
  3. 1 1
      oxygine/src/TweenAnim.h
  4. 3 0
      tools/others/format.bat

+ 3 - 1
oxygine/src/STDMaterial.cpp

@@ -37,6 +37,8 @@ namespace oxygine
 
     void STDMaterial::render(ClipRectActor* actor, const RenderState& parentRS)
     {
+        //Material::render(actor, parentRS);
+        //return;
         Material::setCurrent(this);
 
         RenderState rs = parentRS;
@@ -64,7 +66,7 @@ namespace oxygine
                                    int(clippedRect.size.x + 0.01f),
                                    int(clippedRect.size.y + 0.01f));
 
-                if (!_renderer->getDriver()->getRenderTarget())
+                if (!_renderer->getDriver()->getRenderTarget()->getHandle())
                 {
                     Point vp_size = core::getDisplaySize();
                     gl_rect.pos.y = vp_size.y - gl_rect.getBottom();

+ 5 - 1
oxygine/src/TweenAnim.cpp

@@ -25,7 +25,11 @@ namespace oxygine
 
     void TweenAnim::init(Sprite& actor)
     {
-
+        if (!_resAnim)
+        {
+            _resAnim = actor.getResAnim();
+            _end = _resAnim->getColumns() - 1;
+        }
     }
 
 

+ 1 - 1
oxygine/src/TweenAnim.h

@@ -20,7 +20,7 @@ namespace oxygine
     public:
         typedef Sprite type;
 
-        /**Row/Column mode. Plays single row*/
+        /**Row/Column mode. Plays single row. if resanim == 0 will be used current*/
         TweenAnim(const ResAnim* resAnim, int row = 0);
 
         /**Frames mode. Play animation in interval [start, end]*/

+ 3 - 0
tools/others/format.bat

@@ -17,4 +17,7 @@ set astyle=d:\dropbox\tools\AStyle.exe
 %astyle% d:\oxygine-billing\examples\*.cpp d:\oxygine-billing\examples\*.h %options%
 %astyle% d:\oxygine-billing\src\*.cpp d:\oxygine-billing\src\*.h %options%
 
+%astyle% d:\oxygine-facebook\example\*.cpp d:\oxygine-facebook\example\*.h %options%
+%astyle% d:\oxygine-facebook\src\*.cpp d:\oxygine-facebook\src\*.h %options%
+
 %astyle% d:\oxygine-editor\editor\src\*.cpp d:\oxygine-editor\editor\src\*.h %options%