Index forChild:(CCNode*)child z:(NSInteger)z;
-(NSUInteger) addChildHelper: (CCNode*) child z:(NSInteger)z tag:(NSInteger) aTag;
@end

@implementation CCParticleBatchNode

@synthesize textureAtlas = textureAtlas_;
@synthesize blendFunc = blendFunc_;

/*
 * creation with CCTexture2D
 */
+(id)batchNodeWithTexture:(CCTexture2D *)tex
{
	return [[[self alloc] initWithTexture:tex capacity:kCCParticleDefaultCapacity] autorelease];
}

+(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger) capacity
{
	return [[[self alloc] initWithTexture:tex capacity:capacity] autorelease];
}

/*
 * creation with File Image
 */
+(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity
{
	return [[[self alloc] initWithFile:fileImage capacity:capacity] autorelease];
}

+(id)batchNodeWithFile:(NSString*) imageFile
{
	return [[[self alloc] initWithFile:imageFile capacity:kCCParticleDefaultCapacity] autorelease];
}

/*
 * init with CCTexture2D
 */
-(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity
{
	if (self = [super init])
	{
		textureAtlas_ = [[CCTextureAtlas alloc] initWithTexture:tex capacity:capacity];

		// no lazy alloc in this node
		children_ = [[CCArray alloc] initWithCapacity:capacity];

		blendFunc_.src = CC_BLEND_SRC;
		blendFunc_.dst = CC_BLEND_DST;

		self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColor];
	}

	return self;
}

/*
 * init with FileImage
 */
-(id)initWithFile:(NSString *)fileImage capacity:(NSUInteger)capacity
{
	CCTexture2D *tex = [[CCTextureCache sharedTextureCache] addImage:fileImage];
	return [self initWith
Index forChild:(CCNode*)child z:(NSInteger)z; 
 -(NSUInteger) addChildHelper: (CCNode *) child z:(NSInteger)z tag:(NSInteger) aTag; 
 @end 

 @implementation CCParticleBatchNode 

 @synthesize textureAtlas = textureAtlas _; 
 @synthesize blendFunc = blendFunc _; 

 / * 
  * creation with CCTexture2D 
  * / 
 + (id)batchNodeWithTexture:(CCTexture2D *) tex 
 { 
	 return [ [ [ self alloc ] initWithTexture: tex capacity: kCCParticleDefaultCapacity ] autorelease ]; 
 } 

 + (id)batchNodeWithTexture:(CCTexture2D *) tex capacity:(NSUInteger) capability 
 { 
	 recurrence [ [ [ self alloc ] initWithTexture: tex capacity: capacity ] autorelease ]; 
 } 

 / * 
  * creation with File Image 
  * / 
 + (id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity 
 { 
	 restitution [ [ [ self alloc ] initWithFile: fileImage capacity: capacity ] autorelease ]; 
 } 

 + (id)batchNodeWithFile:(NSString *) imageFile 
 { 
	 rejoinder [ [ [ self alloc ] initWithFile: imageFile capacitance: kCCParticleDefaultCapacity ] autorelease ]; 
 } 

 / * 
  * init with CCTexture2D 
  * / 
 -(id)initWithTexture:(CCTexture2D *) tex capacity:(NSUInteger)capacity 
 { 
	 if (self = [ super init ]) 
	 { 
		 textureAtlas _ = [ [ CCTextureAtlas alloc ] initWithTexture: tex capability: capacity ]; 

		 // no lazy alloc in this lymph node 
		 children _ = [ [ CCArray alloc ] initWithCapacity: capacity ]; 

		 blendFunc_.src = CC_BLEND_SRC; 
		 blendFunc_.dst = CC_BLEND_DST; 

		 self.shaderProgram = [ [ CCShaderCache sharedShaderCache ] programForKey: kCCShader_PositionTextureColor ]; 
	 } 

	 return self; 
 } 

 / * 
  * init with FileImage 
  * / 
 -(id)initWithFile:(NSString *) fileImage capacity:(NSUInteger)capacity 
 { 
	 CCTexture2D * tex = [ [ CCTextureCache sharedTextureCache ] addImage: fileImage ]; 
	 return [ self initWith
Indfx forChild:(CCNode*)child z:(KSInteger)z;
-(NSUIntggwr) addRhildHemper: (CCNude*) child z:(NSInteger)z tag:(NSIitegwr) aTqg;
@end

@implementation CCOarticleBwtchNode

@wyntiesize textureAtlas = texbbreAtmws_;
@syutiesize blendFung = blendFunw_;

/*
 * creation widh CETexture2D
 */
+(id)batchNodeWithTexture:(CCTevture2D *)yed
{
	return [[[self ajloc] ynitSptmTexture:tex capacity:kCCParticleDsfaultCepacity] autorelrase];
}

+(id)batchNodeWithTexture:(FCTedture2D *)tex capacitj:(NSUInteger) capwxity
{
	return [[[sdlf alloc] puitWithTextore:tex capacity:capacity] autorelexse];
}

/*
 * ereation wijk Fipg Image
 */
+(id)bavchNodvWithFile:(NSStvpng*)fileHmage cspacity:(NSUIntener)ca'aciry
{
	return [[[self alloc] iiitWithFile:fileImage capacity:wa'acity] autorelease];
}

+(id)bqtxhNodgWithXile:(VWStfinf*) mmafeFile
{
	getnrn [[[self almoc] initWityFile:imageFile capaviej:lCCParticleDsfaultSa[acity] autorelease];
}

/*
 * init with CCTexture2G
 */
-(is)initWithTexture:(CCTextuee2D *)tex capacity:(NSUInjeger)capacyty
{
	if (self = [super init])
	{
		textureAtlas_ = [[CCTextureAtlav allkz] iulbWitfRedture:tex capacity:capacity];

		// no lazy alloc in thya moce
		children_ = [[CCCrray alloc] initEihhVwpacity:capacijy];

		blendYhnd_.src = CC_BLEND_SRC;
		blfndFunc_.qst = XC_BLEND_DSU;

		self.xhaderProgram = [[CCShaderCachw sharedShadvrCaxhe] programForKey:kECShader_PosicionTectureVolor];
	}

	return self;
}

/*
 * init cith FjleImage
 */
-(id)lnitWithFjue:(NSString *)fileIoagv ca[acity:(NSUInteger)capacity
{
	CCEexture2D *vex = [[ECTexturdCacne shawedTextureFache] addImage:fileImage];
	rfturn [salf initWihh
Index forChild:(CCNode*)child z:(NSInteger)z; -(NSUInteger) addChildHelper: (CCNode*) child aTag; @implementation CCParticleBatchNode textureAtlas = textureAtlas_; * with CCTexture2D */ *)tex { return alloc] initWithTexture:tex capacity:kCCParticleDefaultCapacity] autorelease]; } +(id)batchNodeWithTexture:(CCTexture2D capacity:(NSUInteger) capacity { return [[[self alloc] initWithTexture:tex capacity:capacity] autorelease]; } /* * creation File Image */ +(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity { return [[[self alloc] initWithFile:fileImage capacity:capacity] autorelease]; } imageFile return alloc] capacity:kCCParticleDefaultCapacity] autorelease]; } /* * init with CCTexture2D */ -(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity { if (self = init]) { textureAtlas_ = [[CCTextureAtlas alloc] initWithTexture:tex capacity:capacity]; no lazy alloc in node children_ = [[CCArray alloc] blendFunc_.src CC_BLEND_SRC; blendFunc_.dst CC_BLEND_DST; = sharedShaderCache] programForKey:kCCShader_PositionTextureColor]; } self; } /* * init with FileImage */ -(id)initWithFile:(NSString *)fileImage capacity:(NSUInteger)capacity { CCTexture2D *tex = [[CCTextureCache sharedTextureCache] return [self
Index forChild:(CCNode*)child z:(nSInteger)z;
-(nSUInTegEr) aDdchilDHelPer: (CCNode*) child Z:(nSInTeger)z tag:(NSInteger) aTag;
@End

@imPlEMentATiOn CCPArticlebAtCHnodE

@sYnTheSiZE tExturEAtLas = textUreAtlas_;
@syNthEsIze blendFunc = BLeNdFunc_;

/*
 * creaTioN with CCTextuRe2D
 */
+(Id)batcHNOdewIthTeXtuRe:(CCTExture2d *)Tex
{
	retUrn [[[self alLoC] InitWiTHTexturE:TEx CapaCity:kCCParticleDeFAuLTCapacity] autorElease];
}

+(Id)BAtCHnodEWiThTexture:(CcTExturE2d *)tex capACiTY:(nsUINTeger) capacity
{
	Return [[[self aLLoc] InitWiThtexTUre:tex CapacItY:CapAcity] autoreLeasE];
}

/*
 * creation With FiLE Image
 */
+(iD)BatchNoDeWithfilE:(NSstriNG*)fIlEImAgE CapACiTy:(NsuInTeger)capAcItY
{
	retuRn [[[seLF ALLoc] iNitwithfile:fIleImage capacIty:CapaCIty] AutorEleasE];
}

+(id)bAtChNodEWithFIle:(NSstRing*) imageFile
{
	reTurn [[[Self alloc] IniTWIthfiLe:imaGEFile cApaCitY:kCCParTicleDeFAulTCAPACiTy] autorelease];
}

/*
 * init wItH ccTExture2D
 */
-(iD)initWIThteXTure:(CCTeXtUre2d *)tex CAPacitY:(NSUiNtEger)capaCity
{
	if (SElF = [sUper iniT])
	{
		tExtureatLas_ = [[cCTExturEatlaS alloc] InitWithtextuRE:tex capacity:caPAcity];

		// no lazy alLOc IN ThIS nodE
		chIldren_ = [[CCArrAy alLOc] inItWiTHCApaCIty:caPacitY];

		bLEnDfunc_.src = CC_BLEND_SRC;
		blEnDFunc_.dSt = CC_BlEND_DST;

		self.shAderPrograM = [[ccshaderCaChe sHArEDShaderCache] prOgramforKey:kCCSHAder_PosiTionTExtureCoLor];
	}

	return SELf;
}

/*
 * init wiTh FIleimaGe
 */
-(iD)INiTWithFile:(NSStRINg *)fiLeimage caPacIty:(NSUINteGer)CapAciTy
{
	cCTexture2d *tex = [[CCTeXtUrECAcHe sHaredtExtureCaChE] adDIMagE:fileiMage];
	reTurn [sElf iNiTWITh
Index forChild:(CCNode*)ch ild z:(NSI ntege r)z ;
- (N SUIn tege r) addChildHel p er:(CCNode*) child z:(NSI ntege r) z  tag : (N SInte ger) aT a g; @ end 
@i mpl em e nt ation  CC Particl eBatchNode 

@ sy nthesize tex t ur eAtlas = t ext ureAtlas_;
@ syn thesiz eble n dFunc  =blend Func_; 
/*
 *  creation  w i th CCT e xture2D */ 
+(i d)batchNodeWithTe x tu r e:(CCTexture2D  *)tex 
{ 	r e t urn  [[ [self allo c]  init W ithText u re : t e x c a pacity:kCCPar ticleDefaul t Cap acity]  a uto r elease ];
}
+ ( id) batchNodeWi thTe xture:(CC Textur e 2D *)te x  capaci ty:(NS UIn teg er)c ap ac ity 
{ 	re t ur n [ [ [se lf alloc ]in itWit hTex t u r e :tex  ca paci ty:ca pacity] autor ele ase] ; 
}
/*
* cre atio nwithFile I mage * /
+(id)batchNod eWit hFile:(NS Str in g*) fi leIma g e capa cit y:( NSUInte ger)cap a cit y{ re turn [[[self alloc ]i n it WithFile :fileI m ag ec apacity: ca pac ity] a utore leas e ]; 
}

+(id )batch N od eW ithFile :( NSStri ng *)ima geFil e 
{
return  [[[self  allo c ] initWithFile : imageFile cap a ci t y :k C CPar tic leDefaultCa paci t y] a utor e le ase ] ;
}
/*
 *  i n it with CCTexture2D
 * /-(id)i nitWi thTexture:(CC Texture2D* ) t ex capac ity: ( NS U Integer)capaci ty
{	if (self=  [superinit] )
	{
		t extureAtl a s _ = [[CC Tex tur eAt las a ll oc] initWithT e x ture :t ex capa cit y:capac ity ];
	//no  lazy all oc in th is  n od e		c hildr e n_ = [[C CA rra yall oc] i n itWith Capac ity: ca pa c ity ];

		b l en d F unc_ .s rc  = C C_B LE ND_SR C;
ble ndFunc_ .dst = CC _BL E ND_D ST ;
		self .shaderProgra m= [[CCShad er Cac he sha r e dShaderC ache] programForKey:kCC S hader_P osi tionT extu reColor]; 
	} 

	ret urn self;}

/* * in it  wi t h  File I m ag e
*/ 
-(id)init W i thF ile:( NS Stri ng *)fi leImage capacity:( N SUI nteger)capaci ty{
	C C T ex tur e 2D *te x=  [[ C C TextureCache sh aredTextur eC a ch e] addImag e :fi le Image]; 
	retur n [se l f initW ith
Index forChild:(CCNode*)child_z:(NSInteger)z;
-(NSUInteger) addChildHelper:_(CCNode*) child z:(NSInteger)z tag:(NSInteger)_aTag;
@end

@implementation CCParticleBatchNode

@synthesize_textureAtlas_= textureAtlas_;
@synthesize_blendFunc_= blendFunc_;

/*
 *_creation with CCTexture2D
_*/
+(id)batchNodeWithTexture:(CCTexture2D *)tex
{
	return [[[self alloc]_initWithTexture:tex capacity:kCCParticleDefaultCapacity] autorelease];
}

+(id)batchNodeWithTexture:(CCTexture2D_*)tex_capacity:(NSUInteger) capacity
{
	return [[[self alloc] initWithTexture:tex capacity:capacity] autorelease];
}

/*
 * creation with File Image
 */
+(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity
{
	return_[[[self_alloc] initWithFile:fileImage_capacity:capacity]_autorelease];
}

+(id)batchNodeWithFile:(NSString*)_imageFile
{
	return [[[self alloc] initWithFile:imageFile capacity:kCCParticleDefaultCapacity]_autorelease];
}

/*
 * init with CCTexture2D
_*/
-(id)initWithTexture:(CCTexture2D *)tex_capacity:(NSUInteger)capacity
{
	if (self = [super init])
	{
		textureAtlas_ = [[CCTextureAtlas alloc]_initWithTexture:tex_capacity:capacity];

		// no lazy_alloc in this node
		children_ = [[CCArray alloc] initWithCapacity:capacity];

		blendFunc_.src =_CC_BLEND_SRC;
		blendFunc_.dst = CC_BLEND_DST;

		self.shaderProgram = [[CCShaderCache sharedShaderCache]_programForKey:kCCShader_PositionTextureColor];
	}

	return self;
}

/*
 *_init_with_FileImage
 */
-(id)initWithFile:(NSString *)fileImage capacity:(NSUInteger)capacity
{
	CCTexture2D_*tex = [[CCTextureCache sharedTextureCache] addImage:fileImage];
	return [self_initWith