Added CCBlendProtocol.

This commit is contained in:
NathanSweet 2013-04-02 05:24:25 +02:00
parent 567d076f78
commit 9cda83aba8
2 changed files with 10 additions and 12 deletions

View File

@ -44,7 +44,7 @@ typedef struct {
CCSkeleton* node;
} Cocos2dSkeleton;
@interface CCSkeleton : CCNodeRGBA {
@interface CCSkeleton : CCNodeRGBA<CCBlendProtocol> {
@public
Skeleton* skeleton;
AnimationState* state;
@ -52,6 +52,7 @@ typedef struct {
bool debugBones;
CCTextureAtlas* atlas; // All region attachments for a skeleton must use the same texture.
unsigned int quadCount;
ccBlendFunc blendFunc;
}
+ (CCSkeleton*) create:(SkeletonData*)skeletonData;
@ -59,8 +60,6 @@ typedef struct {
- init:(SkeletonData*)skeletonData;
- init:(SkeletonData*)skeletonData stateData:(AnimationStateData*)stateData;
// CCBlendProtocol
//CC_PROPERTY(ccBlendFunc, blendFunc, BlendFunc);
@end
/**/

View File

@ -83,8 +83,8 @@ Skeleton* _Cocos2dSkeleton_create (SkeletonData* data, CCSkeleton* node) {
skeleton = _Cocos2dSkeleton_create(skeletonData, self);
state = AnimationState_create(stateData);
/*blendFunc.src = GL_ONE;
blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA;*/
blendFunc.src = GL_ONE;
blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA;
[self setShaderProgram:[[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColor]];
[self scheduleUpdate];
@ -108,7 +108,7 @@ Skeleton* _Cocos2dSkeleton_create (SkeletonData* data, CCSkeleton* node) {
- (void) draw {
CC_NODE_DRAW_SETUP();
//ccGLBlendFunc(blendFunc.src, blendFunc.dst);
ccGLBlendFunc(blendFunc.src, blendFunc.dst);
ccColor3B color = self.color;
skeleton->r = color.r / (float)255;
skeleton->g = color.g / (float)255;
@ -157,15 +157,14 @@ Skeleton* _Cocos2dSkeleton_create (SkeletonData* data, CCSkeleton* node) {
}
// CCBlendProtocol
/*
ccBlendFunc CCSkeleton::getBlendFunc () {
return blendFunc;
- (void) setBlendFunc:(ccBlendFunc)blendFunc {
self.blendFunc = blendFunc;
}
void CCSkeleton::setBlendFunc (ccBlendFunc blendFunc) {
this->blendFunc = blendFunc;
- (ccBlendFunc) blendFunc {
return blendFunc;
}
*/
@end