Skip to content

Commit

Permalink
update plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
AGulev committed Dec 3, 2024
1 parent ffdbef4 commit 3c28a58
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ builtins
/utils/runtime/build
/utils/runtime/*.zip
bob.jar
/.editor_settings
Binary file modified defold-spine/plugins/lib/arm64-osx/libSpineExt.dylib
Binary file not shown.
Binary file modified defold-spine/plugins/lib/x86_64-linux/libSpineExt.so
Binary file not shown.
Binary file modified defold-spine/plugins/lib/x86_64-osx/libSpineExt.dylib
Binary file not shown.
Binary file modified defold-spine/plugins/lib/x86_64-win32/libSpineExt.dll
Binary file not shown.
Binary file modified defold-spine/plugins/share/pluginSpineExt.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
import com.dynamo.bob.fs.IResource;
import com.dynamo.bob.pipeline.BuilderUtil;
import com.dynamo.spine.proto.Spine.SpineSceneDesc;
import com.dynamo.bob.pipeline.Spine;

import java.io.IOException;
import java.nio.Buffer;

@ProtoParams(srcClass = SpineSceneDesc.class, messageClass = SpineSceneDesc.class)
@BuilderParams(name="SpineScene", inExts=".spinescene", outExt=".spinescenec")
Expand All @@ -32,4 +36,27 @@ protected SpineSceneDesc.Builder transform(Task task, IResource resource, SpineS

return builder;
}

@Override
public void build(Task task) throws CompileExceptionError, IOException {
super.build(task);

IResource testurec = null;
IResource spinejsonc = null;
for (IResource input: task.getInputs()) {
String path = input.getPath();
if (path.endsWith("texturesetc")) {
testurec = input;
}
else if (path.endsWith("spinejsonc")) {
spinejsonc = input;
}
}
try {
Spine.SPINE_LoadFileFromBuffer(spinejsonc.getContent(), spinejsonc.getPath(), testurec.getContent(), testurec.getPath());
}
catch (Spine.SpineException e) {
throw new CompileExceptionError(task.getInputs().get(0), -1, e.getMessage());
}
}
}

0 comments on commit 3c28a58

Please sign in to comment.