From b0294beb223366daee375dc724c44f20fa8bfca1 Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 31 Jan 2017 14:22:07 +0100 Subject: [PATCH] [ue4] Ported to 3.6 --- .../SpineSkeletonRendererComponent.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp index 5c0e4570f..181cdab6d 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp @@ -228,12 +228,12 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) { idx = 0; } - spRegionAttachment_computeWorldVertices(regionAttachment, slot->bone, worldVertices.GetData()); + spRegionAttachment_computeWorldVertices(regionAttachment, slot->bone, worldVertices.GetData(), 0, 2); - uint8 r = static_cast(Skeleton->r * slot->r * 255); - uint8 g = static_cast(Skeleton->g * slot->g * 255); - uint8 b = static_cast(Skeleton->b * slot->b * 255); - uint8 a = static_cast(Skeleton->a * slot->a * 255); + uint8 r = static_cast(Skeleton->color.r * slot->color.r * 255); + uint8 g = static_cast(Skeleton->color.g * slot->color.g * 255); + uint8 b = static_cast(Skeleton->color.b * slot->color.b * 255); + uint8 a = static_cast(Skeleton->color.a * slot->color.a * 255); colors.Add(FColor(r, g, b, a)); vertices.Add(FVector(worldVertices[0], depthOffset, worldVertices[1])); @@ -298,12 +298,13 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) { if (mesh->super.worldVerticesLength> worldVertices.Num()) { worldVertices.SetNum(mesh->super.worldVerticesLength); } - spMeshAttachment_computeWorldVertices(mesh, slot, worldVertices.GetData()); + + spVertexAttachment_computeWorldVertices(&mesh->super, slot, 0, mesh->super.worldVerticesLength, worldVertices.GetData(), 0, 2); - uint8 r = static_cast(Skeleton->r * slot->r * 255); - uint8 g = static_cast(Skeleton->g * slot->g * 255); - uint8 b = static_cast(Skeleton->b * slot->b * 255); - uint8 a = static_cast(Skeleton->a * slot->a * 255); + uint8 r = static_cast(Skeleton->color.r * slot->color.r * 255); + uint8 g = static_cast(Skeleton->color.g * slot->color.g * 255); + uint8 b = static_cast(Skeleton->color.b * slot->color.b * 255); + uint8 a = static_cast(Skeleton->color.a * slot->color.a * 255); for (int j = 0; j < mesh->super.worldVerticesLength; j += 2) { colors.Add(FColor(r, g, b, a));