Fixed premultiplied alpha.

This commit is contained in:
NathanSweet 2014-02-01 01:27:58 +01:00
parent 0e47b09706
commit 9780af9524
4 changed files with 2 additions and 12 deletions

View File

@ -136,11 +136,6 @@
_skeleton->g = color.g / (float)255;
_skeleton->b = color.b / (float)255;
_skeleton->a = self.opacity / (float)255;
if (_premultipliedAlpha) {
_skeleton->r *= _skeleton->a;
_skeleton->g *= _skeleton->a;
_skeleton->b *= _skeleton->a;
}
int additive = 0;
CCTextureAtlas* textureAtlas = 0;

View File

@ -16,7 +16,7 @@ CCScene* ExampleLayer::scene () {
}
bool ExampleLayer::init () {
if (!CCLayer::init()) return false;
if (!CCLayerColor::initWithColor(ccc4(128,128,128,255))) return false;
skeletonNode = CCSkeletonAnimation::createWithFile("spineboy.json", "spineboy.atlas");
skeletonNode->setMix("walk", "jump", 0.2f);

View File

@ -6,7 +6,7 @@
#include "cocos2d.h"
#include <spine/spine-cocos2dx.h>
class ExampleLayer: public cocos2d::CCLayer {
class ExampleLayer: public cocos2d::CCLayerColor {
public:
static cocos2d::CCScene* scene ();

View File

@ -129,11 +129,6 @@ void CCSkeleton::draw () {
skeleton->g = color.g / (float)255;
skeleton->b = color.b / (float)255;
skeleton->a = getOpacity() / (float)255;
if (premultipliedAlpha) {
skeleton->r *= skeleton->a;
skeleton->g *= skeleton->a;
skeleton->b *= skeleton->a;
}
int additive = 0;
CCTextureAtlas* textureAtlas = 0;