Merge pull request #1786 from cocos-creator/v1.5

merge V1.5
This commit is contained in:
Wang Nan
2017-07-07 09:55:47 +08:00
committed by GitHub
4 changed files with 23 additions and 6 deletions
+11 -2
View File
@@ -85,8 +85,17 @@ Audio.State = {
(function (proto) {
proto.preload = function () {
var src = this._src,
audio = this;
var src = this._src, audio = this;
if (!src) {
this._src = '';
this._audioType = Audio.Type.UNKNOWN;
this._element = null;
this._state = Audio.State.INITIALZING;
this._loaded = false;
return;
}
var item = cc.loader.getItem(src);
if (!item) {
+5 -1
View File
@@ -41,7 +41,11 @@ var AudioSource = cc.Class({
},
ctor: function () {
this.audio = new cc.Audio(this._clip);
this.audio = new cc.Audio();
},
onLoad: function () {
this.clip = this._clip;
},
properties: {
@@ -312,4 +312,8 @@ function Area(a, b, c) {
return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y);
}
module.exports = ConvexPartition;
module.exports = {
ConvexPartition: ConvexPartition,
ForceCounterClockWise: ForceCounterClockWise,
IsCounterClockWise: IsCounterClockWise
};
@@ -24,7 +24,7 @@
****************************************************************************/
var PTM_RATIO = require('../CCPhysicsTypes').PTM_RATIO;
var PolygonSeprator = require('../CCPolygonSeprator');
var PolygonSeparator = require('../CCPolygonSeparator');
/**
* @class PhysicsPolygonCollider
@@ -52,7 +52,7 @@ var PhysicsPolygonCollider = cc.Class({
points.length -= 1;
}
var polys = PolygonSeprator(points);
var polys = PolygonSeparator.ConvexPartition(points);
var offset = this.offset;
for (var i = 0; i < polys.length; i++) {