diff --git a/spine-ue4/Content/Maps/example.umap b/spine-ue4/Content/Maps/example.umap index d70c9b0b8..11ad79945 100644 Binary files a/spine-ue4/Content/Maps/example.umap and b/spine-ue4/Content/Maps/example.umap differ diff --git a/spine-ue4/Content/Raptor/Textures/raptor.uasset b/spine-ue4/Content/Raptor/Textures/raptor.uasset index b30f45e09..81a3c5b1a 100644 Binary files a/spine-ue4/Content/Raptor/Textures/raptor.uasset and b/spine-ue4/Content/Raptor/Textures/raptor.uasset differ diff --git a/spine-ue4/Content/Raptor/raptor.uasset b/spine-ue4/Content/Raptor/raptor.uasset index 191d46942..db05bb1a8 100644 Binary files a/spine-ue4/Content/Raptor/raptor.uasset and b/spine-ue4/Content/Raptor/raptor.uasset differ diff --git a/spine-ue4/Content/SpineBoy/Textures/NewPaperSprite.uasset b/spine-ue4/Content/SpineBoy/Textures/NewPaperSprite.uasset deleted file mode 100644 index e3ff7e2c2..000000000 Binary files a/spine-ue4/Content/SpineBoy/Textures/NewPaperSprite.uasset and /dev/null differ diff --git a/spine-ue4/Content/SpineBoy/Textures/spineboy.uasset b/spine-ue4/Content/SpineBoy/Textures/spineboy.uasset index 92a31a59f..85afea48f 100644 Binary files a/spine-ue4/Content/SpineBoy/Textures/spineboy.uasset and b/spine-ue4/Content/SpineBoy/Textures/spineboy.uasset differ diff --git a/spine-ue4/Content/SpineBoy/spineboy.uasset b/spine-ue4/Content/SpineBoy/spineboy.uasset index 03940e9e6..b7ed2fab3 100644 Binary files a/spine-ue4/Content/SpineBoy/spineboy.uasset and b/spine-ue4/Content/SpineBoy/spineboy.uasset differ diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp index be0deadad..521fd4dbc 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonComponent.cpp @@ -16,18 +16,18 @@ void USpineSkeletonComponent::BeginPlay() { void USpineSkeletonComponent::TickComponent (float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); - if (lastAtlas != atlas || lastData != skeletonData) { + if (lastAtlas != Atlas || lastData != SkeletonData) { DisposeState(); - if (atlas && skeletonData) { - spSkeletonData* data = skeletonData->GetSkeletonData(atlas->GetAtlas(false), false); + if (Atlas && SkeletonData) { + spSkeletonData* data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false); skeleton = spSkeleton_create(data); stateData = spAnimationStateData_create(data); state = spAnimationState_create(stateData); } - lastAtlas = atlas; - lastData = skeletonData; + lastAtlas = Atlas; + lastData = SkeletonData; } if (state) { diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp index 37e58dc73..a1ba360c6 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp @@ -28,14 +28,14 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick AActor* owner = GetOwner(); if (owner) { USpineSkeletonComponent* skeleton = Cast(owner->GetComponentByClass(skeletonClass)); - if (skeleton && !skeleton->IsBeingDestroyed() && skeleton->skeleton) { - if (atlasMaterials.Num() != skeleton->atlas->atlasPages.Num()) { + if (skeleton && !skeleton->IsBeingDestroyed() && skeleton->GetSkeleton()) { + if (atlasMaterials.Num() != skeleton->Atlas->atlasPages.Num()) { atlasMaterials.SetNum(0); pageToMaterial.Empty(); - spAtlasPage* currPage = skeleton->atlas->GetAtlas(false)->pages; - for (int i = 0; i < skeleton->atlas->atlasPages.Num(); i++) { + spAtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->pages; + for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) { UMaterialInstanceDynamic* material = UMaterialInstanceDynamic::Create(DefaultMaterial, owner); - material->SetTextureParameterValue(TextureParameterName, skeleton->atlas->atlasPages[i]); + material->SetTextureParameterValue(TextureParameterName, skeleton->Atlas->atlasPages[i]); atlasMaterials.Add(material); pageToMaterial.Add(currPage, material); currPage = currPage->next; @@ -43,10 +43,10 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick } else { pageToMaterial.Empty(); - spAtlasPage* currPage = skeleton->atlas->GetAtlas(false)->pages; - for (int i = 0; i < skeleton->atlas->atlasPages.Num(); i++) { + spAtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->pages; + for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) { UMaterialInstanceDynamic* current = atlasMaterials[i]; - UTexture2D* texture = skeleton->atlas->atlasPages[i]; + UTexture2D* texture = skeleton->Atlas->atlasPages[i]; UTexture* oldTexture = nullptr; if(!current->GetTextureParameterValue(TextureParameterName, oldTexture) || oldTexture != texture) { UMaterialInstanceDynamic* material = UMaterialInstanceDynamic::Create(DefaultMaterial, owner); @@ -57,8 +57,7 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick currPage = currPage->next; } } - spSkeleton_updateWorldTransform(skeleton->skeleton); - UpdateMesh(skeleton->skeleton); + UpdateMesh(skeleton->GetSkeleton()); } } } @@ -135,7 +134,7 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) { indices.Add(idx + 2); indices.Add(idx + 3); idx += 4; - depthOffset -= this->depthOffset; + depthOffset += this->DepthOffset; SetMaterial(meshSection, material); } else if (attachment->type == SP_ATTACHMENT_MESH) { @@ -158,17 +157,17 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) { uint8 b = static_cast(Skeleton->b * slot->b * 255); uint8 a = static_cast(Skeleton->a * slot->a * 255); - for (int i = 0; i < mesh->super.worldVerticesLength; i += 2) { + for (int j = 0; j < mesh->super.worldVerticesLength; j += 2) { colors.Add(FColor(r, g, b, a)); - vertices.Add(FVector(worldVertices[i], depthOffset, worldVertices[i + 1])); - uvs.Add(FVector2D(mesh->uvs[i], mesh->uvs[i + 1])); + vertices.Add(FVector(worldVertices[j], depthOffset, worldVertices[j + 1])); + uvs.Add(FVector2D(mesh->uvs[j], mesh->uvs[j + 1])); } - for (int i = 0; i < mesh->trianglesCount; i++) { - indices.Add(idx + mesh->triangles[i]); + for (int j = 0; j < mesh->trianglesCount; j++) { + indices.Add(idx + mesh->triangles[j]); } idx += mesh->super.worldVerticesLength >> 1; - depthOffset -= this->depthOffset; + depthOffset += this->DepthOffset; SetMaterial(meshSection, material); } }