mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Update version and fix small issues (#2809)
* Update version and fix small issues * Fix issues reported by gcc
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
* @property {String} ENGINE_VERSION
|
||||
*/
|
||||
var engineVersion;
|
||||
engineVersion = '2.0.0 preview';
|
||||
engineVersion = '2.0.0 preview3';
|
||||
window['CocosEngine'] = cc.ENGINE_VERSION = engineVersion;
|
||||
|
||||
require('./cocos2d/core/utils');
|
||||
|
||||
@@ -46,7 +46,7 @@ var AnimationManager = cc.Class({
|
||||
}
|
||||
|
||||
var events = this._delayEvents;
|
||||
for (i = 0, l = events.length; i < l; i++) {
|
||||
for (let i = 0, l = events.length; i < l; i++) {
|
||||
var event = events[i];
|
||||
event.target[event.func].apply(event.target, event.args);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ let PrivateNode = cc.Class({
|
||||
this.setLocalDirty(LocalDirtyFlag.POSITION);
|
||||
this._renderFlag |= RenderFlow.FLAG_LOCAL_TRANSFORM;
|
||||
if (sendEvent === true && (this._eventMask & POSITION_ON)) {
|
||||
this.emit(EventType.POSITION_CHANGED);
|
||||
this.emit(Node.EventType.POSITION_CHANGED);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -47,11 +47,8 @@ function getReadonlyNodeSize (parent) {
|
||||
if (parent instanceof cc.Scene) {
|
||||
return CC_EDITOR ? cc.engine.getDesignResolutionSize() : cc.visibleRect;
|
||||
}
|
||||
else if (!parent._sizeProvider || (parent._sizeProvider instanceof _ccsg.Node)) {
|
||||
return parent._contentSize;
|
||||
}
|
||||
else {
|
||||
return parent.getContentSize();
|
||||
return parent._contentSize;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,14 +98,14 @@ cc.Component.EventHandler = cc.Class({
|
||||
*/
|
||||
emitEvents: function(events) {
|
||||
'use strict';
|
||||
var args, i, l;
|
||||
let args;
|
||||
if (arguments.length > 0) {
|
||||
args = new Array(arguments.length - 1);
|
||||
for (i = 0, l = args.length; i < l; i++) {
|
||||
for (let i = 0, l = args.length; i < l; i++) {
|
||||
args[i] = arguments[i+1];
|
||||
}
|
||||
}
|
||||
for (i = 0, l = events.length; i < l; i++) {
|
||||
for (let i = 0, l = events.length; i < l; i++) {
|
||||
var event = events[i];
|
||||
if (!(event instanceof cc.Component.EventHandler)) continue;
|
||||
|
||||
|
||||
@@ -145,7 +145,6 @@ let Mask = cc.Class({
|
||||
this._spriteFrame = value;
|
||||
this._applySpriteFrame(lastSprite);
|
||||
},
|
||||
type: cc.SpriteFrame,
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -649,7 +649,7 @@ let ScrollView = cc.Class({
|
||||
*/
|
||||
scrollTo (anchor, timeInSecond, attenuated) {
|
||||
let moveDelta = this._calculateMovePercentDelta({
|
||||
anchor: anchor,
|
||||
anchor: cc.v2(anchor),
|
||||
applyToHorizontal: true,
|
||||
applyToVertical: true,
|
||||
});
|
||||
|
||||
@@ -767,8 +767,9 @@ proto.release = function (asset) {
|
||||
var removed = this.removeItem(id);
|
||||
asset = item.content;
|
||||
if (cc.Class.isInstanceOf(asset, cc.Asset)) {
|
||||
if (asset.nativeUrl) {
|
||||
this.release(asset.nativeUrl); // uncache loading item of native asset
|
||||
let nativeUrl = asset.nativeUrl;
|
||||
if (nativeUrl) {
|
||||
this.release(nativeUrl); // uncache loading item of native asset
|
||||
}
|
||||
asset.destroy();
|
||||
}
|
||||
|
||||
@@ -863,11 +863,12 @@ View.prototype = {
|
||||
* @param {Number} h
|
||||
*/
|
||||
setScissorInPoints: function (x, y, w, h) {
|
||||
var scaleX = this._scaleX, scaleY = this._scaleY;
|
||||
var sx = Math.ceil(x * scaleX + this._viewportRect.x);
|
||||
var sy = Math.ceil(y * scaleY + this._viewportRect.y);
|
||||
var sw = Math.ceil(w * scaleX);
|
||||
var sh = Math.ceil(h * scaleY);
|
||||
let scaleX = this._scaleX, scaleY = this._scaleY;
|
||||
let sx = Math.ceil(x * scaleX + this._viewportRect.x);
|
||||
let sy = Math.ceil(y * scaleY + this._viewportRect.y);
|
||||
let sw = Math.ceil(w * scaleX);
|
||||
let sh = Math.ceil(h * scaleY);
|
||||
let gl = cc.game._renderContext;
|
||||
|
||||
if (!_scissorRect) {
|
||||
var boxArr = gl.getParameter(gl.SCISSOR_BOX);
|
||||
@@ -879,7 +880,7 @@ View.prototype = {
|
||||
_scissorRect.y = sy;
|
||||
_scissorRect.width = sw;
|
||||
_scissorRect.height = sh;
|
||||
cc.game._renderContext.scissor(sx, sy, sw, sh);
|
||||
gl.scissor(sx, sy, sw, sh);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
let SpriteType = require('../../../../components/CCSprite').Type;
|
||||
const Sprite = require('../../../../components/CCSprite');
|
||||
const SpriteType = Sprite.Type;
|
||||
const FillType = Sprite.FillType;
|
||||
let simple = require('./simple');
|
||||
let sliced = require('./sliced');
|
||||
let tiled = require('./tiled');
|
||||
|
||||
@@ -14327,7 +14327,7 @@ var StencilMaterial = (function (Material$$1) {
|
||||
};
|
||||
|
||||
prototypeAccessors.useTexture.get = function () {
|
||||
this._effect.getDefine('useTexture', val);
|
||||
this._effect.getDefine('useTexture');
|
||||
};
|
||||
|
||||
prototypeAccessors.useTexture.set = function (val) {
|
||||
|
||||
@@ -1974,7 +1974,7 @@ var StencilMaterial = (function (Material$$1) {
|
||||
};
|
||||
|
||||
prototypeAccessors.useTexture.get = function () {
|
||||
this._effect.getDefine('useTexture', val);
|
||||
this._effect.getDefine('useTexture');
|
||||
};
|
||||
|
||||
prototypeAccessors.useTexture.set = function (val) {
|
||||
|
||||
@@ -109,7 +109,7 @@ const dynamicAtlasManager = require('../../../utils/dynamic-atlas/manager');
|
||||
rectWidth = frame._rect.width,
|
||||
rectHeight = frame._rect.height,
|
||||
offsetX = frame._offset.x,
|
||||
offsetY = frame._offset.y;
|
||||
offsetY = frame._offset.y,
|
||||
trimX = offsetX + (originalWidth - rectWidth) / 2,
|
||||
trimY = offsetY + (originalHeight - rectHeight) / 2;
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
var ValueType = require('./value-type');
|
||||
var js = require('../platform/js');
|
||||
var CCClass = require('../platform/CCClass');
|
||||
var misc = require('../utils/misc');
|
||||
const ValueType = require('./value-type');
|
||||
const js = require('../platform/js');
|
||||
const CCClass = require('../platform/CCClass');
|
||||
const misc = require('../utils/misc');
|
||||
|
||||
/**
|
||||
* !#en Representation of 2D vectors and points.
|
||||
|
||||
@@ -24,10 +24,11 @@
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
var ValueType = require('./value-type');
|
||||
var js = require('../platform/js');
|
||||
var CCClass = require('../platform/CCClass');
|
||||
var math = require('../renderer/render-engine').math;
|
||||
const ValueType = require('./value-type');
|
||||
const js = require('../platform/js');
|
||||
const CCClass = require('../platform/CCClass');
|
||||
const math = require('../renderer/render-engine').math;
|
||||
const misc = require('../utils/misc');
|
||||
|
||||
/**
|
||||
* !#en Representation of 3D vectors and points.
|
||||
|
||||
Reference in New Issue
Block a user