mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Better color computation.
This commit is contained in:
parent
e578531489
commit
89b29177ba
@ -69,17 +69,14 @@ public class MeshAttachment extends Attachment {
|
|||||||
Skeleton skeleton = slot.getSkeleton();
|
Skeleton skeleton = slot.getSkeleton();
|
||||||
Color skeletonColor = skeleton.getColor();
|
Color skeletonColor = skeleton.getColor();
|
||||||
Color slotColor = slot.getColor();
|
Color slotColor = slot.getColor();
|
||||||
Color regionColor = color;
|
Color meshColor = color;
|
||||||
float r = skeletonColor.r * slotColor.r * regionColor.r;
|
float a = skeletonColor.a * slotColor.a * meshColor.a * 255;
|
||||||
float g = skeletonColor.g * slotColor.g * regionColor.g;
|
|
||||||
float b = skeletonColor.b * slotColor.b * regionColor.b;
|
|
||||||
float a = skeletonColor.a * slotColor.a * regionColor.a * 255;
|
|
||||||
float multiplier = premultipliedAlpha ? a : 255;
|
float multiplier = premultipliedAlpha ? a : 255;
|
||||||
float color = NumberUtils.intToFloatColor( //
|
float color = NumberUtils.intToFloatColor( //
|
||||||
((int)(a) << 24) //
|
((int)a << 24) //
|
||||||
| ((int)(b * multiplier) << 16) //
|
| ((int)(skeletonColor.b * slotColor.b * meshColor.b * multiplier) << 16) //
|
||||||
| ((int)(g * multiplier) << 8) //
|
| ((int)(skeletonColor.g * slotColor.g * meshColor.g * multiplier) << 8) //
|
||||||
| ((int)(r * multiplier)));
|
| (int)(skeletonColor.r * slotColor.r * meshColor.r * multiplier));
|
||||||
|
|
||||||
float[] worldVertices = this.worldVertices;
|
float[] worldVertices = this.worldVertices;
|
||||||
FloatArray verticesArray = slot.getAttachmentVertices();
|
FloatArray verticesArray = slot.getAttachmentVertices();
|
||||||
|
|||||||
@ -149,16 +149,13 @@ public class RegionAttachment extends Attachment {
|
|||||||
Color skeletonColor = skeleton.getColor();
|
Color skeletonColor = skeleton.getColor();
|
||||||
Color slotColor = slot.getColor();
|
Color slotColor = slot.getColor();
|
||||||
Color regionColor = color;
|
Color regionColor = color;
|
||||||
float r = skeletonColor.r * slotColor.r * regionColor.r;
|
|
||||||
float g = skeletonColor.g * slotColor.g * regionColor.g;
|
|
||||||
float b = skeletonColor.b * slotColor.b * regionColor.b;
|
|
||||||
float a = skeletonColor.a * slotColor.a * regionColor.a * 255;
|
float a = skeletonColor.a * slotColor.a * regionColor.a * 255;
|
||||||
float multiplier = premultipliedAlpha ? a : 255;
|
float multiplier = premultipliedAlpha ? a : 255;
|
||||||
float color = NumberUtils.intToFloatColor( //
|
float color = NumberUtils.intToFloatColor( //
|
||||||
((int)(a) << 24) //
|
((int)a << 24) //
|
||||||
| ((int)(b * multiplier) << 16) //
|
| ((int)(skeletonColor.b * slotColor.b * regionColor.b * multiplier) << 16) //
|
||||||
| ((int)(g * multiplier) << 8) //
|
| ((int)(skeletonColor.g * slotColor.g * regionColor.g * multiplier) << 8) //
|
||||||
| ((int)(r * multiplier)));
|
| (int)(skeletonColor.r * slotColor.r * regionColor.r * multiplier));
|
||||||
|
|
||||||
float[] vertices = this.vertices;
|
float[] vertices = this.vertices;
|
||||||
float[] offset = this.offset;
|
float[] offset = this.offset;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user