mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[tests] No explicit skeleton.setupPose() call.
This commit is contained in:
parent
ddf4c50954
commit
235aa7b928
@ -106,8 +106,6 @@ int main(int argc, char *argv[]) {
|
|||||||
// Create skeleton instance
|
// Create skeleton instance
|
||||||
Skeleton skeleton(*skeletonData);
|
Skeleton skeleton(*skeletonData);
|
||||||
|
|
||||||
skeleton.setupPose();
|
|
||||||
|
|
||||||
// Set animation if provided
|
// Set animation if provided
|
||||||
AnimationState *state = nullptr;
|
AnimationState *state = nullptr;
|
||||||
AnimationStateData *stateData = nullptr;
|
AnimationStateData *stateData = nullptr;
|
||||||
|
|||||||
@ -97,7 +97,7 @@ int main() {
|
|||||||
// spine_skeleton_data_result result = spine_skeleton_data_load_binary(atlas, skeleton_bytes, skeleton_length);
|
// spine_skeleton_data_result result = spine_skeleton_data_load_binary(atlas, skeleton_bytes, skeleton_length);
|
||||||
|
|
||||||
uint8_t *skeleton_bytes = read_file("data/spineboy-pro.json", &skeleton_length);
|
uint8_t *skeleton_bytes = read_file("data/spineboy-pro.json", &skeleton_length);
|
||||||
spine_skeleton_data_result result2 = spine_skeleton_data_load_json(atlas, (const char *) skeleton_bytes);
|
spine_skeleton_data_result result2 = spine_skeleton_data_load_json(atlas, (const char *) skeleton_bytes, "data/");
|
||||||
spine_skeleton_data skeleton_data = spine_skeleton_data_result_get_data(result2);
|
spine_skeleton_data skeleton_data = spine_skeleton_data_result_get_data(result2);
|
||||||
|
|
||||||
// Create a skeleton from the data, set the skeleton's position to the bottom center of
|
// Create a skeleton from the data, set the skeleton's position to the bottom center of
|
||||||
|
|||||||
@ -80,14 +80,16 @@ int main() {
|
|||||||
skeleton.setPosition(width / 2, height - 100);
|
skeleton.setPosition(width / 2, height - 100);
|
||||||
skeleton.setScaleX(0.3);
|
skeleton.setScaleX(0.3);
|
||||||
skeleton.setScaleY(0.3);
|
skeleton.setScaleY(0.3);
|
||||||
|
skeleton.setupPose();
|
||||||
|
|
||||||
// Create an AnimationState to drive animations on the skeleton. Set the "portal" animation
|
// Create an AnimationState to drive animations on the skeleton. Set the "portal" animation
|
||||||
// on track with index 0.
|
// on track with index 0.
|
||||||
AnimationStateData animationStateData(skeletonData);
|
AnimationStateData animationStateData(skeletonData);
|
||||||
animationStateData.setDefaultMix(0.2f);
|
animationStateData.setDefaultMix(0.2f);
|
||||||
AnimationState animationState(&animationStateData);
|
AnimationState animationState(&animationStateData);
|
||||||
animationState.setAnimation(0, "portal", true);
|
// animationState.setAnimation(0, "portal", true);
|
||||||
animationState.addAnimation(0, "run", true, 0);
|
// animationState.addAnimation(0, "run", true, 0);
|
||||||
|
animationState.setAnimation(0, "idle", true);
|
||||||
|
|
||||||
// Create the renderer and set the viewport size to match the window size. This sets up a
|
// Create the renderer and set the viewport size to match the window size. This sets up a
|
||||||
// pixel perfect orthogonal projection for 2D rendering.
|
// pixel perfect orthogonal projection for 2D rendering.
|
||||||
|
|||||||
@ -137,8 +137,6 @@ public class HeadlessTest implements ApplicationListener {
|
|||||||
// Create skeleton instance
|
// Create skeleton instance
|
||||||
Skeleton skeleton = new Skeleton(skeletonData);
|
Skeleton skeleton = new Skeleton(skeletonData);
|
||||||
|
|
||||||
skeleton.setupPose();
|
|
||||||
|
|
||||||
// Set animation if provided
|
// Set animation if provided
|
||||||
AnimationState state = null;
|
AnimationState state = null;
|
||||||
if (animationName != null) {
|
if (animationName != null) {
|
||||||
|
|||||||
@ -193,7 +193,7 @@ function generateJavaFromIR (ir: SerializerIR): string {
|
|||||||
javaOutput.push(' json.writeValue(visitedObjects.get(obj));');
|
javaOutput.push(' json.writeValue(visitedObjects.get(obj));');
|
||||||
javaOutput.push(' return;');
|
javaOutput.push(' return;');
|
||||||
javaOutput.push(' }');
|
javaOutput.push(' }');
|
||||||
|
|
||||||
// Generate reference string for this object (only when first encountered)
|
// Generate reference string for this object (only when first encountered)
|
||||||
// Only use name if there's a proper getName() method returning String
|
// Only use name if there's a proper getName() method returning String
|
||||||
const nameGetter = method.properties.find(p =>
|
const nameGetter = method.properties.find(p =>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
- c++ clipping appears broken, try with portal animation in spine-glfw
|
||||||
- spine-c/codegen type extractor should also report typedefs like typedef long long PropertyId; so primitive type to some name, and we need to handle that in the codegen
|
- spine-c/codegen type extractor should also report typedefs like typedef long long PropertyId; so primitive type to some name, and we need to handle that in the codegen
|
||||||
- Generate language bindings in spine-c/codegen
|
- Generate language bindings in spine-c/codegen
|
||||||
- Use CClassOrStruct, CEnum that get generated from spine-cpp-types.json and generate
|
- Use CClassOrStruct, CEnum that get generated from spine-cpp-types.json and generate
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user