mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[cpp] Fixed bug in handling of dark colors on load.
This commit is contained in:
parent
f033239b54
commit
7fba618e88
@ -391,7 +391,7 @@ namespace spine {
|
||||
|
||||
float alpha = nodeColor.a * _skeleton->getColor().a * slot->getColor().a * color.a * 255;
|
||||
// skip rendering if the color of this attachment is 0
|
||||
if (color.a == 0){
|
||||
if (alpha == 0){
|
||||
_clipper->clipEnd(*slot);
|
||||
continue;
|
||||
}
|
||||
@ -414,7 +414,7 @@ namespace spine {
|
||||
darkColor.g = 0;
|
||||
darkColor.b = 0;
|
||||
}
|
||||
darkColor.a = _premultipliedAlpha ? 255 : 0;
|
||||
darkColor.a = darkPremultipliedAlpha;
|
||||
|
||||
BlendFunc blendFunc;
|
||||
switch (slot->getData().getBlendMode()) {
|
||||
|
||||
@ -100,8 +100,6 @@ public:
|
||||
|
||||
bool hasDarkColor();
|
||||
|
||||
void setHasDarkColor(bool inValue);
|
||||
|
||||
/// May be NULL.
|
||||
Attachment *getAttachment();
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ Slot::Slot(SlotData &data, Bone &bone) :
|
||||
_skeleton(bone.getSkeleton()),
|
||||
_color(1, 1, 1, 1),
|
||||
_darkColor(0, 0, 0, 0),
|
||||
_hasDarkColor(false),
|
||||
_hasDarkColor(data.hasDarkColor()),
|
||||
_attachment(NULL),
|
||||
_attachmentTime(0) {
|
||||
setToSetupPose();
|
||||
@ -89,10 +89,6 @@ bool Slot::hasDarkColor() {
|
||||
return _hasDarkColor;
|
||||
}
|
||||
|
||||
void Slot::setHasDarkColor(bool inValue) {
|
||||
_hasDarkColor = inValue;
|
||||
}
|
||||
|
||||
Attachment *Slot::getAttachment() {
|
||||
return _attachment;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user