Эх сурвалжийг харах

[cpp][ue4] Attempted fix for linker errors in UE4.

badlogic 7 жил өмнө
parent
commit
8de7a66920

+ 3 - 15
spine-cpp/spine-cpp/include/spine/Atlas.h

@@ -65,11 +65,7 @@ enum TextureWrap {
 	TextureWrap_Repeat
 };
 
-class 
-#ifdef SPINE_UE4
-	SPINEPLUGIN_API
-#endif	
-AtlasPage : public SpineObject, public HasRendererObject {
+class AtlasPage : public SpineObject, public HasRendererObject {
 public:
 	String name;
 	Format format;
@@ -87,11 +83,7 @@ public:
 	virtual ~AtlasPage() { }
 };
 
-class 
-#ifdef SPINE_UE4
-	SPINEPLUGIN_API
-#endif	
-AtlasRegion : public SpineObject {
+class AtlasRegion : public SpineObject {
 public:
 	AtlasPage *page;
 	String name;
@@ -107,11 +99,7 @@ public:
 
 class TextureLoader;
 
-class 
-#ifdef SPINE_UE4
-	SPINEPLUGIN_API
-#endif
-Atlas : public SpineObject {
+class Atlas : public SpineObject {
 public:
 	Atlas(const String &path, TextureLoader *textureLoader);
 

+ 3 - 1
spine-cpp/spine-cpp/include/spine/SpineObject.h

@@ -34,10 +34,12 @@
 #include <new>
 #include <stddef.h>
 
+#include <spine/dll.h>
+
 namespace spine {
 class String;
 
-class SpineObject {
+class SP_API SpineObject {
 public:
 	void *operator new(size_t sz);
 

+ 7 - 2
spine-ue4/Source/SpineUE4/SpineboyCppPawn.cpp

@@ -17,7 +17,7 @@ ASpineboyCppPawn::ASpineboyCppPawn()
 void ASpineboyCppPawn::BeginPlay()
 {
 	Super::BeginPlay();
-	USpineSkeletonAnimationComponent* animation = FindComponentByClass<USpineSkeletonAnimationComponent>();
+	USpineSkeletonAnimationComponent* animation = FindComponentByClass<USpineSkeletonAnimationComponent>();	
 	animation->SetAnimation(0, FString("walk"), true);
 }
 
@@ -25,7 +25,12 @@ void ASpineboyCppPawn::BeginPlay()
 void ASpineboyCppPawn::Tick(float DeltaTime)
 {
 	Super::Tick(DeltaTime);
-
+	USpineSkeletonAnimationComponent* animation = FindComponentByClass<USpineSkeletonAnimationComponent>();
+	spine::AnimationState *state = animation->GetAnimationState();
+	spine::TrackEntry *entry = state->getCurrent(0);
+	if (entry) {
+		GEngine->AddOnScreenDebugMessage(-1, 0.5f, FColor::Yellow, FString(entry->getAnimation()->getName().buffer()));
+	}
 }
 
 // Called to bind functionality to input