Skip to content

Commit

Permalink
1.5.4 Release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Weng Xiang authored and Weng Xiang committed Dec 9, 2016
1 parent b04913e commit 7bef2cf
Show file tree
Hide file tree
Showing 282 changed files with 12,426 additions and 9,784 deletions.
Binary file modified bin/as/LayaAirFlash/LayaAirFlash.swc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
attribute vec2 position;
attribute vec2 texcoord;
attribute vec4 color;
uniform vec2 size;
uniform mat4 mul_mmat;
varying vec2 v_texcoord;
varying vec4 v_color;
void main() {
vec4 pos=mul_mmat*vec4(position.x,position.y,0,1 );
gl_Position = vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0);
v_color = color;
v_texcoord = texcoord;
attribute vec2 position;
attribute vec2 texcoord;
attribute vec4 color;
uniform vec2 size;
uniform mat4 mul_mmat;
varying vec2 v_texcoord;
varying vec4 v_color;
void main() {
vec4 pos=mul_mmat*vec4(position.x,position.y,0,1 );
gl_Position = vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,pos.z,1.0);
v_color = color;
v_texcoord = texcoord;
}
8 changes: 4 additions & 4 deletions bin/as/LayaAirFlash/flash/src/laya/flash/FlashIncludeStr.as
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public static var GlowFilter_ps_logic:Class;
public static var GlowFilter_ps_uniform:Class;


[Embed(source = "../../files/fillTexture/fillTextureShader.ps", mimeType = "application/octet-stream")]
[Embed(source = "../../files/fillTextureShader.ps", mimeType = "application/octet-stream")]
public static var FillTextureShader_ps:Class;
[Embed(source = "../../files/fillTexture/fillTextureShader.vs", mimeType = "application/octet-stream")]
[Embed(source = "../../files/fillTextureShader.vs", mimeType = "application/octet-stream")]
public static var FillTextureShader_vs:Class;

