Skip to content

Commit 9207cd2

Browse files
committed
[cpp][glfw] Fix reading bounding box attachments in SkeletonBinary, closes #2668, add binary Spineboy to example
1 parent 28fb83d commit 9207cd2

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

examples/export/runtimes.sh

+7
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,13 @@ cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-sdl/data/"
275275
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-sdl/data/"
276276
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-sdl/data/"
277277

278+
echo "spine-glfw"
279+
rm -f "$ROOT/spine-glfw/data/"*
280+
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-glfw/data/"
281+
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-glfw/data/"
282+
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-glfw/data/"
283+
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-glfw/data/"
284+
278285
echo "spine-sfml-c"
279286
rm "$ROOT/spine-sfml/c/data/"*
280287
cp -f ../coin/export/coin-pro.json "$ROOT/spine-sfml/c/data/"

spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,8 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo
608608
setError("Error reading attachment: ", name.buffer());
609609
return NULL;
610610
}
611-
readVertices(input, box->getVertices(), box->getBones(), (flags & 16) != 0);
612-
box->setWorldVerticesLength(box->getVertices().size());
611+
int verticesLength = readVertices(input, box->getVertices(), box->getBones(), (flags & 16) != 0);
612+
box->setWorldVerticesLength(verticesLength);
613613
if (nonessential) {
614614
readColor(input, box->getColor());
615615
}

spine-glfw/data/spineboy-pro.skel

63 KB
Binary file not shown.

spine-glfw/example/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int main() {
4040
GlTextureLoader textureLoader;
4141
Atlas *atlas = new Atlas("data/spineboy-pma.atlas", &textureLoader);
4242
SkeletonJson json(atlas);
43-
SkeletonData *skeletonData = json.readSkeletonDataFile("data/spineboy-pro.json");
43+
SkeletonData *skeletonData = json.readSkeletonDataFile("data/spineboy-pro.skel");
4444

4545
// Create a skeleton from the data, set the skeleton's position to the bottom center of
4646
// the screen and scale it to make it smaller.

0 commit comments

Comments
 (0)