rayxuln / spine-runtime-for-godot

This project is a module for godot that allows it to load/play Spine skeleton animation.
MIT License
93 stars 22 forks source link

Windows crash fix. Mac build fix. Also question about "Gotchas" #46

Open Vadimledyaev opened 2 years ago

Vadimledyaev commented 2 years ago

Hi, thanks for your awesome work!

Can't compile for Windows without adding ";" at the end of lines 71 and 85 of SpineAnimationState.cpp of Spine 3.8: ERR_PRINT(String("Can not find animation: ") + anim_name)**;** return NULL;

https://github.com/rayxuln/spine-runtime-for-godot/blob/spine4.0/SpineAnimationState.cpp

I tested Spine 3.8.x build for Mac. In order to make it possible to build on Mac, a Spine lib fix required: convert t_size into String in SpineSprite.cpp gave a conversion error, lines 800 and 988. Here is a quick rough fix, you can probably make it better. ` for (size_t i=0; i<current_animations.size(); ++i) {

    char str1[128];

    char str2[128];

    String prefix = vformat("ca/%d/", snprintf(str1, sizeof str1, "%zu", i));

    p_list->push_back(PropertyInfo(Variant::NIL, vformat("ID %d", snprintf(str2, sizeof str2, "%zu", i)), PROPERTY_HINT_NONE, prefix, PROPERTY_USAGE_GROUP));`

.... `
for (size_t i=0; i<current_animations.size(); ++i) {

    char str1[128];

    char str2[128];

    String prefix = vformat("ca/%d/", snprintf(str1, sizeof str1, "%zu", i));

    p_list->push_back(PropertyInfo(Variant::NIL, vformat("ID %d", snprintf(str2, sizeof str2, "%zu", i)), PROPERTY_HINT_NONE, prefix, PROPERTY_USAGE_GROUP));`

I am not C++ expert so can you please describe what -Od flag and -O2 flag means? Do I have to run linker on Linux and Mac OS only? No Windows unlinking required? Thanks!

scottkunkel commented 2 years ago

The flags optimize the code and increase in my (limited) testing fps by factor 2

Thomas

On Nov 4, 2021, at 7:06 AM, Vadimledyaev @.***> wrote:

 Hi, thanks for your awesome work!

Can't compile without adding ";" at the end of lines 71 and 85 of SpineAnimationState.cpp of Spine 3.8: ERR_PRINT(String("Can not find animation: ") + anim_name); return NULL;

https://github.com/rayxuln/spine-runtime-for-godot/blob/spine4.0/SpineAnimationState.cpp

I tested Spine 3.8.x build for Mac. In order to make it possible to build on Mac, a Spine lib fix required: convert t_size into String in SpineSprite.cpp, lines 800 and 988. It is a quick rough fix, you can probably make it better.

I am not C++ expert so can you please describe what -Od flag and -O2 flag means? Do I have to run linker on Linux and Mac OS only? No Windows unlinking required? Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Vadimledyaev commented 2 years ago

I could not find much info about these flags and I'm not really sure how to use them.

I have added them to the SConstruct environment as shown on the picture then built. Some warnings appear while building. The build changed size but I could not see much change in performance comparing to the default flags. scons2 scons

Am I doing something wrong?

I will really appreciate if you clarify how to twice the performance. Thanks.

scottkunkel commented 2 years ago

This is for the editor. The final performance in the template builds already uses flags.

Things might have changed since last time I looked.

Thomas

On Nov 4, 2021, at 12:39 PM, Vadimledyaev @.***> wrote:

 I could not find much info about these flags and I'm not really sure how to use them.

I have added them to the SConstruct environment as shown on the picture then built. Some warnings appear while building. The build changed size but I could not see much change in performance comparing to the default flags.

Am I doing something wrong?

I will really appreciate if you clarify how to twice the performance. Thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Vadimledyaev commented 2 years ago

You mean launching the editor with command line arguments like that: image ? I can't see any difference either.

scottkunkel commented 2 years ago

No I mean building for debug As opposed to production

Thomas

On Nov 4, 2021, at 1:00 PM, Vadimledyaev @.***> wrote:

 You mean launching the editor with command line arguments like that:

? I can't see any difference either.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Vadimledyaev commented 2 years ago

This? image

Vadimledyaev commented 2 years ago

Hi, can you please describe how exactly you set the flags?