- Editado
Spine-c runtime, strtod() Problem
My friend programmer found a bug about the spine-c runtime.
He hasn't spine's licence unfortunately the poor man...
I think I found a bug in the latest spine-c runtime.
I tried it on my system but it always failed to load the skeleton files. I did some debugging and I found out that your JSON parser use strtod() to parse the floats. The problem is I'm in France, and we refined frogs eaters use commas instead of periods as decimal separator. The strtod() function is local dependent so it screws up when parsing floats in the skeleton files which are, of course, using periods.
The only way to have spine-c load the skeletons file properly is to force the local to C with std::setlocale(LC_ALL, "C") at the beginning of my program. But this isn't an acceptable solution since I want to use the locale for other things. I would recommend you kick strtod() out and roll your own local independent float parsing function to avoid this problem in the future.
Romain68 escribiówe refined frogs eaters
its not just you, most of Europe does this. But nobody has reported this before?
Also on the note of parsing json. It isn't thread safe
Well, nearly all the functions and vars are static. We had to wrap the loading around a critical section so that when we load skeletons/atlas' as threaded loading would result in a crash.
What variables are static?
It seems there is only one, var that is used in the Json_getError
. I thought there where more (working from memory)
just removed it as a critical section. It breaks on line 190 in atlas.c
on readLine
function call. Well, ok, its the trim
function call inside that.... string is invalid
Fixed in Git!
thanks!
I am also getting the "failed to load skeleton file raptor.json" message running the example.
I am using Xcode with SFML. is there a solution to this?
eventhorizon02 escribióI am also getting the "failed to load skeleton file raptor.json" message running the example.
I am using Xcode with SFML. is there a solution to this?
Are you sure it is related to this thread?
Have you made sure you have exported the atlas and the json file, and are pointing at the correct ones when you create the skeleton?
Are you sure you're up to date? spine-c and spine-sfml were updated to v3 yesterday.