Skip to content

Commit 20e4bb6

Browse files
committed
Merge branch 'develop' of git://github.com/cocos2d/cocos2d-html5 into develop
Conflicts: cocos2d/core/platform/CCConfig.js tools/build.xml
2 parents 585c962 + f1594e6 commit 20e4bb6

File tree

14 files changed

+116
-91
lines changed

14 files changed

+116
-91
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ node_modules
77
/tools/jsdoc_toolkit-2.4.0
88
/package
99
/tools/jsdoc_toolkit/jsdoc_toolkit-2.4.0
10+
/.project

AUTHORS.txt

+11-1
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,14 @@ Asano @LaercioAsano cc.Node bug fix
169169

170170
Bruno Assarisse @bassarisse cc.LabelBMFont bug fix
171171

172-
Mykyta Usikov @musikov cc.ClippingNode bug fix
172+
Mykyta Usikov @musikov cc.ClippingNode bugs fix
173173
cc.fontLoader bug fix
174174
Inverted ClippingNode with DrawNode as stencil bug fix under canvas render mode
175175
JumpTo bug with wrong _delta position bug fix
176176
cc.ProgressTimer bugs fix
177177
cc.Scale9Sprite bugs fix
178178
cc.RenderTexture bug fix
179+
cc.ParticleSystem bug fix
179180

180181
Han XiaoLong @kpkhxlgy0 cc.ParticleSytem bug fix
181182

@@ -234,6 +235,15 @@ Joe Lafiosca @lafiosca Added Javascript file loader
234235

235236
galapagosit @galapagosit ccs.actionManager bug fix
236237

238+
Dany Ellement @DEllement cc.FontDefinition & ccui.RichText improvements
239+
cc.LayerGradient improvements
240+
241+
IShm @IShm cc.Screen bug fix
242+
cc.ParticleSystem bug fix
243+
244+
Thomas Jablonski @thomas-jablonski cc.audioEngine bug fix
245+
246+
WingGao @WingGao cc.TMXLayer bug fix
237247

238248
Retired Core Developers:
239249
Shengxiang Chen (Nero Chan)

