فهرست منبع

minor fixes
new animation

dmuratshin 10 سال پیش
والد
کامیت
3e722099dd

BIN
examples/Demo/data/images/anim1.png


+ 1 - 1
examples/Demo/data/xmls/res.xml

@@ -13,7 +13,7 @@
 		
 		
 		<image file="flower.png"/>
 		<image file="flower.png"/>
 		
 		
-		<image id="anim" file="anim1.png" cols = "7" /> <!-- 'id' is optional -->
+		<image id="anim" file="anim1.png" cols = "8" /> <!-- 'id' is optional -->
 		<image file="batterfly.png"/>
 		<image file="batterfly.png"/>
 		<image file="bg.png" data-custom = "custom user data per xml resource defined in xml"/>
 		<image file="bg.png" data-custom = "custom user data per xml resource defined in xml"/>
 		<image file="grad.png"/>
 		<image file="grad.png"/>

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

@@ -17,7 +17,7 @@ void* myThreadFunc(void* t)
 #ifndef __S3E__
 #ifndef __S3E__
 
 
     //sync with game thread and show notification
     //sync with game thread and show notification
-    core::getMainThreadMessages().postCallback([ = ]()
+    core::getMainThreadDispatcher().postCallback([ = ]()
     {
     {
         test->notify("loaded");
         test->notify("loaded");
     });
     });

+ 1 - 3
examples/DemoBox2D/src/Box2DDebugDraw.cpp

@@ -26,14 +26,12 @@ Box2DDraw::Box2DDraw(): _worldScale(1.0f), _world(0)
 									  } \
 									  } \
 									  ";
 									  ";
 
 
-    _program = new ShaderProgramGL();
-
 
 
     int vs = ShaderProgramGL::createShader(GL_VERTEX_SHADER, vertexShaderData, 0, 0);
     int vs = ShaderProgramGL::createShader(GL_VERTEX_SHADER, vertexShaderData, 0, 0);
     int fs = ShaderProgramGL::createShader(GL_FRAGMENT_SHADER, fragmentShaderData, 0, 0);
     int fs = ShaderProgramGL::createShader(GL_FRAGMENT_SHADER, fragmentShaderData, 0, 0);
 
 
     int pr = ShaderProgramGL::createProgram(vs, fs, (VertexDeclarationGL*)IVideoDriver::instance->getVertexDeclaration(VERTEX_POSITION));
     int pr = ShaderProgramGL::createProgram(vs, fs, (VertexDeclarationGL*)IVideoDriver::instance->getVertexDeclaration(VERTEX_POSITION));
-    _program->init(pr);
+    _program = new ShaderProgramGL(pr);
 }
 }
 
 
 Box2DDraw::~Box2DDraw()
 Box2DDraw::~Box2DDraw()

BIN
examples/HelloWorld/data/images/anim.png


+ 1 - 1
examples/HelloWorld/data/res.xml

@@ -2,7 +2,7 @@
 <resources>
 <resources>
 	<set path = "images" />
 	<set path = "images" />
 	<atlas>
 	<atlas>
-		<image file="anim.png" cols = "7" />
+		<image file="anim.png" cols = "8" />
 		<image file="button.png"/>		
 		<image file="button.png"/>		
 	</atlas>
 	</atlas>
 	
 	

+ 3 - 3
examples/HelloWorld/src/example.cpp

@@ -90,10 +90,10 @@ public:
         spSprite sprite = new Sprite();
         spSprite sprite = new Sprite();
         addChild(sprite);
         addChild(sprite);
 
 
-        int duration = 500;//500 ms
+        int duration = 600;//ms
         int loops = -1;//infinity loops
         int loops = -1;//infinity loops
 
 
-        //animation has 7 columns, check 'res.xml'
+        //animation has 8 columns - frames, check 'res.xml'
         ResAnim* animation = gameResources.getResAnim("anim");
         ResAnim* animation = gameResources.getResAnim("anim");
 
 
         //add animation tween to sprite
         //add animation tween to sprite
@@ -110,7 +110,7 @@ public:
         spTweenQueue tweenQueue = new TweenQueue();
         spTweenQueue tweenQueue = new TweenQueue();
         tweenQueue->setDelay(1500);
         tweenQueue->setDelay(1500);
         //first, move sprite to dest position
         //first, move sprite to dest position
-        tweenQueue->add(Sprite::TweenPosition(destPos), 1500, 1);
+        tweenQueue->add(Sprite::TweenPosition(destPos), 2500, 1);
         //then fade it out smoothly
         //then fade it out smoothly
         tweenQueue->add(Sprite::TweenAlpha(0), 500, 1);
         tweenQueue->add(Sprite::TweenAlpha(0), 500, 1);
 
 

+ 1 - 1
oxygine/src/PostProcess.cpp

@@ -288,7 +288,7 @@ namespace oxygine
         vertexPCT2 v[4];
         vertexPCT2 v[4];
 
 
 
 
-        RectF dst = srcRect.cast<RectF>() / Vector2(srcTexture->getWidth(), srcTexture->getHeight());
+        RectF dst = srcRect.cast<RectF>() / Vector2((float)srcTexture->getWidth(), (float)srcTexture->getHeight());
         fillQuadT(v,
         fillQuadT(v,
                   dst,
                   dst,
                   RectF(-1, -1, 2, 2),
                   RectF(-1, -1, 2, 2),