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

This commit is contained in:
badlogic 2018-09-28 14:54:38 +02:00
parent 90112276d4
commit 8de7a66920
3 changed files with 13 additions and 18 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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