CCBoot.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1598,10 +1598,13 @@ cc._initSys = function (config, CONFIG_KEY) {
15981598
var renderType = cc._RENDER_TYPE_WEBGL;
15991599
var tempCanvas = cc.newElement("Canvas");
16001600
cc._supportRender = true;
1601-
var notSupportGL = !window.WebGLRenderingContext || browserSupportWebGL.indexOf(sys.browserType) == -1 || osSupportWebGL.indexOf(sys.os) == -1;
1602-
if (userRenderMode === 1 || (userRenderMode === 0 && notSupportGL) || (location.origin == "file://")) {
1601+
var notSupportGL = true;
1602+
if(iOS)
1603+
notSupportGL = !window.WebGLRenderingContext || osSupportWebGL.indexOf(sys.os) == -1;
1604+
else
1605+
notSupportGL = !window.WebGLRenderingContext || browserSupportWebGL.indexOf(sys.browserType) == -1 || osSupportWebGL.indexOf(sys.os) == -1;
1606+
if (userRenderMode === 1 || (userRenderMode === 0 && notSupportGL) || (location.origin == "file://"))
16031607
renderType = cc._RENDER_TYPE_CANVAS;
1604-
}
16051608

16061609
sys._canUseCanvasNewBlendModes = function(){
16071610
var canvas = document.createElement('canvas');

cocos2d/core/base-nodes/CCNode.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
11551155
*/
11561156
setScheduler: function (scheduler) {
11571157
if (this._scheduler != scheduler) {
1158-
this.unscheduleAll();
1158+
this.unscheduleAllCallbacks();
11591159
this._scheduler = scheduler;
11601160
}
11611161
},

cocos2d/core/platform/CCConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @type {String}
3232
* @name cc.ENGINE_VERSION
3333
*/
34-
window["CocosEngine"] = cc.ENGINE_VERSION = "Cocos2d-JS v3.4 beta";
34+
window["CocosEngine"] = cc.ENGINE_VERSION = "Cocos2d-JS v3.4 Beta0";
3535

3636
/**
3737
* <p>

cocos2d/core/platform/CCEGLView.js

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ switch(cc.__BrowserGetter.adaptationType){
7575
cc.__BrowserGetter.__defineGetter__("target-densitydpi", function(){
7676
return cc.view._targetDensityDPI;
7777
});
78+
case cc.sys.BROWSER_TYPE_SOUGOU:
7879
case cc.sys.BROWSER_TYPE_UC:
7980
cc.__BrowserGetter.availWidth = function(frame){
8081
return frame.clientWidth;

extensions/cocostudio/loader/parsers/timelineParser-2.x.js

+75-78
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
// WIDGET //
209209
////////////
210210

211-
parser.widgetAttributes = function(widget, json){
211+
parser.widgetAttributes = function(widget, json) {
212212
widget.setCascadeColorEnabled(true);
213213
widget.setCascadeOpacityEnabled(true);
214214

@@ -218,33 +218,33 @@
218218
setContentSize(widget, json["Size"]);
219219

220220
var name = json["Name"];
221-
if(name)
221+
if (name)
222222
widget.setName(name);
223223

224224
var actionTag = json["ActionTag"] || 0;
225225
widget.setActionTag(actionTag);
226226
widget.setUserObject(new ccs.ActionTimelineData(actionTag));
227227

228228
var rotationSkewX = json["RotationSkewX"];
229-
if(rotationSkewX)
229+
if (rotationSkewX)
230230
widget.setRotationX(rotationSkewX);
231231

232232
var rotationSkewY = json["RotationSkewY"];
233-
if(rotationSkewY)
233+
if (rotationSkewY)
234234
widget.setRotationY(rotationSkewY);
235235

236236
//var rotation = json["Rotation"];
237237

238238
var flipX = json["FlipX"];
239-
if(flipX)
239+
if (flipX)
240240
widget.setFlippedX(true);
241241

242242
var flipY = json["FlipY"];
243-
if(flipY)
243+
if (flipY)
244244
widget.setFlippedY(true);
245245

246246
var zOrder = json["zOrder"];
247-
if(zOrder != null)
247+
if (zOrder != null)
248248
widget.setLocalZOrder(zOrder);
249249

250250
//var visible = json["Visible"];
@@ -253,7 +253,7 @@
253253
widget.setVisible(visible);
254254

255255
var alpha = json["Alpha"];
256-
if(alpha != null)
256+
if (alpha != null)
257257
widget.setOpacity(alpha);
258258

259259
widget.setTag(json["Tag"] || 0);
@@ -264,100 +264,97 @@
264264
// -- var frameEvent = json["FrameEvent"];
265265

266266
var callBackType = json["CallBackType"];
267-
if(callBackType != null)
267+
if (callBackType != null)
268268
widget.setCallbackType(callBackType);
269269

270270
var callBackName = json["CallBackName"];
271-
if(callBackName)
271+
if (callBackName)
272272
widget.setCallbackName(callBackName);
273273

274274
var position = json["Position"];
275-
if(position != null)
275+
if (position != null)
276276
widget.setPosition(position["X"] || 0, position["Y"] || 0);
277277

278278
var scale = json["Scale"];
279-
if(scale != null){
279+
if (scale != null) {
280280
var scaleX = getParam(scale["ScaleX"], 1);
281281
var scaleY = getParam(scale["ScaleY"], 1);
282282
widget.setScaleX(scaleX);
283283
widget.setScaleY(scaleY);
284284
}
285285

286286
var anchorPoint = json["AnchorPoint"];
287-
if(anchorPoint != null)
287+
if (anchorPoint != null)
288288
widget.setAnchorPoint(anchorPoint["ScaleX"] || 0, anchorPoint["ScaleY"] || 0);
289289

290290
var color = json["CColor"];
291-
if(color != null)
291+
if (color != null)
292292
widget.setColor(getColor(color));
293293

294-
if(widget instanceof ccui.Layout){
295-
var layoutComponent = ccui.LayoutComponent.bindLayoutComponent(widget);
296-
297-
var positionXPercentEnabled = json["PositionPercentXEnable"] || false;
298-
var positionYPercentEnabled = json["PositionPercentYEnable"] || false;
299-
var positionXPercent = 0,
300-
positionYPercent = 0,
301-
PrePosition = json["PrePosition"];
302-
if(PrePosition != null){
303-
positionXPercent = PrePosition["X"] || 0;
304-
positionYPercent = PrePosition["Y"] || 0;
305-
}
306-
var sizeXPercentEnable = json["PercentWidthEnable"] || false;
307-
var sizeYPercentEnable = json["PercentHeightEnable"] || false;
308-
var sizeXPercent = 0,
309-
sizeYPercent = 0,
310-
PreSize = json["PreSize"];
311-
if(PrePosition != null){
312-
sizeXPercent = PreSize["X"] || 0;
313-
sizeYPercent = PreSize["Y"] || 0;
314-
}
315-
var stretchHorizontalEnabled = json["StretchWidthEnable"] || false;
316-
var stretchVerticalEnabled = json["StretchHeightEnable"] || false;
317-
var horizontalEdge = json["HorizontalEdge"];// = ccui.LayoutComponent.horizontalEdge.LEFT;
318-
var verticalEdge = json["VerticalEdge"]; // = ccui.LayoutComponent.verticalEdge.TOP;
319-
var leftMargin = json["LeftMargin"] || 0;
320-
var rightMargin = json["RightMargin"] || 0;
321-
var topMargin = json["TopMargin"] || 0;
322-
var bottomMargin = json["BottomMargin"] || 0;
323-
324-
layoutComponent.setPositionPercentXEnabled(positionXPercentEnabled);
325-
layoutComponent.setPositionPercentYEnabled(positionYPercentEnabled);
326-
layoutComponent.setPositionPercentX(positionXPercent);
327-
layoutComponent.setPositionPercentY(positionYPercent);
328-
layoutComponent.setPercentWidthEnabled(sizeXPercentEnable);
329-
layoutComponent.setPercentHeightEnabled(sizeYPercentEnable);
330-
layoutComponent.setPercentWidth(sizeXPercent);
331-
layoutComponent.setPercentHeight(sizeYPercent);
332-
layoutComponent.setStretchWidthEnabled(stretchHorizontalEnabled);
333-
layoutComponent.setStretchHeightEnabled(stretchVerticalEnabled);
334-
335-
var horizontalEdgeType = ccui.LayoutComponent.horizontalEdge.NONE;
336-
if (horizontalEdge == "LeftEdge"){
337-
horizontalEdgeType = ccui.LayoutComponent.horizontalEdge.LEFT;
338-
}else if (horizontalEdge == "RightEdge"){
339-
horizontalEdgeType = ccui.LayoutComponent.horizontalEdge.RIGHT;
340-
}else if (horizontalEdge == "BothEdge"){
341-
horizontalEdgeType = ccui.LayoutComponent.horizontalEdge.CENTER;
342-
}
343-
layoutComponent.setHorizontalEdge(horizontalEdgeType);
344-
345-
var verticalEdgeType = ccui.LayoutComponent.verticalEdge.NONE;
346-
if (verticalEdge == "TopEdge"){
347-
verticalEdgeType = ccui.LayoutComponent.verticalEdge.TOP;
348-
}else if (verticalEdge == "BottomEdge"){
349-
verticalEdgeType = ccui.LayoutComponent.verticalEdge.BOTTOM;
350-
}else if (verticalEdge == "BothEdge"){
351-
verticalEdgeType = ccui.LayoutComponent.verticalEdge.CENTER;
352-
}
353-
layoutComponent.setVerticalEdge(verticalEdgeType);
294+
var layoutComponent = ccui.LayoutComponent.bindLayoutComponent(widget);
354295

355-
layoutComponent.setTopMargin(topMargin);
356-
layoutComponent.setBottomMargin(bottomMargin);
357-
layoutComponent.setLeftMargin(leftMargin);
358-
layoutComponent.setRightMargin(rightMargin);
296+
var positionXPercentEnabled = json["PositionPercentXEnable"] || false;
297+
var positionYPercentEnabled = json["PositionPercentYEnable"] || false;
298+
var positionXPercent = 0,
299+
positionYPercent = 0,
300+
PrePosition = json["PrePosition"];
301+
if (PrePosition != null) {
302+
positionXPercent = PrePosition["X"] || 0;
303+
positionYPercent = PrePosition["Y"] || 0;
304+
}
305+
var sizeXPercentEnable = json["PercentWidthEnable"] || false;
306+
var sizeYPercentEnable = json["PercentHeightEnable"] || false;
307+
var sizeXPercent = 0,
308+
sizeYPercent = 0,
309+
PreSize = json["PreSize"];
310+
if (PrePosition != null) {
311+
sizeXPercent = PreSize["X"] || 0;
312+
sizeYPercent = PreSize["Y"] || 0;
313+
}
314+
var stretchHorizontalEnabled = json["StretchWidthEnable"] || false;
315+
var stretchVerticalEnabled = json["StretchHeightEnable"] || false;
316+
var horizontalEdge = json["HorizontalEdge"];// = ccui.LayoutComponent.horizontalEdge.LEFT;
317+
var verticalEdge = json["VerticalEdge"]; // = ccui.LayoutComponent.verticalEdge.TOP;
318+
var leftMargin = json["LeftMargin"] || 0;
319+
var rightMargin = json["RightMargin"] || 0;
320+
var topMargin = json["TopMargin"] || 0;
321+
var bottomMargin = json["BottomMargin"] || 0;
322+
323+
layoutComponent.setPositionPercentXEnabled(positionXPercentEnabled);
324+
layoutComponent.setPositionPercentYEnabled(positionYPercentEnabled);
325+
layoutComponent.setPositionPercentX(positionXPercent);
326+
layoutComponent.setPositionPercentY(positionYPercent);
327+
layoutComponent.setPercentWidthEnabled(sizeXPercentEnable);
328+
layoutComponent.setPercentHeightEnabled(sizeYPercentEnable);
329+
layoutComponent.setPercentWidth(sizeXPercent);
330+
layoutComponent.setPercentHeight(sizeYPercent);
331+
layoutComponent.setStretchWidthEnabled(stretchHorizontalEnabled);
332+
layoutComponent.setStretchHeightEnabled(stretchVerticalEnabled);
333+
334+
var horizontalEdgeType = ccui.LayoutComponent.horizontalEdge.NONE;
335+
if (horizontalEdge == "LeftEdge") {
336+
horizontalEdgeType = ccui.LayoutComponent.horizontalEdge.LEFT;
337+
} else if (horizontalEdge == "RightEdge") {
338+
horizontalEdgeType = ccui.LayoutComponent.horizontalEdge.RIGHT;
339+
} else if (horizontalEdge == "BothEdge") {
340+
horizontalEdgeType = ccui.LayoutComponent.horizontalEdge.CENTER;
341+
}
342+
layoutComponent.setHorizontalEdge(horizontalEdgeType);
343+
344+
var verticalEdgeType = ccui.LayoutComponent.verticalEdge.NONE;
345+
if (verticalEdge == "TopEdge") {
346+
verticalEdgeType = ccui.LayoutComponent.verticalEdge.TOP;
347+
} else if (verticalEdge == "BottomEdge") {
348+
verticalEdgeType = ccui.LayoutComponent.verticalEdge.BOTTOM;
349+
} else if (verticalEdge == "BothEdge") {
350+
verticalEdgeType = ccui.LayoutComponent.verticalEdge.CENTER;
359351
}
352+
layoutComponent.setVerticalEdge(verticalEdgeType);
360353

354+
layoutComponent.setTopMargin(topMargin);
355+
layoutComponent.setBottomMargin(bottomMargin);
356+
layoutComponent.setLeftMargin(leftMargin);
357+
layoutComponent.setRightMargin(rightMargin);
361358
};
362359

363360
/**

extensions/editbox/CCdomNode.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ cc.DOM.methods = /** @lends cc.DOM# */{
391391
cleanup:function () {
392392
// actions
393393
this.stopAllActions();
394-
this.unscheduleAll();
394+
this.unscheduleAllCallbacks();
395395

396396
// timers
397397
this._arrayMakeObjectsPerformSelector(this._children, cc.Node._stateCallbackType.cleanup);

external/chipmunk/chipmunk.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if(typeof exports === 'undefined'){
3333
cp = {};
3434

3535
if(typeof window === 'object'){
36-
window.cp = cp;
36+
window["cp"] = cp;
3737
}
3838
} else {
3939
cp = exports;
@@ -1312,7 +1312,7 @@ var BoxShape2 = cp.BoxShape2 = function(body, box)
13121312
box.l, box.b,
13131313
box.l, box.t,
13141314
box.r, box.t,
1315-
box.r, box.b,
1315+
box.r, box.b
13161316
];
13171317

13181318
return new PolyShape(body, verts, vzero);

template/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<script src="main.js"></script>
2424
</head>
2525
<body style="padding:0; margin: 0; background: #000;">
26-
<script src="src/loading.js"></script>
26+
<script src="res/loading.js"></script>
2727
<canvas id="gameCanvas" width="321" height="480"></canvas>
2828
</body>
2929
</html>

template/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cc.game.onStart = function(){
2-
if(!cc.sys.isNative) //If referenced loading.js, please remove it
2+
if(!cc.sys.isNative && document.getElementById("cocosLoading")) //If referenced loading.js, please remove it
33
document.body.removeChild(document.getElementById("cocosLoading"));
44

55
var designSize = cc.size(480, 800);
File renamed without changes.

tools/XmlCheck.js

+13
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ var xmlFile2 = [];
7272
})();
7373
console.log(" The number of files in the XML file : %s", xmlFile.length);
7474

75+
contains = contains.map(function(a){
76+
return path.normalize(a);
77+
});
78+
moduleFile = moduleFile.map(function(a){
79+
return path.normalize(a);
80+
});
81+
xmlFile = xmlFile.map(function(a){
82+
return path.normalize(a);
83+
});
84+
xmlFile2 = xmlFile2.map(function(a){
85+
return path.normalize(a);
86+
});
87+
7588
console.log("\x1B[0m\x1B[33m");
7689
console.log(" warn : moduleConfig missing...");
7790
contains.forEach(function(a){

tools/build.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
classpath="./compiler/compiler.jar"/>
66
<target name="compile">
77
<jscomp compilationLevel="simple" warning="quiet"
8-
debug="false" output="./../lib/cocos2d-js-v3.4-beta-min.js">
8+
debug="false" output="./../lib/cocos2d-js-v3.4-beta0-min.js">
99
<!--sourceMapOutputFile="./../lib/cocos2d-js-v3.3-beta0-sourcemap" sourceMapFormat="V3" -->
1010
<sources dir="./../">
1111
<file name="Base64Images.js"/>
@@ -298,7 +298,7 @@
298298

299299
<target name="compile_core">
300300
<jscomp compilationLevel="simple" warning="quiet"
301-
debug="false" output="./../lib/cocos2d-js-v3.4-beta-core-min.js">
301+
debug="false" output="./../lib/cocos2d-js-v3.4-beta0-core-min.js">
302302
<!--sourceMapOutputFile="./../lib/cocos2d-js-v3.3-beta0-core-sourcemap" sourceMapFormat="V3" -->
303303
<sources dir="./../">
304304
<file name="CCBoot.js"/>

0 commit comments

Comments
 (0)