Skip to content

Commit 81a29bd

Browse files
author
SeanLin
committed
Merge pull request cocos2d#686 from ricardoquesada/particle_batch_fix
ParticleBatch "works" on html5
2 parents cf5a52f + c1545ba commit 81a29bd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cocos2d/particle_nodes/CCParticleBatchNode.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ cc.ParticleBatchNode = cc.Node.extend(/** @lends cc.ParticleBatchNode# */{
8787
* @param {Number} capacity
8888
* @return {Boolean}
8989
*/
90-
initWithFile:function (fileImage, capacity) {
90+
init:function (fileImage, capacity) {
9191
var tex = cc.TextureCache.getInstance().addImage(fileImage);
9292
return this.initWithTexture(tex, capacity);
9393
},
@@ -277,7 +277,8 @@ cc.ParticleBatchNode = cc.Node.extend(/** @lends cc.ParticleBatchNode# */{
277277
* @override
278278
* @param {CanvasContext} ctx
279279
*/
280-
draw:function (ctx) {
280+
// XXX: Remove the "XXX_" prefix once WebGL is supported
281+
XXX_draw:function (ctx) {
281282
cc.PROFILER_STOP("CCParticleBatchNode - draw");
282283
if (this._textureAtlas.getTotalQuads() == 0) {
283284
return;
@@ -336,7 +337,8 @@ cc.ParticleBatchNode = cc.Node.extend(/** @lends cc.ParticleBatchNode# */{
336337

337338
// override visit.
338339
// Don't call visit on it's children
339-
visit:function (ctx) {
340+
// XXX: Remove the "XXX_" prefix once WebGL is supported
341+
XXX_visit:function (ctx) {
340342
// CAREFUL:
341343
// This visit is almost identical to cc.Node#visit
342344
// with the exception that it doesn't call visit on it's children
@@ -499,7 +501,7 @@ cc.ParticleBatchNode.createWithTexture = function (texture, capacity) {
499501
*/
500502
cc.ParticleBatchNode.create = function (fileImage, capacity) {
501503
var ret = new cc.ParticleBatchNode();
502-
if (ret && ret.initWithFile(fileImage, capacity)) {
504+
if (ret && ret.init(fileImage, capacity)) {
503505
return ret;
504506
}
505507
return null;

cocos2d/platform/jsloader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
'particle_nodes/CCParticleSystem.js',
8080
'particle_nodes/CCParticleSystemQuad.js',
8181
'particle_nodes/CCParticleExamples.js',
82+
'particle_nodes/CCParticleBatchNode.js',
8283
'touch_dispatcher/CCTouchDelegateProtocol.js',
8384
'touch_dispatcher/CCTouchHandler.js',
8485
'touch_dispatcher/CCTouchDispatcher.js',

0 commit comments

Comments
 (0)