Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc.ParticleSystem Renamed _ccsg.ParticleSystem #55

Merged
merged 2 commits into from
Dec 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cocos2d/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ if (CC_DEV) {

deprecateEnum(cc, 'cc.TEXT_ALIGNMENT', 'cc.TextAlignment');
deprecateEnum(cc, 'cc.VERTICAL_TEXT_ALIGNMENT', 'cc.VerticalTextAlignment');
deprecateEnum(cc.ParticleSystem, 'cc.ParticleSystem.TYPE', 'cc.ParticleSystem.Type');
deprecateEnum(cc.ParticleSystem, 'cc.ParticleSystem.MODE', 'cc.ParticleSystem.Mode');
deprecateEnum(_ccsg.ParticleSystem, '_ccsg.ParticleSystem.TYPE', '_ccsg.ParticleSystem.Type');
deprecateEnum(_ccsg.ParticleSystem, '_ccsg.ParticleSystem.MODE', '_ccsg.ParticleSystem.Mode');
deprecateEnum(cc.EParticleSystem, 'cc.EParticleSystem.TYPE', 'cc.EParticleSystem.PositionType');
deprecateEnum(cc.EParticleSystem, 'cc.EParticleSystem.MODE', 'cc.EParticleSystem.EmitterMode');
deprecateEnum(ccui.ScrollView, 'ccui.ScrollView.DIR', 'ccui.ScrollView.Dir');
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/particle/CCEParticleSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ var ParticleSystem = cc.Class({
// OVERRIDE METHODS

_createSgNode: function () {
var sgNode = this._sgNode = new cc.ParticleSystem();
var sgNode = this._sgNode = new _ccsg.ParticleSystem();

var loadCustomAfterFile = false;
if (this._file) {
Expand Down
28 changes: 14 additions & 14 deletions cocos2d/particle/CCParticleBatchNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ cc.PARTICLE_DEFAULT_CAPACITY = 500;
* If the cc.ParticleSystems are not added to a cc.ParticleBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.</br>
*
* Limitations:<br/>
* - At the moment only cc.ParticleSystem is supported<br/>
* - At the moment only ccsg.ParticleSystem is supported<br/>
* - All systems need to be drawn with the same parameters, blend function, aliasing, texture<br/>
*
* Most efficient usage<br/>
* - Initialize the ParticleBatchNode with the texture and enough capacity for all the particle systems<br/>
* - Initialize all particle systems and add them as child to the batch node<br/>
* </p>
* @class
* @extends cc.ParticleSystem
* @extends ccsg.ParticleSystem
* @param {String|cc.Texture2D} fileImage
* @param {Number} capacity
*
Expand Down Expand Up @@ -149,28 +149,28 @@ cc.ParticleBatchNode = _ccsg.Node.extend(/** @lends cc.ParticleBatchNode# */{

/**
* Add a child into the cc.ParticleBatchNode
* @param {cc.ParticleSystem} child
* @param {ccsg.ParticleSystem} child
* @param {Number} zOrder
* @param {Number} tag
*/
addChild:function (child, zOrder, tag) {
if(!child)
throw new Error("cc.ParticleBatchNode.addChild() : child should be non-null");
if(!(child instanceof cc.ParticleSystem))
throw new Error("cc.ParticleBatchNode.addChild() : only supports cc.ParticleSystem as children");
if(!(child instanceof _ccsg.ParticleSystem))
throw new Error("cc.ParticleBatchNode.addChild() : only supports _ccsg.ParticleSystem as children");
zOrder = (zOrder == null) ? child.zIndex : zOrder;
tag = (tag == null) ? child.tag : tag;

if(child.getTexture() !== this.textureAtlas.texture)
throw new Error("cc.ParticleSystem.addChild() : the child is not using the same texture id");
throw new Error("_ccsg.ParticleSystem.addChild() : the child is not using the same texture id");

// If this is the 1st children, then copy blending function
var childBlendFunc = child.getBlendFunc();
if (this._children.length === 0)
this.setBlendFunc(childBlendFunc);
else{
if((childBlendFunc.src !== this._blendFunc.src) || (childBlendFunc.dst !== this._blendFunc.dst)){
cc.log("cc.ParticleSystem.addChild() : Can't add a ParticleSystem that uses a different blending function");
cc.log("_ccsg.ParticleSystem.addChild() : Can't add a ParticleSystem that uses a different blending function");
return;
}
}
Expand All @@ -195,7 +195,7 @@ cc.ParticleBatchNode = _ccsg.Node.extend(/** @lends cc.ParticleBatchNode# */{

/**
* Inserts a child into the cc.ParticleBatchNode
* @param {cc.ParticleSystem} pSystem
* @param {ccsg.ParticleSystem} pSystem
* @param {Number} index
*/
insertChild:function (pSystem, index) {
Expand All @@ -219,16 +219,16 @@ cc.ParticleBatchNode = _ccsg.Node.extend(/** @lends cc.ParticleBatchNode# */{
},

/**
* @param {cc.ParticleSystem} child
* @param {ccsg.ParticleSystem} child
* @param {Boolean} cleanup
*/
removeChild:function (child, cleanup) {
// explicit nil handling
if (child == null)
return;

if(!(child instanceof cc.ParticleSystem))
throw new Error("cc.ParticleBatchNode.removeChild(): only supports cc.ParticleSystem as children");
if(!(child instanceof _ccsg.ParticleSystem))
throw new Error("cc.ParticleBatchNode.removeChild(): only supports _ccsg.ParticleSystem as children");
if(this._children.indexOf(child) === -1){
cc.log("cc.ParticleBatchNode.removeChild(): doesn't contain the sprite. Can't remove it");
return;
Expand All @@ -251,13 +251,13 @@ cc.ParticleBatchNode = _ccsg.Node.extend(/** @lends cc.ParticleBatchNode# */{

/**
* Reorder will be done in this function, no "lazy" reorder to particles
* @param {cc.ParticleSystem} child
* @param {ccsg.ParticleSystem} child
* @param {Number} zOrder
*/
reorderChild:function (child, zOrder) {
if(!child)
throw new Error("cc.ParticleBatchNode.reorderChild(): child should be non-null");
if(!(child instanceof cc.ParticleSystem))
if(!(child instanceof _ccsg.ParticleSystem))
throw new Error("cc.ParticleBatchNode.reorderChild(): only supports cc.QuadParticleSystems as children");
if(this._children.indexOf(child) === -1){
cc.log("cc.ParticleBatchNode.reorderChild(): Child doesn't belong to batch");
Expand Down Expand Up @@ -451,7 +451,7 @@ cc.ParticleBatchNode = _ccsg.Node.extend(/** @lends cc.ParticleBatchNode# */{
// XXX or possibly using vertexZ for reordering, that would be fastest <br/>
// this helper is almost equivalent to CCNode's addChild, but doesn't make use of the lazy sorting <br/>
// </p>
// @param {cc.ParticleSystem} child
// @param {ccsg.ParticleSystem} child
// @param {Number} z
// @param {Number} aTag
// @return {Number}
Expand Down
Loading