mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 01:06:00 +08:00
[cpp][glfw] Fix reading bounding box attachments in SkeletonBinary, closes #2668, add binary Spineboy to example
This commit is contained in:
parent
28fb83d1d7
commit
9207cd2a40
@ -275,6 +275,13 @@ cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-sdl/data/"
|
||||
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-sdl/data/"
|
||||
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-sdl/data/"
|
||||
|
||||
echo "spine-glfw"
|
||||
rm -f "$ROOT/spine-glfw/data/"*
|
||||
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-glfw/data/"
|
||||
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-glfw/data/"
|
||||
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-glfw/data/"
|
||||
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-glfw/data/"
|
||||
|
||||
echo "spine-sfml-c"
|
||||
rm "$ROOT/spine-sfml/c/data/"*
|
||||
cp -f ../coin/export/coin-pro.json "$ROOT/spine-sfml/c/data/"
|
||||
|
||||
@ -608,8 +608,8 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo
|
||||
setError("Error reading attachment: ", name.buffer());
|
||||
return NULL;
|
||||
}
|
||||
readVertices(input, box->getVertices(), box->getBones(), (flags & 16) != 0);
|
||||
box->setWorldVerticesLength(box->getVertices().size());
|
||||
int verticesLength = readVertices(input, box->getVertices(), box->getBones(), (flags & 16) != 0);
|
||||
box->setWorldVerticesLength(verticesLength);
|
||||
if (nonessential) {
|
||||
readColor(input, box->getColor());
|
||||
}
|
||||
|
||||
BIN
spine-glfw/data/spineboy-pro.skel
Normal file
BIN
spine-glfw/data/spineboy-pro.skel
Normal file
Binary file not shown.
@ -40,7 +40,7 @@ int main() {
|
||||
GlTextureLoader textureLoader;
|
||||
Atlas *atlas = new Atlas("data/spineboy-pma.atlas", &textureLoader);
|
||||
SkeletonJson json(atlas);
|
||||
SkeletonData *skeletonData = json.readSkeletonDataFile("data/spineboy-pro.json");
|
||||
SkeletonData *skeletonData = json.readSkeletonDataFile("data/spineboy-pro.skel");
|
||||
|
||||
// Create a skeleton from the data, set the skeleton's position to the bottom center of
|
||||
// the screen and scale it to make it smaller.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user