mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-14 02:58:44 +08:00
Fixed premultiplied alpha.
This commit is contained in:
parent
0e47b09706
commit
9780af9524
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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 ();
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user