mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
Formatting
This commit is contained in:
parent
1121a1de61
commit
3493de7fe8
@ -2016,7 +2016,7 @@ void _spSequenceTimeline_apply(spTimeline *timeline, spSkeleton *skeleton, float
|
||||
|
||||
slotAttachment = slot->attachment;
|
||||
if (slotAttachment != self->attachment) {
|
||||
if (slotAttachment == NULL) return;
|
||||
if (slotAttachment == NULL) return;
|
||||
switch (slotAttachment->type) {
|
||||
case SP_ATTACHMENT_BOUNDING_BOX:
|
||||
case SP_ATTACHMENT_CLIPPING:
|
||||
|
||||
@ -174,7 +174,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons
|
||||
SlotData *slotData = new (__FILE__, __LINE__) SlotData(i, String(slotName, true), *boneData);
|
||||
|
||||
readColor(input, slotData->getColor());
|
||||
unsigned char a = readByte(input);
|
||||
unsigned char a = readByte(input);
|
||||
unsigned char r = readByte(input);
|
||||
unsigned char g = readByte(input);
|
||||
unsigned char b = readByte(input);
|
||||
|
||||
@ -64,7 +64,7 @@ private:
|
||||
spine::Skeleton *skeleton;
|
||||
SpineSprite *sprite;
|
||||
spine::Vector<float> bounds_vertex_buffer;
|
||||
Ref<SpineSkin> last_skin;
|
||||
Ref<SpineSkin> last_skin;
|
||||
|
||||
public:
|
||||
SpineSkeleton();
|
||||
|
||||
@ -38,41 +38,41 @@ using namespace spine;
|
||||
DebugExtension dbgExtension(SpineExtension::getInstance());
|
||||
|
||||
void test() {
|
||||
SFMLTextureLoader textureLoader;
|
||||
Atlas atlas("data/bomb.atlas", &textureLoader);
|
||||
SkeletonBinary loader(&atlas);
|
||||
SkeletonData *skeletonData = loader.readSkeletonDataFile("data/bomb.skel");
|
||||
SFMLTextureLoader textureLoader;
|
||||
Atlas atlas("data/bomb.atlas", &textureLoader);
|
||||
SkeletonBinary loader(&atlas);
|
||||
SkeletonData *skeletonData = loader.readSkeletonDataFile("data/bomb.skel");
|
||||
|
||||
SkeletonDrawable drawable(skeletonData);
|
||||
drawable.setUsePremultipliedAlpha(true);
|
||||
drawable.skeleton->setPosition(320, 590);
|
||||
drawable.state->setAnimation(0, "expl", false);
|
||||
drawable.skeleton->setSkin("mdl");
|
||||
SkeletonDrawable drawable(skeletonData);
|
||||
drawable.setUsePremultipliedAlpha(true);
|
||||
drawable.skeleton->setPosition(320, 590);
|
||||
drawable.state->setAnimation(0, "expl", false);
|
||||
drawable.skeleton->setSkin("mdl");
|
||||
|
||||
sf::RenderWindow window(sf::VideoMode(640, 640), "Spine SFML - Test");
|
||||
window.setFramerateLimit(60);
|
||||
sf::Event event;
|
||||
sf::Clock deltaClock;
|
||||
while (window.isOpen()) {
|
||||
while (window.pollEvent(event))
|
||||
if (event.type == sf::Event::Closed) window.close();
|
||||
sf::RenderWindow window(sf::VideoMode(640, 640), "Spine SFML - Test");
|
||||
window.setFramerateLimit(60);
|
||||
sf::Event event;
|
||||
sf::Clock deltaClock;
|
||||
while (window.isOpen()) {
|
||||
while (window.pollEvent(event))
|
||||
if (event.type == sf::Event::Closed) window.close();
|
||||
|
||||
float delta = deltaClock.getElapsedTime().asSeconds();
|
||||
deltaClock.restart();
|
||||
float delta = deltaClock.getElapsedTime().asSeconds();
|
||||
deltaClock.restart();
|
||||
|
||||
drawable.update(delta);
|
||||
drawable.update(delta);
|
||||
|
||||
window.clear();
|
||||
window.draw(drawable);
|
||||
window.display();
|
||||
}
|
||||
window.clear();
|
||||
window.draw(drawable);
|
||||
window.display();
|
||||
}
|
||||
|
||||
delete skeletonData;
|
||||
delete skeletonData;
|
||||
}
|
||||
|
||||
int main() {
|
||||
SpineExtension::setInstance(&dbgExtension);
|
||||
test();
|
||||
dbgExtension.reportLeaks();
|
||||
return 0;
|
||||
SpineExtension::setInstance(&dbgExtension);
|
||||
test();
|
||||
dbgExtension.reportLeaks();
|
||||
return 0;
|
||||
}
|
||||
@ -53,7 +53,10 @@ public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Spine)
|
||||
USpineSkeletonDataAsset *SkeletonData;
|
||||
|
||||
spine::Skeleton *GetSkeleton() { CheckState(); return skeleton; };
|
||||
spine::Skeleton *GetSkeleton() {
|
||||
CheckState();
|
||||
return skeleton;
|
||||
};
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "Components|Spine|Skeleton")
|
||||
void GetSkins(TArray<FString> &Skins);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user