[Embed(source = "../../files/skinAnishader/skinShader.ps", mimeType = "application/octet-stream")]
Expand Down Expand Up @@ -79,8 +79,8 @@ public static var SkinAniShader_vs:Class;
add("files/parts/ColorFilter_ps_uniform.glsl", ColorFilter_ps_uniform);
add("files/parts/GlowFilter_ps_logic.glsl", GlowFilter_ps_logic);
add("files/parts/GlowFilter_ps_uniform.glsl", GlowFilter_ps_uniform);
add("fillTexture/fillTextureShader.ps", FillTextureShader_ps);
add("fillTexture/fillTextureShader.vs", FillTextureShader_vs);
add("files/fillTextureShader.ps", FillTextureShader_ps);
add("files/fillTextureShader.vs", FillTextureShader_vs);
add("skinAnishader/skinShader.ps", SkinAniShader_ps);
add("skinAnishader/skinShader.vs", SkinAniShader_vs);
}
Expand Down
13 changes: 10 additions & 3 deletions bin/as/libs/src/Config.as
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ package {
* Config 用于配置一些全局参数。
*/
public class Config {

/**
* WebGL模式下文本缓存最大数量。
*/
public static var WebGLTextCacheCount:int = 500;
public static var WebGLTextCacheCount:int = 500;

/**
* 表示是否使用了大图合集功能。
Expand All @@ -34,6 +34,13 @@ package {
* 设置是否抗锯齿,只对2D(WebGL)、3D有效。
*/
public static var isAntialias:Boolean = false;

/**
* 设置画布是否透明,只对2D(WebGL)、3D有效。
*/
public static var isAlpha:Boolean = false;
/**
* 设置画布是否预乘,只对2D(WebGL)、3D有效。
*/
public static var premultipliedAlpha:Boolean = false;
}
}
2 changes: 1 addition & 1 deletion bin/as/libs/src/Laya.as
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ package {
/** Render 类的引用。*/
public static var render:Render;
/** 引擎版本。*/
public static var version:String = "1.5.4Beta";
public static var version:String = "1.5.5Beta";
public static var stageBox:Sprite;
/**Market对象 只有加速器模式下才有值*/
public static var conchMarket:IMarket = __JS__("window.conch?conchMarket:null");
Expand Down
700 changes: 495 additions & 205 deletions bin/as/libs/src/Laya3D.as

Large diffs are not rendered by default.

49 changes: 38 additions & 11 deletions bin/as/libs/src/laya/ani/AnimationPlayer.as
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
package laya.ani {
import laya.events.Event;
import laya.events.EventDispatcher;
import laya.resource.IDestroy;
import laya.utils.Stat;

/**开始播放时调度。
* @eventType Event.PLAYED
* */
[Event(name = "played", type = "laya.events.Event")]
/**暂停时调度。
* @eventType Event.PAUSED
* */
[Event(name = "paused", type = "laya.events.Event")]
/**完成一次循环时调度。
* @eventType Event.COMPLETE
* */
[Event(name = "complete", type = "laya.events.Event")]
/**停止时调度。
* @eventType Event.STOPPED
* */
[Event(name = "stopped", type = "laya.events.Event")]

/**
* <code>AnimationPlayer</code> 类用于动画播放器。
*/
public class AnimationPlayer extends EventDispatcher {
public class AnimationPlayer extends EventDispatcher implements IDestroy {
/** 数据模板*/
private var _templet:AnimationTemplet;
/** 当前精确时间,不包括重播时间*/
Expand Down Expand Up @@ -195,7 +213,7 @@ package laya.ani {

if (value < _playStart || value > _playEnd)
throw new Error("AnimationPlayer:value must large than playStartTime,small than playEndTime.");

_startUpdateLoopCount = Stat.loopCount;
var cacheFrameInterval:Number = _cacheFrameRateInterval * _cachePlayRate;
_currentTime = value /*% playDuration*/;
Expand Down Expand Up @@ -267,7 +285,7 @@ package laya.ani {
var anifullFrames:Array = _fullFrames = [];
var templet:AnimationTemplet = _templet;

var cacheFrameInterval:Number = _cacheFrameRateInterval*_cachePlayRate;
var cacheFrameInterval:Number = _cacheFrameRateInterval * _cachePlayRate;

for (var i:int = 0, iNum:int = templet.getAnimationCount(); i < iNum; i++) {
var aniFullFrame:Array = [];
Expand Down Expand Up @@ -297,28 +315,36 @@ package laya.ani {

aniFullFrame.push(nodeFullFrames);
}

anifullFrames.push(aniFullFrame);
}
event(Event.CACHEFRAMEINDEX_CHANGED, this);
//event(Event.CACHEFRAMEINDEX_CHANGED, this);
}

/**
* @private
*/
private function _calculatePlayDuration():void {
if (state !== AnimationState.stopped) {//防止动画已停止,异步回调导致BUG
var oriDuration:Number = _templet.getAniDuration(_currentAnimationClipIndex);
var oriDuration:int = _templet.getAniDuration(_currentAnimationClipIndex);
(_playEnd === 0) && (_playEnd = oriDuration);

if (Math.floor(_playEnd) > oriDuration)//以毫秒为最小时间单位,取整。
//throw new Error("AnimationPlayer:playEnd must less than original Duration.");
if (_playEnd> oriDuration)//以毫秒为最小时间单位,取整。FillTextureSprite
_playEnd = oriDuration;

_playDuration = _playEnd - _playStart;
}
}

/**
* @private
*/
public function _destroy():void {
offAll();
_templet = null;
_fullFrames = null;
}

/**
* 播放动画。
* @param index 动画索引。
Expand All @@ -327,7 +353,7 @@ package laya.ani {
* @param playStart 播放的起始时间位置。
* @param playEnd 播放的结束时间位置。(0为动画一次循环的最长结束时间位置)。
*/
public function play(index:int = 0, playbackRate:Number = 1.0, overallDuration:int = /*int.MAX_VALUE*/2147483647, playStart:int = 0, playEnd:int = 0):void {
public function play(index:int = 0, playbackRate:Number = 1.0, overallDuration:int = /*int.MAX_VALUE*/ 2147483647, playStart:Number = 0, playEnd:Number = 0):void {
if (!_templet)
throw new Error("AnimationPlayer:templet must not be null,maybe you need to set url.");

Expand All @@ -336,7 +362,7 @@ package laya.ani {

if ((playEnd !== 0) && (playStart > playEnd))
throw new Error("AnimationPlayer:start must less than end.");
_currentTime = 0;
_currentFrameTime = 0;
_elapsedPlaybackTime = 0;
Expand Down Expand Up @@ -366,7 +392,7 @@ package laya.ani {
* @param playStartFrame 播放的原始起始帧率位置。
* @param playEndFrame 播放的原始结束帧率位置。(0为动画一次循环的最长结束时间位置)。
*/
public function playByFrame(index:int = 0, playbackRate:Number = 1.0, overallDuration:Number = /*Number.MAX_SAFE_INTEGER*/9007199254740991, playStartFrame:int = 0, playEndFrame:int = 0, fpsIn3DBuilder:int = 30):void {
public function playByFrame(index:int = 0, playbackRate:Number = 1.0, overallDuration:Number = /*int.MAX_VALUE*/ 2147483647, playStartFrame:Number = 0, playEndFrame:Number = 0, fpsIn3DBuilder:int = 30):void {
var interval:Number = 1000.0 / fpsIn3DBuilder;
play(index, playbackRate, overallDuration, playStartFrame * interval, playEndFrame * interval);
}
Expand Down Expand Up @@ -425,5 +451,6 @@ package laya.ani {
this.event(Event.COMPLETE);
}
}

}
}
Loading

0 comments on commit 7bef2cf

Please sign in to comment.