mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[c] Fixed C wrapper generator
This commit is contained in:
parent
b1e5ed1c25
commit
dcc0e20361
@ -1,4 +1,5 @@
|
||||
- clean up logging, use chalk to do colored warnings/errors and make logging look very nice and informative (no emojis)
|
||||
- License header should be read from spine-libgdx/spine-libgdx/src/.../Skeleton.java in c-writer and not embedded in the file.
|
||||
- it's weird that method generation comes before array specialization. i'd assume method generation should get the specialization and use those to output the correct array type for return types and parameters and error if an array type is not specialized?
|
||||
- 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 from spine-cpp-lite
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
**Status:** In Progress
|
||||
**Created:** 2025-07-08T22:31:47
|
||||
**Agent PID:** 40566
|
||||
**Agent PID:** 42523
|
||||
|
||||
## Context for Resumption
|
||||
**Read these files in full into your context**
|
||||
@ -35,7 +35,10 @@ Interactive review of the spine-c-new code generator with user confirmation at e
|
||||
- [x] Remove unused `opaqueTypeGen` variable (line 135)
|
||||
- [x] Extract const/non-const conflict checking (lines 141-198) into its own function `checkConstNonConstConflicts` with proper documentation
|
||||
|
||||
## exclusions.ts (complete)
|
||||
## exclusions.ts
|
||||
- [x] Add field exclusion parsing support (field: Type::field)
|
||||
- [x] Add granular field accessor exclusions: field-get: Type::field and field-set: Type::field
|
||||
- [x] Support excluding all field accessors for a type: field: Type, field-get: Type, field-set: Type
|
||||
- [x] Change Exclusion type to be a discriminated union: `{ kind: 'type', typeName: string } | { kind: 'method', typeName: string, methodName: string, isConst?: boolean }`
|
||||
- [x] Document in the Exclusion type definition (in types.ts) that `isConst` refers to method const (i.e., `void meh() const`), not return type const
|
||||
- [x] Remove unnecessary logging of `isConst` in parseExclusion
|
||||
@ -94,12 +97,35 @@ Interactive review of the spine-c-new code generator with user confirmation at e
|
||||
## index.ts (continued)
|
||||
- [x] Add function to check all method return and parameter types for multi-level pointers (e.g., **) and error out early
|
||||
|
||||
## array-generator.ts
|
||||
- [ ] Remove unused typesJson field - it's passed to constructor but never used as a field
|
||||
- [ ] Remove spine/Array.h include since spine/spine.h already includes it
|
||||
- [ ] Remove Array/~Array constructor/destructor check - Member now has explicit constructor/destructor types
|
||||
- [ ] Fix template parameter replacement - Array methods are templated, need to replace T with actual element type
|
||||
- [ ] **MAJOR REFACTOR**: Extract common method/constructor generation logic to avoid duplication between generators
|
||||
## checks.ts
|
||||
- [x] Add checkFieldAccessorConflicts to detect when generated getters/setters would conflict with existing methods
|
||||
|
||||
## ir-generator.ts
|
||||
- [x] Add static RTTI method for classes that have getRTTI() - generate spine_<type>_rtti() that returns &Type::rtti
|
||||
- [x] Handle method overloads with same name but different parameters - use descriptive suffix like constructors (e.g., spine_animation_search, spine_animation_search_with_step)
|
||||
- [x] Honor constructor exclusions (e.g., method: Atlas::Atlas) - constructors weren't checking exclusions
|
||||
- [x] Add logging with indentation when methods/constructors are excluded due to exclusions
|
||||
- [x] Add getters and setters for public fields - generate spine_<type>_get_<field> and spine_<type>_set_<field> methods (type extractor only provides public members)
|
||||
- [x] Fix redundant enum value names - remove duplicate enum name prefix from values (e.g., TextureFilter::TextureFilterNearest becomes SPINE_TEXTURE_FILTER_NEAREST)
|
||||
- [x] Add field exclusion support (field: Type::field) and check for unsupported types like Array<String> in fields
|
||||
- [x] Add checkTypeSupport function to validate types before trying to convert them
|
||||
- [x] Fix constructor generation - only generate constructors that are explicitly public, never assume implicit default constructor (could be private)
|
||||
- [x] Don't error on missing constructors for abstract classes - they can't be instantiated anyway but are useful to wrap
|
||||
- [x] Fix constructor argument handling - cast pointer parameters from opaque C types to C++ types (e.g., spine_skeleton_data to SkeletonData*)
|
||||
- [x] Unify argument handling - buildCppArgs now used by constructors, methods, and array methods
|
||||
- [x] Unify return statement generation - generateReturnStatement shared between methods and array methods
|
||||
|
||||
## array-generator.ts (complete)
|
||||
- [x] Remove unused typesJson field - it's passed to constructor but never used as a field
|
||||
- [x] Remove spine/Array.h include since spine/spine.h already includes it
|
||||
- [x] Remove Array/~Array constructor/destructor check - Member now has explicit constructor/destructor types
|
||||
- [x] Fix template parameter replacement - Array methods are templated, need to replace T with actual element type
|
||||
- [x] **MAJOR REFACTOR**: Extract common method/constructor generation logic to avoid duplication between generators
|
||||
|
||||
## file-writer.ts (merged into c-writer.ts)
|
||||
- [x] Remove unused writeType and writeEnum methods (only writeTypeRaw and writeEnumRaw are used)
|
||||
- [x] Rename writeTypeRaw/writeEnumRaw to just writeClassOrStruct/writeEnum since the old ones are unused
|
||||
- [x] Merged all functionality into c-writer.ts
|
||||
|
||||
## Architecture Refactor - Intermediate Representation
|
||||
|
||||
@ -107,7 +133,7 @@ Interactive review of the spine-c-new code generator with user confirmation at e
|
||||
```typescript
|
||||
interface CParameter {
|
||||
name: string; // Parameter name in C
|
||||
cType: string; // C type (e.g., "float*", "spine_bone")
|
||||
cType: string; // C type (e.g., "float*", "spine_bone")
|
||||
cppType: string; // Original C++ type (e.g., "float&", "Bone*")
|
||||
isOutput: boolean; // true for non-const references that become output params
|
||||
}
|
||||
@ -152,33 +178,63 @@ class CWriter {
|
||||
// Handle SPINE_C_API macros
|
||||
// Format with proper spacing
|
||||
}
|
||||
|
||||
|
||||
writeClassSource(type: CClassOrStruct): string {
|
||||
// Generate all function implementations
|
||||
// Just output the body from each CMethod
|
||||
}
|
||||
|
||||
|
||||
writeEnumHeader(enumType: CEnum): string {
|
||||
// Generate enum declaration
|
||||
}
|
||||
|
||||
|
||||
private writeMethodDeclaration(method: CMethod): string
|
||||
private writeMethodImplementation(method: CMethod): string
|
||||
```
|
||||
|
||||
### Refactoring Steps:
|
||||
- [ ] Create c-types.ts with IR types
|
||||
- [ ] Create c-writer.ts with CWriter class
|
||||
- [ ] Create ir-generator.ts with functions to convert Type → C types:
|
||||
- [ ] `generateConstructors(type: ClassOrStruct): CMethod[]`
|
||||
- [ ] `generateDestructor(type: ClassOrStruct): CMethod`
|
||||
- [ ] `generateMethods(type: ClassOrStruct): CMethod[]`
|
||||
- [ ] `generateArrayMethods(elementType: string, cTypeName: string, arrayType: ClassOrStruct): CMethod[]`
|
||||
- [ ] `generateEnum(enumType: Enum): CEnum`
|
||||
- [ ] Update index.ts to use new architecture:
|
||||
- [ ] Generate CClassOrStruct for each class/struct type
|
||||
- [ ] Generate CEnum for each enum type
|
||||
- [ ] Pass to CWriter to generate code
|
||||
- [ ] For arrays, generate specialized CClassOrStruct with array methods
|
||||
- [ ] Delete old generators after verification
|
||||
- [ ] Verify output is byte-for-byte identical to current output
|
||||
### Refactoring Steps (complete):
|
||||
- [x] Create c-types.ts with IR types
|
||||
- [x] Create c-writer.ts with CWriter class
|
||||
- [x] Create ir-generator.ts with functions to convert Type → C types:
|
||||
- [x] `generateConstructors(type: ClassOrStruct): CMethod[]`
|
||||
- [x] `generateDestructor(type: ClassOrStruct): CMethod`
|
||||
- [x] `generateMethods(type: ClassOrStruct): CMethod[]`
|
||||
- [x] `generateArrayMethods(elementType: string, cTypeName: string, arrayType: ClassOrStruct): CMethod[]`
|
||||
- [x] `generateEnum(enumType: Enum): CEnum`
|
||||
- [x] Update index.ts to use new architecture:
|
||||
- [x] Generate CClassOrStruct for each class/struct type
|
||||
- [x] Generate CEnum for each enum type
|
||||
- [x] Pass to CWriter to generate code
|
||||
- [x] For arrays, generate specialized CClassOrStruct with array methods
|
||||
- [x] Delete old generators after verification
|
||||
- [x] Verify output is working (some minor issues with RTTI and const types to fix later)
|
||||
|
||||
## Error Fixes
|
||||
- [x] Fix exclusions.txt to use :: instead of . for method separators
|
||||
- [x] Add missing exclusions for unsupported array types (Array<String>, Array<Array<T>>)
|
||||
- [x] Make unsupported array types a hard error instead of warning
|
||||
- [x] Filter out excluded sources before reporting array errors
|
||||
- [x] Add isFieldExcluded, isFieldGetterExcluded, isFieldSetterExcluded functions
|
||||
- [x] Fix abstract class instantiation (Attachment) - don't generate constructors for abstract classes
|
||||
- [x] Fix mixin class constructors (BoneTimeline) - only generate constructors for classes that inherit from SpineObject
|
||||
- [x] Fix method name conflicts with type names (spine_bone_pose) - added checkMethodTypeNameConflicts check and excluded Bone::pose
|
||||
- [x] Add exclusions for BoneTimeline1 and BoneTimeline2 (have pure virtual methods but not detected as abstract)
|
||||
- [x] Fix method overload naming conflicts - include type information in suffix for methods with same names but different parameter types
|
||||
- [x] Fix static methods returning value types - Color::valueOf returns Color not Color* - added checkValueReturns and excluded Color::valueOf
|
||||
- [x] Enhanced type extractor to extract protected members (with access level) for proper abstract class detection
|
||||
- [x] Fixed BoneTimeline1/BoneTimeline2 abstract detection by including protected pure virtual methods
|
||||
- [x] Fix checkValueReturns to allow enum return values (enums are just integers in C)
|
||||
|
||||
## warnings.ts
|
||||
|
||||
## type-extractor.ts
|
||||
- [x] Fix inheritance processing order - addInheritedMethods assumes parent types are already processed but extractTypes doesn't guarantee this order
|
||||
- [x] Bug: Method name hiding - DeformTimeline has protected apply(5 params) which hides inherited public apply(8 params) from SlotCurveTimeline due to C++ name hiding rules
|
||||
- [x] Bug: addInheritedMethods was missing guard check and not setting inheritedMethodsAdded flag, causing duplicate inherited methods
|
||||
|
||||
## ir-generator.ts (continued)
|
||||
- [x] Fix inherited method calls to use base class cast when fromSupertype is set to avoid C++ name hiding issues
|
||||
- [x] Fix naming conflict between methods named "create" and constructors - always add suffix to create methods
|
||||
|
||||
## checks.ts (continued)
|
||||
- [x] Fix checkConstNonConstConflicts - it was checking for different return types instead of checking for const vs non-const methods
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
# Excluded types (whole type is skipped)
|
||||
type: SkeletonClipping
|
||||
type: Triangulator
|
||||
type: SpineObject
|
||||
type: TextureLoader
|
||||
@ -14,6 +13,7 @@ type: AnimationStateListenerObject
|
||||
type: Pool
|
||||
type: ArrayUtils
|
||||
type: BlockAllocator
|
||||
type: Block
|
||||
type: MathUtil
|
||||
type: Array
|
||||
type: PoolObject
|
||||
@ -24,24 +24,37 @@ type: EventQueue
|
||||
type: Json
|
||||
type: BaseTimeline
|
||||
|
||||
# We handle those in extensions.cpp through a simpler mechanism
|
||||
# We handle those in extensions.cpp through more idiomatic means
|
||||
method: AnimationState::setListener
|
||||
method: AnimationState::addListener
|
||||
method: AnimationState::removeListener
|
||||
method: AnimationState::clearListeners
|
||||
method: TrackEntry::setListener
|
||||
method: TrackEntry::getListener
|
||||
method: Atlas::Atlas
|
||||
|
||||
# Used in UE4, not used anywhere else
|
||||
# Used in UE4/cocos2dx, not used anywhere else
|
||||
method: AnimationState::setRendererObject
|
||||
method: TrackEntry::setRendererObject
|
||||
|
||||
# Array<String> methods need special handling
|
||||
method: AttachmentTimeline.getAttachmentNames
|
||||
# Array<String> returning methods and fields not supported
|
||||
method: AttachmentTimeline::getAttachmentNames
|
||||
method: Skin::findNamesForSlot
|
||||
field: AtlasRegion::names
|
||||
|
||||
# Array<Array<T>> returning methods not supported
|
||||
method: DeformTimeline::getVertices
|
||||
method: DrawOrderTimeline::getDrawOrders
|
||||
|
||||
# Can not emulate AttachmentMap::Entries, as that's stack allocated
|
||||
method: Skin::getAttachments
|
||||
|
||||
# Method/type name conflicts
|
||||
method: Bone::pose
|
||||
|
||||
# Methods that return objects by value (not supported - would need heap allocation)
|
||||
method: Color::valueOf
|
||||
|
||||
# Exclude const versions of getSetupPose() - we'll only expose the non-const version
|
||||
method: BoneData::getSetupPose const
|
||||
method: ConstraintDataGeneric::getSetupPose const
|
||||
@ -51,4 +64,8 @@ method: PhysicsConstraintData::getSetupPose const
|
||||
method: PosedDataGeneric::getSetupPose const
|
||||
method: SliderData::getSetupPose const
|
||||
method: SlotData::getSetupPose const
|
||||
method: TransformConstraintData::getSetupPose const
|
||||
method: TransformConstraintData::getSetupPose const
|
||||
|
||||
# Exclude setters and constructor for RenderCommand
|
||||
method: RenderCommand::RenderCommand
|
||||
field-set: RenderCommand
|
||||
@ -1,5 +1,7 @@
|
||||
import { Type, ArraySpecialization, isPrimitive, toSnakeCase, Member } from './types';
|
||||
import { WarningsCollector } from './warnings';
|
||||
import { Exclusion } from './types';
|
||||
import { isMethodExcluded, isFieldExcluded, isFieldGetterExcluded } from './exclusions';
|
||||
|
||||
// Note: This regex won't correctly parse nested arrays like Array<Array<int>>
|
||||
// It will match "Array<Array<int>" instead of the full type.
|
||||
@ -31,7 +33,7 @@ function extractArrayTypes(
|
||||
/**
|
||||
* Scans included spine-cpp types to find Array<T> specializations
|
||||
*/
|
||||
export function scanArraySpecializations(includedTypes: Type[]): ArraySpecialization[] {
|
||||
export function scanArraySpecializations(includedTypes: Type[], exclusions: Exclusion[]): ArraySpecialization[] {
|
||||
const arrayTypes = new Map<string, {type: Type, member: Member}[]>();
|
||||
const warnings = new WarningsCollector();
|
||||
|
||||
@ -70,25 +72,63 @@ export function scanArraySpecializations(includedTypes: Type[]): ArraySpecializa
|
||||
|
||||
const elementType = elementMatch[1].trim();
|
||||
|
||||
// Filter out excluded sources
|
||||
const filteredSources = sources.filter(source => {
|
||||
const typeName = source.type.name;
|
||||
const member = source.member;
|
||||
|
||||
// Check if the entire type is excluded
|
||||
if (exclusions.some(e => e.kind === 'type' && e.typeName === typeName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check based on member kind
|
||||
switch (member.kind) {
|
||||
case 'method':
|
||||
// Check if method is excluded
|
||||
return !isMethodExcluded(typeName, member.name, exclusions, member);
|
||||
|
||||
case 'field':
|
||||
// Check if field is excluded (all accessors)
|
||||
if (isFieldExcluded(typeName, member.name, exclusions)) {
|
||||
return false;
|
||||
}
|
||||
// Check if field getter is excluded
|
||||
if (isFieldGetterExcluded(typeName, member.name, exclusions)) {
|
||||
return false;
|
||||
}
|
||||
// Field is included if at least setter is not excluded
|
||||
return true;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// Skip if all sources are excluded
|
||||
if (filteredSources.length === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// For template types, check if element type is a template parameter
|
||||
const firstSource = sources[0];
|
||||
const sourceType = firstSource.type;
|
||||
if (sourceType.kind !== "enum" && sourceType.isTemplate && sourceType.templateParams?.includes(elementType)) {
|
||||
// Warn about template placeholders like T, K
|
||||
warnings.addWarning(arrayType, `Template class uses generic array with template parameter '${elementType}'`, sources);
|
||||
warnings.addWarning(arrayType, `Template class uses generic array with template parameter '${elementType}'`, filteredSources);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check for const element types (not allowed in arrays)
|
||||
if (elementType.startsWith('const ') || elementType.includes(' const ')) {
|
||||
warnings.addWarning(arrayType, "Arrays should not have const element types", sources);
|
||||
warnings.addWarning(arrayType, "Arrays should not have const element types", filteredSources);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check for multi-level pointers (unsupported, should be caught by checkMultiLevelPointers in index.ts)
|
||||
const pointerCount = (elementType.match(/\*/g) || []).length;
|
||||
if (pointerCount > 1) {
|
||||
warnings.addWarning(arrayType, "Multi-level pointers are not supported", sources);
|
||||
warnings.addWarning(arrayType, "Multi-level pointers are not supported", filteredSources);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -135,13 +175,13 @@ export function scanArraySpecializations(includedTypes: Type[]): ArraySpecializa
|
||||
// Check for problematic types
|
||||
if (elementType.startsWith('Array<')) {
|
||||
// C doesn't support nested templates, would need manual Array<Array<T>> implementation
|
||||
warnings.addWarning(arrayType, "C doesn't support nested templates", sources);
|
||||
warnings.addWarning(arrayType, "C doesn't support nested templates", filteredSources);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (elementType === 'String') {
|
||||
// String arrays should use const char** instead
|
||||
warnings.addWarning(arrayType, "String arrays should use const char** in C API", sources);
|
||||
warnings.addWarning(arrayType, "String arrays should use const char** in C API", filteredSources);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -161,8 +201,21 @@ export function scanArraySpecializations(includedTypes: Type[]): ArraySpecializa
|
||||
});
|
||||
}
|
||||
|
||||
// Print warnings
|
||||
warnings.printWarnings('Array Generation Warnings:');
|
||||
// Print warnings and exit if there are any unsupported types
|
||||
if (warnings.hasWarnings()) {
|
||||
warnings.printWarnings('Array Generation Errors:');
|
||||
console.error('\nERROR: Found unsupported array types that cannot be wrapped in C.');
|
||||
console.error('You must either:');
|
||||
console.error(' 1. Modify the C++ code to avoid these types');
|
||||
console.error(' 2. Add method/field exclusions to exclusions.txt');
|
||||
console.error('\nExample exclusions:');
|
||||
console.error(' method: AttachmentTimeline::getAttachmentNames');
|
||||
console.error(' field: AtlasRegion::names');
|
||||
console.error(' method: DeformTimeline::getVertices');
|
||||
console.error(' method: DrawOrderTimeline::getDrawOrders');
|
||||
console.error(' method: Skin::findNamesForSlot');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Sort specializations: primitives first, then enums, then pointers
|
||||
specializations.sort((a, b) => {
|
||||
|
||||
34
spine-c-new/codegen/src/c-types.ts
Normal file
34
spine-c-new/codegen/src/c-types.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { ClassOrStruct, Enum } from './types';
|
||||
|
||||
export interface CParameter {
|
||||
name: string; // Parameter name in C
|
||||
cType: string; // C type (e.g., "float*", "spine_bone")
|
||||
cppType: string; // Original C++ type (e.g., "float&", "Bone*")
|
||||
isOutput: boolean; // true for non-const references that become output params
|
||||
}
|
||||
|
||||
export interface CMethod {
|
||||
name: string; // Full C function name (e.g., "spine_bone_get_x")
|
||||
returnType: string; // C return type
|
||||
parameters: CParameter[];
|
||||
body: string; // The actual implementation code (e.g., "return ((Bone*)self)->getX();")
|
||||
}
|
||||
|
||||
export interface CClassOrStruct {
|
||||
name: string; // C type name (e.g., "spine_bone")
|
||||
cppType: ClassOrStruct; // Original C++ type info
|
||||
constructors: CMethod[]; // All constructors (including default)
|
||||
destructor: CMethod; // Always present (calls delete)
|
||||
methods: CMethod[]; // All methods
|
||||
}
|
||||
|
||||
export interface CEnumValue {
|
||||
name: string; // C enum value name (e.g., "SPINE_BLEND_MODE_NORMAL")
|
||||
value?: string; // Optional explicit value
|
||||
}
|
||||
|
||||
export interface CEnum {
|
||||
name: string; // C type name (e.g., "spine_blend_mode")
|
||||
cppType: Enum; // Original C++ enum info
|
||||
values: CEnumValue[]; // Converted enum values
|
||||
}
|
||||
350
spine-c-new/codegen/src/c-writer.ts
Normal file
350
spine-c-new/codegen/src/c-writer.ts
Normal file
@ -0,0 +1,350 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { Type, toSnakeCase } from './types';
|
||||
import { CClassOrStruct, CEnum, CMethod, CParameter } from './c-types';
|
||||
|
||||
const LICENSE_HEADER = fs.readFileSync(path.join(__dirname, '../../../spine-cpp/spine-cpp/src/spine/Skeleton.cpp'), 'utf8').split('\n').slice(0, 28).join('\n');
|
||||
|
||||
/** Generates strings for CClassOrStruct and CEnum, and writes them to files. */
|
||||
export class CWriter {
|
||||
constructor(private outputDir: string) {
|
||||
// Clean and recreate output directory
|
||||
this.cleanOutputDirectory();
|
||||
}
|
||||
|
||||
private cleanOutputDirectory(): void {
|
||||
// Remove existing generated directory if it exists
|
||||
if (fs.existsSync(this.outputDir)) {
|
||||
console.log(`Cleaning ${this.outputDir}...`);
|
||||
fs.rmSync(this.outputDir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
// Recreate the directory
|
||||
fs.mkdirSync(this.outputDir, { recursive: true });
|
||||
}
|
||||
|
||||
writeClassHeader(type: CClassOrStruct): string {
|
||||
const lines: string[] = [];
|
||||
|
||||
// Add header guard
|
||||
const guardName = `SPINE_${type.name.toUpperCase()}_H`;
|
||||
lines.push(`#ifndef ${guardName}`);
|
||||
lines.push(`#define ${guardName}`);
|
||||
lines.push('');
|
||||
|
||||
// Add includes
|
||||
lines.push('#include "../base.h"');
|
||||
lines.push('#include "types.h"');
|
||||
lines.push('');
|
||||
|
||||
// Add extern C
|
||||
lines.push('#ifdef __cplusplus');
|
||||
lines.push('extern "C" {');
|
||||
lines.push('#endif');
|
||||
lines.push('');
|
||||
|
||||
// Add all method declarations
|
||||
for (const constructor of type.constructors) {
|
||||
lines.push(this.writeMethodDeclaration(constructor));
|
||||
}
|
||||
|
||||
if (type.constructors.length > 0) {
|
||||
lines.push('');
|
||||
}
|
||||
|
||||
lines.push(this.writeMethodDeclaration(type.destructor));
|
||||
lines.push('');
|
||||
|
||||
for (const method of type.methods) {
|
||||
lines.push(this.writeMethodDeclaration(method));
|
||||
}
|
||||
|
||||
// Close extern C
|
||||
lines.push('');
|
||||
lines.push('#ifdef __cplusplus');
|
||||
lines.push('}');
|
||||
lines.push('#endif');
|
||||
lines.push('');
|
||||
lines.push(`#endif /* ${guardName} */`);
|
||||
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
writeClassSource(type: CClassOrStruct): string {
|
||||
const lines: string[] = [];
|
||||
|
||||
// Add includes
|
||||
lines.push(`#include "${type.name.replace("spine_", "")}.h"`);
|
||||
lines.push('#include <spine/spine.h>');
|
||||
lines.push('');
|
||||
lines.push('using namespace spine;');
|
||||
lines.push('');
|
||||
|
||||
// Add all method implementations
|
||||
for (const constructor of type.constructors) {
|
||||
lines.push(this.writeMethodImplementation(constructor));
|
||||
lines.push('');
|
||||
}
|
||||
|
||||
lines.push(this.writeMethodImplementation(type.destructor));
|
||||
lines.push('');
|
||||
|
||||
for (const method of type.methods) {
|
||||
lines.push(this.writeMethodImplementation(method));
|
||||
lines.push('');
|
||||
}
|
||||
|
||||
return lines.join('\n').trim() + '\n';
|
||||
}
|
||||
|
||||
writeEnumHeader(enumType: CEnum): string {
|
||||
const lines: string[] = [];
|
||||
|
||||
// Add header guard
|
||||
const guardName = `SPINE_${enumType.name.toUpperCase()}_H`;
|
||||
lines.push(`#ifndef ${guardName}`);
|
||||
lines.push(`#define ${guardName}`);
|
||||
lines.push('');
|
||||
|
||||
// Add extern C
|
||||
lines.push('#ifdef __cplusplus');
|
||||
lines.push('extern "C" {');
|
||||
lines.push('#endif');
|
||||
lines.push('');
|
||||
|
||||
// Add enum declaration
|
||||
lines.push(`typedef enum ${enumType.name} {`);
|
||||
|
||||
for (let i = 0; i < enumType.values.length; i++) {
|
||||
const value = enumType.values[i];
|
||||
const comma = i < enumType.values.length - 1 ? ',' : '';
|
||||
|
||||
if (value.value) {
|
||||
lines.push(` ${value.name} = ${value.value}${comma}`);
|
||||
} else {
|
||||
lines.push(` ${value.name}${comma}`);
|
||||
}
|
||||
}
|
||||
|
||||
lines.push(`} ${enumType.name};`);
|
||||
|
||||
// Close extern C
|
||||
lines.push('');
|
||||
lines.push('#ifdef __cplusplus');
|
||||
lines.push('}');
|
||||
lines.push('#endif');
|
||||
lines.push('');
|
||||
lines.push(`#endif /* ${guardName} */`);
|
||||
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
private writeMethodDeclaration(method: CMethod): string {
|
||||
const params = this.formatParameters(method.parameters);
|
||||
return `SPINE_C_API ${method.returnType} ${method.name}(${params});`;
|
||||
}
|
||||
|
||||
private writeMethodImplementation(method: CMethod): string {
|
||||
const params = this.formatParameters(method.parameters);
|
||||
const signature = `${method.returnType} ${method.name}(${params})`;
|
||||
|
||||
return `${signature} {
|
||||
${method.body}
|
||||
}`;
|
||||
}
|
||||
|
||||
private formatParameters(parameters: CParameter[]): string {
|
||||
if (parameters.length === 0) {
|
||||
return 'void';
|
||||
}
|
||||
|
||||
return parameters
|
||||
.map(p => `${p.cType} ${p.name}`)
|
||||
.join(', ');
|
||||
}
|
||||
|
||||
async writeType(typeName: string, headerContent: string, sourceContent?: string): Promise<void> {
|
||||
const fileName = toSnakeCase(typeName);
|
||||
|
||||
// Write header file
|
||||
const headerPath = path.join(this.outputDir, `${fileName}.h`);
|
||||
fs.writeFileSync(headerPath, headerContent);
|
||||
|
||||
// Write source file (as .cpp since it contains C++ code)
|
||||
if (sourceContent) {
|
||||
const sourcePath = path.join(this.outputDir, `${fileName}.cpp`);
|
||||
fs.writeFileSync(sourcePath, sourceContent);
|
||||
}
|
||||
}
|
||||
|
||||
async writeMainHeader(cClasses: CClassOrStruct[]): Promise<void> {
|
||||
const mainHeaderPath = path.join(this.outputDir, '..', '..', 'include', 'spine-c.h');
|
||||
|
||||
// Ensure include directory exists
|
||||
const includeDir = path.dirname(mainHeaderPath);
|
||||
if (!fs.existsSync(includeDir)) {
|
||||
fs.mkdirSync(includeDir, { recursive: true });
|
||||
}
|
||||
|
||||
const lines = [
|
||||
LICENSE_HEADER,
|
||||
'',
|
||||
'#ifndef SPINE_C_H',
|
||||
'#define SPINE_C_H',
|
||||
'',
|
||||
'// Base definitions',
|
||||
'#include "../src/base.h"',
|
||||
'',
|
||||
'// All type declarations and enum includes',
|
||||
'#include "../src/generated/types.h"',
|
||||
'',
|
||||
'// Extension types & functions',
|
||||
'#include "../src/extensions.h"',
|
||||
'',
|
||||
'// Generated class types'
|
||||
];
|
||||
|
||||
// Add class includes (they contain the actual function declarations)
|
||||
for (const classType of cClasses) {
|
||||
lines.push(`#include "../src/generated/${classType.name.replace("spine_", "")}.h"`);
|
||||
}
|
||||
|
||||
lines.push('');
|
||||
lines.push('#endif // SPINE_C_H');
|
||||
|
||||
fs.writeFileSync(mainHeaderPath, lines.join('\n'));
|
||||
}
|
||||
|
||||
async writeArrays(cArrayTypes: CClassOrStruct[]): Promise<void> {
|
||||
console.log('\nGenerating arrays.h/arrays.cpp...');
|
||||
|
||||
// Generate header
|
||||
const arrayHeaderLines: string[] = [];
|
||||
{
|
||||
arrayHeaderLines.push(LICENSE_HEADER);
|
||||
arrayHeaderLines.push('');
|
||||
arrayHeaderLines.push('#ifndef SPINE_C_ARRAYS_H');
|
||||
arrayHeaderLines.push('#define SPINE_C_ARRAYS_H');
|
||||
arrayHeaderLines.push('');
|
||||
arrayHeaderLines.push('#include "../base.h"');
|
||||
arrayHeaderLines.push('#include "types.h"');
|
||||
arrayHeaderLines.push('');
|
||||
arrayHeaderLines.push('#ifdef __cplusplus');
|
||||
arrayHeaderLines.push('extern "C" {');
|
||||
arrayHeaderLines.push('#endif');
|
||||
arrayHeaderLines.push('');
|
||||
|
||||
// Add opaque type declarations
|
||||
for (const arrayType of cArrayTypes) {
|
||||
arrayHeaderLines.push(`SPINE_OPAQUE_TYPE(${arrayType.name})`);
|
||||
}
|
||||
|
||||
arrayHeaderLines.push('');
|
||||
|
||||
// Add all method declarations
|
||||
for (const arrayType of cArrayTypes) {
|
||||
arrayHeaderLines.push(arrayType.constructors.map(c => this.writeMethodDeclaration(c)).join('\n\n'));
|
||||
arrayHeaderLines.push(this.writeMethodDeclaration(arrayType.destructor));
|
||||
arrayHeaderLines.push(arrayType.methods.map(c => this.writeMethodDeclaration(c)).join('\n\n'));
|
||||
arrayHeaderLines.push('');
|
||||
}
|
||||
|
||||
// Close extern C
|
||||
arrayHeaderLines.push('#ifdef __cplusplus');
|
||||
arrayHeaderLines.push('}');
|
||||
arrayHeaderLines.push('#endif');
|
||||
arrayHeaderLines.push('');
|
||||
arrayHeaderLines.push('#endif /* SPINE_C_ARRAYS_H */');
|
||||
}
|
||||
|
||||
// Generate source
|
||||
const arraySourceLines: string[] = [];
|
||||
{
|
||||
arraySourceLines.push(LICENSE_HEADER);
|
||||
arraySourceLines.push('');
|
||||
arraySourceLines.push('#include "arrays.h"');
|
||||
arraySourceLines.push('#include <spine/spine.h>');
|
||||
arraySourceLines.push('');
|
||||
arraySourceLines.push('using namespace spine;');
|
||||
arraySourceLines.push('');
|
||||
|
||||
// Add all method implementations
|
||||
for (const arrayType of cArrayTypes) {
|
||||
arraySourceLines.push(arrayType.constructors.map(c => this.writeMethodImplementation(c)).join('\n\n'));
|
||||
arraySourceLines.push(this.writeMethodImplementation(arrayType.destructor));
|
||||
arraySourceLines.push(arrayType.methods.map(c => this.writeMethodImplementation(c)).join('\n\n'));
|
||||
arraySourceLines.push('');
|
||||
}
|
||||
}
|
||||
|
||||
const headerPath = path.join(this.outputDir, 'arrays.h');
|
||||
const sourcePath = path.join(this.outputDir, 'arrays.cpp');
|
||||
|
||||
fs.writeFileSync(headerPath, arrayHeaderLines.join('\n'));
|
||||
fs.writeFileSync(sourcePath, arraySourceLines.join('\n'));
|
||||
}
|
||||
|
||||
/** Writes the types.h file, which includes all class forward declarations and enum types. */
|
||||
async writeTypesHeader(cClasses: CClassOrStruct[], cEnums: CEnum[]): Promise<void> {
|
||||
const headerPath = path.join(this.outputDir, 'types.h');
|
||||
const lines: string[] = [
|
||||
LICENSE_HEADER,
|
||||
'',
|
||||
'#ifndef SPINE_C_TYPES_H',
|
||||
'#define SPINE_C_TYPES_H',
|
||||
'',
|
||||
'#ifdef __cplusplus',
|
||||
'extern "C" {',
|
||||
'#endif',
|
||||
'',
|
||||
'#include "../base.h"',
|
||||
'',
|
||||
'// Forward declarations for all non-enum types'
|
||||
];
|
||||
|
||||
// Forward declare all class types
|
||||
for (const classType of cClasses) {
|
||||
lines.push(`SPINE_OPAQUE_TYPE(${classType.name})`);
|
||||
}
|
||||
|
||||
lines.push('');
|
||||
lines.push('// Include all enum types (cannot be forward declared)');
|
||||
|
||||
// Include all enum headers
|
||||
for (const enumType of cEnums) {
|
||||
lines.push(`#include "${enumType.name.replace("spine_", "")}.h"`);
|
||||
}
|
||||
|
||||
lines.push('');
|
||||
lines.push('// Array specializations');
|
||||
lines.push('#include "arrays.h"');
|
||||
|
||||
lines.push('');
|
||||
lines.push('#ifdef __cplusplus');
|
||||
lines.push('}');
|
||||
lines.push('#endif');
|
||||
lines.push('');
|
||||
lines.push('#endif // SPINE_C_TYPES_H');
|
||||
|
||||
fs.writeFileSync(headerPath, lines.join('\n'));
|
||||
}
|
||||
|
||||
async writeAll(cClasses: CClassOrStruct[], cEnums: CEnum[], cArrayTypes: CClassOrStruct[]): Promise<void> {
|
||||
await this.writeTypesHeader(cClasses, cEnums);
|
||||
await this.writeMainHeader(cClasses);
|
||||
await this.writeArrays(cArrayTypes);
|
||||
|
||||
// Write all class files
|
||||
for (const classType of cClasses) {
|
||||
const headerContent = this.writeClassHeader(classType);
|
||||
const sourceContent = this.writeClassSource(classType);
|
||||
await this.writeType(classType.name.replace("spine_", ""), headerContent, sourceContent);
|
||||
}
|
||||
|
||||
// Write all enum headers
|
||||
for (const enumType of cEnums) {
|
||||
const headerContent = this.writeEnumHeader(enumType);
|
||||
await this.writeType(enumType.name.replace("spine_", ""), headerContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
421
spine-c-new/codegen/src/checks.ts
Normal file
421
spine-c-new/codegen/src/checks.ts
Normal file
@ -0,0 +1,421 @@
|
||||
import { isMethodExcluded } from "./exclusions";
|
||||
import { Exclusion, Method, Field, Type } from "./types";
|
||||
import { ClassOrStruct, toSnakeCase, isPrimitive } from "./types";
|
||||
|
||||
/**
|
||||
* Checks for methods that have both const and non-const versions with different return types.
|
||||
* This is a problem for C bindings because C doesn't support function overloading.
|
||||
*
|
||||
* In C++, you can have:
|
||||
* T& getValue(); // for non-const objects
|
||||
* const T& getValue() const; // for const objects
|
||||
*
|
||||
* But in C, we can only have one function with a given name, so we need to detect
|
||||
* and report these conflicts.
|
||||
*
|
||||
* @param classes - Array of class/struct types to check
|
||||
* @param exclusions - Exclusion rules to skip specific methods
|
||||
* @returns Array of conflicts found, or exits if conflicts exist
|
||||
*/
|
||||
export function checkConstNonConstConflicts(classes: ClassOrStruct[], exclusions: Exclusion[]): void {
|
||||
const conflicts: Array<{ type: string, method: string }> = [];
|
||||
|
||||
for (const type of classes) {
|
||||
if (type.members === undefined) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get all non-static methods
|
||||
const allMethods = type.members?.filter(m =>
|
||||
m.kind === 'method' &&
|
||||
!m.isStatic
|
||||
) as Method[] | undefined;
|
||||
|
||||
if (allMethods) {
|
||||
const methodGroups = new Map<string, Method[]>();
|
||||
for (const method of allMethods) {
|
||||
// Skip if this specific const/non-const version is excluded
|
||||
if (isMethodExcluded(type.name, method.name, exclusions, { isConst: method.isConst })) {
|
||||
continue;
|
||||
}
|
||||
const key = method.name + '(' + (method.parameters?.map(p => p.type).join(',') || '') + ')';
|
||||
if (!methodGroups.has(key)) {
|
||||
methodGroups.set(key, []);
|
||||
}
|
||||
methodGroups.get(key)!.push(method as Method);
|
||||
}
|
||||
|
||||
for (const [signature, group] of methodGroups) {
|
||||
if (group.length > 1) {
|
||||
// Check if we have both const and non-const versions
|
||||
const hasConst = group.some(m => m.isConst === true);
|
||||
const hasNonConst = group.some(m => m.isConst === false);
|
||||
|
||||
if (hasConst && hasNonConst) {
|
||||
conflicts.push({ type: type.name, method: group[0].name });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we found conflicts, report them all and exit
|
||||
if (conflicts.length > 0) {
|
||||
console.error("\n" + "=".repeat(80));
|
||||
console.error("SUMMARY OF ALL CONST/NON-CONST METHOD CONFLICTS");
|
||||
console.error("=".repeat(80));
|
||||
console.error(`\nFound ${conflicts.length} method conflicts across the codebase:\n`);
|
||||
|
||||
for (const conflict of conflicts) {
|
||||
console.error(` - ${conflict.type}::${conflict.method}()`);
|
||||
}
|
||||
|
||||
console.error("\nThese methods have both const and non-const versions in C++ which cannot");
|
||||
console.error("be represented in the C API. You need to either:");
|
||||
console.error(" 1. Add these to exclusions.txt");
|
||||
console.error(" 2. Modify the C++ code to avoid const/non-const overloading");
|
||||
console.error("=".repeat(80) + "\n");
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for multi-level pointers in method signatures and errors if found
|
||||
*/
|
||||
export function checkMultiLevelPointers(types: ClassOrStruct[]) {
|
||||
const errors: { type: string, member: string, signature: string }[] = [];
|
||||
|
||||
// Helper to check if a type has multi-level pointers
|
||||
function hasMultiLevelPointers(typeStr: string): boolean {
|
||||
// First check the outer type (after removing template content)
|
||||
let outerType = typeStr;
|
||||
|
||||
// Extract all template contents for separate checking
|
||||
const templateContents: string[] = [];
|
||||
let depth = 0;
|
||||
let templateStart = -1;
|
||||
|
||||
for (let i = 0; i < typeStr.length; i++) {
|
||||
if (typeStr[i] === '<') {
|
||||
if (depth === 0) {
|
||||
templateStart = i + 1;
|
||||
}
|
||||
depth++;
|
||||
} else if (typeStr[i] === '>') {
|
||||
depth--;
|
||||
if (depth === 0 && templateStart !== -1) {
|
||||
templateContents.push(typeStr.substring(templateStart, i));
|
||||
templateStart = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove all template content from outer type
|
||||
outerType = outerType.replace(/<[^>]+>/g, '<>');
|
||||
|
||||
// Check outer type for consecutive pointers
|
||||
if (/\*\s*\*/.test(outerType)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Recursively check template contents
|
||||
for (const content of templateContents) {
|
||||
if (hasMultiLevelPointers(content)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const type of types) {
|
||||
if (!type.members) continue;
|
||||
|
||||
for (const member of type.members) {
|
||||
if (member.kind === 'method') {
|
||||
// Check return type
|
||||
if (hasMultiLevelPointers(member.returnType)) {
|
||||
errors.push({
|
||||
type: type.name,
|
||||
member: member.name,
|
||||
signature: `return type: ${member.returnType}`
|
||||
});
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (member.parameters) {
|
||||
for (const param of member.parameters) {
|
||||
if (hasMultiLevelPointers(param.type)) {
|
||||
errors.push({
|
||||
type: type.name,
|
||||
member: member.name,
|
||||
signature: `parameter '${param.name}': ${param.type}`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (member.kind === 'field') {
|
||||
// Check field type
|
||||
if (hasMultiLevelPointers(member.type)) {
|
||||
errors.push({
|
||||
type: type.name,
|
||||
member: member.name,
|
||||
signature: `field type: ${member.type}`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we found multi-level pointers, report them and exit
|
||||
if (errors.length > 0) {
|
||||
console.error("\n" + "=".repeat(80));
|
||||
console.error("MULTI-LEVEL POINTER ERROR");
|
||||
console.error("=".repeat(80));
|
||||
console.error(`\nFound ${errors.length} multi-level pointer usage(s) which are not supported:\n`);
|
||||
|
||||
for (const error of errors) {
|
||||
console.error(` - ${error.type}::${error.member} - ${error.signature}`);
|
||||
}
|
||||
|
||||
console.error("\nMulti-level pointers (e.g., char**, void***) cannot be represented in the C API.");
|
||||
console.error("You need to either:");
|
||||
console.error(" 1. Refactor the C++ code to avoid multi-level pointers");
|
||||
console.error(" 2. Exclude these types/methods in exclusions.txt");
|
||||
console.error("=".repeat(80) + "\n");
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for conflicts between generated field accessors and existing methods.
|
||||
* For example, if a class has a public field 'x' and also has methods getX() or setX(),
|
||||
* the generated getters/setters would conflict.
|
||||
*/
|
||||
export function checkFieldAccessorConflicts(classes: ClassOrStruct[], exclusions: Exclusion[]): void {
|
||||
const conflicts: Array<{ type: string, field: string, conflictingMethod: string, accessorType: 'getter' | 'setter' }> = [];
|
||||
|
||||
for (const type of classes) {
|
||||
if (!type.members) continue;
|
||||
|
||||
// Get all non-static fields
|
||||
const fields = type.members.filter(m =>
|
||||
m.kind === 'field' &&
|
||||
!m.isStatic
|
||||
) as Field[];
|
||||
|
||||
// Get all methods
|
||||
const methods = type.members.filter(m =>
|
||||
m.kind === 'method'
|
||||
) as Method[];
|
||||
|
||||
// For each field, check if getter/setter would conflict
|
||||
for (const field of fields) {
|
||||
const fieldNameSnake = toSnakeCase(field.name);
|
||||
const getterName = `get_${fieldNameSnake}`;
|
||||
const setterName = `set_${fieldNameSnake}`;
|
||||
|
||||
// Check for getter conflicts
|
||||
for (const method of methods) {
|
||||
if (isMethodExcluded(type.name, method.name, exclusions, { isConst: method.isConst })) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const methodNameSnake = toSnakeCase(method.name);
|
||||
|
||||
// Check if this method would conflict with the generated getter
|
||||
if (methodNameSnake === getterName || methodNameSnake === `get${field.name.toLowerCase()}`) {
|
||||
conflicts.push({
|
||||
type: type.name,
|
||||
field: field.name,
|
||||
conflictingMethod: method.name,
|
||||
accessorType: 'getter'
|
||||
});
|
||||
}
|
||||
|
||||
// Check if this method would conflict with the generated setter
|
||||
if (!field.type.includes('const') && !field.type.endsWith('&')) {
|
||||
if (methodNameSnake === setterName || methodNameSnake === `set${field.name.toLowerCase()}`) {
|
||||
conflicts.push({
|
||||
type: type.name,
|
||||
field: field.name,
|
||||
conflictingMethod: method.name,
|
||||
accessorType: 'setter'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we found conflicts, report them
|
||||
if (conflicts.length > 0) {
|
||||
console.error("\n" + "=".repeat(80));
|
||||
console.error("FIELD ACCESSOR CONFLICTS");
|
||||
console.error("=".repeat(80));
|
||||
console.error(`\nFound ${conflicts.length} conflicts between public fields and existing methods:\n`);
|
||||
|
||||
for (const conflict of conflicts) {
|
||||
console.error(` - ${conflict.type}::${conflict.field} would generate ${conflict.accessorType} that conflicts with ${conflict.type}::${conflict.conflictingMethod}()`);
|
||||
}
|
||||
|
||||
console.error("\nThese fields have corresponding getter/setter methods in C++.");
|
||||
console.error("You should either:");
|
||||
console.error(" 1. Make the field private/protected in C++");
|
||||
console.error(" 2. Exclude the conflicting method in exclusions.txt");
|
||||
console.error(" 3. Add field exclusion support to skip generating accessors for specific fields");
|
||||
console.error("=".repeat(80) + "\n");
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for method names that would conflict with type names when converted to C.
|
||||
* For example, if we have a type BonePose (→ spine_bone_pose) and a method Bone::pose() (→ spine_bone_pose)
|
||||
*/
|
||||
export function checkMethodTypeNameConflicts(classes: ClassOrStruct[], allTypes: Type[], exclusions: Exclusion[]): void {
|
||||
const conflicts: Array<{ className: string, methodName: string, conflictingType: string }> = [];
|
||||
|
||||
// Build a set of all C type names
|
||||
const cTypeNames = new Set<string>();
|
||||
for (const type of allTypes) {
|
||||
cTypeNames.add(`spine_${toSnakeCase(type.name)}`);
|
||||
}
|
||||
|
||||
// Check all methods
|
||||
for (const type of classes) {
|
||||
if (!type.members) continue;
|
||||
|
||||
const methods = type.members!.filter(m =>
|
||||
m.kind === 'method'
|
||||
) as Method[];
|
||||
|
||||
for (const method of methods) {
|
||||
// Skip excluded methods
|
||||
if (isMethodExcluded(type.name, method.name, exclusions, method)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Generate the C function name
|
||||
const cFunctionName = `spine_${toSnakeCase(type.name)}_${toSnakeCase(method.name)}`;
|
||||
|
||||
// Check if this conflicts with any type name
|
||||
if (cTypeNames.has(cFunctionName)) {
|
||||
// Find which type it conflicts with
|
||||
const conflictingType = allTypes.find(t =>
|
||||
`spine_${toSnakeCase(t.name)}` === cFunctionName
|
||||
);
|
||||
|
||||
if (conflictingType) {
|
||||
conflicts.push({
|
||||
className: type.name,
|
||||
methodName: method.name,
|
||||
conflictingType: conflictingType!.name
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Report conflicts
|
||||
if (conflicts.length > 0) {
|
||||
console.error("\n" + "=".repeat(80));
|
||||
console.error("METHOD/TYPE NAME CONFLICTS");
|
||||
console.error("=".repeat(80));
|
||||
console.error(`\nFound ${conflicts.length} method names that conflict with type names:\n`);
|
||||
|
||||
for (const conflict of conflicts) {
|
||||
console.error(` - ${conflict.className}::${conflict.methodName}() conflicts with type ${conflict.conflictingType}`);
|
||||
console.error(` Both generate the same C name: spine_${toSnakeCase(conflict.className)}_${toSnakeCase(conflict.methodName)}`);
|
||||
}
|
||||
|
||||
console.error("\nThese conflicts cannot be resolved automatically. You must either:");
|
||||
console.error(" 1. Rename the method or type in C++");
|
||||
console.error(" 2. Exclude the method in exclusions.txt");
|
||||
console.error(" 3. Exclude the conflicting type in exclusions.txt");
|
||||
console.error("=".repeat(80) + "\n");
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for methods that return non-primitive types by value.
|
||||
* These cannot be wrapped in C without heap allocation.
|
||||
*/
|
||||
export function checkValueReturns(classes: ClassOrStruct[], allTypes: Type[], exclusions: Exclusion[]): void {
|
||||
const issues: Array<{ type: string, method: string, returnType: string }> = [];
|
||||
|
||||
// Build a set of enum type names for quick lookup
|
||||
const enumTypes = new Set<string>();
|
||||
for (const type of allTypes) {
|
||||
if (type.kind === 'enum') {
|
||||
enumTypes.add(type.name);
|
||||
}
|
||||
}
|
||||
|
||||
for (const type of classes) {
|
||||
if (!type.members) continue;
|
||||
|
||||
const methods = type.members.filter(m =>
|
||||
m.kind === 'method'
|
||||
) as Method[];
|
||||
|
||||
for (const method of methods) {
|
||||
// Skip excluded methods
|
||||
if (isMethodExcluded(type.name, method.name, exclusions, method)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const returnType = method.returnType;
|
||||
|
||||
// Skip void, primitives, pointers, and references
|
||||
if (returnType === 'void' ||
|
||||
isPrimitive(returnType) ||
|
||||
returnType.endsWith('*') ||
|
||||
returnType.endsWith('&')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip String (handled specially)
|
||||
if (returnType === 'String' || returnType === 'const String') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip enums (they're just integers in C)
|
||||
if (enumTypes.has(returnType)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// This is a non-primitive type returned by value
|
||||
issues.push({
|
||||
type: type.name,
|
||||
method: method.name,
|
||||
returnType: returnType
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Report issues
|
||||
if (issues.length > 0) {
|
||||
console.error("\n" + "=".repeat(80));
|
||||
console.error("METHODS RETURNING OBJECTS BY VALUE");
|
||||
console.error("=".repeat(80));
|
||||
console.error(`\nFound ${issues.length} methods that return non-primitive types by value:\n`);
|
||||
|
||||
for (const issue of issues) {
|
||||
console.error(` - ${issue.type}::${issue.method}() returns ${issue.returnType}`);
|
||||
}
|
||||
|
||||
console.error("\nC cannot return objects by value through opaque pointers.");
|
||||
console.error("You must either:");
|
||||
console.error(" 1. Change the C++ method to return a pointer or reference");
|
||||
console.error(" 2. Exclude the method in exclusions.txt");
|
||||
console.error("=".repeat(80) + "\n");
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,11 @@ import { Exclusion } from './types';
|
||||
* - Empty lines are ignored
|
||||
* - Type exclusions: "type: TypeName"
|
||||
* - Method exclusions: "method: TypeName::methodName [const]"
|
||||
* - Field exclusions: "field: TypeName[::fieldName]"
|
||||
* - Field getter exclusions: "field-get: TypeName[::fieldName]"
|
||||
* - Field setter exclusions: "field-set: TypeName[::fieldName]"
|
||||
*
|
||||
* When fieldName is omitted, applies to all fields of that type.
|
||||
*
|
||||
* Examples:
|
||||
* ```
|
||||
@ -22,6 +27,19 @@ import { Exclusion } from './types';
|
||||
*
|
||||
* # Exclude only const version of a method
|
||||
* method: BoneData::getSetupPose const
|
||||
*
|
||||
* # Exclude constructors (allows type but prevents creation)
|
||||
* method: AtlasRegion::AtlasRegion
|
||||
*
|
||||
* # Exclude field accessors
|
||||
* field: AtlasRegion::names # Exclude both getter and setter
|
||||
* field-get: SecretData::password # Exclude only getter
|
||||
* field-set: Bone::x # Exclude only setter (read-only)
|
||||
*
|
||||
* # Exclude all field accessors for a type
|
||||
* field: RenderCommand # No field accessors at all
|
||||
* field-get: DebugData # No getters (write-only fields)
|
||||
* field-set: RenderCommand # No setters (read-only fields)
|
||||
* ```
|
||||
*/
|
||||
export function loadExclusions(filePath: string): Exclusion[] {
|
||||
@ -58,7 +76,60 @@ export function loadExclusions(filePath: string): Exclusion[] {
|
||||
methodName: methodName,
|
||||
isConst: isConst || undefined
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
// Parse field exclusion (all accessors)
|
||||
// Format: field: Type::field or field: Type (for all fields)
|
||||
const fieldMatch = trimmed.match(/^field:\s*(.+?)(?:::(.+?))?$/);
|
||||
if (fieldMatch) {
|
||||
const typeName = fieldMatch[1].trim();
|
||||
const fieldName = fieldMatch[2]?.trim();
|
||||
|
||||
if (fieldName) {
|
||||
// Specific field
|
||||
exclusions.push({
|
||||
kind: 'field',
|
||||
typeName,
|
||||
fieldName
|
||||
});
|
||||
} else {
|
||||
// All fields - add both field-get and field-set for the type
|
||||
exclusions.push({
|
||||
kind: 'field-get',
|
||||
typeName,
|
||||
fieldName: '*' // Special marker for all fields
|
||||
});
|
||||
exclusions.push({
|
||||
kind: 'field-set',
|
||||
typeName,
|
||||
fieldName: '*'
|
||||
});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Parse field getter exclusion
|
||||
// Format: field-get: Type::field or field-get: Type (for all fields)
|
||||
const fieldGetMatch = trimmed.match(/^field-get:\s*(.+?)(?:::(.+?))?$/);
|
||||
if (fieldGetMatch) {
|
||||
exclusions.push({
|
||||
kind: 'field-get',
|
||||
typeName: fieldGetMatch[1].trim(),
|
||||
fieldName: fieldGetMatch[2]?.trim() || '*'
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
// Parse field setter exclusion
|
||||
// Format: field-set: Type::field or field-set: Type (for all fields)
|
||||
const fieldSetMatch = trimmed.match(/^field-set:\s*(.+?)(?:::(.+?))?$/);
|
||||
if (fieldSetMatch) {
|
||||
exclusions.push({
|
||||
kind: 'field-set',
|
||||
typeName: fieldSetMatch[1].trim(),
|
||||
fieldName: fieldSetMatch[2]?.trim() || '*'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,4 +156,41 @@ export function isMethodExcluded(typeName: string, methodName: string, exclusion
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export function isFieldExcluded(typeName: string, fieldName: string, exclusions: Exclusion[]): boolean {
|
||||
return exclusions.some(ex => {
|
||||
if (ex.kind === 'field' && ex.typeName === typeName && ex.fieldName === fieldName) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
export function isFieldGetterExcluded(typeName: string, fieldName: string, exclusions: Exclusion[]): boolean {
|
||||
return exclusions.some(ex => {
|
||||
if (ex.kind === 'field-get' && ex.typeName === typeName &&
|
||||
(ex.fieldName === fieldName || ex.fieldName === '*')) {
|
||||
return true;
|
||||
}
|
||||
// If the entire field is excluded, getter is also excluded
|
||||
if (ex.kind === 'field' && ex.typeName === typeName && ex.fieldName === fieldName) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
export function isFieldSetterExcluded(typeName: string, fieldName: string, exclusions: Exclusion[]): boolean {
|
||||
return exclusions.some(ex => {
|
||||
if (ex.kind === 'field-set' && ex.typeName === typeName &&
|
||||
(ex.fieldName === fieldName || ex.fieldName === '*')) {
|
||||
return true;
|
||||
}
|
||||
// If the entire field is excluded, setter is also excluded
|
||||
if (ex.kind === 'field' && ex.typeName === typeName && ex.fieldName === fieldName) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
@ -1,226 +1,30 @@
|
||||
#!/usr/bin/env node
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { Type, Member, SpineTypes, toSnakeCase, Exclusion, ClassOrStruct } from './types';
|
||||
import { loadExclusions, isTypeExcluded, isMethodExcluded } from './exclusions';
|
||||
import { ConstructorGenerator } from './generators/constructor-generator';
|
||||
import { MethodGenerator } from './generators/method-generator';
|
||||
import { EnumGenerator } from './generators/enum-generator';
|
||||
import { ArrayGenerator } from './generators/array-generator';
|
||||
import { FileWriter } from './file-writer';
|
||||
import { extractTypes, loadTypes } from './type-extractor';
|
||||
import { scanArraySpecializations } from './array-scanner';
|
||||
|
||||
/**
|
||||
* Checks for methods that have both const and non-const versions with different return types.
|
||||
* This is a problem for C bindings because C doesn't support function overloading.
|
||||
*
|
||||
* In C++, you can have:
|
||||
* T& getValue(); // for non-const objects
|
||||
* const T& getValue() const; // for const objects
|
||||
*
|
||||
* But in C, we can only have one function with a given name, so we need to detect
|
||||
* and report these conflicts.
|
||||
*
|
||||
* @param classes - Array of class/struct types to check
|
||||
* @param exclusions - Exclusion rules to skip specific methods
|
||||
* @returns Array of conflicts found, or exits if conflicts exist
|
||||
*/
|
||||
function checkConstNonConstConflicts(classes: ClassOrStruct[], exclusions: Exclusion[]): void {
|
||||
const conflicts: Array<{ type: string, method: string }> = [];
|
||||
|
||||
for (const type of classes) {
|
||||
if (type.members === undefined) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get all non-static methods first
|
||||
const allMethods = type.members?.filter(m => m.kind === 'method').filter(m => !m.isStatic);
|
||||
|
||||
if (allMethods) {
|
||||
const methodGroups = new Map<string, Array<Member & { kind: 'method' }>>();
|
||||
for (const method of allMethods) {
|
||||
if (method.name === 'getSetupPose') {
|
||||
console.log(`Skipping excluded method: ${type.name}::${method.name}${method.isConst ? ' const' : ''}`);
|
||||
}
|
||||
// Skip if this specific const/non-const version is excluded
|
||||
if (isMethodExcluded(type.name, method.name, exclusions, method)) {
|
||||
continue;
|
||||
}
|
||||
const key = method.name + '(' + (method.parameters?.map(p => p.type).join(',') || '') + ')';
|
||||
if (!methodGroups.has(key)) {
|
||||
methodGroups.set(key, []);
|
||||
}
|
||||
methodGroups.get(key)!.push(method);
|
||||
}
|
||||
|
||||
for (const [signature, group] of methodGroups) {
|
||||
if (group.length > 1) {
|
||||
const returnTypes = new Set(group.map(m => m.returnType));
|
||||
if (returnTypes.size > 1) {
|
||||
conflicts.push({ type: type.name, method: group[0].name });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we found conflicts, report them all and exit
|
||||
if (conflicts.length > 0) {
|
||||
console.error("\n" + "=".repeat(80));
|
||||
console.error("SUMMARY OF ALL CONST/NON-CONST METHOD CONFLICTS");
|
||||
console.error("=".repeat(80));
|
||||
console.error(`\nFound ${conflicts.length} method conflicts across the codebase:\n`);
|
||||
|
||||
for (const conflict of conflicts) {
|
||||
console.error(` - ${conflict.type}::${conflict.method}()`);
|
||||
}
|
||||
|
||||
console.error("\nThese methods have both const and non-const versions in C++ which cannot");
|
||||
console.error("be represented in the C API. You need to either:");
|
||||
console.error(" 1. Add these to exclusions.txt");
|
||||
console.error(" 2. Modify the C++ code to avoid const/non-const overloading");
|
||||
console.error("=".repeat(80) + "\n");
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for multi-level pointers in method signatures and errors if found
|
||||
*/
|
||||
function checkMultiLevelPointers(types: ClassOrStruct[]) {
|
||||
const errors: {type: string, member: string, signature: string}[] = [];
|
||||
|
||||
// Helper to check if a type has multi-level pointers
|
||||
function hasMultiLevelPointers(typeStr: string): boolean {
|
||||
// First check the outer type (after removing template content)
|
||||
let outerType = typeStr;
|
||||
|
||||
// Extract all template contents for separate checking
|
||||
const templateContents: string[] = [];
|
||||
let depth = 0;
|
||||
let templateStart = -1;
|
||||
|
||||
for (let i = 0; i < typeStr.length; i++) {
|
||||
if (typeStr[i] === '<') {
|
||||
if (depth === 0) {
|
||||
templateStart = i + 1;
|
||||
}
|
||||
depth++;
|
||||
} else if (typeStr[i] === '>') {
|
||||
depth--;
|
||||
if (depth === 0 && templateStart !== -1) {
|
||||
templateContents.push(typeStr.substring(templateStart, i));
|
||||
templateStart = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove all template content from outer type
|
||||
outerType = outerType.replace(/<[^>]+>/g, '<>');
|
||||
|
||||
// Check outer type for consecutive pointers
|
||||
if (/\*\s*\*/.test(outerType)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Recursively check template contents
|
||||
for (const content of templateContents) {
|
||||
if (hasMultiLevelPointers(content)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const type of types) {
|
||||
if (!type.members) continue;
|
||||
|
||||
for (const member of type.members) {
|
||||
if (member.kind === 'method') {
|
||||
// Check return type
|
||||
if (hasMultiLevelPointers(member.returnType)) {
|
||||
errors.push({
|
||||
type: type.name,
|
||||
member: member.name,
|
||||
signature: `return type: ${member.returnType}`
|
||||
});
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (member.parameters) {
|
||||
for (const param of member.parameters) {
|
||||
if (hasMultiLevelPointers(param.type)) {
|
||||
errors.push({
|
||||
type: type.name,
|
||||
member: member.name,
|
||||
signature: `parameter '${param.name}': ${param.type}`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (member.kind === 'field') {
|
||||
// Check field type
|
||||
if (hasMultiLevelPointers(member.type)) {
|
||||
errors.push({
|
||||
type: type.name,
|
||||
member: member.name,
|
||||
signature: `field type: ${member.type}`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we found multi-level pointers, report them and exit
|
||||
if (errors.length > 0) {
|
||||
console.error("\n" + "=".repeat(80));
|
||||
console.error("MULTI-LEVEL POINTER ERROR");
|
||||
console.error("=".repeat(80));
|
||||
console.error(`\nFound ${errors.length} multi-level pointer usage(s) which are not supported:\n`);
|
||||
|
||||
for (const error of errors) {
|
||||
console.error(` - ${error.type}::${error.member} - ${error.signature}`);
|
||||
}
|
||||
|
||||
console.error("\nMulti-level pointers (e.g., char**, void***) cannot be represented in the C API.");
|
||||
console.error("You need to either:");
|
||||
console.error(" 1. Refactor the C++ code to avoid multi-level pointers");
|
||||
console.error(" 2. Exclude these types/methods in exclusions.txt");
|
||||
console.error("=".repeat(80) + "\n");
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
import { CWriter } from './c-writer';
|
||||
import { checkConstNonConstConflicts, checkMultiLevelPointers, checkFieldAccessorConflicts, checkMethodTypeNameConflicts, checkValueReturns } from './checks';
|
||||
import { isTypeExcluded, loadExclusions } from './exclusions';
|
||||
import { generateArrays, generateTypes } from './ir-generator';
|
||||
import { extractTypes } from './type-extractor';
|
||||
import { ClassOrStruct } from './types';
|
||||
|
||||
async function main() {
|
||||
// Extract types if needed
|
||||
extractTypes();
|
||||
|
||||
console.log('Loading type information...');
|
||||
|
||||
// Load all necessary data
|
||||
const typesJson = loadTypes() as SpineTypes;
|
||||
// Load all exclusions
|
||||
const exclusions = loadExclusions(path.join(__dirname, '../exclusions.txt'));
|
||||
|
||||
// Flatten all types from all headers into a single array
|
||||
const allTypes: Type[] = [];
|
||||
for (const header of Object.keys(typesJson)) {
|
||||
allTypes.push(...typesJson[header]);
|
||||
}
|
||||
// Extract ALL types from spine-cpp first (needed for inheritance checking)
|
||||
const allExtractedTypes = extractTypes();
|
||||
allExtractedTypes.sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
// Create a map of all types for easy lookup
|
||||
const typeMap = new Map<string, Type>();
|
||||
for (const type of allTypes) {
|
||||
typeMap.set(type.name, type);
|
||||
}
|
||||
// Then filter out excluded and template types
|
||||
let arrayType: ClassOrStruct | undefined;
|
||||
const types = allExtractedTypes.filter(type => {
|
||||
// Store the Array type, needed for array specializations
|
||||
if (type.name === 'Array' && type.kind !== 'enum') {
|
||||
arrayType = type as ClassOrStruct;
|
||||
}
|
||||
|
||||
|
||||
// Filter types: only exclude templates and manually excluded types
|
||||
const includedTypes = allTypes.filter(type => {
|
||||
if (isTypeExcluded(type.name, exclusions)) {
|
||||
console.log(`Excluding type due to exclusions.txt: ${type.name}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -234,9 +38,13 @@ async function main() {
|
||||
return true;
|
||||
});
|
||||
|
||||
if (!arrayType) {
|
||||
throw new Error('Array type not found in types');
|
||||
}
|
||||
|
||||
// Separate classes and enums
|
||||
const classes = includedTypes.filter(t => t.kind !== "enum");
|
||||
const enums = includedTypes.filter(t => t.kind === 'enum');
|
||||
const classes = types.filter(t => t.kind !== "enum");
|
||||
const enums = types.filter(t => t.kind === 'enum');
|
||||
|
||||
console.log(`Found ${classes.length} classes/structs and ${enums.length} enums to generate`);
|
||||
|
||||
@ -246,76 +54,22 @@ async function main() {
|
||||
// Check for multi-level pointers
|
||||
checkMultiLevelPointers(classes);
|
||||
|
||||
// Create a set of valid type names for type checking
|
||||
const validTypes = new Set<string>(includedTypes.map(t => t.name));
|
||||
// Check for field accessor conflicts
|
||||
checkFieldAccessorConflicts(classes, exclusions);
|
||||
|
||||
// Initialize generators
|
||||
const constructorGen = new ConstructorGenerator(validTypes);
|
||||
const methodGen = new MethodGenerator(exclusions, validTypes);
|
||||
const enumGen = new EnumGenerator();
|
||||
const fileWriter = new FileWriter(path.join(__dirname, '../../src/generated'));
|
||||
// Check for method/type name conflicts
|
||||
checkMethodTypeNameConflicts(classes, allExtractedTypes, exclusions);
|
||||
|
||||
// Check for methods returning objects by value
|
||||
checkValueReturns(classes, allExtractedTypes, exclusions);
|
||||
|
||||
// Generate code for each type
|
||||
for (const type of classes) {
|
||||
console.log(`Generating ${type.name}...`);
|
||||
// Generate C intermediate representation for classes, enums and arrays
|
||||
const { cTypes, cEnums } = await generateTypes(types, exclusions, allExtractedTypes);
|
||||
const cArrayTypes = await generateArrays(types, arrayType, exclusions);
|
||||
|
||||
const headerContent: string[] = [];
|
||||
const sourceContent: string[] = [];
|
||||
|
||||
// Source includes
|
||||
sourceContent.push(`#include "${toSnakeCase(type.name)}.h"`);
|
||||
sourceContent.push('#include <spine/spine.h>');
|
||||
sourceContent.push('');
|
||||
sourceContent.push('using namespace spine;');
|
||||
sourceContent.push('');
|
||||
|
||||
// Opaque type is already in types.h, don't generate it here
|
||||
|
||||
// Generate constructors
|
||||
const constructors = constructorGen.generate(type);
|
||||
if (constructors.declarations.length > 0) {
|
||||
headerContent.push(...constructors.declarations);
|
||||
sourceContent.push(...constructors.implementations);
|
||||
}
|
||||
|
||||
// Generate methods
|
||||
const methods = methodGen.generate(type);
|
||||
if (methods.declarations.length > 0) {
|
||||
headerContent.push(...methods.declarations);
|
||||
sourceContent.push(...methods.implementations);
|
||||
}
|
||||
|
||||
// Write files
|
||||
await fileWriter.writeType(type.name, headerContent, sourceContent);
|
||||
}
|
||||
|
||||
// Generate enum files
|
||||
for (const enumType of enums) {
|
||||
console.log(`Generating enum ${enumType.name}...`);
|
||||
const enumCode = enumGen.generate(enumType);
|
||||
await fileWriter.writeEnum(enumType.name, enumCode);
|
||||
}
|
||||
|
||||
// Generate Array specializations
|
||||
console.log('\nScanning for Array specializations...');
|
||||
const arraySpecs = scanArraySpecializations(includedTypes);
|
||||
console.log(`Found ${arraySpecs.length} array specializations to generate`);
|
||||
|
||||
if (arraySpecs.length > 0) {
|
||||
console.log('\nGenerating arrays.h/arrays.cpp...');
|
||||
const arrayGen = new ArrayGenerator(typesJson);
|
||||
const { header, source } = arrayGen.generate(arraySpecs);
|
||||
|
||||
// Write arrays.h and arrays.cpp
|
||||
await fileWriter.writeArrays(header, source);
|
||||
}
|
||||
|
||||
// Generate types.h file (includes arrays.h)
|
||||
await fileWriter.writeTypesHeader(classes, enums);
|
||||
|
||||
// Generate main header file
|
||||
await fileWriter.writeMainHeader(classes, enums);
|
||||
// Write all files to disk
|
||||
const cWriter = new CWriter(path.join(__dirname, '../../src/generated'));
|
||||
await cWriter.writeAll(cTypes, cEnums, cArrayTypes);
|
||||
|
||||
console.log('Code generation complete!');
|
||||
}
|
||||
|
||||
916
spine-c-new/codegen/src/ir-generator.ts
Normal file
916
spine-c-new/codegen/src/ir-generator.ts
Normal file
@ -0,0 +1,916 @@
|
||||
import { ClassOrStruct, Enum, Member, Constructor, Method, Field, Destructor, Parameter, Type } from './types';
|
||||
import { CClassOrStruct, CEnum, CMethod, CParameter, CEnumValue } from './c-types';
|
||||
import { toSnakeCase, toCFunctionName, toCTypeName, isPrimitive, checkTypeSupport } from './types';
|
||||
import { Exclusion } from './types';
|
||||
import { ArraySpecialization } from './types';
|
||||
import { scanArraySpecializations } from './array-scanner';
|
||||
import { isFieldExcluded, isFieldGetterExcluded, isFieldSetterExcluded } from './exclusions';
|
||||
|
||||
/**
|
||||
* Checks if a type inherits from SpineObject (directly or indirectly)
|
||||
*/
|
||||
function inheritsFromSpineObject(type: ClassOrStruct, allTypes: Map<string, Type>): boolean {
|
||||
// Check direct inheritance
|
||||
if (type.superTypes?.includes('SpineObject')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check indirect inheritance through all supertypes
|
||||
if (type.superTypes) {
|
||||
for (const superTypeName of type.superTypes) {
|
||||
// Strip template parameters for lookup
|
||||
// e.g., "PosedDataGeneric<BoneLocal>" -> "PosedDataGeneric"
|
||||
const baseTypeName = superTypeName.split('<')[0].trim();
|
||||
|
||||
const superType = allTypes.get(baseTypeName);
|
||||
if (superType && superType.kind !== 'enum') {
|
||||
if (inheritsFromSpineObject(superType, allTypes)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function generateConstructors(type: ClassOrStruct, knownTypeNames: Set<string>, exclusions: Exclusion[], allTypes: Map<string, Type>): CMethod[] {
|
||||
const constructors: CMethod[] = [];
|
||||
const cTypeName = `spine_${toSnakeCase(type.name)}`;
|
||||
const cppTypeName = type.name;
|
||||
|
||||
// Abstract classes cannot be instantiated
|
||||
if (type.isAbstract) {
|
||||
console.log(` ${type.name} is abstract - no constructors generated`);
|
||||
return constructors;
|
||||
}
|
||||
|
||||
// Only generate constructors for classes that inherit from SpineObject
|
||||
// (they have the location-based operator new)
|
||||
if (!inheritsFromSpineObject(type, allTypes)) {
|
||||
console.log(` ${type.name} does not inherit from SpineObject - no constructors generated`);
|
||||
return constructors;
|
||||
}
|
||||
|
||||
// Find all constructors (we only have public members in the JSON)
|
||||
const ctorMembers = (type.members || [])
|
||||
.filter(m => m.kind === 'constructor') as Constructor[];
|
||||
|
||||
// Check if all constructors are excluded
|
||||
const allConstructorsExcluded = exclusions.some(e =>
|
||||
e.kind === 'method' &&
|
||||
e.typeName === type.name &&
|
||||
e.methodName === type.name // Constructor has same name as class
|
||||
);
|
||||
|
||||
if (allConstructorsExcluded) {
|
||||
// If all constructors are excluded, don't generate any
|
||||
console.log(` Excluding constructor: ${type.name}::${type.name}`);
|
||||
return constructors;
|
||||
}
|
||||
|
||||
// Only generate constructors that are explicitly defined as public
|
||||
// We cannot assume anything about implicit constructors since:
|
||||
// 1. For classes, the default constructor is private by default
|
||||
// 2. There might be a private/protected default constructor we don't know about
|
||||
// The type extractor only shows public members
|
||||
|
||||
// Check if this type has no public constructors
|
||||
if (ctorMembers.length === 0) {
|
||||
// Check if constructor is explicitly excluded
|
||||
const constructorExcluded = exclusions.some(e =>
|
||||
e.kind === 'method' &&
|
||||
e.typeName === type.name &&
|
||||
e.methodName === type.name
|
||||
);
|
||||
|
||||
if (constructorExcluded) {
|
||||
console.log(` No public constructors for ${type.name}, but constructor is excluded - type can be used but not created from C`);
|
||||
} else {
|
||||
console.error(`\nERROR: ${type.name} has no public constructors - it cannot be instantiated from C`);
|
||||
console.error(` You must either:`);
|
||||
console.error(` 1. Add a public constructor to the C++ class`);
|
||||
console.error(` 2. Add 'type: ${type.name}' to exclusions.txt to exclude the entire type`);
|
||||
console.error(` 3. Add 'method: ${type.name}::${type.name}' to exclusions.txt to allow the type but prevent creation`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Generate constructors for each constructor member
|
||||
let i = 1;
|
||||
for (const ctor of ctorMembers) {
|
||||
if (!ctor.parameters || ctor.parameters.length === 0) {
|
||||
// Default constructor
|
||||
constructors.push({
|
||||
name: `${cTypeName}_create`,
|
||||
returnType: cTypeName,
|
||||
parameters: [],
|
||||
body: `return (${cTypeName}) new (__FILE__, __LINE__) ${cppTypeName}();`
|
||||
});
|
||||
} else {
|
||||
// Parameterized constructor
|
||||
const cParams = convertParameters(ctor.parameters, knownTypeNames);
|
||||
const suffix = i == 1 ? "": i;
|
||||
|
||||
// Build the C++ constructor call
|
||||
const cppArgs = buildCppArgs(ctor.parameters, cParams, knownTypeNames);
|
||||
|
||||
constructors.push({
|
||||
name: `${cTypeName}_create${suffix}`,
|
||||
returnType: cTypeName,
|
||||
parameters: cParams,
|
||||
body: `return (${cTypeName}) new (__FILE__, __LINE__) ${cppTypeName}(${cppArgs});`
|
||||
});
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return constructors;
|
||||
}
|
||||
|
||||
export function generateDestructor(type: ClassOrStruct): CMethod {
|
||||
const cTypeName = `spine_${toSnakeCase(type.name)}`;
|
||||
const cppTypeName = type.name;
|
||||
|
||||
return {
|
||||
name: `${cTypeName}_dispose`,
|
||||
returnType: 'void',
|
||||
parameters: [{
|
||||
name: 'self',
|
||||
cType: cTypeName,
|
||||
cppType: `${cppTypeName}*`,
|
||||
isOutput: false
|
||||
}],
|
||||
body: `delete (${cppTypeName}*)self;`
|
||||
};
|
||||
}
|
||||
|
||||
export function generateMethods(type: ClassOrStruct, knownTypeNames: Set<string>, exclusions: Exclusion[]): CMethod[] {
|
||||
const methods: CMethod[] = [];
|
||||
const cTypeName = `spine_${toSnakeCase(type.name)}`;
|
||||
const cppTypeName = type.name;
|
||||
|
||||
// Get all methods (we only have public members in the JSON)
|
||||
const methodMembers = (type.members || [])
|
||||
.filter(m => m.kind === 'method') as Method[];
|
||||
|
||||
// Check if this class has getRTTI method
|
||||
const hasGetRTTI = methodMembers.some(m => m.name === 'getRTTI');
|
||||
|
||||
// Group methods by name to detect overloads
|
||||
const methodsByName = new Map<string, Method[]>();
|
||||
for (const method of methodMembers) {
|
||||
// Skip excluded methods and operators
|
||||
if (isMethodExcluded(type.name, method, exclusions)) {
|
||||
console.log(` Excluding method: ${type.name}::${method.name}${method.isConst ? ' const' : ''}`);
|
||||
continue;
|
||||
}
|
||||
if (method.name.startsWith('operator')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const methods = methodsByName.get(method.name) || [];
|
||||
methods.push(method);
|
||||
methodsByName.set(method.name, methods);
|
||||
}
|
||||
|
||||
// Generate methods with appropriate suffixes for overloads
|
||||
for (const [methodName, methodOverloads] of methodsByName) {
|
||||
// Special handling for methods named "create" to avoid conflicts with constructors
|
||||
const isCreateMethod = methodName === 'create';
|
||||
|
||||
if (methodOverloads.length === 1 && !isCreateMethod) {
|
||||
// No overloads and not a create method, use standard name
|
||||
const cMethod = generateMethod(type, methodOverloads[0], cTypeName, cppTypeName, knownTypeNames);
|
||||
if (cMethod) {
|
||||
methods.push(cMethod);
|
||||
}
|
||||
} else {
|
||||
// Multiple overloads OR create method, add parameter-based suffix
|
||||
let i = 1;
|
||||
for (const method of methodOverloads) {
|
||||
// For create methods, always add suffix to avoid constructor conflicts
|
||||
// For overloads, we need to include type information in the suffix
|
||||
const suffix = isCreateMethod ? `method` : i;
|
||||
i++;
|
||||
|
||||
const baseCMethodName = toCFunctionName(type.name, method.name);
|
||||
const cMethodName = `${baseCMethodName}_${suffix}`;
|
||||
|
||||
const cMethod = generateMethod(type, method, cTypeName, cppTypeName, knownTypeNames, cMethodName);
|
||||
if (cMethod) {
|
||||
methods.push(cMethod);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If class has getRTTI, also add static rtti method
|
||||
if (hasGetRTTI) {
|
||||
methods.push({
|
||||
name: `${cTypeName}_rtti`,
|
||||
returnType: 'spine_rtti',
|
||||
parameters: [],
|
||||
body: `return (spine_rtti)&${cppTypeName}::rtti;`
|
||||
});
|
||||
}
|
||||
|
||||
return methods;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate getter and setter methods for public fields
|
||||
*/
|
||||
export function generateFieldAccessors(type: ClassOrStruct, knownTypeNames: Set<string>, exclusions: Exclusion[]): CMethod[] {
|
||||
const methods: CMethod[] = [];
|
||||
const cTypeName = `spine_${toSnakeCase(type.name)}`;
|
||||
const cppTypeName = type.name;
|
||||
|
||||
// Get all non-static fields (we only have public members in the JSON)
|
||||
const fieldMembers = (type.members || [])
|
||||
.filter(m => m.kind === 'field' && !m.isStatic) as Field[];
|
||||
|
||||
for (const field of fieldMembers) {
|
||||
// Check if entire field is excluded
|
||||
if (isFieldExcluded(type.name, field.name, exclusions)) {
|
||||
console.log(` Excluding field: ${type.name}::${field.name}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if field type is supported
|
||||
const typeError = checkTypeSupport(field.type, knownTypeNames);
|
||||
if (typeError) {
|
||||
console.warn(` Skipping field ${type.name}::${field.name}: ${typeError}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const fieldNameSnake = toSnakeCase(field.name);
|
||||
|
||||
// Generate getter
|
||||
if (!isFieldGetterExcluded(type.name, field.name, exclusions)) {
|
||||
try {
|
||||
const cReturnType = toCTypeName(field.type, knownTypeNames);
|
||||
const getterName = `${cTypeName}_get_${fieldNameSnake}`;
|
||||
|
||||
methods.push({
|
||||
name: getterName,
|
||||
returnType: cReturnType,
|
||||
parameters: [{
|
||||
name: 'self',
|
||||
cType: cTypeName,
|
||||
cppType: `${cppTypeName}*`,
|
||||
isOutput: false
|
||||
}],
|
||||
body: generateFieldGetterBody(field, cppTypeName, knownTypeNames)
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn(` Skipping getter for field ${type.name}::${field.name}: ${e}`);
|
||||
}
|
||||
} else {
|
||||
console.log(` Excluding field getter: ${type.name}::${field.name}`);
|
||||
}
|
||||
|
||||
// Generate setter (only for non-const, non-reference types)
|
||||
if (!field.type.includes('const') && !field.type.endsWith('&') && !isFieldSetterExcluded(type.name, field.name, exclusions)) {
|
||||
try {
|
||||
const cParamType = toCTypeName(field.type, knownTypeNames);
|
||||
const setterName = `${cTypeName}_set_${fieldNameSnake}`;
|
||||
|
||||
methods.push({
|
||||
name: setterName,
|
||||
returnType: 'void',
|
||||
parameters: [
|
||||
{
|
||||
name: 'self',
|
||||
cType: cTypeName,
|
||||
cppType: `${cppTypeName}*`,
|
||||
isOutput: false
|
||||
},
|
||||
{
|
||||
name: 'value',
|
||||
cType: cParamType,
|
||||
cppType: field.type,
|
||||
isOutput: false
|
||||
}
|
||||
],
|
||||
body: generateFieldSetterBody(field, cppTypeName, knownTypeNames)
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn(` Skipping setter for field ${type.name}::${field.name}: ${e}`);
|
||||
}
|
||||
} else if (isFieldSetterExcluded(type.name, field.name, exclusions)) {
|
||||
console.log(` Excluding field setter: ${type.name}::${field.name}`);
|
||||
}
|
||||
}
|
||||
|
||||
return methods;
|
||||
}
|
||||
|
||||
function generateFieldGetterBody(field: Field, cppTypeName: string, knownTypeNames: Set<string>): string {
|
||||
const fieldAccess = `((${cppTypeName}*)self)->${field.name}`;
|
||||
|
||||
// Handle String fields
|
||||
if (field.type === 'String' || field.type === 'const String' || field.type === 'const String&') {
|
||||
return `return ${fieldAccess}.buffer();`;
|
||||
}
|
||||
|
||||
// Handle reference types
|
||||
if (field.type.endsWith('&')) {
|
||||
const baseType = field.type.slice(0, -1).trim();
|
||||
const cType = toCTypeName(baseType, knownTypeNames);
|
||||
|
||||
if (isPrimitive(baseType)) {
|
||||
return `return ${fieldAccess};`;
|
||||
}
|
||||
|
||||
return `return (${cType})&${fieldAccess};`;
|
||||
}
|
||||
|
||||
// Handle pointer types
|
||||
if (field.type.endsWith('*')) {
|
||||
const baseType = field.type.slice(0, -1).trim();
|
||||
|
||||
if (isPrimitive(baseType)) {
|
||||
return `return ${fieldAccess};`;
|
||||
}
|
||||
|
||||
const cType = toCTypeName(field.type, knownTypeNames);
|
||||
return `return (${cType})${fieldAccess};`;
|
||||
}
|
||||
|
||||
// Handle enum types
|
||||
if (knownTypeNames.has(field.type)) {
|
||||
const cType = toCTypeName(field.type, knownTypeNames);
|
||||
return `return (${cType})${fieldAccess};`;
|
||||
}
|
||||
|
||||
// Handle primitive types
|
||||
if (isPrimitive(field.type)) {
|
||||
return `return ${fieldAccess};`;
|
||||
}
|
||||
|
||||
// Handle non-primitive value types (need to return address)
|
||||
const cType = toCTypeName(field.type, knownTypeNames);
|
||||
return `return (${cType})&${fieldAccess};`;
|
||||
}
|
||||
|
||||
function generateFieldSetterBody(field: Field, cppTypeName: string, knownTypeNames: Set<string>): string {
|
||||
const fieldAccess = `((${cppTypeName}*)self)->${field.name}`;
|
||||
|
||||
// Handle String fields
|
||||
if (field.type === 'String') {
|
||||
return `${fieldAccess} = String(value);`;
|
||||
}
|
||||
|
||||
// Handle Array types
|
||||
if (field.type.startsWith('Array<')) {
|
||||
const arrayMatch = field.type.match(/^Array<(.+?)>$/);
|
||||
if (arrayMatch) {
|
||||
const elementType = arrayMatch[1];
|
||||
return `${fieldAccess} = *((Array<${elementType}>*)value);`;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle enum types
|
||||
if (knownTypeNames.has(field.type)) {
|
||||
return `${fieldAccess} = (${field.type})value;`;
|
||||
}
|
||||
|
||||
// Handle pointer types (cast back from opaque type)
|
||||
if (field.type.endsWith('*') && !isPrimitive(field.type)) {
|
||||
const baseType = field.type.slice(0, -1).trim();
|
||||
return `${fieldAccess} = (${baseType}*)value;`;
|
||||
}
|
||||
|
||||
// Handle everything else
|
||||
return `${fieldAccess} = value;`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate CClassOrStruct for an array specialization
|
||||
*/
|
||||
export function generateArrayType(spec: ArraySpecialization, arrayType: ClassOrStruct, knownTypeNames: Set<string>): CClassOrStruct {
|
||||
const cTypeName = spec.cTypeName;
|
||||
|
||||
// Generate array constructors
|
||||
const constructors = [
|
||||
{
|
||||
name: `${cTypeName}_create`,
|
||||
returnType: cTypeName,
|
||||
parameters: [],
|
||||
body: `return (${cTypeName}) new (__FILE__, __LINE__) Array<${spec.elementType}>();`
|
||||
},
|
||||
{
|
||||
name: `${cTypeName}_create_with_capacity`,
|
||||
returnType: cTypeName,
|
||||
parameters: [{
|
||||
name: 'initialCapacity',
|
||||
cType: 'size_t',
|
||||
cppType: 'size_t',
|
||||
isOutput: false
|
||||
}],
|
||||
body: `return (${cTypeName}) new (__FILE__, __LINE__) Array<${spec.elementType}>(initialCapacity);`
|
||||
}
|
||||
];
|
||||
|
||||
// Generate destructor
|
||||
const destructor = {
|
||||
name: `${cTypeName}_dispose`,
|
||||
returnType: 'void',
|
||||
parameters: [{
|
||||
name: 'array',
|
||||
cType: cTypeName,
|
||||
cppType: `Array<${spec.elementType}>*`,
|
||||
isOutput: false
|
||||
}],
|
||||
body: `delete (Array<${spec.elementType}>*)array;`
|
||||
};
|
||||
|
||||
// Generate array methods
|
||||
const methods = generateArrayMethods(spec.elementType, cTypeName, arrayType, knownTypeNames);
|
||||
|
||||
return {
|
||||
name: cTypeName,
|
||||
cppType: arrayType,
|
||||
constructors,
|
||||
destructor,
|
||||
methods
|
||||
};
|
||||
}
|
||||
|
||||
export function generateArrayMethods(elementType: string, cTypeName: string, arrayType: ClassOrStruct, knownTypeNames: Set<string>): CMethod[] {
|
||||
const methods: CMethod[] = [];
|
||||
const cppElementType = elementType;
|
||||
const cElementType = toCTypeName(elementType, knownTypeNames);
|
||||
|
||||
// Generate array-specific methods
|
||||
const arrayMethods = (arrayType.members || []).filter(m => m.kind === 'method') as Method[];
|
||||
|
||||
for (const method of arrayMethods) {
|
||||
// Skip constructors/destructors (handled separately)
|
||||
if (method.name === 'Array' || method.name === '~Array') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip operator overloads
|
||||
if (method.name.startsWith('operator')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Replace template parameter T with actual element type
|
||||
const specializedMethod = specializeArrayMethod(method, cppElementType);
|
||||
|
||||
const cMethod = generateArrayMethod(cTypeName, specializedMethod, cppElementType, cElementType, knownTypeNames);
|
||||
if (cMethod) {
|
||||
methods.push(cMethod);
|
||||
}
|
||||
}
|
||||
|
||||
return methods;
|
||||
}
|
||||
|
||||
export function generateEnum(enumType: Enum): CEnum {
|
||||
const cEnumName = `spine_${toSnakeCase(enumType.name)}`;
|
||||
const enumNameUpper = toSnakeCase(enumType.name).toUpperCase();
|
||||
const values: CEnumValue[] = [];
|
||||
|
||||
for (const value of enumType.values) {
|
||||
// Convert value name to snake case
|
||||
let valueNameSnake = toSnakeCase(value.name).toUpperCase();
|
||||
|
||||
// Remove redundant prefix if the value name starts with the enum name
|
||||
// e.g., for TextureFilter::TextureFilter_Nearest, remove the "TextureFilter_" prefix
|
||||
const enumNameCamelCase = enumType.name.toUpperCase();
|
||||
if (value.name.toUpperCase().startsWith(enumNameCamelCase)) {
|
||||
let withoutPrefix = value.name.slice(enumType.name.length);
|
||||
// Also strip leading underscore if present
|
||||
if (withoutPrefix.startsWith('_')) {
|
||||
withoutPrefix = withoutPrefix.slice(1);
|
||||
}
|
||||
// Only use the stripped version if it's not empty
|
||||
if (withoutPrefix.length > 0) {
|
||||
valueNameSnake = toSnakeCase(withoutPrefix).toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
values.push({
|
||||
name: `SPINE_${enumNameUpper}_${valueNameSnake}`,
|
||||
value: value.value
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
name: cEnumName,
|
||||
cppType: enumType,
|
||||
values
|
||||
};
|
||||
}
|
||||
|
||||
// Helper functions
|
||||
|
||||
function convertParameters(params: Parameter[], knownTypeNames: Set<string>): CParameter[] {
|
||||
const cParams: CParameter[] = [];
|
||||
|
||||
for (const param of params) {
|
||||
const cType = toCTypeName(param.type, knownTypeNames);
|
||||
const isOutput = isOutputParameter(param.type);
|
||||
|
||||
cParams.push({
|
||||
name: param.name,
|
||||
cType,
|
||||
cppType: param.type,
|
||||
isOutput
|
||||
});
|
||||
}
|
||||
|
||||
return cParams;
|
||||
}
|
||||
|
||||
function isOutputParameter(cppType: string): boolean {
|
||||
// Non-const references to primitives become output parameters
|
||||
const refMatch = cppType.match(/^((?:const\s+)?(.+?))\s*&$/);
|
||||
if (refMatch) {
|
||||
const fullBaseType = refMatch[1].trim();
|
||||
const baseType = refMatch[2].trim();
|
||||
const isConst = fullBaseType.startsWith('const ');
|
||||
|
||||
return !isConst && isPrimitive(baseType);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function generateParameterSuffix(params: CParameter[]): string {
|
||||
if (params.length === 0) return '';
|
||||
return params.map(p => toSnakeCase(p.name)).join('_');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a parameter suffix that includes type information for overloaded methods.
|
||||
* This ensures unique function names when methods have the same parameter names but different types.
|
||||
*/
|
||||
function generateParameterSuffixWithTypes(params: CParameter[], knownTypeNames: Set<string>): string {
|
||||
if (params.length === 0) return '';
|
||||
|
||||
return params.map(p => {
|
||||
const paramName = toSnakeCase(p.name);
|
||||
|
||||
// For pointer types that differ (e.g., float* vs spine_array_float), include type info
|
||||
if (p.cType.includes('spine_array_')) {
|
||||
// Extract the array element type
|
||||
const arrayType = p.cType.replace('spine_array_', 'array_');
|
||||
return `${paramName}_${arrayType}`;
|
||||
} else if (p.cType.endsWith('*') && isPrimitive(p.cType.slice(0, -1).trim())) {
|
||||
// For primitive pointers like float*, int*
|
||||
const baseType = p.cType.slice(0, -1).trim();
|
||||
return `${paramName}_${baseType}_ptr`;
|
||||
}
|
||||
|
||||
// For other parameters, just use the name
|
||||
return paramName;
|
||||
}).join('_');
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a C parameter to its C++ argument form for function calls.
|
||||
* Handles type conversions, casts, and dereferencing as needed.
|
||||
*/
|
||||
function convertArgumentToCpp(cppType: string, cParamName: string, isOutput: boolean, knownTypeNames: Set<string>): string {
|
||||
// Handle String parameters
|
||||
if (cppType === 'const String&' || cppType === 'String') {
|
||||
return `String(${cParamName})`;
|
||||
}
|
||||
|
||||
// Handle pointer parameters (need to cast from opaque type)
|
||||
if (cppType.endsWith('*')) {
|
||||
const baseType = cppType.slice(0, -1).trim();
|
||||
if (!isPrimitive(baseType)) {
|
||||
// Cast from opaque C type to C++ type
|
||||
return `(${cppType})${cParamName}`;
|
||||
} else {
|
||||
return cParamName;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle reference parameters
|
||||
if (cppType.endsWith('&')) {
|
||||
const baseType = cppType.slice(0, -1).trim();
|
||||
|
||||
// Non-const primitive refs are output parameters
|
||||
if (isOutput) {
|
||||
return `*${cParamName}`;
|
||||
}
|
||||
|
||||
// For T const& where T is a pointer type (e.g., Animation* const&)
|
||||
if (baseType.endsWith(' const')) {
|
||||
// Remove const to get the actual type
|
||||
const actualType = baseType.slice(0, -6).trim(); // Remove ' const'
|
||||
if (actualType.endsWith('*')) {
|
||||
// It's a pointer, just cast and use directly
|
||||
return `(${actualType})${cParamName}`;
|
||||
}
|
||||
}
|
||||
|
||||
// Class references need to dereference the pointer
|
||||
if (!isPrimitive(baseType)) {
|
||||
return `*((${baseType}*)${cParamName})`;
|
||||
}
|
||||
|
||||
// Const primitive refs
|
||||
return cParamName;
|
||||
}
|
||||
|
||||
// Handle enum parameters
|
||||
if (cppType.match(/^(?:const\s+)?([A-Z]\w+)(?:\s*&)?$/) && knownTypeNames.has(cppType.replace(/^const\s+/, '').replace(/\s*&$/, ''))) {
|
||||
const enumType = cppType.replace(/^const\s+/, '').replace(/\s*&$/, '');
|
||||
return `(${enumType})${cParamName}`;
|
||||
}
|
||||
|
||||
// Handle everything else
|
||||
return cParamName;
|
||||
}
|
||||
|
||||
function buildCppArgs(cppParams: Parameter[], cParams: CParameter[], knownTypeNames: Set<string>): string {
|
||||
const args: string[] = [];
|
||||
|
||||
for (let i = 0; i < cppParams.length; i++) {
|
||||
const cppParam = cppParams[i];
|
||||
const cParam = cParams[i];
|
||||
args.push(convertArgumentToCpp(cppParam.type, cParam.name, cParam.isOutput, knownTypeNames));
|
||||
}
|
||||
|
||||
return args.join(', ');
|
||||
}
|
||||
|
||||
function generateMethod(type: ClassOrStruct, method: Method, cTypeName: string, cppTypeName: string, knownTypeNames: Set<string>, customMethodName?: string): CMethod | null {
|
||||
try {
|
||||
const cReturnType = toCTypeName(method.returnType, knownTypeNames);
|
||||
const cMethodName = customMethodName || toCFunctionName(type.name, method.name);
|
||||
|
||||
// Convert parameters
|
||||
const cParams: CParameter[] = [];
|
||||
|
||||
// Add self parameter for non-static methods
|
||||
if (!method.isStatic) {
|
||||
cParams.push({
|
||||
name: 'self',
|
||||
cType: cTypeName,
|
||||
cppType: `${cppTypeName}*`,
|
||||
isOutput: false
|
||||
});
|
||||
}
|
||||
|
||||
// Add method parameters
|
||||
if (method.parameters) {
|
||||
cParams.push(...convertParameters(method.parameters, knownTypeNames));
|
||||
}
|
||||
|
||||
// Generate method body
|
||||
let methodCall: string;
|
||||
if (method.isStatic) {
|
||||
methodCall = `${cppTypeName}::${method.name}(${buildCppArgs(method.parameters || [], cParams, knownTypeNames)})`;
|
||||
} else if (method.fromSupertype) {
|
||||
// For inherited methods that may be hidden by derived class methods with same name,
|
||||
// explicitly call the base class version
|
||||
methodCall = `((${method.fromSupertype}*)(${cppTypeName}*)self)->${method.name}(${buildCppArgs(method.parameters || [], cParams.slice(1), knownTypeNames)})`;
|
||||
} else {
|
||||
methodCall = `((${cppTypeName}*)self)->${method.name}(${buildCppArgs(method.parameters || [], cParams.slice(1), knownTypeNames)})`;
|
||||
}
|
||||
const body = generateReturnStatement(method.returnType, methodCall, knownTypeNames);
|
||||
|
||||
return {
|
||||
name: cMethodName,
|
||||
returnType: cReturnType,
|
||||
parameters: cParams,
|
||||
body
|
||||
};
|
||||
} catch (e) {
|
||||
console.warn(`Skipping method ${type.name}::${method.name}: ${e}`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the return statement for a method based on its return type.
|
||||
* Handles type conversions, casts, and special cases like String and references.
|
||||
*/
|
||||
function generateReturnStatement(returnType: string, methodCall: string, knownTypeNames: Set<string>,
|
||||
elementType?: string, cElementType?: string): string {
|
||||
const isVoid = returnType === 'void';
|
||||
|
||||
// Handle void returns
|
||||
if (isVoid) {
|
||||
return `${methodCall};`;
|
||||
}
|
||||
|
||||
// Handle String returns
|
||||
if (returnType === 'String' || returnType === 'const String' || returnType === 'const String&') {
|
||||
return `return ${methodCall}.buffer();`;
|
||||
}
|
||||
|
||||
// Handle element type returns (for array methods)
|
||||
if (elementType && returnType === elementType) {
|
||||
if (elementType.endsWith('*') && !isPrimitive(elementType)) {
|
||||
return `return (${cElementType})${methodCall};`;
|
||||
}
|
||||
return `return ${methodCall};`;
|
||||
}
|
||||
|
||||
// Handle reference returns
|
||||
if (returnType.endsWith('&')) {
|
||||
const baseType = returnType.slice(0, -1).trim();
|
||||
|
||||
// Handle element type references (for array methods)
|
||||
if (elementType && returnType === `${elementType}&`) {
|
||||
if (elementType.endsWith('*') && !isPrimitive(elementType)) {
|
||||
return `return (${cElementType})&${methodCall};`;
|
||||
}
|
||||
return `return &${methodCall};`;
|
||||
}
|
||||
|
||||
const cType = toCTypeName(baseType, knownTypeNames);
|
||||
|
||||
// For primitive references, return the value
|
||||
if (isPrimitive(baseType)) {
|
||||
return `return ${methodCall};`;
|
||||
}
|
||||
|
||||
// For class references, return the address cast to opaque type
|
||||
return `return (${cType})&${methodCall};`;
|
||||
}
|
||||
|
||||
// Handle pointer returns
|
||||
if (returnType.endsWith('*')) {
|
||||
const baseType = returnType.slice(0, -1).trim();
|
||||
|
||||
// Primitive pointers pass through
|
||||
if (isPrimitive(baseType)) {
|
||||
return `return ${methodCall};`;
|
||||
}
|
||||
|
||||
// Class pointers need cast
|
||||
const cType = toCTypeName(returnType, knownTypeNames);
|
||||
return `return (${cType})${methodCall};`;
|
||||
}
|
||||
|
||||
// Handle enum returns
|
||||
if (knownTypeNames.has(returnType)) {
|
||||
const cType = toCTypeName(returnType, knownTypeNames);
|
||||
return `return (${cType})${methodCall};`;
|
||||
}
|
||||
|
||||
// Handle primitive returns
|
||||
return `return ${methodCall};`;
|
||||
}
|
||||
|
||||
function specializeArrayMethod(method: Method, cppElementType: string): Method {
|
||||
// Helper to replace T with the actual element type, handling const correctly
|
||||
const replaceT = (type: string): string => {
|
||||
// For const T&, if T is a pointer, we need T const& not const T&
|
||||
if (type === 'const T &' && cppElementType.endsWith('*')) {
|
||||
return `${cppElementType} const &`;
|
||||
}
|
||||
// For const T*, if T is a pointer, keep it as is
|
||||
if (type === 'const T *' && cppElementType.endsWith('*')) {
|
||||
return `${cppElementType} const *`;
|
||||
}
|
||||
// Otherwise do simple replacement
|
||||
return type.replace(/\bT\b/g, cppElementType);
|
||||
};
|
||||
|
||||
const specializedReturnType = replaceT(method.returnType);
|
||||
const specializedParams = method.parameters?.map(p => ({
|
||||
...p,
|
||||
type: replaceT(p.type)
|
||||
}));
|
||||
|
||||
return {
|
||||
...method,
|
||||
returnType: specializedReturnType,
|
||||
parameters: specializedParams
|
||||
};
|
||||
}
|
||||
|
||||
function generateArrayMethod(cTypeName: string, method: Method, cppElementType: string, cElementType: string, knownTypeNames: Set<string>): CMethod | null {
|
||||
try {
|
||||
const cReturnType = toCTypeName(method.returnType, knownTypeNames);
|
||||
const cMethodName = `${cTypeName}_${toSnakeCase(method.name)}`;
|
||||
|
||||
// Convert parameters
|
||||
const cParams: CParameter[] = [];
|
||||
|
||||
// Add self parameter
|
||||
cParams.push({
|
||||
name: 'array',
|
||||
cType: cTypeName,
|
||||
cppType: `Array<${cppElementType}>*`,
|
||||
isOutput: false
|
||||
});
|
||||
|
||||
// Add method parameters
|
||||
if (method.parameters) {
|
||||
cParams.push(...convertParameters(method.parameters, knownTypeNames));
|
||||
}
|
||||
|
||||
// Generate method body for array
|
||||
const body = generateArrayMethodBody(method, cppElementType, cElementType, knownTypeNames);
|
||||
|
||||
return {
|
||||
name: cMethodName,
|
||||
returnType: cReturnType,
|
||||
parameters: cParams,
|
||||
body
|
||||
};
|
||||
} catch (e) {
|
||||
console.warn(`Skipping array method ${method.name}: ${e}`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function generateArrayMethodBody(method: Method, cppElementType: string, cElementType: string, knownTypeNames: Set<string>): string {
|
||||
const self = `((Array<${cppElementType}>*)array)->`;
|
||||
|
||||
// Build method call arguments using shared function
|
||||
const cppArgs = method.parameters ?
|
||||
buildCppArgs(method.parameters, convertParameters(method.parameters, knownTypeNames), knownTypeNames) :
|
||||
'';
|
||||
|
||||
const methodCall = `${self}${method.name}(${cppArgs})`;
|
||||
|
||||
// Use shared return value handling
|
||||
return generateReturnStatement(method.returnType, methodCall, knownTypeNames, cppElementType, cElementType);
|
||||
}
|
||||
|
||||
function isMethodExcluded(typeName: string, method: Method, exclusions: Exclusion[]): boolean {
|
||||
for (const exclusion of exclusions) {
|
||||
if (exclusion.kind === 'method' &&
|
||||
exclusion.typeName === typeName &&
|
||||
exclusion.methodName === method.name) {
|
||||
// If isConst is specified, it must match
|
||||
if (exclusion.isConst !== undefined) {
|
||||
return exclusion.isConst === method.isConst;
|
||||
}
|
||||
// Otherwise, exclude all overloads
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function generateTypes(types: Type[], exclusions: Exclusion[], allExtractedTypes: Type[]): Promise<{ cTypes: CClassOrStruct[], cEnums: CEnum[] }> {
|
||||
const knownTypeNames = new Set<string>(types.map(t => t.name));
|
||||
const allTypesMap = new Map<string, Type>(allExtractedTypes.map(t => [t.name, t]));
|
||||
|
||||
// Generate C intermediate representation for classes/structs
|
||||
const cTypes: CClassOrStruct[] = [];
|
||||
for (const type of types.filter(t => t.kind !== 'enum')) {
|
||||
console.log(`Generating ${type.name}...`);
|
||||
|
||||
// Generate IR
|
||||
const constructors = generateConstructors(type, knownTypeNames, exclusions, allTypesMap);
|
||||
const destructor = generateDestructor(type);
|
||||
const methods = generateMethods(type, knownTypeNames, exclusions);
|
||||
const fieldAccessors = generateFieldAccessors(type, knownTypeNames, exclusions);
|
||||
|
||||
// Combine all methods
|
||||
const allMethods = [...methods, ...fieldAccessors];
|
||||
|
||||
const cType: CClassOrStruct = {
|
||||
name: `spine_${toSnakeCase(type.name)}`,
|
||||
cppType: type,
|
||||
constructors,
|
||||
destructor,
|
||||
methods: allMethods
|
||||
};
|
||||
|
||||
cTypes.push(cType);
|
||||
}
|
||||
|
||||
// Generate C intermediate representation for enums
|
||||
const cEnums: CEnum[] = [];
|
||||
for (const enumType of types.filter(t => t.kind === 'enum')) {
|
||||
console.log(`Generating enum ${enumType.name}...`);
|
||||
|
||||
const cEnum = generateEnum(enumType);
|
||||
cEnums.push(cEnum);
|
||||
}
|
||||
|
||||
return { cTypes, cEnums };
|
||||
}
|
||||
|
||||
export function generateArrays(types: Type[], arrayType: ClassOrStruct, exclusions: Exclusion[]): CClassOrStruct[] {
|
||||
const knownTypeNames = new Set<string>(types.map(t => t.name));
|
||||
|
||||
// Generate Array specializations
|
||||
console.log('\nScanning for Array specializations...');
|
||||
const arraySpecializations = scanArraySpecializations(types, exclusions);
|
||||
console.log(`Found ${arraySpecializations.length} array specializations to generate`);
|
||||
|
||||
// Generate array types
|
||||
const cArrayTypes: CClassOrStruct[] = [];
|
||||
for (const arraySpecialization of arraySpecializations) {
|
||||
const arrayIR = generateArrayType(arraySpecialization, arrayType, knownTypeNames);
|
||||
cArrayTypes.push(arrayIR);
|
||||
}
|
||||
return cArrayTypes;
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { execSync } from 'child_process';
|
||||
import { Type, Member, Method, Field, Constructor, Destructor, Parameter, EnumValue, SpineTypes, ClassOrStruct, Enum } from './types';
|
||||
import { Type, Member, Method, Field, Constructor, Destructor, Parameter, EnumValue, ClassOrStruct, Enum } from './types';
|
||||
|
||||
const SPINE_CPP_PATH = path.join(__dirname, '../../../spine-cpp');
|
||||
const SPINE_INCLUDE_DIR = path.join(SPINE_CPP_PATH, 'spine-cpp/include');
|
||||
@ -98,16 +98,17 @@ function isInTargetFile(node: any, targetPath: string): boolean {
|
||||
/**
|
||||
* Extracts member information from an AST node
|
||||
*/
|
||||
function extractMember(inner: any, parent: any): Member | null {
|
||||
function extractMember(inner: any, parent: any): Member & { access?: 'public' | 'protected' } | null {
|
||||
if (inner.isImplicit) return null;
|
||||
|
||||
switch (inner.kind) {
|
||||
case 'FieldDecl':
|
||||
const field: Field = {
|
||||
const field: Field & { access?: 'public' | 'protected' } = {
|
||||
kind: 'field',
|
||||
name: inner.name || '',
|
||||
type: inner.type?.qualType || '',
|
||||
isStatic: inner.storageClass === 'static'
|
||||
isStatic: inner.storageClass === 'static',
|
||||
access: 'public' // Will be set correctly later
|
||||
};
|
||||
return field;
|
||||
|
||||
@ -116,7 +117,7 @@ function extractMember(inner: any, parent: any): Member | null {
|
||||
// Skip operators - not needed for C wrapper generation
|
||||
if (inner.name.startsWith('operator')) return null;
|
||||
|
||||
const method: Method = {
|
||||
const method: Method & { access?: 'public' | 'protected' } = {
|
||||
kind: 'method',
|
||||
name: inner.name,
|
||||
returnType: extractReturnType(inner),
|
||||
@ -124,25 +125,28 @@ function extractMember(inner: any, parent: any): Member | null {
|
||||
isStatic: inner.storageClass === 'static',
|
||||
isVirtual: inner.virtual || false,
|
||||
isPure: inner.pure || false,
|
||||
isConst: inner.constQualifier || false
|
||||
isConst: inner.constQualifier || false,
|
||||
access: 'public' // Will be set correctly later
|
||||
};
|
||||
return method;
|
||||
|
||||
case 'CXXConstructorDecl':
|
||||
const constructor: Constructor = {
|
||||
const constructor: Constructor & { access?: 'public' | 'protected' } = {
|
||||
kind: 'constructor',
|
||||
name: inner.name || parent.name || '',
|
||||
parameters: extractParameters(inner)
|
||||
parameters: extractParameters(inner),
|
||||
access: 'public' // Will be set correctly later
|
||||
};
|
||||
return constructor;
|
||||
|
||||
case 'CXXDestructorDecl':
|
||||
// Include destructors for completeness
|
||||
const destructor: Destructor = {
|
||||
const destructor: Destructor & { access?: 'public' | 'protected' } = {
|
||||
kind: 'destructor',
|
||||
name: inner.name || `~${parent.name}`,
|
||||
isVirtual: inner.virtual || false,
|
||||
isPure: inner.pure || false
|
||||
isPure: inner.pure || false,
|
||||
access: 'public' // Will be set correctly later
|
||||
};
|
||||
return destructor;
|
||||
|
||||
@ -175,7 +179,11 @@ function extractTypeInfo(node: any, sourceLines: string[]): Type {
|
||||
}
|
||||
|
||||
return enumValue;
|
||||
})
|
||||
}),
|
||||
loc: {
|
||||
line: node.loc?.line || 0,
|
||||
col: node.loc?.col || 0
|
||||
}
|
||||
};
|
||||
return enumInfo;
|
||||
}
|
||||
@ -206,12 +214,19 @@ function extractTypeInfo(node: any, sourceLines: string[]): Type {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (inner.kind === 'FriendDecl' || currentAccess !== 'public') continue;
|
||||
if (inner.kind === 'FriendDecl') continue;
|
||||
|
||||
// Skip private members entirely
|
||||
if (currentAccess === 'private') continue;
|
||||
|
||||
// Extract public and protected members
|
||||
const member = extractMember(inner, node);
|
||||
if (member) {
|
||||
// Always set access level (we only extract public and protected)
|
||||
member.access = currentAccess as 'public' | 'protected';
|
||||
info.members.push(member);
|
||||
// Check if this is a pure virtual method
|
||||
|
||||
// Check if this is a pure virtual method (regardless of access level)
|
||||
if (member.kind === 'method' && member.isPure) {
|
||||
hasPureVirtual = true;
|
||||
}
|
||||
@ -221,6 +236,14 @@ function extractTypeInfo(node: any, sourceLines: string[]): Type {
|
||||
// Always set isAbstract to a boolean value
|
||||
info.isAbstract = hasPureVirtual;
|
||||
|
||||
// Filter out protected members - we only needed them to check for abstract classes
|
||||
info.members = info.members.filter(m => (m as any).access === 'public');
|
||||
|
||||
// Remove access field from all members since we only keep public members
|
||||
info.members.forEach(m => {
|
||||
delete (m as any).access;
|
||||
});
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@ -297,8 +320,6 @@ function processNode(
|
||||
types.push(typeInfo);
|
||||
} else if (node.kind === 'EnumDecl') {
|
||||
types.push(extractTypeInfo(node, sourceLines));
|
||||
} else if (node.kind === 'TypedefDecl' || node.kind === 'TypeAliasDecl') {
|
||||
types.push(extractTypeInfo(node, sourceLines));
|
||||
}
|
||||
}
|
||||
|
||||
@ -329,26 +350,20 @@ function extractLocalTypes(headerFile: string, typeMap: Map<string, Type> | null
|
||||
|
||||
// Filter out forward declarations and SpineObject
|
||||
const filteredTypes = types
|
||||
.filter(t => t.kind !== 'enum')
|
||||
.filter(t => {
|
||||
// Skip types with no members (forward declarations)
|
||||
if (t.members && t.members.length === 0) return false;
|
||||
// Keep all enums
|
||||
if (t.kind === 'enum') return true;
|
||||
|
||||
// Skip SpineObject - it's not needed for C wrapper generation
|
||||
if (t.name === 'SpineObject') return false;
|
||||
|
||||
// For classes/structs, skip those with no members (forward declarations)
|
||||
const classOrStruct = t as ClassOrStruct;
|
||||
if (classOrStruct.members && classOrStruct.members.length === 0) return false;
|
||||
|
||||
return true;
|
||||
})
|
||||
.sort((a, b) => (a.loc?.line || 0) - (b.loc?.line || 0));
|
||||
|
||||
// Add inherited methods if we have a type map
|
||||
if (typeMap) {
|
||||
for (const type of filteredTypes) {
|
||||
if (type.superTypes && type.members) {
|
||||
addInheritedMethods(type, typeMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
.sort((a, b) => a.loc.line - b.loc.line);
|
||||
|
||||
return filteredTypes;
|
||||
}
|
||||
@ -473,11 +488,17 @@ function addTemplateInheritedMethods(
|
||||
/**
|
||||
* Adds inherited methods to a type
|
||||
*/
|
||||
function addInheritedMethods(type: ClassOrStruct, typeMap: Map<string, Type>): void {
|
||||
function addInheritedMethods(type: ClassOrStruct & { inheritedMethodsAdded: boolean }, typeMap: Map<string, (ClassOrStruct & { inheritedMethodsAdded: boolean } | Enum)>): void {
|
||||
// Skip if already processed
|
||||
if (type.inheritedMethodsAdded) {
|
||||
return;
|
||||
}
|
||||
|
||||
const inheritedMethods: Member[] = [];
|
||||
const ownMethodSignatures = new Set<string>();
|
||||
|
||||
// Build a set of method signatures from this type
|
||||
// All members are public at this point (protected/private were filtered out earlier)
|
||||
for (const member of type.members || []) {
|
||||
if (member.kind === 'method') {
|
||||
const sig = getMethodSignature(member as Method);
|
||||
@ -501,6 +522,9 @@ function addInheritedMethods(type: ClassOrStruct, typeMap: Map<string, Type>): v
|
||||
|
||||
const templateType = typeMap.get(templateClassName);
|
||||
if (templateType && templateType.kind !== 'enum' && templateType.members) {
|
||||
if (!templateType.inheritedMethodsAdded) {
|
||||
addInheritedMethods(templateType, typeMap);
|
||||
}
|
||||
// Process template inheritance
|
||||
addTemplateInheritedMethods(
|
||||
type, templateType, templateClassName, templateArgs,
|
||||
@ -513,6 +537,10 @@ function addInheritedMethods(type: ClassOrStruct, typeMap: Map<string, Type>): v
|
||||
|
||||
if (!superType || superType.kind === 'enum' || !superType.members) continue;
|
||||
|
||||
if (!superType.inheritedMethodsAdded) {
|
||||
addInheritedMethods(superType, typeMap);
|
||||
}
|
||||
|
||||
// Add non-overridden methods from supertype
|
||||
for (const member of superType.members) {
|
||||
if (member.kind === 'method') {
|
||||
@ -532,6 +560,9 @@ function addInheritedMethods(type: ClassOrStruct, typeMap: Map<string, Type>): v
|
||||
if (type.members) {
|
||||
type.members.push(...inheritedMethods);
|
||||
}
|
||||
|
||||
// Mark as processed
|
||||
type.inheritedMethodsAdded = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -600,29 +631,29 @@ function isExtractionNeeded(): boolean {
|
||||
/**
|
||||
* Runs the type extraction process and generates the output file
|
||||
*/
|
||||
export function extractTypes(): void {
|
||||
export function extractTypes(): Type[] {
|
||||
if (!isExtractionNeeded()) {
|
||||
return;
|
||||
return loadTypes();
|
||||
}
|
||||
|
||||
console.log('Running type extraction...');
|
||||
|
||||
try {
|
||||
const allHeaders = findAllHeaderFiles();
|
||||
const allTypes: SpineTypes = {};
|
||||
const allTypes: { [header: string]: (ClassOrStruct & { inheritedMethodsAdded: boolean } | Enum)[] } = {};
|
||||
let processed = 0, errors = 0;
|
||||
|
||||
console.error(`Processing ${allHeaders.length} header files...`);
|
||||
|
||||
// First pass: extract all types without inheritance
|
||||
const typeMap = new Map<string, Type>();
|
||||
const typeMap = new Map<string, (ClassOrStruct & { inheritedMethodsAdded: boolean } | Enum)>();
|
||||
|
||||
for (const headerFile of allHeaders) {
|
||||
const relPath = path.relative(SPINE_INCLUDE_DIR, headerFile);
|
||||
process.stderr.write(`\r\x1b[K Pass 1 - Processing ${++processed}/${allHeaders.length}: ${relPath}...`);
|
||||
|
||||
try {
|
||||
const types = extractLocalTypes(headerFile);
|
||||
const types = extractLocalTypes(headerFile).map(type => type as ClassOrStruct & { inheritedMethodsAdded: boolean } | Enum);
|
||||
if (types.length > 0) {
|
||||
allTypes[relPath] = types;
|
||||
// Build type map
|
||||
@ -647,17 +678,24 @@ export function extractTypes(): void {
|
||||
process.stderr.write(`\r\x1b[K Pass 2 - Processing ${++processed}/${Object.keys(allTypes).length}: ${relPath}...`);
|
||||
|
||||
for (const type of allTypes[relPath]) {
|
||||
if (type.kind !== 'enum' && type.superTypes && type.members) {
|
||||
addInheritedMethods(type, typeMap);
|
||||
if (type.kind !== 'enum') {
|
||||
const classOrStruct = type;
|
||||
if (classOrStruct.superTypes && classOrStruct.members) {
|
||||
if (classOrStruct.name === "ConstraintTimeline1") {
|
||||
console.log("ConstraintTimeline1");
|
||||
}
|
||||
|
||||
// Check if any inherited methods are pure virtual
|
||||
// If so, and the class doesn't override them, it's abstract
|
||||
if (!type.isAbstract) {
|
||||
const hasPureVirtual = type.members.some((m: Member) =>
|
||||
m.kind === 'method' && m.isPure === true
|
||||
);
|
||||
if (hasPureVirtual) {
|
||||
type.isAbstract = true;
|
||||
addInheritedMethods(classOrStruct, typeMap);
|
||||
|
||||
// Check if any inherited methods (including protected) are pure virtual
|
||||
// If so, and the class doesn't override them, it's abstract
|
||||
if (!classOrStruct.isAbstract) {
|
||||
const hasPureVirtual = classOrStruct.members.some((m: Member) =>
|
||||
m.kind === 'method' && m.isPure === true
|
||||
);
|
||||
if (hasPureVirtual) {
|
||||
classOrStruct.isAbstract = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -666,6 +704,12 @@ export function extractTypes(): void {
|
||||
|
||||
console.error(`\n Completed: ${Object.keys(allTypes).length} files processed, ${errors} errors`);
|
||||
|
||||
if (errors > 0) {
|
||||
console.error(`\n ${errors} errors occurred during type extraction`);
|
||||
console.error(`\n Run the commands shown for each error and fix the issue in spine-cpp`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Write to output file
|
||||
fs.writeFileSync(OUTPUT_FILE, JSON.stringify(allTypes, null, 2));
|
||||
console.log(`Type extraction complete, wrote ${OUTPUT_FILE}`);
|
||||
@ -673,15 +717,24 @@ export function extractTypes(): void {
|
||||
console.error('Failed to extract types:', error.message);
|
||||
throw error;
|
||||
}
|
||||
|
||||
return loadTypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the extracted type information
|
||||
* Loads the extracted type information from spine-c/codegen/spine-cpp-types.json
|
||||
*/
|
||||
export function loadTypes(): SpineTypes {
|
||||
export function loadTypes(): Type[] {
|
||||
if (!fs.existsSync(OUTPUT_FILE)) {
|
||||
throw new Error(`Type information not found at ${OUTPUT_FILE}. Run extraction first.`);
|
||||
}
|
||||
|
||||
return JSON.parse(fs.readFileSync(OUTPUT_FILE, 'utf8'));
|
||||
const typesJson = JSON.parse(fs.readFileSync(OUTPUT_FILE, 'utf8'));
|
||||
// Flatten all types from all headers into a single array
|
||||
const types: Type[] = [];
|
||||
for (const header of Object.keys(typesJson)) {
|
||||
types.push(...typesJson[header]);
|
||||
}
|
||||
|
||||
return types;
|
||||
}
|
||||
@ -48,6 +48,10 @@ export type Enum = {
|
||||
kind: 'enum';
|
||||
name: string;
|
||||
values: EnumValue[];
|
||||
loc: {
|
||||
line: number;
|
||||
col: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface EnumValue {
|
||||
@ -58,7 +62,7 @@ export interface EnumValue {
|
||||
export interface ClassOrStruct {
|
||||
name: string;
|
||||
kind: 'class' | 'struct';
|
||||
loc?: {
|
||||
loc: {
|
||||
line: number;
|
||||
col: number;
|
||||
};
|
||||
@ -71,10 +75,6 @@ export interface ClassOrStruct {
|
||||
|
||||
export type Type = ClassOrStruct | Enum;
|
||||
|
||||
export interface SpineTypes {
|
||||
[header: string]: Type[];
|
||||
}
|
||||
|
||||
export type Exclusion =
|
||||
| {
|
||||
kind: 'type';
|
||||
@ -85,6 +85,21 @@ export type Exclusion =
|
||||
typeName: string;
|
||||
methodName: string;
|
||||
isConst?: boolean; // Whether the method is const (e.g., void foo() const), NOT whether return type is const
|
||||
}
|
||||
| {
|
||||
kind: 'field';
|
||||
typeName: string;
|
||||
fieldName: string;
|
||||
}
|
||||
| {
|
||||
kind: 'field-get';
|
||||
typeName: string;
|
||||
fieldName: string;
|
||||
}
|
||||
| {
|
||||
kind: 'field-set';
|
||||
typeName: string;
|
||||
fieldName: string;
|
||||
};
|
||||
|
||||
export interface ArraySpecialization {
|
||||
@ -154,7 +169,7 @@ export function isPrimitive(cppType: string): boolean {
|
||||
* Converts a C++ type to its corresponding C type.
|
||||
*
|
||||
* @param cppType The C++ type to convert
|
||||
* @param validTypes Set of valid type names (classes and enums) from filtered types
|
||||
* @param knownTypeNames Set of known type names (classes and enums) from filtered types
|
||||
* @returns The C type
|
||||
* @throws Error if the type is not recognized
|
||||
*
|
||||
@ -166,7 +181,7 @@ export function isPrimitive(cppType: string): boolean {
|
||||
* - Class references: "const Color&" → "spine_color"
|
||||
* - Non-const primitive refs: "float&" → "float*" (output parameter)
|
||||
*/
|
||||
export function toCTypeName(cppType: string, validTypes: Set<string>): string {
|
||||
export function toCTypeName(cppType: string, knownTypeNames: Set<string>): string {
|
||||
// Remove extra spaces and normalize
|
||||
const normalizedType = cppType.replace(/\s+/g, ' ').trim();
|
||||
|
||||
@ -181,7 +196,7 @@ export function toCTypeName(cppType: string, validTypes: Set<string>): string {
|
||||
return 'const char*';
|
||||
}
|
||||
|
||||
// PropertyId is a typedef
|
||||
// Special Type: PropertyId is a typedef
|
||||
if (normalizedType === 'PropertyId') {
|
||||
return 'int64_t';
|
||||
}
|
||||
@ -206,6 +221,12 @@ export function toCTypeName(cppType: string, validTypes: Set<string>): string {
|
||||
return `spine_array_${toSnakeCase(elementType)}`;
|
||||
}
|
||||
|
||||
// Handle "Type * const" pattern (const pointer)
|
||||
if (normalizedType.endsWith(' const')) {
|
||||
const baseType = normalizedType.slice(0, -6).trim(); // Remove ' const'
|
||||
return toCTypeName(baseType, knownTypeNames);
|
||||
}
|
||||
|
||||
// Pointers
|
||||
const pointerMatch = normalizedType.match(/^(.+?)\s*\*$/);
|
||||
if (pointerMatch) {
|
||||
@ -233,7 +254,7 @@ export function toCTypeName(cppType: string, validTypes: Set<string>): string {
|
||||
}
|
||||
|
||||
// Const references and class references - recurse without the reference
|
||||
return toCTypeName(baseType, validTypes);
|
||||
return toCTypeName(baseType, knownTypeNames);
|
||||
}
|
||||
|
||||
// Function pointers - for now, just error
|
||||
@ -241,11 +262,50 @@ export function toCTypeName(cppType: string, validTypes: Set<string>): string {
|
||||
throw new Error(`Function pointer types not yet supported: ${normalizedType}`);
|
||||
}
|
||||
|
||||
// Handle const types - strip const and recurse
|
||||
if (normalizedType.startsWith('const ') && !normalizedType.includes('*') && !normalizedType.includes('&')) {
|
||||
const baseType = normalizedType.slice(6).trim(); // Remove 'const '
|
||||
return toCTypeName(baseType, knownTypeNames);
|
||||
}
|
||||
|
||||
// Everything else should be a class or enum type
|
||||
// Check if it's a valid type
|
||||
if (!validTypes.has(normalizedType)) {
|
||||
if (!knownTypeNames.has(normalizedType)) {
|
||||
throw new Error(`Unknown type: ${normalizedType}. Not a primitive and not in the list of valid types.`);
|
||||
}
|
||||
|
||||
return `spine_${toSnakeCase(normalizedType)}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a C++ type can be represented in the C API.
|
||||
* Returns null if the type can be handled, or an error message if not.
|
||||
*/
|
||||
export function checkTypeSupport(cppType: string, knownTypeNames: Set<string>): string | null {
|
||||
// Remove extra spaces and normalize
|
||||
const normalizedType = cppType.replace(/\s+/g, ' ').trim();
|
||||
|
||||
// Check for Array<String> which we can't handle
|
||||
const arrayMatch = normalizedType.match(/^(?:const\s+)?Array<(.+?)>\s*(?:&|\*)?$/);
|
||||
if (arrayMatch) {
|
||||
const elementType = arrayMatch[1].trim();
|
||||
if (elementType === 'String') {
|
||||
return "Array<String> is not supported - use const char** instead";
|
||||
}
|
||||
// Check if array type exists
|
||||
const arrayTypeName = `spine_array_${toSnakeCase(elementType)}`;
|
||||
// We can't check if the array was generated, so we'll let toCTypeName handle that
|
||||
}
|
||||
|
||||
// Check for multi-level pointers
|
||||
if (/\*\s*\*/.test(normalizedType)) {
|
||||
return "Multi-level pointers are not supported";
|
||||
}
|
||||
|
||||
// Check for function pointers
|
||||
if (normalizedType.includes('(') && normalizedType.includes(')')) {
|
||||
return "Function pointer types are not supported";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -36,23 +36,21 @@
|
||||
// All type declarations and enum includes
|
||||
#include "../src/generated/types.h"
|
||||
|
||||
// Extension functions
|
||||
// Extension types & functions
|
||||
#include "../src/extensions.h"
|
||||
|
||||
// Generated class types
|
||||
#include "../src/generated/alpha_timeline.h"
|
||||
#include "../src/generated/animation.h"
|
||||
#include "../src/generated/track_entry.h"
|
||||
#include "../src/generated/event_queue_entry.h"
|
||||
#include "../src/generated/animation_state.h"
|
||||
#include "../src/generated/animation_state_data.h"
|
||||
#include "../src/generated/atlas_page.h"
|
||||
#include "../src/generated/atlas_region.h"
|
||||
#include "../src/generated/atlas.h"
|
||||
#include "../src/generated/atlas_attachment_loader.h"
|
||||
#include "../src/generated/atlas_page.h"
|
||||
#include "../src/generated/atlas_region.h"
|
||||
#include "../src/generated/attachment.h"
|
||||
#include "../src/generated/attachment_loader.h"
|
||||
#include "../src/generated/attachment_timeline.h"
|
||||
#include "../src/generated/block.h"
|
||||
#include "../src/generated/bone.h"
|
||||
#include "../src/generated/bone_data.h"
|
||||
#include "../src/generated/bone_local.h"
|
||||
@ -63,11 +61,6 @@
|
||||
#include "../src/generated/bounding_box_attachment.h"
|
||||
#include "../src/generated/clipping_attachment.h"
|
||||
#include "../src/generated/color.h"
|
||||
#include "../src/generated/rgba_timeline.h"
|
||||
#include "../src/generated/rgb_timeline.h"
|
||||
#include "../src/generated/alpha_timeline.h"
|
||||
#include "../src/generated/rgba2_timeline.h"
|
||||
#include "../src/generated/rgb2_timeline.h"
|
||||
#include "../src/generated/constraint.h"
|
||||
#include "../src/generated/constraint_data.h"
|
||||
#include "../src/generated/constraint_timeline.h"
|
||||
@ -79,16 +72,21 @@
|
||||
#include "../src/generated/draw_order_timeline.h"
|
||||
#include "../src/generated/event.h"
|
||||
#include "../src/generated/event_data.h"
|
||||
#include "../src/generated/event_queue_entry.h"
|
||||
#include "../src/generated/event_timeline.h"
|
||||
#include "../src/generated/from_property.h"
|
||||
#include "../src/generated/from_rotate.h"
|
||||
#include "../src/generated/from_scale_x.h"
|
||||
#include "../src/generated/from_scale_y.h"
|
||||
#include "../src/generated/from_shear_y.h"
|
||||
#include "../src/generated/from_x.h"
|
||||
#include "../src/generated/from_y.h"
|
||||
#include "../src/generated/ik_constraint.h"
|
||||
#include "../src/generated/ik_constraint_data.h"
|
||||
#include "../src/generated/ik_constraint_pose.h"
|
||||
#include "../src/generated/ik_constraint_timeline.h"
|
||||
#include "../src/generated/inherit_timeline.h"
|
||||
#include "../src/generated/linked_mesh.h"
|
||||
#include "../src/generated/interpolation.h"
|
||||
#include "../src/generated/pow_interpolation.h"
|
||||
#include "../src/generated/pow_out_interpolation.h"
|
||||
#include "../src/generated/mesh_attachment.h"
|
||||
#include "../src/generated/path_attachment.h"
|
||||
#include "../src/generated/path_constraint.h"
|
||||
@ -98,24 +96,30 @@
|
||||
#include "../src/generated/path_constraint_position_timeline.h"
|
||||
#include "../src/generated/path_constraint_spacing_timeline.h"
|
||||
#include "../src/generated/physics_constraint.h"
|
||||
#include "../src/generated/physics_constraint_data.h"
|
||||
#include "../src/generated/physics_constraint_pose.h"
|
||||
#include "../src/generated/physics_constraint_timeline.h"
|
||||
#include "../src/generated/physics_constraint_inertia_timeline.h"
|
||||
#include "../src/generated/physics_constraint_strength_timeline.h"
|
||||
#include "../src/generated/physics_constraint_damping_timeline.h"
|
||||
#include "../src/generated/physics_constraint_mass_timeline.h"
|
||||
#include "../src/generated/physics_constraint_wind_timeline.h"
|
||||
#include "../src/generated/physics_constraint_data.h"
|
||||
#include "../src/generated/physics_constraint_gravity_timeline.h"
|
||||
#include "../src/generated/physics_constraint_inertia_timeline.h"
|
||||
#include "../src/generated/physics_constraint_mass_timeline.h"
|
||||
#include "../src/generated/physics_constraint_mix_timeline.h"
|
||||
#include "../src/generated/physics_constraint_pose.h"
|
||||
#include "../src/generated/physics_constraint_reset_timeline.h"
|
||||
#include "../src/generated/physics_constraint_strength_timeline.h"
|
||||
#include "../src/generated/physics_constraint_timeline.h"
|
||||
#include "../src/generated/physics_constraint_wind_timeline.h"
|
||||
#include "../src/generated/point_attachment.h"
|
||||
#include "../src/generated/polygon.h"
|
||||
#include "../src/generated/posed.h"
|
||||
#include "../src/generated/posed_active.h"
|
||||
#include "../src/generated/posed_data.h"
|
||||
#include "../src/generated/rtti.h"
|
||||
#include "../src/generated/region_attachment.h"
|
||||
#include "../src/generated/render_command.h"
|
||||
#include "../src/generated/rgb2_timeline.h"
|
||||
#include "../src/generated/rgba2_timeline.h"
|
||||
#include "../src/generated/rgba_timeline.h"
|
||||
#include "../src/generated/rgb_timeline.h"
|
||||
#include "../src/generated/rotate_timeline.h"
|
||||
#include "../src/generated/rtti.h"
|
||||
#include "../src/generated/scale_timeline.h"
|
||||
#include "../src/generated/scale_x_timeline.h"
|
||||
#include "../src/generated/scale_y_timeline.h"
|
||||
@ -127,10 +131,9 @@
|
||||
#include "../src/generated/skeleton.h"
|
||||
#include "../src/generated/skeleton_binary.h"
|
||||
#include "../src/generated/skeleton_bounds.h"
|
||||
#include "../src/generated/polygon.h"
|
||||
#include "../src/generated/skeleton_clipping.h"
|
||||
#include "../src/generated/skeleton_data.h"
|
||||
#include "../src/generated/skeleton_json.h"
|
||||
#include "../src/generated/render_command.h"
|
||||
#include "../src/generated/skeleton_renderer.h"
|
||||
#include "../src/generated/skin.h"
|
||||
#include "../src/generated/slider.h"
|
||||
@ -145,21 +148,15 @@
|
||||
#include "../src/generated/slot_timeline.h"
|
||||
#include "../src/generated/texture_region.h"
|
||||
#include "../src/generated/timeline.h"
|
||||
#include "../src/generated/transform_constraint.h"
|
||||
#include "../src/generated/from_property.h"
|
||||
#include "../src/generated/to_property.h"
|
||||
#include "../src/generated/from_rotate.h"
|
||||
#include "../src/generated/to_rotate.h"
|
||||
#include "../src/generated/from_x.h"
|
||||
#include "../src/generated/to_x.h"
|
||||
#include "../src/generated/from_y.h"
|
||||
#include "../src/generated/to_y.h"
|
||||
#include "../src/generated/from_scale_x.h"
|
||||
#include "../src/generated/to_scale_x.h"
|
||||
#include "../src/generated/from_scale_y.h"
|
||||
#include "../src/generated/to_scale_y.h"
|
||||
#include "../src/generated/from_shear_y.h"
|
||||
#include "../src/generated/to_shear_y.h"
|
||||
#include "../src/generated/to_x.h"
|
||||
#include "../src/generated/to_y.h"
|
||||
#include "../src/generated/track_entry.h"
|
||||
#include "../src/generated/transform_constraint.h"
|
||||
#include "../src/generated/transform_constraint_data.h"
|
||||
#include "../src/generated/transform_constraint_pose.h"
|
||||
#include "../src/generated/transform_constraint_timeline.h"
|
||||
@ -168,6 +165,5 @@
|
||||
#include "../src/generated/translate_y_timeline.h"
|
||||
#include "../src/generated/update.h"
|
||||
#include "../src/generated/vertex_attachment.h"
|
||||
#include "../src/generated/vertices.h"
|
||||
|
||||
#endif // SPINE_C_H
|
||||
@ -36,22 +36,22 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if _WIN32
|
||||
#define SPINE_C_EXPORT extern "C" __declspec(dllexport)
|
||||
#define SPINE_C_API extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#define SPINE_C_EXPORT extern "C" __attribute__((used))
|
||||
#define SPINE_C_API extern "C" __attribute__((used))
|
||||
#else
|
||||
#define SPINE_C_EXPORT extern "C"
|
||||
#define SPINE_C_API extern "C"
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#if _WIN32
|
||||
#define SPINE_C_EXPORT __declspec(dllexport)
|
||||
#define SPINE_C_API __declspec(dllexport)
|
||||
#else
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#define SPINE_C_EXPORT __attribute__((used))
|
||||
#define SPINE_C_API __attribute__((used))
|
||||
#else
|
||||
#define SPINE_C_EXPORT
|
||||
#define SPINE_C_API
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@ -62,4 +62,6 @@
|
||||
} name##_wrapper; \
|
||||
typedef name##_wrapper *name;
|
||||
|
||||
typedef long long spine_property_id;
|
||||
|
||||
#endif // SPINE_C_BASE_H
|
||||
@ -136,27 +136,6 @@ void spine_report_leaks() {
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
// Color functions
|
||||
float spine_color_get_r(spine_color color) {
|
||||
if (!color) return 0;
|
||||
return ((Color *) color)->r;
|
||||
}
|
||||
|
||||
float spine_color_get_g(spine_color color) {
|
||||
if (!color) return 0;
|
||||
return ((Color *) color)->g;
|
||||
}
|
||||
|
||||
float spine_color_get_b(spine_color color) {
|
||||
if (!color) return 0;
|
||||
return ((Color *) color)->b;
|
||||
}
|
||||
|
||||
float spine_color_get_a(spine_color color) {
|
||||
if (!color) return 0;
|
||||
return ((Color *) color)->a;
|
||||
}
|
||||
|
||||
// Bounds functions
|
||||
float spine_bounds_get_x(spine_bounds bounds) {
|
||||
if (!bounds) return 0;
|
||||
@ -425,64 +404,6 @@ spine_animation_state_events spine_skeleton_drawable_get_animation_state_events(
|
||||
return ((_spine_skeleton_drawable *) drawable)->animationStateEvents;
|
||||
}
|
||||
|
||||
// Render command functions
|
||||
float *spine_render_command_get_positions(spine_render_command command) {
|
||||
if (!command) return nullptr;
|
||||
return ((RenderCommand *) command)->positions;
|
||||
}
|
||||
|
||||
float *spine_render_command_get_uvs(spine_render_command command) {
|
||||
if (!command) return nullptr;
|
||||
return ((RenderCommand *) command)->uvs;
|
||||
}
|
||||
|
||||
int32_t *spine_render_command_get_colors(spine_render_command command) {
|
||||
if (!command) return nullptr;
|
||||
return (int32_t *) ((RenderCommand *) command)->colors;
|
||||
}
|
||||
|
||||
int32_t *spine_render_command_get_dark_colors(spine_render_command command) {
|
||||
if (!command) return nullptr;
|
||||
return (int32_t *) ((RenderCommand *) command)->darkColors;
|
||||
}
|
||||
|
||||
int32_t spine_render_command_get_num_vertices(spine_render_command command) {
|
||||
if (!command) return 0;
|
||||
return ((RenderCommand *) command)->numVertices;
|
||||
}
|
||||
|
||||
uint16_t *spine_render_command_get_indices(spine_render_command command) {
|
||||
if (!command) return nullptr;
|
||||
return ((RenderCommand *) command)->indices;
|
||||
}
|
||||
|
||||
int32_t spine_render_command_get_num_indices(spine_render_command command) {
|
||||
if (!command) return 0;
|
||||
return ((RenderCommand *) command)->numIndices;
|
||||
}
|
||||
|
||||
int32_t spine_render_command_get_atlas_page(spine_render_command command) {
|
||||
if (!command) return 0;
|
||||
return (int32_t) (intptr_t) ((RenderCommand *) command)->texture;
|
||||
}
|
||||
|
||||
spine_blend_mode spine_render_command_get_blend_mode(spine_render_command command) {
|
||||
if (!command) return SPINE_BLEND_MODE_NORMAL;
|
||||
BlendMode mode = ((RenderCommand *) command)->blendMode;
|
||||
switch (mode) {
|
||||
case BlendMode_Normal: return SPINE_BLEND_MODE_NORMAL;
|
||||
case BlendMode_Additive: return SPINE_BLEND_MODE_ADDITIVE;
|
||||
case BlendMode_Multiply: return SPINE_BLEND_MODE_MULTIPLY;
|
||||
case BlendMode_Screen: return SPINE_BLEND_MODE_SCREEN;
|
||||
default: return SPINE_BLEND_MODE_NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
spine_render_command spine_render_command_get_next(spine_render_command command) {
|
||||
if (!command) return nullptr;
|
||||
return (spine_render_command) ((RenderCommand *) command)->next;
|
||||
}
|
||||
|
||||
// Skin entries
|
||||
spine_skin_entries spine_skin_entries_create() {
|
||||
_spine_skin_entries *entries = SpineExtension::calloc<_spine_skin_entries>(1, __FILE__, __LINE__);
|
||||
|
||||
@ -55,76 +55,58 @@ typedef void* (*spine_texture_loader_load_func)(const char *path);
|
||||
typedef void (*spine_texture_loader_unload_func)(void *texture);
|
||||
|
||||
// Version functions
|
||||
SPINE_C_EXPORT int32_t spine_major_version();
|
||||
SPINE_C_EXPORT int32_t spine_minor_version();
|
||||
SPINE_C_EXPORT void spine_enable_debug_extension(bool enable);
|
||||
SPINE_C_EXPORT void spine_report_leaks();
|
||||
|
||||
// Color functions
|
||||
SPINE_C_EXPORT float spine_color_get_r(spine_color color);
|
||||
SPINE_C_EXPORT float spine_color_get_g(spine_color color);
|
||||
SPINE_C_EXPORT float spine_color_get_b(spine_color color);
|
||||
SPINE_C_EXPORT float spine_color_get_a(spine_color color);
|
||||
SPINE_C_API int32_t spine_major_version();
|
||||
SPINE_C_API int32_t spine_minor_version();
|
||||
SPINE_C_API void spine_enable_debug_extension(bool enable);
|
||||
SPINE_C_API void spine_report_leaks();
|
||||
|
||||
// Bounds functions
|
||||
SPINE_C_EXPORT float spine_bounds_get_x(spine_bounds bounds);
|
||||
SPINE_C_EXPORT float spine_bounds_get_y(spine_bounds bounds);
|
||||
SPINE_C_EXPORT float spine_bounds_get_width(spine_bounds bounds);
|
||||
SPINE_C_EXPORT float spine_bounds_get_height(spine_bounds bounds);
|
||||
SPINE_C_API float spine_bounds_get_x(spine_bounds bounds);
|
||||
SPINE_C_API float spine_bounds_get_y(spine_bounds bounds);
|
||||
SPINE_C_API float spine_bounds_get_width(spine_bounds bounds);
|
||||
SPINE_C_API float spine_bounds_get_height(spine_bounds bounds);
|
||||
|
||||
// Vector functions
|
||||
SPINE_C_EXPORT float spine_vector_get_x(spine_vector vector);
|
||||
SPINE_C_EXPORT float spine_vector_get_y(spine_vector vector);
|
||||
SPINE_C_API float spine_vector_get_x(spine_vector vector);
|
||||
SPINE_C_API float spine_vector_get_y(spine_vector vector);
|
||||
|
||||
// Atlas functions
|
||||
SPINE_C_EXPORT spine_atlas spine_atlas_load(const char *atlasData);
|
||||
SPINE_C_EXPORT spine_atlas spine_atlas_load_callback(const char *atlasData, const char *atlasDir,
|
||||
SPINE_C_API spine_atlas spine_atlas_load(const char *atlasData);
|
||||
SPINE_C_API spine_atlas spine_atlas_load_callback(const char *atlasData, const char *atlasDir,
|
||||
spine_texture_loader_load_func load,
|
||||
spine_texture_loader_unload_func unload);
|
||||
SPINE_C_EXPORT int32_t spine_atlas_get_num_image_paths(spine_atlas atlas);
|
||||
SPINE_C_EXPORT const char *spine_atlas_get_image_path(spine_atlas atlas, int32_t index);
|
||||
SPINE_C_EXPORT bool spine_atlas_is_pma(spine_atlas atlas);
|
||||
SPINE_C_EXPORT const char *spine_atlas_get_error(spine_atlas atlas);
|
||||
SPINE_C_EXPORT void spine_atlas_dispose(spine_atlas atlas);
|
||||
SPINE_C_API int32_t spine_atlas_get_num_image_paths(spine_atlas atlas);
|
||||
SPINE_C_API const char *spine_atlas_get_image_path(spine_atlas atlas, int32_t index);
|
||||
SPINE_C_API bool spine_atlas_is_pma(spine_atlas atlas);
|
||||
SPINE_C_API const char *spine_atlas_get_error(spine_atlas atlas);
|
||||
SPINE_C_API void spine_atlas_dispose(spine_atlas atlas);
|
||||
|
||||
// Skeleton data functions
|
||||
SPINE_C_EXPORT spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const char *skeletonData);
|
||||
SPINE_C_EXPORT spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length);
|
||||
SPINE_C_EXPORT const char *spine_skeleton_data_result_get_error(spine_skeleton_data_result result);
|
||||
SPINE_C_EXPORT spine_skeleton_data spine_skeleton_data_result_get_data(spine_skeleton_data_result result);
|
||||
SPINE_C_EXPORT void spine_skeleton_data_result_dispose(spine_skeleton_data_result result);
|
||||
SPINE_C_API spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const char *skeletonData);
|
||||
SPINE_C_API spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length);
|
||||
SPINE_C_API const char *spine_skeleton_data_result_get_error(spine_skeleton_data_result result);
|
||||
SPINE_C_API spine_skeleton_data spine_skeleton_data_result_get_data(spine_skeleton_data_result result);
|
||||
SPINE_C_API void spine_skeleton_data_result_dispose(spine_skeleton_data_result result);
|
||||
|
||||
// Skeleton drawable functions
|
||||
SPINE_C_EXPORT spine_skeleton_drawable spine_skeleton_drawable_create(spine_skeleton_data skeletonData);
|
||||
SPINE_C_EXPORT spine_render_command spine_skeleton_drawable_render(spine_skeleton_drawable drawable);
|
||||
SPINE_C_EXPORT void spine_skeleton_drawable_dispose(spine_skeleton_drawable drawable);
|
||||
SPINE_C_EXPORT spine_skeleton spine_skeleton_drawable_get_skeleton(spine_skeleton_drawable drawable);
|
||||
SPINE_C_EXPORT spine_animation_state spine_skeleton_drawable_get_animation_state(spine_skeleton_drawable drawable);
|
||||
SPINE_C_EXPORT spine_animation_state_data spine_skeleton_drawable_get_animation_state_data(spine_skeleton_drawable drawable);
|
||||
SPINE_C_EXPORT spine_animation_state_events spine_skeleton_drawable_get_animation_state_events(spine_skeleton_drawable drawable);
|
||||
|
||||
// Render command functions
|
||||
SPINE_C_EXPORT float *spine_render_command_get_positions(spine_render_command command);
|
||||
SPINE_C_EXPORT float *spine_render_command_get_uvs(spine_render_command command);
|
||||
SPINE_C_EXPORT int32_t *spine_render_command_get_colors(spine_render_command command);
|
||||
SPINE_C_EXPORT int32_t *spine_render_command_get_dark_colors(spine_render_command command);
|
||||
SPINE_C_EXPORT int32_t spine_render_command_get_num_vertices(spine_render_command command);
|
||||
SPINE_C_EXPORT uint16_t *spine_render_command_get_indices(spine_render_command command);
|
||||
SPINE_C_EXPORT int32_t spine_render_command_get_num_indices(spine_render_command command);
|
||||
SPINE_C_EXPORT int32_t spine_render_command_get_atlas_page(spine_render_command command);
|
||||
SPINE_C_EXPORT spine_blend_mode spine_render_command_get_blend_mode(spine_render_command command);
|
||||
SPINE_C_EXPORT spine_render_command spine_render_command_get_next(spine_render_command command);
|
||||
SPINE_C_API spine_skeleton_drawable spine_skeleton_drawable_create(spine_skeleton_data skeletonData);
|
||||
SPINE_C_API spine_render_command spine_skeleton_drawable_render(spine_skeleton_drawable drawable);
|
||||
SPINE_C_API void spine_skeleton_drawable_dispose(spine_skeleton_drawable drawable);
|
||||
SPINE_C_API spine_skeleton spine_skeleton_drawable_get_skeleton(spine_skeleton_drawable drawable);
|
||||
SPINE_C_API spine_animation_state spine_skeleton_drawable_get_animation_state(spine_skeleton_drawable drawable);
|
||||
SPINE_C_API spine_animation_state_data spine_skeleton_drawable_get_animation_state_data(spine_skeleton_drawable drawable);
|
||||
SPINE_C_API spine_animation_state_events spine_skeleton_drawable_get_animation_state_events(spine_skeleton_drawable drawable);
|
||||
|
||||
// Skin entries functions
|
||||
SPINE_C_EXPORT spine_skin_entries spine_skin_entries_create();
|
||||
SPINE_C_EXPORT void spine_skin_entries_dispose(spine_skin_entries entries);
|
||||
SPINE_C_EXPORT int32_t spine_skin_entries_get_num_entries(spine_skin_entries entries);
|
||||
SPINE_C_EXPORT spine_skin_entry spine_skin_entries_get_entry(spine_skin_entries entries, int32_t index);
|
||||
SPINE_C_API spine_skin_entries spine_skin_entries_create();
|
||||
SPINE_C_API void spine_skin_entries_dispose(spine_skin_entries entries);
|
||||
SPINE_C_API int32_t spine_skin_entries_get_num_entries(spine_skin_entries entries);
|
||||
SPINE_C_API spine_skin_entry spine_skin_entries_get_entry(spine_skin_entries entries, int32_t index);
|
||||
|
||||
// Skin entry functions
|
||||
SPINE_C_EXPORT int32_t spine_skin_entry_get_slot_index(spine_skin_entry entry);
|
||||
SPINE_C_EXPORT const char *spine_skin_entry_get_name(spine_skin_entry entry);
|
||||
SPINE_C_EXPORT spine_attachment spine_skin_entry_get_attachment(spine_skin_entry entry);
|
||||
SPINE_C_API int32_t spine_skin_entry_get_slot_index(spine_skin_entry entry);
|
||||
SPINE_C_API const char *spine_skin_entry_get_name(spine_skin_entry entry);
|
||||
SPINE_C_API spine_attachment spine_skin_entry_get_attachment(spine_skin_entry entry);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -1,101 +1,96 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "alpha_timeline.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_alpha_timeline spine_alpha_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex) {
|
||||
AlphaTimeline *obj = new (__FILE__, __LINE__) AlphaTimeline(frameCount, bezierCount, slotIndex);
|
||||
return (spine_alpha_timeline) obj;
|
||||
return (spine_alpha_timeline) new (__FILE__, __LINE__) AlphaTimeline(frameCount, bezierCount, slotIndex);
|
||||
}
|
||||
|
||||
void spine_alpha_timeline_dispose(spine_alpha_timeline obj) {
|
||||
if (!obj) return;
|
||||
delete (AlphaTimeline *) obj;
|
||||
void spine_alpha_timeline_dispose(spine_alpha_timeline self) {
|
||||
delete (AlphaTimeline*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_alpha_timeline_get_rtti() {
|
||||
return (spine_rtti) &AlphaTimeline::rtti;
|
||||
spine_rtti spine_alpha_timeline_get_rtti(spine_alpha_timeline self) {
|
||||
return (spine_rtti)&((AlphaTimeline*)self)->getRTTI();
|
||||
}
|
||||
|
||||
void spine_alpha_timeline_apply(spine_alpha_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
AlphaTimeline *_obj = (AlphaTimeline *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
void spine_alpha_timeline_apply(spine_alpha_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((AlphaTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
void spine_alpha_timeline_set_frame(spine_alpha_timeline obj, size_t frame, float time, float value) {
|
||||
if (!obj) return ;
|
||||
AlphaTimeline *_obj = (AlphaTimeline *) obj;
|
||||
_obj->setFrame(frame, time, value);
|
||||
void spine_alpha_timeline_set_frame(spine_alpha_timeline self, size_t frame, float time, float value) {
|
||||
((CurveTimeline1*)(AlphaTimeline*)self)->setFrame(frame, time, value);
|
||||
}
|
||||
|
||||
float spine_alpha_timeline_get_curve_value(spine_alpha_timeline obj, float time) {
|
||||
if (!obj) return 0;
|
||||
AlphaTimeline *_obj = (AlphaTimeline *) obj;
|
||||
return _obj->getCurveValue(time);
|
||||
float spine_alpha_timeline_get_curve_value(spine_alpha_timeline self, float time) {
|
||||
return ((CurveTimeline1*)(AlphaTimeline*)self)->getCurveValue(time);
|
||||
}
|
||||
|
||||
float spine_alpha_timeline_get_relative_value(spine_alpha_timeline obj, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
AlphaTimeline *_obj = (AlphaTimeline *) obj;
|
||||
return _obj->getRelativeValue(time, alpha, (MixBlend) blend, current, setup);
|
||||
float spine_alpha_timeline_get_relative_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
return ((CurveTimeline1*)(AlphaTimeline*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup);
|
||||
}
|
||||
|
||||
float spine_alpha_timeline_get_absolute_value(spine_alpha_timeline obj, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
AlphaTimeline *_obj = (AlphaTimeline *) obj;
|
||||
return _obj->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup);
|
||||
float spine_alpha_timeline_get_absolute_value_1(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
return ((CurveTimeline1*)(AlphaTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup);
|
||||
}
|
||||
|
||||
float spine_alpha_timeline_get_absolute_value_6(spine_alpha_timeline obj, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) {
|
||||
if (!obj) return 0;
|
||||
AlphaTimeline *_obj = (AlphaTimeline *) obj;
|
||||
return _obj->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value);
|
||||
float spine_alpha_timeline_get_absolute_value_2(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) {
|
||||
return ((CurveTimeline1*)(AlphaTimeline*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value);
|
||||
}
|
||||
|
||||
float spine_alpha_timeline_get_scale_value(spine_alpha_timeline obj, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
AlphaTimeline *_obj = (AlphaTimeline *) obj;
|
||||
return _obj->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup);
|
||||
float spine_alpha_timeline_get_scale_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) {
|
||||
return ((CurveTimeline1*)(AlphaTimeline*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup);
|
||||
}
|
||||
|
||||
int spine_alpha_timeline_get_slot_index(spine_alpha_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
AlphaTimeline *_obj = (AlphaTimeline *) obj;
|
||||
return _obj->getSlotIndex();
|
||||
void spine_alpha_timeline_set_linear(spine_alpha_timeline self, size_t frame) {
|
||||
((CurveTimeline1*)(AlphaTimeline*)self)->setLinear(frame);
|
||||
}
|
||||
|
||||
void spine_alpha_timeline_set_slot_index(spine_alpha_timeline obj, int value) {
|
||||
if (!obj) return;
|
||||
AlphaTimeline *_obj = (AlphaTimeline *) obj;
|
||||
_obj->setSlotIndex(value);
|
||||
void spine_alpha_timeline_set_stepped(spine_alpha_timeline self, size_t frame) {
|
||||
((CurveTimeline1*)(AlphaTimeline*)self)->setStepped(frame);
|
||||
}
|
||||
|
||||
void spine_alpha_timeline_set_bezier(spine_alpha_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
((CurveTimeline1*)(AlphaTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
}
|
||||
|
||||
float spine_alpha_timeline_get_bezier_value(spine_alpha_timeline self, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
return ((CurveTimeline1*)(AlphaTimeline*)self)->getBezierValue(time, frame, valueOffset, i);
|
||||
}
|
||||
|
||||
spine_array_float spine_alpha_timeline_get_curves(spine_alpha_timeline self) {
|
||||
return (spine_array_float)&((CurveTimeline1*)(AlphaTimeline*)self)->getCurves();
|
||||
}
|
||||
|
||||
size_t spine_alpha_timeline_get_frame_entries(spine_alpha_timeline self) {
|
||||
return ((CurveTimeline1*)(AlphaTimeline*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
size_t spine_alpha_timeline_get_frame_count(spine_alpha_timeline self) {
|
||||
return ((CurveTimeline1*)(AlphaTimeline*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
spine_array_float spine_alpha_timeline_get_frames(spine_alpha_timeline self) {
|
||||
return (spine_array_float)&((CurveTimeline1*)(AlphaTimeline*)self)->getFrames();
|
||||
}
|
||||
|
||||
float spine_alpha_timeline_get_duration(spine_alpha_timeline self) {
|
||||
return ((CurveTimeline1*)(AlphaTimeline*)self)->getDuration();
|
||||
}
|
||||
|
||||
spine_array_property_id spine_alpha_timeline_get_property_ids(spine_alpha_timeline self) {
|
||||
return (spine_array_property_id)&((CurveTimeline1*)(AlphaTimeline*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
int spine_alpha_timeline_get_slot_index(spine_alpha_timeline self) {
|
||||
return ((SlotTimeline*)(AlphaTimeline*)self)->getSlotIndex();
|
||||
}
|
||||
|
||||
void spine_alpha_timeline_set_slot_index(spine_alpha_timeline self, int inValue) {
|
||||
((SlotTimeline*)(AlphaTimeline*)self)->setSlotIndex(inValue);
|
||||
}
|
||||
|
||||
spine_rtti spine_alpha_timeline_rtti(void) {
|
||||
return (spine_rtti)&AlphaTimeline::rtti;
|
||||
}
|
||||
|
||||
@ -1,56 +1,41 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ALPHA_TIMELINE_H
|
||||
#define SPINE_SPINE_ALPHA_TIMELINE_H
|
||||
|
||||
#ifndef SPINE_C_ALPHATIMELINE_H
|
||||
#define SPINE_C_ALPHATIMELINE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_alpha_timeline spine_alpha_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex);
|
||||
|
||||
SPINE_C_EXPORT spine_alpha_timeline spine_alpha_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex);
|
||||
SPINE_C_EXPORT void spine_alpha_timeline_dispose(spine_alpha_timeline obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_alpha_timeline_get_rtti();
|
||||
SPINE_C_EXPORT void spine_alpha_timeline_apply(spine_alpha_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT void spine_alpha_timeline_set_frame(spine_alpha_timeline obj, size_t frame, float time, float value);
|
||||
SPINE_C_EXPORT float spine_alpha_timeline_get_curve_value(spine_alpha_timeline obj, float time);
|
||||
SPINE_C_EXPORT float spine_alpha_timeline_get_relative_value(spine_alpha_timeline obj, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_EXPORT float spine_alpha_timeline_get_absolute_value(spine_alpha_timeline obj, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_EXPORT float spine_alpha_timeline_get_absolute_value_6(spine_alpha_timeline obj, float time, float alpha, spine_mix_blend blend, float current, float setup, float value);
|
||||
SPINE_C_EXPORT float spine_alpha_timeline_get_scale_value(spine_alpha_timeline obj, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup);
|
||||
SPINE_C_EXPORT int spine_alpha_timeline_get_slot_index(spine_alpha_timeline obj);
|
||||
SPINE_C_EXPORT void spine_alpha_timeline_set_slot_index(spine_alpha_timeline obj, int value);
|
||||
SPINE_C_API void spine_alpha_timeline_dispose(spine_alpha_timeline self);
|
||||
|
||||
SPINE_C_API spine_rtti spine_alpha_timeline_get_rtti(spine_alpha_timeline self);
|
||||
SPINE_C_API void spine_alpha_timeline_apply(spine_alpha_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API void spine_alpha_timeline_set_frame(spine_alpha_timeline self, size_t frame, float time, float value);
|
||||
SPINE_C_API float spine_alpha_timeline_get_curve_value(spine_alpha_timeline self, float time);
|
||||
SPINE_C_API float spine_alpha_timeline_get_relative_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_API float spine_alpha_timeline_get_absolute_value_1(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_API float spine_alpha_timeline_get_absolute_value_2(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value);
|
||||
SPINE_C_API float spine_alpha_timeline_get_scale_value(spine_alpha_timeline self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup);
|
||||
SPINE_C_API void spine_alpha_timeline_set_linear(spine_alpha_timeline self, size_t frame);
|
||||
SPINE_C_API void spine_alpha_timeline_set_stepped(spine_alpha_timeline self, size_t frame);
|
||||
SPINE_C_API void spine_alpha_timeline_set_bezier(spine_alpha_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_API float spine_alpha_timeline_get_bezier_value(spine_alpha_timeline self, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_API spine_array_float spine_alpha_timeline_get_curves(spine_alpha_timeline self);
|
||||
SPINE_C_API size_t spine_alpha_timeline_get_frame_entries(spine_alpha_timeline self);
|
||||
SPINE_C_API size_t spine_alpha_timeline_get_frame_count(spine_alpha_timeline self);
|
||||
SPINE_C_API spine_array_float spine_alpha_timeline_get_frames(spine_alpha_timeline self);
|
||||
SPINE_C_API float spine_alpha_timeline_get_duration(spine_alpha_timeline self);
|
||||
SPINE_C_API spine_array_property_id spine_alpha_timeline_get_property_ids(spine_alpha_timeline self);
|
||||
SPINE_C_API int spine_alpha_timeline_get_slot_index(spine_alpha_timeline self);
|
||||
SPINE_C_API void spine_alpha_timeline_set_slot_index(spine_alpha_timeline self, int inValue);
|
||||
SPINE_C_API spine_rtti spine_alpha_timeline_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ALPHATIMELINE_H
|
||||
#endif /* SPINE_SPINE_ALPHA_TIMELINE_H */
|
||||
@ -1,105 +1,52 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "animation.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_animation spine_animation_create(const char* name, spine_array_timeline timelines, float duration) {
|
||||
Animation *obj = new (__FILE__, __LINE__) Animation(String(name), (Array<Timeline *> &) timelines, duration);
|
||||
return (spine_animation) obj;
|
||||
return (spine_animation) new (__FILE__, __LINE__) Animation(*((const String*)name), *((Array<Timeline *>*)timelines), duration);
|
||||
}
|
||||
|
||||
void spine_animation_dispose(spine_animation obj) {
|
||||
if (!obj) return;
|
||||
delete (Animation *) obj;
|
||||
void spine_animation_dispose(spine_animation self) {
|
||||
delete (Animation*)self;
|
||||
}
|
||||
|
||||
int32_t spine_animation_get_num_timelines(spine_animation obj) {
|
||||
if (!obj) return 0;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
return (int32_t) _obj->getTimelines().size();
|
||||
spine_array_timeline spine_animation_get_timelines(spine_animation self) {
|
||||
return (spine_array_timeline)&((Animation*)self)->getTimelines();
|
||||
}
|
||||
|
||||
spine_timeline *spine_animation_get_timelines(spine_animation obj) {
|
||||
if (!obj) return nullptr;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
return (spine_timeline *) _obj->getTimelines().buffer();
|
||||
void spine_animation_set_timelines(spine_animation self, spine_array_timeline timelines) {
|
||||
((Animation*)self)->setTimelines(*((Array<Timeline *>*)timelines));
|
||||
}
|
||||
|
||||
void spine_animation_set_timelines(spine_animation obj, spine_array_timeline value) {
|
||||
if (!obj) return;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
_obj->setTimelines((Array<Timeline *> &) value);
|
||||
bool spine_animation_has_timeline(spine_animation self, spine_array_property_id ids) {
|
||||
return ((Animation*)self)->hasTimeline(*((Array<PropertyId>*)ids));
|
||||
}
|
||||
|
||||
bool spine_animation_has_timeline(spine_animation obj, spine_array_property_id ids) {
|
||||
if (!obj) return false;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
return _obj->hasTimeline((Array<PropertyId> &) ids);
|
||||
float spine_animation_get_duration(spine_animation self) {
|
||||
return ((Animation*)self)->getDuration();
|
||||
}
|
||||
|
||||
float spine_animation_get_duration(spine_animation obj) {
|
||||
if (!obj) return 0;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
return _obj->getDuration();
|
||||
void spine_animation_set_duration(spine_animation self, float inValue) {
|
||||
((Animation*)self)->setDuration(inValue);
|
||||
}
|
||||
|
||||
void spine_animation_set_duration(spine_animation obj, float value) {
|
||||
if (!obj) return;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
_obj->setDuration(value);
|
||||
void spine_animation_apply(spine_animation self, spine_skeleton skeleton, float lastTime, float time, bool loop, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((Animation*)self)->apply(*((Skeleton*)skeleton), lastTime, time, loop, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
void spine_animation_apply(spine_animation obj, spine_skeleton skeleton, float lastTime, float time, bool loop, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, loop, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
const char* spine_animation_get_name(spine_animation self) {
|
||||
return (const char*)&((Animation*)self)->getName();
|
||||
}
|
||||
|
||||
const char* spine_animation_get_name(spine_animation obj) {
|
||||
if (!obj) return nullptr;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
return (const char *) _obj->getName().buffer();
|
||||
spine_array_int spine_animation_get_bones(spine_animation self) {
|
||||
return (spine_array_int)&((Animation*)self)->getBones();
|
||||
}
|
||||
|
||||
int32_t spine_animation_get_num_bones(spine_animation obj) {
|
||||
if (!obj) return 0;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
return (int32_t) _obj->getBones().size();
|
||||
int spine_animation_search_1(spine_array_float values, float target) {
|
||||
return Animation::search(*((Array<float>*)values), target);
|
||||
}
|
||||
|
||||
int *spine_animation_get_bones(spine_animation obj) {
|
||||
if (!obj) return nullptr;
|
||||
Animation *_obj = (Animation *) obj;
|
||||
auto& vec = _obj->getBones();
|
||||
if (vec.size() == 0) return nullptr;
|
||||
return (int *) &vec[0];
|
||||
int spine_animation_search_2(spine_array_float values, float target, int step) {
|
||||
return Animation::search(*((Array<float>*)values), target, step);
|
||||
}
|
||||
|
||||
@ -1,56 +1,30 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ANIMATION_H
|
||||
#define SPINE_SPINE_ANIMATION_H
|
||||
|
||||
#ifndef SPINE_C_ANIMATION_H
|
||||
#define SPINE_C_ANIMATION_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_animation spine_animation_create(const char* name, spine_array_timeline timelines, float duration);
|
||||
|
||||
SPINE_C_EXPORT spine_animation spine_animation_create(const char* name, spine_array_timeline timelines, float duration);
|
||||
SPINE_C_EXPORT void spine_animation_dispose(spine_animation obj);
|
||||
SPINE_C_EXPORT int32_t spine_animation_get_num_timelines(spine_animation obj);
|
||||
SPINE_C_EXPORT spine_timeline *spine_animation_get_timelines(spine_animation obj);
|
||||
SPINE_C_EXPORT void spine_animation_set_timelines(spine_animation obj, spine_array_timeline value);
|
||||
SPINE_C_EXPORT bool spine_animation_has_timeline(spine_animation obj, spine_array_property_id ids);
|
||||
SPINE_C_EXPORT float spine_animation_get_duration(spine_animation obj);
|
||||
SPINE_C_EXPORT void spine_animation_set_duration(spine_animation obj, float value);
|
||||
SPINE_C_EXPORT void spine_animation_apply(spine_animation obj, spine_skeleton skeleton, float lastTime, float time, bool loop, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT const char* spine_animation_get_name(spine_animation obj);
|
||||
SPINE_C_EXPORT int32_t spine_animation_get_num_bones(spine_animation obj);
|
||||
SPINE_C_EXPORT int *spine_animation_get_bones(spine_animation obj);
|
||||
SPINE_C_API void spine_animation_dispose(spine_animation self);
|
||||
|
||||
SPINE_C_API spine_array_timeline spine_animation_get_timelines(spine_animation self);
|
||||
SPINE_C_API void spine_animation_set_timelines(spine_animation self, spine_array_timeline timelines);
|
||||
SPINE_C_API bool spine_animation_has_timeline(spine_animation self, spine_array_property_id ids);
|
||||
SPINE_C_API float spine_animation_get_duration(spine_animation self);
|
||||
SPINE_C_API void spine_animation_set_duration(spine_animation self, float inValue);
|
||||
SPINE_C_API void spine_animation_apply(spine_animation self, spine_skeleton skeleton, float lastTime, float time, bool loop, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API const char* spine_animation_get_name(spine_animation self);
|
||||
SPINE_C_API spine_array_int spine_animation_get_bones(spine_animation self);
|
||||
SPINE_C_API int spine_animation_search_1(spine_array_float values, float target);
|
||||
SPINE_C_API int spine_animation_search_2(spine_array_float values, float target, int step);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ANIMATION_H
|
||||
#endif /* SPINE_SPINE_ANIMATION_H */
|
||||
@ -1,181 +1,100 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "animation_state.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_animation_state spine_animation_state_create(spine_animation_state_data data) {
|
||||
AnimationState *obj = new (__FILE__, __LINE__) AnimationState((AnimationStateData *) data);
|
||||
return (spine_animation_state) obj;
|
||||
return (spine_animation_state) new (__FILE__, __LINE__) AnimationState((AnimationStateData *)data);
|
||||
}
|
||||
|
||||
void spine_animation_state_dispose(spine_animation_state obj) {
|
||||
if (!obj) return;
|
||||
delete (AnimationState *) obj;
|
||||
void spine_animation_state_dispose(spine_animation_state self) {
|
||||
delete (AnimationState*)self;
|
||||
}
|
||||
|
||||
void spine_animation_state_update(spine_animation_state obj, float delta) {
|
||||
if (!obj) return ;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
_obj->update(delta);
|
||||
void spine_animation_state_update(spine_animation_state self, float delta) {
|
||||
((AnimationState*)self)->update(delta);
|
||||
}
|
||||
|
||||
bool spine_animation_state_apply(spine_animation_state obj, spine_skeleton skeleton) {
|
||||
if (!obj) return false;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return _obj->apply(*(Skeleton*) skeleton);
|
||||
bool spine_animation_state_apply(spine_animation_state self, spine_skeleton skeleton) {
|
||||
return ((AnimationState*)self)->apply(*((Skeleton*)skeleton));
|
||||
}
|
||||
|
||||
void spine_animation_state_clear_tracks(spine_animation_state obj) {
|
||||
if (!obj) return ;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
_obj->clearTracks();
|
||||
void spine_animation_state_clear_tracks(spine_animation_state self) {
|
||||
((AnimationState*)self)->clearTracks();
|
||||
}
|
||||
|
||||
void spine_animation_state_clear_track(spine_animation_state obj, size_t trackIndex) {
|
||||
if (!obj) return ;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
_obj->clearTrack(trackIndex);
|
||||
void spine_animation_state_clear_track(spine_animation_state self, size_t trackIndex) {
|
||||
((AnimationState*)self)->clearTrack(trackIndex);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_set_animation(spine_animation_state obj, size_t trackIndex, const char* animationName, bool loop) {
|
||||
if (!obj) return (spine_track_entry) 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (spine_track_entry) _obj->setAnimation(trackIndex, String(animationName), loop);
|
||||
spine_track_entry spine_animation_state_set_animation_1(spine_animation_state self, size_t trackIndex, const char* animationName, bool loop) {
|
||||
return (spine_track_entry)((AnimationState*)self)->setAnimation(trackIndex, *((const String*)animationName), loop);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_set_animation_3(spine_animation_state obj, size_t trackIndex, spine_animation animation, bool loop) {
|
||||
if (!obj) return (spine_track_entry) 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (spine_track_entry) _obj->setAnimation(trackIndex, (Animation *) animation, loop);
|
||||
spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop) {
|
||||
return (spine_track_entry)((AnimationState*)self)->setAnimation(trackIndex, (Animation *)animation, loop);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_add_animation(spine_animation_state obj, size_t trackIndex, const char* animationName, bool loop, float delay) {
|
||||
if (!obj) return (spine_track_entry) 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (spine_track_entry) _obj->addAnimation(trackIndex, String(animationName), loop, delay);
|
||||
spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char* animationName, bool loop, float delay) {
|
||||
return (spine_track_entry)((AnimationState*)self)->addAnimation(trackIndex, *((const String*)animationName), loop, delay);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_add_animation_4(spine_animation_state obj, size_t trackIndex, spine_animation animation, bool loop, float delay) {
|
||||
if (!obj) return (spine_track_entry) 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (spine_track_entry) _obj->addAnimation(trackIndex, (Animation *) animation, loop, delay);
|
||||
spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop, float delay) {
|
||||
return (spine_track_entry)((AnimationState*)self)->addAnimation(trackIndex, (Animation *)animation, loop, delay);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state obj, size_t trackIndex, float mixDuration) {
|
||||
if (!obj) return (spine_track_entry) 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (spine_track_entry) _obj->setEmptyAnimation(trackIndex, mixDuration);
|
||||
spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration) {
|
||||
return (spine_track_entry)((AnimationState*)self)->setEmptyAnimation(trackIndex, mixDuration);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state obj, size_t trackIndex, float mixDuration, float delay) {
|
||||
if (!obj) return (spine_track_entry) 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (spine_track_entry) _obj->addEmptyAnimation(trackIndex, mixDuration, delay);
|
||||
spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration, float delay) {
|
||||
return (spine_track_entry)((AnimationState*)self)->addEmptyAnimation(trackIndex, mixDuration, delay);
|
||||
}
|
||||
|
||||
void spine_animation_state_set_empty_animations(spine_animation_state obj, float value) {
|
||||
if (!obj) return;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
_obj->setEmptyAnimations(value);
|
||||
void spine_animation_state_set_empty_animations(spine_animation_state self, float mixDuration) {
|
||||
((AnimationState*)self)->setEmptyAnimations(mixDuration);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_get_current(spine_animation_state obj, size_t trackIndex) {
|
||||
if (!obj) return (spine_track_entry) 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (spine_track_entry) _obj->getCurrent(trackIndex);
|
||||
spine_track_entry spine_animation_state_get_current(spine_animation_state self, size_t trackIndex) {
|
||||
return (spine_track_entry)((AnimationState*)self)->getCurrent(trackIndex);
|
||||
}
|
||||
|
||||
spine_animation_state_data spine_animation_state_get_data(spine_animation_state obj) {
|
||||
if (!obj) return (spine_animation_state_data) 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (spine_animation_state_data) _obj->getData();
|
||||
spine_animation_state_data spine_animation_state_get_data(spine_animation_state self) {
|
||||
return (spine_animation_state_data)((AnimationState*)self)->getData();
|
||||
}
|
||||
|
||||
int32_t spine_animation_state_get_num_tracks(spine_animation_state obj) {
|
||||
if (!obj) return 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (int32_t) _obj->getTracks().size();
|
||||
spine_array_track_entry spine_animation_state_get_tracks(spine_animation_state self) {
|
||||
return (spine_array_track_entry)&((AnimationState*)self)->getTracks();
|
||||
}
|
||||
|
||||
spine_track_entry *spine_animation_state_get_tracks(spine_animation_state obj) {
|
||||
if (!obj) return nullptr;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (spine_track_entry *) _obj->getTracks().buffer();
|
||||
float spine_animation_state_get_time_scale(spine_animation_state self) {
|
||||
return ((AnimationState*)self)->getTimeScale();
|
||||
}
|
||||
|
||||
float spine_animation_state_get_time_scale(spine_animation_state obj) {
|
||||
if (!obj) return 0;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return _obj->getTimeScale();
|
||||
void spine_animation_state_set_time_scale(spine_animation_state self, float inValue) {
|
||||
((AnimationState*)self)->setTimeScale(inValue);
|
||||
}
|
||||
|
||||
void spine_animation_state_set_time_scale(spine_animation_state obj, float value) {
|
||||
if (!obj) return;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
_obj->setTimeScale(value);
|
||||
void spine_animation_state_disable_queue(spine_animation_state self) {
|
||||
((AnimationState*)self)->disableQueue();
|
||||
}
|
||||
|
||||
void spine_animation_state_disable_queue(spine_animation_state obj) {
|
||||
if (!obj) return ;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
_obj->disableQueue();
|
||||
void spine_animation_state_enable_queue(spine_animation_state self) {
|
||||
((AnimationState*)self)->enableQueue();
|
||||
}
|
||||
|
||||
void spine_animation_state_enable_queue(spine_animation_state obj) {
|
||||
if (!obj) return ;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
_obj->enableQueue();
|
||||
void spine_animation_state_set_manual_track_entry_disposal(spine_animation_state self, bool inValue) {
|
||||
((AnimationState*)self)->setManualTrackEntryDisposal(inValue);
|
||||
}
|
||||
|
||||
void spine_animation_state_set_manual_track_entry_disposal(spine_animation_state obj, bool value) {
|
||||
if (!obj) return;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
_obj->setManualTrackEntryDisposal(value);
|
||||
bool spine_animation_state_get_manual_track_entry_disposal(spine_animation_state self) {
|
||||
return ((AnimationState*)self)->getManualTrackEntryDisposal();
|
||||
}
|
||||
|
||||
bool spine_animation_state_get_manual_track_entry_disposal(spine_animation_state obj) {
|
||||
if (!obj) return false;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return _obj->getManualTrackEntryDisposal();
|
||||
void spine_animation_state_dispose_track_entry(spine_animation_state self, spine_track_entry entry) {
|
||||
((AnimationState*)self)->disposeTrackEntry((TrackEntry *)entry);
|
||||
}
|
||||
|
||||
void spine_animation_state_dispose_track_entry(spine_animation_state obj, spine_track_entry entry) {
|
||||
if (!obj) return ;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
_obj->disposeTrackEntry((TrackEntry *) entry);
|
||||
}
|
||||
|
||||
void * spine_animation_state_get_renderer_object(spine_animation_state obj) {
|
||||
if (!obj) return nullptr;
|
||||
AnimationState *_obj = (AnimationState *) obj;
|
||||
return (void *) _obj->getRendererObject();
|
||||
void * spine_animation_state_get_renderer_object(spine_animation_state self) {
|
||||
return ((HasRendererObject*)(AnimationState*)self)->getRendererObject();
|
||||
}
|
||||
|
||||
@ -1,69 +1,42 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ANIMATION_STATE_H
|
||||
#define SPINE_SPINE_ANIMATION_STATE_H
|
||||
|
||||
#ifndef SPINE_C_ANIMATIONSTATE_H
|
||||
#define SPINE_C_ANIMATIONSTATE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_animation_state spine_animation_state_create(spine_animation_state_data data);
|
||||
|
||||
SPINE_C_EXPORT spine_animation_state spine_animation_state_create(spine_animation_state_data data);
|
||||
SPINE_C_EXPORT void spine_animation_state_dispose(spine_animation_state obj);
|
||||
SPINE_C_EXPORT void spine_animation_state_update(spine_animation_state obj, float delta);
|
||||
SPINE_C_EXPORT bool spine_animation_state_apply(spine_animation_state obj, spine_skeleton skeleton);
|
||||
SPINE_C_EXPORT void spine_animation_state_clear_tracks(spine_animation_state obj);
|
||||
SPINE_C_EXPORT void spine_animation_state_clear_track(spine_animation_state obj, size_t trackIndex);
|
||||
SPINE_C_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state obj, size_t trackIndex, const char* animationName, bool loop);
|
||||
SPINE_C_EXPORT spine_track_entry spine_animation_state_set_animation_3(spine_animation_state obj, size_t trackIndex, spine_animation animation, bool loop);
|
||||
SPINE_C_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state obj, size_t trackIndex, const char* animationName, bool loop, float delay);
|
||||
SPINE_C_EXPORT spine_track_entry spine_animation_state_add_animation_4(spine_animation_state obj, size_t trackIndex, spine_animation animation, bool loop, float delay);
|
||||
SPINE_C_EXPORT spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state obj, size_t trackIndex, float mixDuration);
|
||||
SPINE_C_EXPORT spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state obj, size_t trackIndex, float mixDuration, float delay);
|
||||
SPINE_C_EXPORT void spine_animation_state_set_empty_animations(spine_animation_state obj, float value);
|
||||
SPINE_C_EXPORT spine_track_entry spine_animation_state_get_current(spine_animation_state obj, size_t trackIndex);
|
||||
SPINE_C_EXPORT spine_animation_state_data spine_animation_state_get_data(spine_animation_state obj);
|
||||
SPINE_C_EXPORT int32_t spine_animation_state_get_num_tracks(spine_animation_state obj);
|
||||
SPINE_C_EXPORT spine_track_entry *spine_animation_state_get_tracks(spine_animation_state obj);
|
||||
SPINE_C_EXPORT float spine_animation_state_get_time_scale(spine_animation_state obj);
|
||||
SPINE_C_EXPORT void spine_animation_state_set_time_scale(spine_animation_state obj, float value);
|
||||
SPINE_C_EXPORT void spine_animation_state_disable_queue(spine_animation_state obj);
|
||||
SPINE_C_EXPORT void spine_animation_state_enable_queue(spine_animation_state obj);
|
||||
SPINE_C_EXPORT void spine_animation_state_set_manual_track_entry_disposal(spine_animation_state obj, bool value);
|
||||
SPINE_C_EXPORT bool spine_animation_state_get_manual_track_entry_disposal(spine_animation_state obj);
|
||||
SPINE_C_EXPORT void spine_animation_state_dispose_track_entry(spine_animation_state obj, spine_track_entry entry);
|
||||
SPINE_C_EXPORT void * spine_animation_state_get_renderer_object(spine_animation_state obj);
|
||||
SPINE_C_API void spine_animation_state_dispose(spine_animation_state self);
|
||||
|
||||
SPINE_C_API void spine_animation_state_update(spine_animation_state self, float delta);
|
||||
SPINE_C_API bool spine_animation_state_apply(spine_animation_state self, spine_skeleton skeleton);
|
||||
SPINE_C_API void spine_animation_state_clear_tracks(spine_animation_state self);
|
||||
SPINE_C_API void spine_animation_state_clear_track(spine_animation_state self, size_t trackIndex);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_set_animation_1(spine_animation_state self, size_t trackIndex, const char* animationName, bool loop);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char* animationName, bool loop, float delay);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop, float delay);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration, float delay);
|
||||
SPINE_C_API void spine_animation_state_set_empty_animations(spine_animation_state self, float mixDuration);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_get_current(spine_animation_state self, size_t trackIndex);
|
||||
SPINE_C_API spine_animation_state_data spine_animation_state_get_data(spine_animation_state self);
|
||||
SPINE_C_API spine_array_track_entry spine_animation_state_get_tracks(spine_animation_state self);
|
||||
SPINE_C_API float spine_animation_state_get_time_scale(spine_animation_state self);
|
||||
SPINE_C_API void spine_animation_state_set_time_scale(spine_animation_state self, float inValue);
|
||||
SPINE_C_API void spine_animation_state_disable_queue(spine_animation_state self);
|
||||
SPINE_C_API void spine_animation_state_enable_queue(spine_animation_state self);
|
||||
SPINE_C_API void spine_animation_state_set_manual_track_entry_disposal(spine_animation_state self, bool inValue);
|
||||
SPINE_C_API bool spine_animation_state_get_manual_track_entry_disposal(spine_animation_state self);
|
||||
SPINE_C_API void spine_animation_state_dispose_track_entry(spine_animation_state self, spine_track_entry entry);
|
||||
SPINE_C_API void * spine_animation_state_get_renderer_object(spine_animation_state self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ANIMATIONSTATE_H
|
||||
#endif /* SPINE_SPINE_ANIMATION_STATE_H */
|
||||
@ -1,85 +1,40 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "animation_state_data.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_animation_state_data spine_animation_state_data_create(spine_skeleton_data skeletonData) {
|
||||
AnimationStateData *obj = new (__FILE__, __LINE__) AnimationStateData((SkeletonData *) skeletonData);
|
||||
return (spine_animation_state_data) obj;
|
||||
return (spine_animation_state_data) new (__FILE__, __LINE__) AnimationStateData((SkeletonData *)skeletonData);
|
||||
}
|
||||
|
||||
void spine_animation_state_data_dispose(spine_animation_state_data obj) {
|
||||
if (!obj) return;
|
||||
delete (AnimationStateData *) obj;
|
||||
void spine_animation_state_data_dispose(spine_animation_state_data self) {
|
||||
delete (AnimationStateData*)self;
|
||||
}
|
||||
|
||||
spine_skeleton_data spine_animation_state_data_get_skeleton_data(spine_animation_state_data obj) {
|
||||
if (!obj) return (spine_skeleton_data) 0;
|
||||
AnimationStateData *_obj = (AnimationStateData *) obj;
|
||||
return (spine_skeleton_data) _obj->getSkeletonData();
|
||||
spine_skeleton_data spine_animation_state_data_get_skeleton_data(spine_animation_state_data self) {
|
||||
return (spine_skeleton_data)((AnimationStateData*)self)->getSkeletonData();
|
||||
}
|
||||
|
||||
float spine_animation_state_data_get_default_mix(spine_animation_state_data obj) {
|
||||
if (!obj) return 0;
|
||||
AnimationStateData *_obj = (AnimationStateData *) obj;
|
||||
return _obj->getDefaultMix();
|
||||
float spine_animation_state_data_get_default_mix(spine_animation_state_data self) {
|
||||
return ((AnimationStateData*)self)->getDefaultMix();
|
||||
}
|
||||
|
||||
void spine_animation_state_data_set_default_mix(spine_animation_state_data obj, float value) {
|
||||
if (!obj) return;
|
||||
AnimationStateData *_obj = (AnimationStateData *) obj;
|
||||
_obj->setDefaultMix(value);
|
||||
void spine_animation_state_data_set_default_mix(spine_animation_state_data self, float inValue) {
|
||||
((AnimationStateData*)self)->setDefaultMix(inValue);
|
||||
}
|
||||
|
||||
void spine_animation_state_data_set_mix(spine_animation_state_data obj, const char* fromName, const char* toName, float duration) {
|
||||
if (!obj) return ;
|
||||
AnimationStateData *_obj = (AnimationStateData *) obj;
|
||||
_obj->setMix(String(fromName), String(toName), duration);
|
||||
void spine_animation_state_data_set_mix_1(spine_animation_state_data self, const char* fromName, const char* toName, float duration) {
|
||||
((AnimationStateData*)self)->setMix(*((const String*)fromName), *((const String*)toName), duration);
|
||||
}
|
||||
|
||||
void spine_animation_state_data_set_mix_3(spine_animation_state_data obj, spine_animation from, spine_animation to, float duration) {
|
||||
if (!obj) return ;
|
||||
AnimationStateData *_obj = (AnimationStateData *) obj;
|
||||
_obj->setMix((Animation *) from, (Animation *) to, duration);
|
||||
void spine_animation_state_data_set_mix_2(spine_animation_state_data self, spine_animation from, spine_animation to, float duration) {
|
||||
((AnimationStateData*)self)->setMix((Animation *)from, (Animation *)to, duration);
|
||||
}
|
||||
|
||||
float spine_animation_state_data_get_mix(spine_animation_state_data obj, spine_animation from, spine_animation to) {
|
||||
if (!obj) return 0;
|
||||
AnimationStateData *_obj = (AnimationStateData *) obj;
|
||||
return _obj->getMix((Animation *) from, (Animation *) to);
|
||||
float spine_animation_state_data_get_mix(spine_animation_state_data self, spine_animation from, spine_animation to) {
|
||||
return ((AnimationStateData*)self)->getMix((Animation *)from, (Animation *)to);
|
||||
}
|
||||
|
||||
void spine_animation_state_data_clear(spine_animation_state_data obj) {
|
||||
if (!obj) return ;
|
||||
AnimationStateData *_obj = (AnimationStateData *) obj;
|
||||
_obj->clear();
|
||||
void spine_animation_state_data_clear(spine_animation_state_data self) {
|
||||
((AnimationStateData*)self)->clear();
|
||||
}
|
||||
|
||||
@ -1,53 +1,27 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ANIMATION_STATE_DATA_H
|
||||
#define SPINE_SPINE_ANIMATION_STATE_DATA_H
|
||||
|
||||
#ifndef SPINE_C_ANIMATIONSTATEDATA_H
|
||||
#define SPINE_C_ANIMATIONSTATEDATA_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_animation_state_data spine_animation_state_data_create(spine_skeleton_data skeletonData);
|
||||
|
||||
SPINE_C_EXPORT spine_animation_state_data spine_animation_state_data_create(spine_skeleton_data skeletonData);
|
||||
SPINE_C_EXPORT void spine_animation_state_data_dispose(spine_animation_state_data obj);
|
||||
SPINE_C_EXPORT spine_skeleton_data spine_animation_state_data_get_skeleton_data(spine_animation_state_data obj);
|
||||
SPINE_C_EXPORT float spine_animation_state_data_get_default_mix(spine_animation_state_data obj);
|
||||
SPINE_C_EXPORT void spine_animation_state_data_set_default_mix(spine_animation_state_data obj, float value);
|
||||
SPINE_C_EXPORT void spine_animation_state_data_set_mix(spine_animation_state_data obj, const char* fromName, const char* toName, float duration);
|
||||
SPINE_C_EXPORT void spine_animation_state_data_set_mix_3(spine_animation_state_data obj, spine_animation from, spine_animation to, float duration);
|
||||
SPINE_C_EXPORT float spine_animation_state_data_get_mix(spine_animation_state_data obj, spine_animation from, spine_animation to);
|
||||
SPINE_C_EXPORT void spine_animation_state_data_clear(spine_animation_state_data obj);
|
||||
SPINE_C_API void spine_animation_state_data_dispose(spine_animation_state_data self);
|
||||
|
||||
SPINE_C_API spine_skeleton_data spine_animation_state_data_get_skeleton_data(spine_animation_state_data self);
|
||||
SPINE_C_API float spine_animation_state_data_get_default_mix(spine_animation_state_data self);
|
||||
SPINE_C_API void spine_animation_state_data_set_default_mix(spine_animation_state_data self, float inValue);
|
||||
SPINE_C_API void spine_animation_state_data_set_mix_1(spine_animation_state_data self, const char* fromName, const char* toName, float duration);
|
||||
SPINE_C_API void spine_animation_state_data_set_mix_2(spine_animation_state_data self, spine_animation from, spine_animation to, float duration);
|
||||
SPINE_C_API float spine_animation_state_data_get_mix(spine_animation_state_data self, spine_animation from, spine_animation to);
|
||||
SPINE_C_API void spine_animation_state_data_clear(spine_animation_state_data self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ANIMATIONSTATEDATA_H
|
||||
#endif /* SPINE_SPINE_ANIMATION_STATE_DATA_H */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,84 +1,24 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "atlas.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_atlas spine_atlas_create(const char* path, spine_texture_loader textureLoader, bool createTexture) {
|
||||
Atlas *obj = new (__FILE__, __LINE__) Atlas(String(path), (TextureLoader *) textureLoader, createTexture);
|
||||
return (spine_atlas) obj;
|
||||
void spine_atlas_dispose(spine_atlas self) {
|
||||
delete (Atlas*)self;
|
||||
}
|
||||
|
||||
spine_atlas spine_atlas_create_with_string_int_string_texture_loader_bool(const char * data, int length, const char * dir, spine_texture_loader textureLoader, bool createTexture) {
|
||||
Atlas *obj = new (__FILE__, __LINE__) Atlas((const char *) data, length, (const char *) dir, (TextureLoader *) textureLoader, createTexture);
|
||||
return (spine_atlas) obj;
|
||||
void spine_atlas_flip_v(spine_atlas self) {
|
||||
((Atlas*)self)->flipV();
|
||||
}
|
||||
|
||||
void spine_atlas_dispose(spine_atlas obj) {
|
||||
if (!obj) return;
|
||||
delete (Atlas *) obj;
|
||||
spine_atlas_region spine_atlas_find_region(spine_atlas self, const char* name) {
|
||||
return (spine_atlas_region)((Atlas*)self)->findRegion(*((const String*)name));
|
||||
}
|
||||
|
||||
void spine_atlas_flip_v(spine_atlas obj) {
|
||||
if (!obj) return ;
|
||||
Atlas *_obj = (Atlas *) obj;
|
||||
_obj->flipV();
|
||||
spine_array_atlas_page spine_atlas_get_pages(spine_atlas self) {
|
||||
return (spine_array_atlas_page)&((Atlas*)self)->getPages();
|
||||
}
|
||||
|
||||
spine_atlas_region spine_atlas_find_region(spine_atlas obj, const char* name) {
|
||||
if (!obj) return (spine_atlas_region) 0;
|
||||
Atlas *_obj = (Atlas *) obj;
|
||||
return (spine_atlas_region) _obj->findRegion(String(name));
|
||||
}
|
||||
|
||||
int32_t spine_atlas_get_num_pages(spine_atlas obj) {
|
||||
if (!obj) return 0;
|
||||
Atlas *_obj = (Atlas *) obj;
|
||||
return (int32_t) _obj->getPages().size();
|
||||
}
|
||||
|
||||
spine_atlas_page *spine_atlas_get_pages(spine_atlas obj) {
|
||||
if (!obj) return nullptr;
|
||||
Atlas *_obj = (Atlas *) obj;
|
||||
return (spine_atlas_page *) _obj->getPages().buffer();
|
||||
}
|
||||
|
||||
int32_t spine_atlas_get_num_regions(spine_atlas obj) {
|
||||
if (!obj) return 0;
|
||||
Atlas *_obj = (Atlas *) obj;
|
||||
return (int32_t) _obj->getRegions().size();
|
||||
}
|
||||
|
||||
spine_atlas_region *spine_atlas_get_regions(spine_atlas obj) {
|
||||
if (!obj) return nullptr;
|
||||
Atlas *_obj = (Atlas *) obj;
|
||||
return (spine_atlas_region *) _obj->getRegions().buffer();
|
||||
spine_array_atlas_region spine_atlas_get_regions(spine_atlas self) {
|
||||
return (spine_array_atlas_region)&((Atlas*)self)->getRegions();
|
||||
}
|
||||
|
||||
@ -1,54 +1,22 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ATLAS_H
|
||||
#define SPINE_SPINE_ATLAS_H
|
||||
|
||||
#ifndef SPINE_C_ATLAS_H
|
||||
#define SPINE_C_ATLAS_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "../extensions.h"
|
||||
SPINE_C_API void spine_atlas_dispose(spine_atlas self);
|
||||
|
||||
SPINE_C_EXPORT spine_atlas spine_atlas_create(const char* path, spine_texture_loader textureLoader, bool createTexture);
|
||||
SPINE_C_EXPORT spine_atlas spine_atlas_create_with_string_int_string_texture_loader_bool(const char * data, int length, const char * dir, spine_texture_loader textureLoader, bool createTexture);
|
||||
SPINE_C_EXPORT void spine_atlas_dispose(spine_atlas obj);
|
||||
SPINE_C_EXPORT void spine_atlas_flip_v(spine_atlas obj);
|
||||
SPINE_C_EXPORT spine_atlas_region spine_atlas_find_region(spine_atlas obj, const char* name);
|
||||
SPINE_C_EXPORT int32_t spine_atlas_get_num_pages(spine_atlas obj);
|
||||
SPINE_C_EXPORT spine_atlas_page *spine_atlas_get_pages(spine_atlas obj);
|
||||
SPINE_C_EXPORT int32_t spine_atlas_get_num_regions(spine_atlas obj);
|
||||
SPINE_C_EXPORT spine_atlas_region *spine_atlas_get_regions(spine_atlas obj);
|
||||
SPINE_C_API void spine_atlas_flip_v(spine_atlas self);
|
||||
SPINE_C_API spine_atlas_region spine_atlas_find_region(spine_atlas self, const char* name);
|
||||
SPINE_C_API spine_array_atlas_page spine_atlas_get_pages(spine_atlas self);
|
||||
SPINE_C_API spine_array_atlas_region spine_atlas_get_regions(spine_atlas self);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ATLAS_H
|
||||
#endif /* SPINE_SPINE_ATLAS_H */
|
||||
@ -1,85 +1,40 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "atlas_attachment_loader.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_atlas_attachment_loader spine_atlas_attachment_loader_create(spine_atlas atlas) {
|
||||
AtlasAttachmentLoader *obj = new (__FILE__, __LINE__) AtlasAttachmentLoader((Atlas *) atlas);
|
||||
return (spine_atlas_attachment_loader) obj;
|
||||
return (spine_atlas_attachment_loader) new (__FILE__, __LINE__) AtlasAttachmentLoader((Atlas *)atlas);
|
||||
}
|
||||
|
||||
void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader obj) {
|
||||
if (!obj) return;
|
||||
delete (AtlasAttachmentLoader *) obj;
|
||||
void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader self) {
|
||||
delete (AtlasAttachmentLoader*)self;
|
||||
}
|
||||
|
||||
spine_region_attachment spine_atlas_attachment_loader_new_region_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name, const char* path, spine_sequence sequence) {
|
||||
if (!obj) return (spine_region_attachment) 0;
|
||||
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
|
||||
return (spine_region_attachment) _obj->newRegionAttachment(*(Skin*) skin, String(name), String(path), (Sequence *) sequence);
|
||||
spine_region_attachment spine_atlas_attachment_loader_new_region_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name, const char* path, spine_sequence sequence) {
|
||||
return (spine_region_attachment)((AtlasAttachmentLoader*)self)->newRegionAttachment(*((Skin*)skin), *((const String*)name), *((const String*)path), (Sequence *)sequence);
|
||||
}
|
||||
|
||||
spine_mesh_attachment spine_atlas_attachment_loader_new_mesh_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name, const char* path, spine_sequence sequence) {
|
||||
if (!obj) return (spine_mesh_attachment) 0;
|
||||
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
|
||||
return (spine_mesh_attachment) _obj->newMeshAttachment(*(Skin*) skin, String(name), String(path), (Sequence *) sequence);
|
||||
spine_mesh_attachment spine_atlas_attachment_loader_new_mesh_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name, const char* path, spine_sequence sequence) {
|
||||
return (spine_mesh_attachment)((AtlasAttachmentLoader*)self)->newMeshAttachment(*((Skin*)skin), *((const String*)name), *((const String*)path), (Sequence *)sequence);
|
||||
}
|
||||
|
||||
spine_bounding_box_attachment spine_atlas_attachment_loader_new_bounding_box_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name) {
|
||||
if (!obj) return (spine_bounding_box_attachment) 0;
|
||||
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
|
||||
return (spine_bounding_box_attachment) _obj->newBoundingBoxAttachment(*(Skin*) skin, String(name));
|
||||
spine_bounding_box_attachment spine_atlas_attachment_loader_new_bounding_box_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name) {
|
||||
return (spine_bounding_box_attachment)((AtlasAttachmentLoader*)self)->newBoundingBoxAttachment(*((Skin*)skin), *((const String*)name));
|
||||
}
|
||||
|
||||
spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name) {
|
||||
if (!obj) return (spine_path_attachment) 0;
|
||||
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
|
||||
return (spine_path_attachment) _obj->newPathAttachment(*(Skin*) skin, String(name));
|
||||
spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name) {
|
||||
return (spine_path_attachment)((AtlasAttachmentLoader*)self)->newPathAttachment(*((Skin*)skin), *((const String*)name));
|
||||
}
|
||||
|
||||
spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name) {
|
||||
if (!obj) return 0;
|
||||
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
|
||||
return (spine_point_attachment) _obj->newPointAttachment(*(Skin*) skin, String(name));
|
||||
spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name) {
|
||||
return (spine_point_attachment)((AtlasAttachmentLoader*)self)->newPointAttachment(*((Skin*)skin), *((const String*)name));
|
||||
}
|
||||
|
||||
spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name) {
|
||||
if (!obj) return (spine_clipping_attachment) 0;
|
||||
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
|
||||
return (spine_clipping_attachment) _obj->newClippingAttachment(*(Skin*) skin, String(name));
|
||||
spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name) {
|
||||
return (spine_clipping_attachment)((AtlasAttachmentLoader*)self)->newClippingAttachment(*((Skin*)skin), *((const String*)name));
|
||||
}
|
||||
|
||||
spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader obj, const char* name) {
|
||||
if (!obj) return (spine_atlas_region) 0;
|
||||
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
|
||||
return (spine_atlas_region) _obj->findRegion(String(name));
|
||||
spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader self, const char* name) {
|
||||
return (spine_atlas_region)((AtlasAttachmentLoader*)self)->findRegion(*((const String*)name));
|
||||
}
|
||||
|
||||
@ -1,53 +1,27 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ATLAS_ATTACHMENT_LOADER_H
|
||||
#define SPINE_SPINE_ATLAS_ATTACHMENT_LOADER_H
|
||||
|
||||
#ifndef SPINE_C_ATLASATTACHMENTLOADER_H
|
||||
#define SPINE_C_ATLASATTACHMENTLOADER_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_atlas_attachment_loader spine_atlas_attachment_loader_create(spine_atlas atlas);
|
||||
|
||||
SPINE_C_EXPORT spine_atlas_attachment_loader spine_atlas_attachment_loader_create(spine_atlas atlas);
|
||||
SPINE_C_EXPORT void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader obj);
|
||||
SPINE_C_EXPORT spine_region_attachment spine_atlas_attachment_loader_new_region_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name, const char* path, spine_sequence sequence);
|
||||
SPINE_C_EXPORT spine_mesh_attachment spine_atlas_attachment_loader_new_mesh_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name, const char* path, spine_sequence sequence);
|
||||
SPINE_C_EXPORT spine_bounding_box_attachment spine_atlas_attachment_loader_new_bounding_box_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name);
|
||||
SPINE_C_EXPORT spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name);
|
||||
SPINE_C_EXPORT spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name);
|
||||
SPINE_C_EXPORT spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const char* name);
|
||||
SPINE_C_EXPORT spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader obj, const char* name);
|
||||
SPINE_C_API void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader self);
|
||||
|
||||
SPINE_C_API spine_region_attachment spine_atlas_attachment_loader_new_region_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name, const char* path, spine_sequence sequence);
|
||||
SPINE_C_API spine_mesh_attachment spine_atlas_attachment_loader_new_mesh_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name, const char* path, spine_sequence sequence);
|
||||
SPINE_C_API spine_bounding_box_attachment spine_atlas_attachment_loader_new_bounding_box_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name);
|
||||
SPINE_C_API spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name);
|
||||
SPINE_C_API spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name);
|
||||
SPINE_C_API spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader self, spine_skin skin, const char* name);
|
||||
SPINE_C_API spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader self, const char* name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ATLASATTACHMENTLOADER_H
|
||||
#endif /* SPINE_SPINE_ATLAS_ATTACHMENT_LOADER_H */
|
||||
@ -1,43 +1,108 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "atlas_page.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_atlas_page spine_atlas_page_create(const char* inName) {
|
||||
AtlasPage *obj = new (__FILE__, __LINE__) AtlasPage(String(inName));
|
||||
return (spine_atlas_page) obj;
|
||||
return (spine_atlas_page) new (__FILE__, __LINE__) AtlasPage(*((const String*)inName));
|
||||
}
|
||||
|
||||
void spine_atlas_page_dispose(spine_atlas_page obj) {
|
||||
if (!obj) return;
|
||||
delete (AtlasPage *) obj;
|
||||
void spine_atlas_page_dispose(spine_atlas_page self) {
|
||||
delete (AtlasPage*)self;
|
||||
}
|
||||
|
||||
const char* spine_atlas_page_get_name(spine_atlas_page self) {
|
||||
return ((AtlasPage*)self)->name.buffer();
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_name(spine_atlas_page self, const char* value) {
|
||||
((AtlasPage*)self)->name = String(value);
|
||||
}
|
||||
|
||||
const char* spine_atlas_page_get_texture_path(spine_atlas_page self) {
|
||||
return ((AtlasPage*)self)->texturePath.buffer();
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_texture_path(spine_atlas_page self, const char* value) {
|
||||
((AtlasPage*)self)->texturePath = String(value);
|
||||
}
|
||||
|
||||
spine_format spine_atlas_page_get_format(spine_atlas_page self) {
|
||||
return (spine_format)((AtlasPage*)self)->format;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_format(spine_atlas_page self, spine_format value) {
|
||||
((AtlasPage*)self)->format = (Format)value;
|
||||
}
|
||||
|
||||
spine_texture_filter spine_atlas_page_get_min_filter(spine_atlas_page self) {
|
||||
return (spine_texture_filter)((AtlasPage*)self)->minFilter;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_min_filter(spine_atlas_page self, spine_texture_filter value) {
|
||||
((AtlasPage*)self)->minFilter = (TextureFilter)value;
|
||||
}
|
||||
|
||||
spine_texture_filter spine_atlas_page_get_mag_filter(spine_atlas_page self) {
|
||||
return (spine_texture_filter)((AtlasPage*)self)->magFilter;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_mag_filter(spine_atlas_page self, spine_texture_filter value) {
|
||||
((AtlasPage*)self)->magFilter = (TextureFilter)value;
|
||||
}
|
||||
|
||||
spine_texture_wrap spine_atlas_page_get_u_wrap(spine_atlas_page self) {
|
||||
return (spine_texture_wrap)((AtlasPage*)self)->uWrap;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_u_wrap(spine_atlas_page self, spine_texture_wrap value) {
|
||||
((AtlasPage*)self)->uWrap = (TextureWrap)value;
|
||||
}
|
||||
|
||||
spine_texture_wrap spine_atlas_page_get_v_wrap(spine_atlas_page self) {
|
||||
return (spine_texture_wrap)((AtlasPage*)self)->vWrap;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_v_wrap(spine_atlas_page self, spine_texture_wrap value) {
|
||||
((AtlasPage*)self)->vWrap = (TextureWrap)value;
|
||||
}
|
||||
|
||||
int spine_atlas_page_get_width(spine_atlas_page self) {
|
||||
return ((AtlasPage*)self)->width;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_width(spine_atlas_page self, int value) {
|
||||
((AtlasPage*)self)->width = value;
|
||||
}
|
||||
|
||||
int spine_atlas_page_get_height(spine_atlas_page self) {
|
||||
return ((AtlasPage*)self)->height;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_height(spine_atlas_page self, int value) {
|
||||
((AtlasPage*)self)->height = value;
|
||||
}
|
||||
|
||||
bool spine_atlas_page_get_pma(spine_atlas_page self) {
|
||||
return ((AtlasPage*)self)->pma;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_pma(spine_atlas_page self, bool value) {
|
||||
((AtlasPage*)self)->pma = value;
|
||||
}
|
||||
|
||||
int spine_atlas_page_get_index(spine_atlas_page self) {
|
||||
return ((AtlasPage*)self)->index;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_index(spine_atlas_page self, int value) {
|
||||
((AtlasPage*)self)->index = value;
|
||||
}
|
||||
|
||||
void * spine_atlas_page_get_texture(spine_atlas_page self) {
|
||||
return ((AtlasPage*)self)->texture;
|
||||
}
|
||||
|
||||
void spine_atlas_page_set_texture(spine_atlas_page self, void * value) {
|
||||
((AtlasPage*)self)->texture = (void*)value;
|
||||
}
|
||||
|
||||
@ -1,46 +1,44 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ATLAS_PAGE_H
|
||||
#define SPINE_SPINE_ATLAS_PAGE_H
|
||||
|
||||
#ifndef SPINE_C_ATLASPAGE_H
|
||||
#define SPINE_C_ATLASPAGE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_atlas_page spine_atlas_page_create(const char* inName);
|
||||
|
||||
SPINE_C_EXPORT spine_atlas_page spine_atlas_page_create(const char* inName);
|
||||
SPINE_C_EXPORT void spine_atlas_page_dispose(spine_atlas_page obj);
|
||||
SPINE_C_API void spine_atlas_page_dispose(spine_atlas_page self);
|
||||
|
||||
SPINE_C_API const char* spine_atlas_page_get_name(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_name(spine_atlas_page self, const char* value);
|
||||
SPINE_C_API const char* spine_atlas_page_get_texture_path(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_texture_path(spine_atlas_page self, const char* value);
|
||||
SPINE_C_API spine_format spine_atlas_page_get_format(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_format(spine_atlas_page self, spine_format value);
|
||||
SPINE_C_API spine_texture_filter spine_atlas_page_get_min_filter(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_min_filter(spine_atlas_page self, spine_texture_filter value);
|
||||
SPINE_C_API spine_texture_filter spine_atlas_page_get_mag_filter(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_mag_filter(spine_atlas_page self, spine_texture_filter value);
|
||||
SPINE_C_API spine_texture_wrap spine_atlas_page_get_u_wrap(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_u_wrap(spine_atlas_page self, spine_texture_wrap value);
|
||||
SPINE_C_API spine_texture_wrap spine_atlas_page_get_v_wrap(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_v_wrap(spine_atlas_page self, spine_texture_wrap value);
|
||||
SPINE_C_API int spine_atlas_page_get_width(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_width(spine_atlas_page self, int value);
|
||||
SPINE_C_API int spine_atlas_page_get_height(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_height(spine_atlas_page self, int value);
|
||||
SPINE_C_API bool spine_atlas_page_get_pma(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_pma(spine_atlas_page self, bool value);
|
||||
SPINE_C_API int spine_atlas_page_get_index(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_index(spine_atlas_page self, int value);
|
||||
SPINE_C_API void * spine_atlas_page_get_texture(spine_atlas_page self);
|
||||
SPINE_C_API void spine_atlas_page_set_texture(spine_atlas_page self, void * value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ATLASPAGE_H
|
||||
#endif /* SPINE_SPINE_ATLAS_PAGE_H */
|
||||
@ -1,38 +1,76 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "atlas_region.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_atlas_region_dispose(spine_atlas_region obj) {
|
||||
if (!obj) return;
|
||||
delete (AtlasRegion *) obj;
|
||||
spine_atlas_region spine_atlas_region_create(void) {
|
||||
return (spine_atlas_region) new (__FILE__, __LINE__) AtlasRegion();
|
||||
}
|
||||
|
||||
void spine_atlas_region_dispose(spine_atlas_region self) {
|
||||
delete (AtlasRegion*)self;
|
||||
}
|
||||
|
||||
spine_atlas_page spine_atlas_region_get_page(spine_atlas_region self) {
|
||||
return (spine_atlas_page)((AtlasRegion*)self)->page;
|
||||
}
|
||||
|
||||
void spine_atlas_region_set_page(spine_atlas_region self, spine_atlas_page value) {
|
||||
((AtlasRegion*)self)->page = (AtlasPage*)value;
|
||||
}
|
||||
|
||||
const char* spine_atlas_region_get_name(spine_atlas_region self) {
|
||||
return ((AtlasRegion*)self)->name.buffer();
|
||||
}
|
||||
|
||||
void spine_atlas_region_set_name(spine_atlas_region self, const char* value) {
|
||||
((AtlasRegion*)self)->name = String(value);
|
||||
}
|
||||
|
||||
int spine_atlas_region_get_index(spine_atlas_region self) {
|
||||
return ((AtlasRegion*)self)->index;
|
||||
}
|
||||
|
||||
void spine_atlas_region_set_index(spine_atlas_region self, int value) {
|
||||
((AtlasRegion*)self)->index = value;
|
||||
}
|
||||
|
||||
int spine_atlas_region_get_x(spine_atlas_region self) {
|
||||
return ((AtlasRegion*)self)->x;
|
||||
}
|
||||
|
||||
void spine_atlas_region_set_x(spine_atlas_region self, int value) {
|
||||
((AtlasRegion*)self)->x = value;
|
||||
}
|
||||
|
||||
int spine_atlas_region_get_y(spine_atlas_region self) {
|
||||
return ((AtlasRegion*)self)->y;
|
||||
}
|
||||
|
||||
void spine_atlas_region_set_y(spine_atlas_region self, int value) {
|
||||
((AtlasRegion*)self)->y = value;
|
||||
}
|
||||
|
||||
spine_array_int spine_atlas_region_get_splits(spine_atlas_region self) {
|
||||
return (spine_array_int)&((AtlasRegion*)self)->splits;
|
||||
}
|
||||
|
||||
void spine_atlas_region_set_splits(spine_atlas_region self, spine_array_int value) {
|
||||
((AtlasRegion*)self)->splits = *((Array<int>*)value);
|
||||
}
|
||||
|
||||
spine_array_int spine_atlas_region_get_pads(spine_atlas_region self) {
|
||||
return (spine_array_int)&((AtlasRegion*)self)->pads;
|
||||
}
|
||||
|
||||
void spine_atlas_region_set_pads(spine_atlas_region self, spine_array_int value) {
|
||||
((AtlasRegion*)self)->pads = *((Array<int>*)value);
|
||||
}
|
||||
|
||||
spine_array_float spine_atlas_region_get_values(spine_atlas_region self) {
|
||||
return (spine_array_float)&((AtlasRegion*)self)->values;
|
||||
}
|
||||
|
||||
void spine_atlas_region_set_values(spine_atlas_region self, spine_array_float value) {
|
||||
((AtlasRegion*)self)->values = *((Array<float>*)value);
|
||||
}
|
||||
|
||||
@ -1,45 +1,36 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ATLAS_REGION_H
|
||||
#define SPINE_SPINE_ATLAS_REGION_H
|
||||
|
||||
#ifndef SPINE_C_ATLASREGION_H
|
||||
#define SPINE_C_ATLASREGION_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_atlas_region spine_atlas_region_create(void);
|
||||
|
||||
SPINE_C_EXPORT void spine_atlas_region_dispose(spine_atlas_region obj);
|
||||
SPINE_C_API void spine_atlas_region_dispose(spine_atlas_region self);
|
||||
|
||||
SPINE_C_API spine_atlas_page spine_atlas_region_get_page(spine_atlas_region self);
|
||||
SPINE_C_API void spine_atlas_region_set_page(spine_atlas_region self, spine_atlas_page value);
|
||||
SPINE_C_API const char* spine_atlas_region_get_name(spine_atlas_region self);
|
||||
SPINE_C_API void spine_atlas_region_set_name(spine_atlas_region self, const char* value);
|
||||
SPINE_C_API int spine_atlas_region_get_index(spine_atlas_region self);
|
||||
SPINE_C_API void spine_atlas_region_set_index(spine_atlas_region self, int value);
|
||||
SPINE_C_API int spine_atlas_region_get_x(spine_atlas_region self);
|
||||
SPINE_C_API void spine_atlas_region_set_x(spine_atlas_region self, int value);
|
||||
SPINE_C_API int spine_atlas_region_get_y(spine_atlas_region self);
|
||||
SPINE_C_API void spine_atlas_region_set_y(spine_atlas_region self, int value);
|
||||
SPINE_C_API spine_array_int spine_atlas_region_get_splits(spine_atlas_region self);
|
||||
SPINE_C_API void spine_atlas_region_set_splits(spine_atlas_region self, spine_array_int value);
|
||||
SPINE_C_API spine_array_int spine_atlas_region_get_pads(spine_atlas_region self);
|
||||
SPINE_C_API void spine_atlas_region_set_pads(spine_atlas_region self, spine_array_int value);
|
||||
SPINE_C_API spine_array_float spine_atlas_region_get_values(spine_atlas_region self);
|
||||
SPINE_C_API void spine_atlas_region_set_values(spine_atlas_region self, spine_array_float value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ATLASREGION_H
|
||||
#endif /* SPINE_SPINE_ATLAS_REGION_H */
|
||||
@ -1,72 +1,36 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "attachment.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_attachment_dispose(spine_attachment obj) {
|
||||
if (!obj) return;
|
||||
delete (Attachment *) obj;
|
||||
void spine_attachment_dispose(spine_attachment self) {
|
||||
delete (Attachment*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_attachment_get_rtti() {
|
||||
return (spine_rtti) &Attachment::rtti;
|
||||
spine_rtti spine_attachment_get_rtti(spine_attachment self) {
|
||||
return (spine_rtti)&((Attachment*)self)->getRTTI();
|
||||
}
|
||||
|
||||
const char* spine_attachment_get_name(spine_attachment obj) {
|
||||
if (!obj) return nullptr;
|
||||
Attachment *_obj = (Attachment *) obj;
|
||||
return (const char *) _obj->getName().buffer();
|
||||
const char* spine_attachment_get_name(spine_attachment self) {
|
||||
return (const char*)&((Attachment*)self)->getName();
|
||||
}
|
||||
|
||||
spine_attachment spine_attachment_copy(spine_attachment obj) {
|
||||
if (!obj) return (spine_attachment) 0;
|
||||
Attachment *_obj = (Attachment *) obj;
|
||||
return (spine_attachment) _obj->copy();
|
||||
spine_attachment spine_attachment_copy(spine_attachment self) {
|
||||
return (spine_attachment)((Attachment*)self)->copy();
|
||||
}
|
||||
|
||||
int spine_attachment_get_ref_count(spine_attachment obj) {
|
||||
if (!obj) return 0;
|
||||
Attachment *_obj = (Attachment *) obj;
|
||||
return _obj->getRefCount();
|
||||
int spine_attachment_get_ref_count(spine_attachment self) {
|
||||
return ((Attachment*)self)->getRefCount();
|
||||
}
|
||||
|
||||
void spine_attachment_reference(spine_attachment obj) {
|
||||
if (!obj) return ;
|
||||
Attachment *_obj = (Attachment *) obj;
|
||||
_obj->reference();
|
||||
void spine_attachment_reference(spine_attachment self) {
|
||||
((Attachment*)self)->reference();
|
||||
}
|
||||
|
||||
void spine_attachment_dereference(spine_attachment obj) {
|
||||
if (!obj) return ;
|
||||
Attachment *_obj = (Attachment *) obj;
|
||||
_obj->dereference();
|
||||
void spine_attachment_dereference(spine_attachment self) {
|
||||
((Attachment*)self)->dereference();
|
||||
}
|
||||
|
||||
spine_rtti spine_attachment_rtti(void) {
|
||||
return (spine_rtti)&Attachment::rtti;
|
||||
}
|
||||
|
||||
@ -1,51 +1,25 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ATTACHMENT_H
|
||||
#define SPINE_SPINE_ATTACHMENT_H
|
||||
|
||||
#ifndef SPINE_C_ATTACHMENT_H
|
||||
#define SPINE_C_ATTACHMENT_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_attachment_dispose(spine_attachment self);
|
||||
|
||||
SPINE_C_EXPORT void spine_attachment_dispose(spine_attachment obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_attachment_get_rtti();
|
||||
SPINE_C_EXPORT const char* spine_attachment_get_name(spine_attachment obj);
|
||||
SPINE_C_EXPORT spine_attachment spine_attachment_copy(spine_attachment obj);
|
||||
SPINE_C_EXPORT int spine_attachment_get_ref_count(spine_attachment obj);
|
||||
SPINE_C_EXPORT void spine_attachment_reference(spine_attachment obj);
|
||||
SPINE_C_EXPORT void spine_attachment_dereference(spine_attachment obj);
|
||||
SPINE_C_API spine_rtti spine_attachment_get_rtti(spine_attachment self);
|
||||
SPINE_C_API const char* spine_attachment_get_name(spine_attachment self);
|
||||
SPINE_C_API spine_attachment spine_attachment_copy(spine_attachment self);
|
||||
SPINE_C_API int spine_attachment_get_ref_count(spine_attachment self);
|
||||
SPINE_C_API void spine_attachment_reference(spine_attachment self);
|
||||
SPINE_C_API void spine_attachment_dereference(spine_attachment self);
|
||||
SPINE_C_API spine_rtti spine_attachment_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ATTACHMENT_H
|
||||
#endif /* SPINE_SPINE_ATTACHMENT_H */
|
||||
@ -1,74 +1,32 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "attachment_loader.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_attachment_loader_dispose(spine_attachment_loader obj) {
|
||||
if (!obj) return;
|
||||
delete (AttachmentLoader *) obj;
|
||||
void spine_attachment_loader_dispose(spine_attachment_loader self) {
|
||||
delete (AttachmentLoader*)self;
|
||||
}
|
||||
|
||||
spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader obj, spine_skin skin, const char* name, const char* path, spine_sequence sequence) {
|
||||
if (!obj) return (spine_region_attachment) 0;
|
||||
AttachmentLoader *_obj = (AttachmentLoader *) obj;
|
||||
return (spine_region_attachment) _obj->newRegionAttachment(*(Skin*) skin, String(name), String(path), (Sequence *) sequence);
|
||||
spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader self, spine_skin skin, const char* name, const char* path, spine_sequence sequence) {
|
||||
return (spine_region_attachment)((AttachmentLoader*)self)->newRegionAttachment(*((Skin*)skin), *((const String*)name), *((const String*)path), (Sequence *)sequence);
|
||||
}
|
||||
|
||||
spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader obj, spine_skin skin, const char* name, const char* path, spine_sequence sequence) {
|
||||
if (!obj) return (spine_mesh_attachment) 0;
|
||||
AttachmentLoader *_obj = (AttachmentLoader *) obj;
|
||||
return (spine_mesh_attachment) _obj->newMeshAttachment(*(Skin*) skin, String(name), String(path), (Sequence *) sequence);
|
||||
spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader self, spine_skin skin, const char* name, const char* path, spine_sequence sequence) {
|
||||
return (spine_mesh_attachment)((AttachmentLoader*)self)->newMeshAttachment(*((Skin*)skin), *((const String*)name), *((const String*)path), (Sequence *)sequence);
|
||||
}
|
||||
|
||||
spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader obj, spine_skin skin, const char* name) {
|
||||
if (!obj) return (spine_bounding_box_attachment) 0;
|
||||
AttachmentLoader *_obj = (AttachmentLoader *) obj;
|
||||
return (spine_bounding_box_attachment) _obj->newBoundingBoxAttachment(*(Skin*) skin, String(name));
|
||||
spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader self, spine_skin skin, const char* name) {
|
||||
return (spine_bounding_box_attachment)((AttachmentLoader*)self)->newBoundingBoxAttachment(*((Skin*)skin), *((const String*)name));
|
||||
}
|
||||
|
||||
spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader obj, spine_skin skin, const char* name) {
|
||||
if (!obj) return (spine_path_attachment) 0;
|
||||
AttachmentLoader *_obj = (AttachmentLoader *) obj;
|
||||
return (spine_path_attachment) _obj->newPathAttachment(*(Skin*) skin, String(name));
|
||||
spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader self, spine_skin skin, const char* name) {
|
||||
return (spine_path_attachment)((AttachmentLoader*)self)->newPathAttachment(*((Skin*)skin), *((const String*)name));
|
||||
}
|
||||
|
||||
spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader obj, spine_skin skin, const char* name) {
|
||||
if (!obj) return 0;
|
||||
AttachmentLoader *_obj = (AttachmentLoader *) obj;
|
||||
return (spine_point_attachment) _obj->newPointAttachment(*(Skin*) skin, String(name));
|
||||
spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader self, spine_skin skin, const char* name) {
|
||||
return (spine_point_attachment)((AttachmentLoader*)self)->newPointAttachment(*((Skin*)skin), *((const String*)name));
|
||||
}
|
||||
|
||||
spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader obj, spine_skin skin, const char* name) {
|
||||
if (!obj) return (spine_clipping_attachment) 0;
|
||||
AttachmentLoader *_obj = (AttachmentLoader *) obj;
|
||||
return (spine_clipping_attachment) _obj->newClippingAttachment(*(Skin*) skin, String(name));
|
||||
spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader self, spine_skin skin, const char* name) {
|
||||
return (spine_clipping_attachment)((AttachmentLoader*)self)->newClippingAttachment(*((Skin*)skin), *((const String*)name));
|
||||
}
|
||||
|
||||
@ -1,51 +1,24 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ATTACHMENT_LOADER_H
|
||||
#define SPINE_SPINE_ATTACHMENT_LOADER_H
|
||||
|
||||
#ifndef SPINE_C_ATTACHMENTLOADER_H
|
||||
#define SPINE_C_ATTACHMENTLOADER_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_attachment_loader_dispose(spine_attachment_loader self);
|
||||
|
||||
SPINE_C_EXPORT void spine_attachment_loader_dispose(spine_attachment_loader obj);
|
||||
SPINE_C_EXPORT spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader obj, spine_skin skin, const char* name, const char* path, spine_sequence sequence);
|
||||
SPINE_C_EXPORT spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader obj, spine_skin skin, const char* name, const char* path, spine_sequence sequence);
|
||||
SPINE_C_EXPORT spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader obj, spine_skin skin, const char* name);
|
||||
SPINE_C_EXPORT spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader obj, spine_skin skin, const char* name);
|
||||
SPINE_C_EXPORT spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader obj, spine_skin skin, const char* name);
|
||||
SPINE_C_EXPORT spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader obj, spine_skin skin, const char* name);
|
||||
SPINE_C_API spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader self, spine_skin skin, const char* name, const char* path, spine_sequence sequence);
|
||||
SPINE_C_API spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader self, spine_skin skin, const char* name, const char* path, spine_sequence sequence);
|
||||
SPINE_C_API spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader self, spine_skin skin, const char* name);
|
||||
SPINE_C_API spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader self, spine_skin skin, const char* name);
|
||||
SPINE_C_API spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader self, spine_skin skin, const char* name);
|
||||
SPINE_C_API spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader self, spine_skin skin, const char* name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ATTACHMENTLOADER_H
|
||||
#endif /* SPINE_SPINE_ATTACHMENT_LOADER_H */
|
||||
@ -1,125 +1,56 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "attachment_timeline.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_attachment_timeline spine_attachment_timeline_create(size_t frameCount, int slotIndex) {
|
||||
AttachmentTimeline *obj = new (__FILE__, __LINE__) AttachmentTimeline(frameCount, slotIndex);
|
||||
return (spine_attachment_timeline) obj;
|
||||
return (spine_attachment_timeline) new (__FILE__, __LINE__) AttachmentTimeline(frameCount, slotIndex);
|
||||
}
|
||||
|
||||
void spine_attachment_timeline_dispose(spine_attachment_timeline obj) {
|
||||
if (!obj) return;
|
||||
delete (AttachmentTimeline *) obj;
|
||||
void spine_attachment_timeline_dispose(spine_attachment_timeline self) {
|
||||
delete (AttachmentTimeline*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_attachment_timeline_get_rtti() {
|
||||
return (spine_rtti) &AttachmentTimeline::rtti;
|
||||
spine_rtti spine_attachment_timeline_get_rtti(spine_attachment_timeline self) {
|
||||
return (spine_rtti)&((AttachmentTimeline*)self)->getRTTI();
|
||||
}
|
||||
|
||||
void spine_attachment_timeline_apply(spine_attachment_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
void spine_attachment_timeline_apply(spine_attachment_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((AttachmentTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
void spine_attachment_timeline_set_frame(spine_attachment_timeline obj, int frame, float time, const char* attachmentName) {
|
||||
if (!obj) return ;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
_obj->setFrame(frame, time, String(attachmentName));
|
||||
void spine_attachment_timeline_set_frame(spine_attachment_timeline self, int frame, float time, const char* attachmentName) {
|
||||
((AttachmentTimeline*)self)->setFrame(frame, time, *((const String*)attachmentName));
|
||||
}
|
||||
|
||||
int32_t spine_attachment_timeline_get_num_attachment_names(spine_attachment_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return (int32_t) _obj->getAttachmentNames().size();
|
||||
size_t spine_attachment_timeline_get_frame_entries(spine_attachment_timeline self) {
|
||||
return ((Timeline*)(AttachmentTimeline*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
const char * *spine_attachment_timeline_get_attachment_names(spine_attachment_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return (const char * *) _obj->getAttachmentNames().buffer();
|
||||
size_t spine_attachment_timeline_get_frame_count(spine_attachment_timeline self) {
|
||||
return ((Timeline*)(AttachmentTimeline*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
size_t spine_attachment_timeline_get_frame_entries(spine_attachment_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return _obj->getFrameEntries();
|
||||
spine_array_float spine_attachment_timeline_get_frames(spine_attachment_timeline self) {
|
||||
return (spine_array_float)&((Timeline*)(AttachmentTimeline*)self)->getFrames();
|
||||
}
|
||||
|
||||
size_t spine_attachment_timeline_get_frame_count(spine_attachment_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return _obj->getFrameCount();
|
||||
float spine_attachment_timeline_get_duration(spine_attachment_timeline self) {
|
||||
return ((Timeline*)(AttachmentTimeline*)self)->getDuration();
|
||||
}
|
||||
|
||||
int32_t spine_attachment_timeline_get_num_frames(spine_attachment_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return (int32_t) _obj->getFrames().size();
|
||||
spine_array_property_id spine_attachment_timeline_get_property_ids(spine_attachment_timeline self) {
|
||||
return (spine_array_property_id)&((Timeline*)(AttachmentTimeline*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
float *spine_attachment_timeline_get_frames(spine_attachment_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return (float *) _obj->getFrames().buffer();
|
||||
int spine_attachment_timeline_get_slot_index(spine_attachment_timeline self) {
|
||||
return ((SlotTimeline*)(AttachmentTimeline*)self)->getSlotIndex();
|
||||
}
|
||||
|
||||
float spine_attachment_timeline_get_duration(spine_attachment_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return _obj->getDuration();
|
||||
void spine_attachment_timeline_set_slot_index(spine_attachment_timeline self, int inValue) {
|
||||
((SlotTimeline*)(AttachmentTimeline*)self)->setSlotIndex(inValue);
|
||||
}
|
||||
|
||||
int32_t spine_attachment_timeline_get_num_property_ids(spine_attachment_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return (int32_t) _obj->getPropertyIds().size();
|
||||
}
|
||||
|
||||
int64_t *spine_attachment_timeline_get_property_ids(spine_attachment_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return (int64_t *) _obj->getPropertyIds().buffer();
|
||||
}
|
||||
|
||||
int spine_attachment_timeline_get_slot_index(spine_attachment_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
return _obj->getSlotIndex();
|
||||
}
|
||||
|
||||
void spine_attachment_timeline_set_slot_index(spine_attachment_timeline obj, int value) {
|
||||
if (!obj) return;
|
||||
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
|
||||
_obj->setSlotIndex(value);
|
||||
spine_rtti spine_attachment_timeline_rtti(void) {
|
||||
return (spine_rtti)&AttachmentTimeline::rtti;
|
||||
}
|
||||
|
||||
@ -1,60 +1,31 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_ATTACHMENT_TIMELINE_H
|
||||
#define SPINE_SPINE_ATTACHMENT_TIMELINE_H
|
||||
|
||||
#ifndef SPINE_C_ATTACHMENTTIMELINE_H
|
||||
#define SPINE_C_ATTACHMENTTIMELINE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_attachment_timeline spine_attachment_timeline_create(size_t frameCount, int slotIndex);
|
||||
|
||||
SPINE_C_EXPORT spine_attachment_timeline spine_attachment_timeline_create(size_t frameCount, int slotIndex);
|
||||
SPINE_C_EXPORT void spine_attachment_timeline_dispose(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_attachment_timeline_get_rtti();
|
||||
SPINE_C_EXPORT void spine_attachment_timeline_apply(spine_attachment_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT void spine_attachment_timeline_set_frame(spine_attachment_timeline obj, int frame, float time, const char* attachmentName);
|
||||
SPINE_C_EXPORT int32_t spine_attachment_timeline_get_num_attachment_names(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT const char * *spine_attachment_timeline_get_attachment_names(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT size_t spine_attachment_timeline_get_frame_entries(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT size_t spine_attachment_timeline_get_frame_count(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_attachment_timeline_get_num_frames(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT float *spine_attachment_timeline_get_frames(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT float spine_attachment_timeline_get_duration(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_attachment_timeline_get_num_property_ids(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT int64_t *spine_attachment_timeline_get_property_ids(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT int spine_attachment_timeline_get_slot_index(spine_attachment_timeline obj);
|
||||
SPINE_C_EXPORT void spine_attachment_timeline_set_slot_index(spine_attachment_timeline obj, int value);
|
||||
SPINE_C_API void spine_attachment_timeline_dispose(spine_attachment_timeline self);
|
||||
|
||||
SPINE_C_API spine_rtti spine_attachment_timeline_get_rtti(spine_attachment_timeline self);
|
||||
SPINE_C_API void spine_attachment_timeline_apply(spine_attachment_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API void spine_attachment_timeline_set_frame(spine_attachment_timeline self, int frame, float time, const char* attachmentName);
|
||||
SPINE_C_API size_t spine_attachment_timeline_get_frame_entries(spine_attachment_timeline self);
|
||||
SPINE_C_API size_t spine_attachment_timeline_get_frame_count(spine_attachment_timeline self);
|
||||
SPINE_C_API spine_array_float spine_attachment_timeline_get_frames(spine_attachment_timeline self);
|
||||
SPINE_C_API float spine_attachment_timeline_get_duration(spine_attachment_timeline self);
|
||||
SPINE_C_API spine_array_property_id spine_attachment_timeline_get_property_ids(spine_attachment_timeline self);
|
||||
SPINE_C_API int spine_attachment_timeline_get_slot_index(spine_attachment_timeline self);
|
||||
SPINE_C_API void spine_attachment_timeline_set_slot_index(spine_attachment_timeline self, int inValue);
|
||||
SPINE_C_API spine_rtti spine_attachment_timeline_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ATTACHMENTTIMELINE_H
|
||||
#endif /* SPINE_SPINE_ATTACHMENT_TIMELINE_H */
|
||||
@ -1,36 +1,5 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SPINE_C_ATTACHMENTTYPE_H
|
||||
#define SPINE_C_ATTACHMENTTYPE_H
|
||||
|
||||
#include "../base.h"
|
||||
#ifndef SPINE_SPINE_ATTACHMENT_TYPE_H
|
||||
#define SPINE_SPINE_ATTACHMENT_TYPE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -50,4 +19,4 @@ typedef enum spine_attachment_type {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_ATTACHMENTTYPE_H
|
||||
#endif /* SPINE_SPINE_ATTACHMENT_TYPE_H */
|
||||
@ -1,36 +1,5 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SPINE_C_BLENDMODE_H
|
||||
#define SPINE_C_BLENDMODE_H
|
||||
|
||||
#include "../base.h"
|
||||
#ifndef SPINE_SPINE_BLEND_MODE_H
|
||||
#define SPINE_SPINE_BLEND_MODE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -47,4 +16,4 @@ typedef enum spine_blend_mode {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BLENDMODE_H
|
||||
#endif /* SPINE_SPINE_BLEND_MODE_H */
|
||||
@ -1,56 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "block.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_block_dispose(spine_block obj) {
|
||||
if (!obj) return;
|
||||
delete (Block *) obj;
|
||||
}
|
||||
|
||||
int spine_block_free(spine_block obj) {
|
||||
if (!obj) return 0;
|
||||
Block *_obj = (Block *) obj;
|
||||
return _obj->free();
|
||||
}
|
||||
|
||||
bool spine_block_can_fit(spine_block obj, int numBytes) {
|
||||
if (!obj) return false;
|
||||
Block *_obj = (Block *) obj;
|
||||
return _obj->canFit(numBytes);
|
||||
}
|
||||
|
||||
uint8_t * spine_block_allocate(spine_block obj, int numBytes) {
|
||||
if (!obj) return 0;
|
||||
Block *_obj = (Block *) obj;
|
||||
return (uint8_t *) _obj->allocate(numBytes);
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SPINE_C_BLOCK_H
|
||||
#define SPINE_C_BLOCK_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
|
||||
SPINE_C_EXPORT void spine_block_dispose(spine_block obj);
|
||||
SPINE_C_EXPORT int spine_block_free(spine_block obj);
|
||||
SPINE_C_EXPORT bool spine_block_can_fit(spine_block obj, int numBytes);
|
||||
SPINE_C_EXPORT uint8_t * spine_block_allocate(spine_block obj, int numBytes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BLOCK_H
|
||||
@ -1,130 +1,72 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "bone.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_bone spine_bone_create(spine_bone_data data, spine_bone parent) {
|
||||
Bone *obj = new (__FILE__, __LINE__) Bone(*(BoneData*) data, (Bone *) parent);
|
||||
return (spine_bone) obj;
|
||||
return (spine_bone) new (__FILE__, __LINE__) Bone(*((BoneData*)data), (Bone *)parent);
|
||||
}
|
||||
|
||||
spine_bone spine_bone_create_with_bone_bone(spine_bone bone, spine_bone parent) {
|
||||
Bone *obj = new (__FILE__, __LINE__) Bone(*(Bone*) bone, (Bone *) parent);
|
||||
return (spine_bone) obj;
|
||||
spine_bone spine_bone_create2(spine_bone bone, spine_bone parent) {
|
||||
return (spine_bone) new (__FILE__, __LINE__) Bone(*((Bone*)bone), (Bone *)parent);
|
||||
}
|
||||
|
||||
void spine_bone_dispose(spine_bone obj) {
|
||||
if (!obj) return;
|
||||
delete (Bone *) obj;
|
||||
void spine_bone_dispose(spine_bone self) {
|
||||
delete (Bone*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_bone_get_rtti() {
|
||||
return (spine_rtti) &Bone::rtti;
|
||||
spine_rtti spine_bone_get_rtti(spine_bone self) {
|
||||
return (spine_rtti)&((Bone*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_bone spine_bone_get_parent(spine_bone obj) {
|
||||
if (!obj) return (spine_bone) 0;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
return (spine_bone) _obj->getParent();
|
||||
spine_bone spine_bone_get_parent(spine_bone self) {
|
||||
return (spine_bone)((Bone*)self)->getParent();
|
||||
}
|
||||
|
||||
int32_t spine_bone_get_num_children(spine_bone obj) {
|
||||
if (!obj) return 0;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
return (int32_t) _obj->getChildren().size();
|
||||
spine_array_bone spine_bone_get_children(spine_bone self) {
|
||||
return (spine_array_bone)&((Bone*)self)->getChildren();
|
||||
}
|
||||
|
||||
spine_bone *spine_bone_get_children(spine_bone obj) {
|
||||
if (!obj) return nullptr;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
return (spine_bone *) _obj->getChildren().buffer();
|
||||
bool spine_bone_is_y_down(void) {
|
||||
return Bone::isYDown();
|
||||
}
|
||||
|
||||
void spine_bone_setup_pose(spine_bone obj) {
|
||||
if (!obj) return ;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
_obj->setupPose();
|
||||
void spine_bone_set_y_down(bool value) {
|
||||
Bone::setYDown(value);
|
||||
}
|
||||
|
||||
spine_bone_data spine_bone_get_data(spine_bone obj) {
|
||||
if (!obj) return (spine_bone_data) 0;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
return (spine_bone_data) &_obj->getData();
|
||||
spine_bone_data spine_bone_get_data(spine_bone self) {
|
||||
return (spine_bone_data)&((PosedGeneric<BoneData, BoneLocal, BonePose>*)(Bone*)self)->getData();
|
||||
}
|
||||
|
||||
spine_bone_local spine_bone_get_pose(spine_bone obj) {
|
||||
if (!obj) return (spine_bone_local) 0;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
return (spine_bone_local) &_obj->getPose();
|
||||
spine_bone_local spine_bone_get_pose(spine_bone self) {
|
||||
return (spine_bone_local)&((PosedGeneric<BoneData, BoneLocal, BonePose>*)(Bone*)self)->getPose();
|
||||
}
|
||||
|
||||
spine_bone_pose spine_bone_get_applied_pose(spine_bone obj) {
|
||||
if (!obj) return (spine_bone_pose) 0;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
return (spine_bone_pose) &_obj->getAppliedPose();
|
||||
spine_bone_pose spine_bone_get_applied_pose(spine_bone self) {
|
||||
return (spine_bone_pose)&((PosedGeneric<BoneData, BoneLocal, BonePose>*)(Bone*)self)->getAppliedPose();
|
||||
}
|
||||
|
||||
void spine_bone_reset_constrained(spine_bone obj) {
|
||||
if (!obj) return ;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
_obj->resetConstrained();
|
||||
void spine_bone_reset_constrained(spine_bone self) {
|
||||
((PosedGeneric<BoneData, BoneLocal, BonePose>*)(Bone*)self)->resetConstrained();
|
||||
}
|
||||
|
||||
void spine_bone_update_pose(spine_bone obj) {
|
||||
if (!obj) return ;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
_obj->pose();
|
||||
void spine_bone_constrained(spine_bone self) {
|
||||
((PosedGeneric<BoneData, BoneLocal, BonePose>*)(Bone*)self)->constrained();
|
||||
}
|
||||
|
||||
void spine_bone_constrained(spine_bone obj) {
|
||||
if (!obj) return ;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
_obj->constrained();
|
||||
bool spine_bone_is_pose_equal_to_applied(spine_bone self) {
|
||||
return ((PosedGeneric<BoneData, BoneLocal, BonePose>*)(Bone*)self)->isPoseEqualToApplied();
|
||||
}
|
||||
|
||||
bool spine_bone_is_pose_equal_to_applied(spine_bone obj) {
|
||||
if (!obj) return false;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
return _obj->isPoseEqualToApplied();
|
||||
bool spine_bone_is_active(spine_bone self) {
|
||||
return ((PosedActive*)(Bone*)self)->isActive();
|
||||
}
|
||||
|
||||
bool spine_bone_is_active(spine_bone obj) {
|
||||
if (!obj) return false;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
return _obj->isActive();
|
||||
void spine_bone_set_active(spine_bone self, bool active) {
|
||||
((PosedActive*)(Bone*)self)->setActive(active);
|
||||
}
|
||||
|
||||
void spine_bone_set_active(spine_bone obj, bool value) {
|
||||
if (!obj) return;
|
||||
Bone *_obj = (Bone *) obj;
|
||||
_obj->setActive(value);
|
||||
spine_rtti spine_bone_rtti(void) {
|
||||
return (spine_rtti)&Bone::rtti;
|
||||
}
|
||||
|
||||
@ -1,61 +1,35 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_BONE_H
|
||||
#define SPINE_SPINE_BONE_H
|
||||
|
||||
#ifndef SPINE_C_BONE_H
|
||||
#define SPINE_C_BONE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_bone spine_bone_create(spine_bone_data data, spine_bone parent);
|
||||
SPINE_C_API spine_bone spine_bone_create2(spine_bone bone, spine_bone parent);
|
||||
|
||||
SPINE_C_EXPORT spine_bone spine_bone_create(spine_bone_data data, spine_bone parent);
|
||||
SPINE_C_EXPORT spine_bone spine_bone_create_with_bone_bone(spine_bone bone, spine_bone parent);
|
||||
SPINE_C_EXPORT void spine_bone_dispose(spine_bone obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_bone_get_rtti();
|
||||
SPINE_C_EXPORT spine_bone spine_bone_get_parent(spine_bone obj);
|
||||
SPINE_C_EXPORT int32_t spine_bone_get_num_children(spine_bone obj);
|
||||
SPINE_C_EXPORT spine_bone *spine_bone_get_children(spine_bone obj);
|
||||
SPINE_C_EXPORT void spine_bone_setup_pose(spine_bone obj);
|
||||
SPINE_C_EXPORT spine_bone_data spine_bone_get_data(spine_bone obj);
|
||||
SPINE_C_EXPORT spine_bone_local spine_bone_get_pose(spine_bone obj);
|
||||
SPINE_C_EXPORT spine_bone_pose spine_bone_get_applied_pose(spine_bone obj);
|
||||
SPINE_C_EXPORT void spine_bone_reset_constrained(spine_bone obj);
|
||||
SPINE_C_EXPORT void spine_bone_update_pose(spine_bone obj);
|
||||
SPINE_C_EXPORT void spine_bone_constrained(spine_bone obj);
|
||||
SPINE_C_EXPORT bool spine_bone_is_pose_equal_to_applied(spine_bone obj);
|
||||
SPINE_C_EXPORT bool spine_bone_is_active(spine_bone obj);
|
||||
SPINE_C_EXPORT void spine_bone_set_active(spine_bone obj, bool value);
|
||||
SPINE_C_API void spine_bone_dispose(spine_bone self);
|
||||
|
||||
SPINE_C_API spine_rtti spine_bone_get_rtti(spine_bone self);
|
||||
SPINE_C_API spine_bone spine_bone_get_parent(spine_bone self);
|
||||
SPINE_C_API spine_array_bone spine_bone_get_children(spine_bone self);
|
||||
SPINE_C_API bool spine_bone_is_y_down(void);
|
||||
SPINE_C_API void spine_bone_set_y_down(bool value);
|
||||
SPINE_C_API spine_bone_data spine_bone_get_data(spine_bone self);
|
||||
SPINE_C_API spine_bone_local spine_bone_get_pose(spine_bone self);
|
||||
SPINE_C_API spine_bone_pose spine_bone_get_applied_pose(spine_bone self);
|
||||
SPINE_C_API void spine_bone_reset_constrained(spine_bone self);
|
||||
SPINE_C_API void spine_bone_constrained(spine_bone self);
|
||||
SPINE_C_API bool spine_bone_is_pose_equal_to_applied(spine_bone self);
|
||||
SPINE_C_API bool spine_bone_is_active(spine_bone self);
|
||||
SPINE_C_API void spine_bone_set_active(spine_bone self, bool active);
|
||||
SPINE_C_API spine_rtti spine_bone_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BONE_H
|
||||
#endif /* SPINE_SPINE_BONE_H */
|
||||
@ -1,103 +1,64 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "bone_data.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_bone_data spine_bone_data_create(int index, const char* name, spine_bone_data parent) {
|
||||
BoneData *obj = new (__FILE__, __LINE__) BoneData(index, String(name), (BoneData *) parent);
|
||||
return (spine_bone_data) obj;
|
||||
return (spine_bone_data) new (__FILE__, __LINE__) BoneData(index, *((const String*)name), (BoneData *)parent);
|
||||
}
|
||||
|
||||
void spine_bone_data_dispose(spine_bone_data obj) {
|
||||
if (!obj) return;
|
||||
delete (BoneData *) obj;
|
||||
void spine_bone_data_dispose(spine_bone_data self) {
|
||||
delete (BoneData*)self;
|
||||
}
|
||||
|
||||
int spine_bone_data_get_index(spine_bone_data obj) {
|
||||
if (!obj) return 0;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
return _obj->getIndex();
|
||||
int spine_bone_data_get_index(spine_bone_data self) {
|
||||
return ((BoneData*)self)->getIndex();
|
||||
}
|
||||
|
||||
spine_bone_data spine_bone_data_get_parent(spine_bone_data obj) {
|
||||
if (!obj) return (spine_bone_data) 0;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
return (spine_bone_data) _obj->getParent();
|
||||
spine_bone_data spine_bone_data_get_parent(spine_bone_data self) {
|
||||
return (spine_bone_data)((BoneData*)self)->getParent();
|
||||
}
|
||||
|
||||
float spine_bone_data_get_length(spine_bone_data obj) {
|
||||
if (!obj) return 0;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
return _obj->getLength();
|
||||
float spine_bone_data_get_length(spine_bone_data self) {
|
||||
return ((BoneData*)self)->getLength();
|
||||
}
|
||||
|
||||
void spine_bone_data_set_length(spine_bone_data obj, float value) {
|
||||
if (!obj) return;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
_obj->setLength(value);
|
||||
void spine_bone_data_set_length(spine_bone_data self, float inValue) {
|
||||
((BoneData*)self)->setLength(inValue);
|
||||
}
|
||||
|
||||
spine_color spine_bone_data_get_color(spine_bone_data obj) {
|
||||
if (!obj) return (spine_color) 0;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
return (spine_color) &_obj->getColor();
|
||||
spine_color spine_bone_data_get_color(spine_bone_data self) {
|
||||
return (spine_color)&((BoneData*)self)->getColor();
|
||||
}
|
||||
|
||||
const char* spine_bone_data_get_icon(spine_bone_data obj) {
|
||||
if (!obj) return nullptr;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
return (const char *) _obj->getIcon().buffer();
|
||||
const char* spine_bone_data_get_icon(spine_bone_data self) {
|
||||
return (const char*)&((BoneData*)self)->getIcon();
|
||||
}
|
||||
|
||||
void spine_bone_data_set_icon(spine_bone_data obj, const char* value) {
|
||||
if (!obj) return;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
_obj->setIcon(String(value));
|
||||
void spine_bone_data_set_icon(spine_bone_data self, const char* icon) {
|
||||
((BoneData*)self)->setIcon(*((const String*)icon));
|
||||
}
|
||||
|
||||
bool spine_bone_data_get_visible(spine_bone_data obj) {
|
||||
if (!obj) return false;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
return _obj->getVisible();
|
||||
bool spine_bone_data_get_visible(spine_bone_data self) {
|
||||
return ((BoneData*)self)->getVisible();
|
||||
}
|
||||
|
||||
void spine_bone_data_set_visible(spine_bone_data obj, bool value) {
|
||||
if (!obj) return;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
_obj->setVisible(value);
|
||||
void spine_bone_data_set_visible(spine_bone_data self, bool inValue) {
|
||||
((BoneData*)self)->setVisible(inValue);
|
||||
}
|
||||
|
||||
spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data obj) {
|
||||
if (!obj) return (spine_bone_local) 0;
|
||||
BoneData *_obj = (BoneData *) obj;
|
||||
return (spine_bone_local) &_obj->getSetupPose();
|
||||
spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data self) {
|
||||
return (spine_bone_local)&((PosedDataGeneric<BoneLocal>*)(BoneData*)self)->getSetupPose();
|
||||
}
|
||||
|
||||
const char* spine_bone_data_get_name(spine_bone_data self) {
|
||||
return (const char*)&((PosedDataGeneric<BoneLocal>*)(BoneData*)self)->getName();
|
||||
}
|
||||
|
||||
bool spine_bone_data_is_skin_required(spine_bone_data self) {
|
||||
return ((PosedDataGeneric<BoneLocal>*)(BoneData*)self)->isSkinRequired();
|
||||
}
|
||||
|
||||
void spine_bone_data_set_skin_required(spine_bone_data self, bool skinRequired) {
|
||||
((PosedDataGeneric<BoneLocal>*)(BoneData*)self)->setSkinRequired(skinRequired);
|
||||
}
|
||||
|
||||
@ -1,56 +1,33 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_BONE_DATA_H
|
||||
#define SPINE_SPINE_BONE_DATA_H
|
||||
|
||||
#ifndef SPINE_C_BONEDATA_H
|
||||
#define SPINE_C_BONEDATA_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_bone_data spine_bone_data_create(int index, const char* name, spine_bone_data parent);
|
||||
|
||||
SPINE_C_EXPORT spine_bone_data spine_bone_data_create(int index, const char* name, spine_bone_data parent);
|
||||
SPINE_C_EXPORT void spine_bone_data_dispose(spine_bone_data obj);
|
||||
SPINE_C_EXPORT int spine_bone_data_get_index(spine_bone_data obj);
|
||||
SPINE_C_EXPORT spine_bone_data spine_bone_data_get_parent(spine_bone_data obj);
|
||||
SPINE_C_EXPORT float spine_bone_data_get_length(spine_bone_data obj);
|
||||
SPINE_C_EXPORT void spine_bone_data_set_length(spine_bone_data obj, float value);
|
||||
SPINE_C_EXPORT spine_color spine_bone_data_get_color(spine_bone_data obj);
|
||||
SPINE_C_EXPORT const char* spine_bone_data_get_icon(spine_bone_data obj);
|
||||
SPINE_C_EXPORT void spine_bone_data_set_icon(spine_bone_data obj, const char* value);
|
||||
SPINE_C_EXPORT bool spine_bone_data_get_visible(spine_bone_data obj);
|
||||
SPINE_C_EXPORT void spine_bone_data_set_visible(spine_bone_data obj, bool value);
|
||||
SPINE_C_EXPORT spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data obj);
|
||||
SPINE_C_API void spine_bone_data_dispose(spine_bone_data self);
|
||||
|
||||
SPINE_C_API int spine_bone_data_get_index(spine_bone_data self);
|
||||
SPINE_C_API spine_bone_data spine_bone_data_get_parent(spine_bone_data self);
|
||||
SPINE_C_API float spine_bone_data_get_length(spine_bone_data self);
|
||||
SPINE_C_API void spine_bone_data_set_length(spine_bone_data self, float inValue);
|
||||
SPINE_C_API spine_color spine_bone_data_get_color(spine_bone_data self);
|
||||
SPINE_C_API const char* spine_bone_data_get_icon(spine_bone_data self);
|
||||
SPINE_C_API void spine_bone_data_set_icon(spine_bone_data self, const char* icon);
|
||||
SPINE_C_API bool spine_bone_data_get_visible(spine_bone_data self);
|
||||
SPINE_C_API void spine_bone_data_set_visible(spine_bone_data self, bool inValue);
|
||||
SPINE_C_API spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data self);
|
||||
SPINE_C_API const char* spine_bone_data_get_name(spine_bone_data self);
|
||||
SPINE_C_API bool spine_bone_data_is_skin_required(spine_bone_data self);
|
||||
SPINE_C_API void spine_bone_data_set_skin_required(spine_bone_data self, bool skinRequired);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BONEDATA_H
|
||||
#endif /* SPINE_SPINE_BONE_DATA_H */
|
||||
@ -1,163 +1,92 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "bone_local.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_bone_local spine_bone_local_create(void) {
|
||||
BoneLocal *obj = new (__FILE__, __LINE__) BoneLocal();
|
||||
return (spine_bone_local) obj;
|
||||
return (spine_bone_local) new (__FILE__, __LINE__) BoneLocal();
|
||||
}
|
||||
|
||||
void spine_bone_local_dispose(spine_bone_local obj) {
|
||||
if (!obj) return;
|
||||
delete (BoneLocal *) obj;
|
||||
void spine_bone_local_dispose(spine_bone_local self) {
|
||||
delete (BoneLocal*)self;
|
||||
}
|
||||
|
||||
void spine_bone_local_set(spine_bone_local obj, spine_bone_local value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->set(*((BoneLocal*) value));
|
||||
void spine_bone_local_set(spine_bone_local self, spine_bone_local pose) {
|
||||
((BoneLocal*)self)->set(*((BoneLocal*)pose));
|
||||
}
|
||||
|
||||
float spine_bone_local_get_x(spine_bone_local obj) {
|
||||
if (!obj) return 0;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
return _obj->getX();
|
||||
float spine_bone_local_get_x(spine_bone_local self) {
|
||||
return ((BoneLocal*)self)->getX();
|
||||
}
|
||||
|
||||
void spine_bone_local_set_x(spine_bone_local obj, float value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setX(value);
|
||||
void spine_bone_local_set_x(spine_bone_local self, float x) {
|
||||
((BoneLocal*)self)->setX(x);
|
||||
}
|
||||
|
||||
float spine_bone_local_get_y(spine_bone_local obj) {
|
||||
if (!obj) return 0;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
return _obj->getY();
|
||||
float spine_bone_local_get_y(spine_bone_local self) {
|
||||
return ((BoneLocal*)self)->getY();
|
||||
}
|
||||
|
||||
void spine_bone_local_set_y(spine_bone_local obj, float value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setY(value);
|
||||
void spine_bone_local_set_y(spine_bone_local self, float y) {
|
||||
((BoneLocal*)self)->setY(y);
|
||||
}
|
||||
|
||||
void spine_bone_local_set_position(spine_bone_local obj, float x, float y) {
|
||||
if (!obj) return ;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setPosition(x, y);
|
||||
void spine_bone_local_set_position(spine_bone_local self, float x, float y) {
|
||||
((BoneLocal*)self)->setPosition(x, y);
|
||||
}
|
||||
|
||||
float spine_bone_local_get_rotation(spine_bone_local obj) {
|
||||
if (!obj) return 0;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
return _obj->getRotation();
|
||||
float spine_bone_local_get_rotation(spine_bone_local self) {
|
||||
return ((BoneLocal*)self)->getRotation();
|
||||
}
|
||||
|
||||
void spine_bone_local_set_rotation(spine_bone_local obj, float value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setRotation(value);
|
||||
void spine_bone_local_set_rotation(spine_bone_local self, float rotation) {
|
||||
((BoneLocal*)self)->setRotation(rotation);
|
||||
}
|
||||
|
||||
float spine_bone_local_get_scale_x(spine_bone_local obj) {
|
||||
if (!obj) return 0;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
return _obj->getScaleX();
|
||||
float spine_bone_local_get_scale_x(spine_bone_local self) {
|
||||
return ((BoneLocal*)self)->getScaleX();
|
||||
}
|
||||
|
||||
void spine_bone_local_set_scale_x(spine_bone_local obj, float value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setScaleX(value);
|
||||
void spine_bone_local_set_scale_x(spine_bone_local self, float scaleX) {
|
||||
((BoneLocal*)self)->setScaleX(scaleX);
|
||||
}
|
||||
|
||||
float spine_bone_local_get_scale_y(spine_bone_local obj) {
|
||||
if (!obj) return 0;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
return _obj->getScaleY();
|
||||
float spine_bone_local_get_scale_y(spine_bone_local self) {
|
||||
return ((BoneLocal*)self)->getScaleY();
|
||||
}
|
||||
|
||||
void spine_bone_local_set_scale_y(spine_bone_local obj, float value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setScaleY(value);
|
||||
void spine_bone_local_set_scale_y(spine_bone_local self, float scaleY) {
|
||||
((BoneLocal*)self)->setScaleY(scaleY);
|
||||
}
|
||||
|
||||
void spine_bone_local_set_scale(spine_bone_local obj, float scaleX, float scaleY) {
|
||||
if (!obj) return ;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setScale(scaleX, scaleY);
|
||||
void spine_bone_local_set_scale_1(spine_bone_local self, float scaleX, float scaleY) {
|
||||
((BoneLocal*)self)->setScale(scaleX, scaleY);
|
||||
}
|
||||
|
||||
void spine_bone_local_set_scale(spine_bone_local obj, float value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setScale(value);
|
||||
void spine_bone_local_set_scale_2(spine_bone_local self, float scale) {
|
||||
((BoneLocal*)self)->setScale(scale);
|
||||
}
|
||||
|
||||
float spine_bone_local_get_shear_x(spine_bone_local obj) {
|
||||
if (!obj) return 0;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
return _obj->getShearX();
|
||||
float spine_bone_local_get_shear_x(spine_bone_local self) {
|
||||
return ((BoneLocal*)self)->getShearX();
|
||||
}
|
||||
|
||||
void spine_bone_local_set_shear_x(spine_bone_local obj, float value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setShearX(value);
|
||||
void spine_bone_local_set_shear_x(spine_bone_local self, float shearX) {
|
||||
((BoneLocal*)self)->setShearX(shearX);
|
||||
}
|
||||
|
||||
float spine_bone_local_get_shear_y(spine_bone_local obj) {
|
||||
if (!obj) return 0;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
return _obj->getShearY();
|
||||
float spine_bone_local_get_shear_y(spine_bone_local self) {
|
||||
return ((BoneLocal*)self)->getShearY();
|
||||
}
|
||||
|
||||
void spine_bone_local_set_shear_y(spine_bone_local obj, float value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setShearY(value);
|
||||
void spine_bone_local_set_shear_y(spine_bone_local self, float shearY) {
|
||||
((BoneLocal*)self)->setShearY(shearY);
|
||||
}
|
||||
|
||||
spine_inherit spine_bone_local_get_inherit(spine_bone_local obj) {
|
||||
if (!obj) return (spine_inherit) 0;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
return (spine_inherit) _obj->getInherit();
|
||||
spine_inherit spine_bone_local_get_inherit(spine_bone_local self) {
|
||||
return (spine_inherit)((BoneLocal*)self)->getInherit();
|
||||
}
|
||||
|
||||
void spine_bone_local_set_inherit(spine_bone_local obj, spine_inherit value) {
|
||||
if (!obj) return;
|
||||
BoneLocal *_obj = (BoneLocal *) obj;
|
||||
_obj->setInherit((Inherit) value);
|
||||
void spine_bone_local_set_inherit(spine_bone_local self, spine_inherit inherit) {
|
||||
((BoneLocal*)self)->setInherit((Inherit)inherit);
|
||||
}
|
||||
|
||||
@ -1,66 +1,40 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_BONE_LOCAL_H
|
||||
#define SPINE_SPINE_BONE_LOCAL_H
|
||||
|
||||
#ifndef SPINE_C_BONELOCAL_H
|
||||
#define SPINE_C_BONELOCAL_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_bone_local spine_bone_local_create(void);
|
||||
|
||||
SPINE_C_EXPORT spine_bone_local spine_bone_local_create(void);
|
||||
SPINE_C_EXPORT void spine_bone_local_dispose(spine_bone_local obj);
|
||||
SPINE_C_EXPORT void spine_bone_local_set(spine_bone_local obj, spine_bone_local value);
|
||||
SPINE_C_EXPORT float spine_bone_local_get_x(spine_bone_local obj);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_x(spine_bone_local obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_local_get_y(spine_bone_local obj);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_y(spine_bone_local obj, float value);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_position(spine_bone_local obj, float x, float y);
|
||||
SPINE_C_EXPORT float spine_bone_local_get_rotation(spine_bone_local obj);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_rotation(spine_bone_local obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_local_get_scale_x(spine_bone_local obj);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_scale_x(spine_bone_local obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_local_get_scale_y(spine_bone_local obj);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_scale_y(spine_bone_local obj, float value);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_scale(spine_bone_local obj, float scaleX, float scaleY);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_scale(spine_bone_local obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_local_get_shear_x(spine_bone_local obj);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_shear_x(spine_bone_local obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_local_get_shear_y(spine_bone_local obj);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_shear_y(spine_bone_local obj, float value);
|
||||
SPINE_C_EXPORT spine_inherit spine_bone_local_get_inherit(spine_bone_local obj);
|
||||
SPINE_C_EXPORT void spine_bone_local_set_inherit(spine_bone_local obj, spine_inherit value);
|
||||
SPINE_C_API void spine_bone_local_dispose(spine_bone_local self);
|
||||
|
||||
SPINE_C_API void spine_bone_local_set(spine_bone_local self, spine_bone_local pose);
|
||||
SPINE_C_API float spine_bone_local_get_x(spine_bone_local self);
|
||||
SPINE_C_API void spine_bone_local_set_x(spine_bone_local self, float x);
|
||||
SPINE_C_API float spine_bone_local_get_y(spine_bone_local self);
|
||||
SPINE_C_API void spine_bone_local_set_y(spine_bone_local self, float y);
|
||||
SPINE_C_API void spine_bone_local_set_position(spine_bone_local self, float x, float y);
|
||||
SPINE_C_API float spine_bone_local_get_rotation(spine_bone_local self);
|
||||
SPINE_C_API void spine_bone_local_set_rotation(spine_bone_local self, float rotation);
|
||||
SPINE_C_API float spine_bone_local_get_scale_x(spine_bone_local self);
|
||||
SPINE_C_API void spine_bone_local_set_scale_x(spine_bone_local self, float scaleX);
|
||||
SPINE_C_API float spine_bone_local_get_scale_y(spine_bone_local self);
|
||||
SPINE_C_API void spine_bone_local_set_scale_y(spine_bone_local self, float scaleY);
|
||||
SPINE_C_API void spine_bone_local_set_scale_1(spine_bone_local self, float scaleX, float scaleY);
|
||||
SPINE_C_API void spine_bone_local_set_scale_2(spine_bone_local self, float scale);
|
||||
SPINE_C_API float spine_bone_local_get_shear_x(spine_bone_local self);
|
||||
SPINE_C_API void spine_bone_local_set_shear_x(spine_bone_local self, float shearX);
|
||||
SPINE_C_API float spine_bone_local_get_shear_y(spine_bone_local self);
|
||||
SPINE_C_API void spine_bone_local_set_shear_y(spine_bone_local self, float shearY);
|
||||
SPINE_C_API spine_inherit spine_bone_local_get_inherit(spine_bone_local self);
|
||||
SPINE_C_API void spine_bone_local_set_inherit(spine_bone_local self, spine_inherit inherit);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BONELOCAL_H
|
||||
#endif /* SPINE_SPINE_BONE_LOCAL_H */
|
||||
@ -1,347 +1,220 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "bone_pose.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_bone_pose spine_bone_pose_create(void) {
|
||||
BonePose *obj = new (__FILE__, __LINE__) BonePose();
|
||||
return (spine_bone_pose) obj;
|
||||
return (spine_bone_pose) new (__FILE__, __LINE__) BonePose();
|
||||
}
|
||||
|
||||
void spine_bone_pose_dispose(spine_bone_pose obj) {
|
||||
if (!obj) return;
|
||||
delete (BonePose *) obj;
|
||||
void spine_bone_pose_dispose(spine_bone_pose self) {
|
||||
delete (BonePose*)self;
|
||||
}
|
||||
|
||||
void spine_bone_pose_update(spine_bone_pose obj, spine_skeleton skeleton, spine_physics physics) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->update(*(Skeleton*) skeleton, (Physics) physics);
|
||||
void spine_bone_pose_update(spine_bone_pose self, spine_skeleton skeleton, spine_physics physics) {
|
||||
((BonePose*)self)->update(*((Skeleton*)skeleton), (Physics)physics);
|
||||
}
|
||||
|
||||
void spine_bone_pose_update_world_transform(spine_bone_pose obj, spine_skeleton skeleton) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->updateWorldTransform(*(Skeleton*) skeleton);
|
||||
void spine_bone_pose_update_world_transform(spine_bone_pose self, spine_skeleton skeleton) {
|
||||
((BonePose*)self)->updateWorldTransform(*((Skeleton*)skeleton));
|
||||
}
|
||||
|
||||
void spine_bone_pose_update_local_transform(spine_bone_pose obj, spine_skeleton skeleton) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->updateLocalTransform(*(Skeleton*) skeleton);
|
||||
void spine_bone_pose_update_local_transform(spine_bone_pose self, spine_skeleton skeleton) {
|
||||
((BonePose*)self)->updateLocalTransform(*((Skeleton*)skeleton));
|
||||
}
|
||||
|
||||
void spine_bone_pose_validate_local_transform(spine_bone_pose obj, spine_skeleton skeleton) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->validateLocalTransform(*(Skeleton*) skeleton);
|
||||
void spine_bone_pose_validate_local_transform(spine_bone_pose self, spine_skeleton skeleton) {
|
||||
((BonePose*)self)->validateLocalTransform(*((Skeleton*)skeleton));
|
||||
}
|
||||
|
||||
void spine_bone_pose_modify_local(spine_bone_pose obj, spine_skeleton skeleton) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->modifyLocal(*(Skeleton*) skeleton);
|
||||
void spine_bone_pose_modify_local(spine_bone_pose self, spine_skeleton skeleton) {
|
||||
((BonePose*)self)->modifyLocal(*((Skeleton*)skeleton));
|
||||
}
|
||||
|
||||
void spine_bone_pose_modify_world(spine_bone_pose obj, int update) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->modifyWorld(update);
|
||||
void spine_bone_pose_modify_world(spine_bone_pose self, int update) {
|
||||
((BonePose*)self)->modifyWorld(update);
|
||||
}
|
||||
|
||||
void spine_bone_pose_reset_world(spine_bone_pose obj, int update) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->resetWorld(update);
|
||||
void spine_bone_pose_reset_world(spine_bone_pose self, int update) {
|
||||
((BonePose*)self)->resetWorld(update);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_a(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getA();
|
||||
float spine_bone_pose_get_a(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getA();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_a(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setA(value);
|
||||
void spine_bone_pose_set_a(spine_bone_pose self, float a) {
|
||||
((BonePose*)self)->setA(a);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_b(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getB();
|
||||
float spine_bone_pose_get_b(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getB();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_b(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setB(value);
|
||||
void spine_bone_pose_set_b(spine_bone_pose self, float b) {
|
||||
((BonePose*)self)->setB(b);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_c(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getC();
|
||||
float spine_bone_pose_get_c(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getC();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_c(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setC(value);
|
||||
void spine_bone_pose_set_c(spine_bone_pose self, float c) {
|
||||
((BonePose*)self)->setC(c);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_d(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getD();
|
||||
float spine_bone_pose_get_d(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getD();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_d(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setD(value);
|
||||
void spine_bone_pose_set_d(spine_bone_pose self, float d) {
|
||||
((BonePose*)self)->setD(d);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_world_x(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getWorldX();
|
||||
float spine_bone_pose_get_world_x(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getWorldX();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_world_x(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setWorldX(value);
|
||||
void spine_bone_pose_set_world_x(spine_bone_pose self, float worldX) {
|
||||
((BonePose*)self)->setWorldX(worldX);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_world_y(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getWorldY();
|
||||
float spine_bone_pose_get_world_y(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getWorldY();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_world_y(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setWorldY(value);
|
||||
void spine_bone_pose_set_world_y(spine_bone_pose self, float worldY) {
|
||||
((BonePose*)self)->setWorldY(worldY);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_world_rotation_x(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getWorldRotationX();
|
||||
float spine_bone_pose_get_world_rotation_x(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getWorldRotationX();
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_world_rotation_y(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getWorldRotationY();
|
||||
float spine_bone_pose_get_world_rotation_y(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getWorldRotationY();
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_world_scale_x(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getWorldScaleX();
|
||||
float spine_bone_pose_get_world_scale_x(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getWorldScaleX();
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_world_scale_y(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getWorldScaleY();
|
||||
float spine_bone_pose_get_world_scale_y(spine_bone_pose self) {
|
||||
return ((BonePose*)self)->getWorldScaleY();
|
||||
}
|
||||
|
||||
void spine_bone_pose_world_to_local(spine_bone_pose obj, float worldX, float worldY, float* outLocalX, float* outLocalY) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->worldToLocal(worldX, worldY, *outLocalX, *outLocalY);
|
||||
void spine_bone_pose_world_to_local(spine_bone_pose self, float worldX, float worldY, float* outLocalX, float* outLocalY) {
|
||||
((BonePose*)self)->worldToLocal(worldX, worldY, *outLocalX, *outLocalY);
|
||||
}
|
||||
|
||||
void spine_bone_pose_local_to_world(spine_bone_pose obj, float localX, float localY, float* outWorldX, float* outWorldY) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->localToWorld(localX, localY, *outWorldX, *outWorldY);
|
||||
void spine_bone_pose_local_to_world(spine_bone_pose self, float localX, float localY, float* outWorldX, float* outWorldY) {
|
||||
((BonePose*)self)->localToWorld(localX, localY, *outWorldX, *outWorldY);
|
||||
}
|
||||
|
||||
void spine_bone_pose_world_to_parent(spine_bone_pose obj, float worldX, float worldY, float* outParentX, float* outParentY) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->worldToParent(worldX, worldY, *outParentX, *outParentY);
|
||||
void spine_bone_pose_world_to_parent(spine_bone_pose self, float worldX, float worldY, float* outParentX, float* outParentY) {
|
||||
((BonePose*)self)->worldToParent(worldX, worldY, *outParentX, *outParentY);
|
||||
}
|
||||
|
||||
void spine_bone_pose_parent_to_world(spine_bone_pose obj, float parentX, float parentY, float* outWorldX, float* outWorldY) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->parentToWorld(parentX, parentY, *outWorldX, *outWorldY);
|
||||
void spine_bone_pose_parent_to_world(spine_bone_pose self, float parentX, float parentY, float* outWorldX, float* outWorldY) {
|
||||
((BonePose*)self)->parentToWorld(parentX, parentY, *outWorldX, *outWorldY);
|
||||
}
|
||||
|
||||
float spine_bone_pose_world_to_local_rotation(spine_bone_pose obj, float worldRotation) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->worldToLocalRotation(worldRotation);
|
||||
float spine_bone_pose_world_to_local_rotation(spine_bone_pose self, float worldRotation) {
|
||||
return ((BonePose*)self)->worldToLocalRotation(worldRotation);
|
||||
}
|
||||
|
||||
float spine_bone_pose_local_to_world_rotation(spine_bone_pose obj, float localRotation) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->localToWorldRotation(localRotation);
|
||||
float spine_bone_pose_local_to_world_rotation(spine_bone_pose self, float localRotation) {
|
||||
return ((BonePose*)self)->localToWorldRotation(localRotation);
|
||||
}
|
||||
|
||||
void spine_bone_pose_rotate_world(spine_bone_pose obj, float degrees) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->rotateWorld(degrees);
|
||||
void spine_bone_pose_rotate_world(spine_bone_pose self, float degrees) {
|
||||
((BonePose*)self)->rotateWorld(degrees);
|
||||
}
|
||||
|
||||
void spine_bone_pose_set(spine_bone_pose obj, spine_bone_local value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->set(*((BoneLocal*) value));
|
||||
void spine_bone_pose_set(spine_bone_pose self, spine_bone_local pose) {
|
||||
((BoneLocal*)(BonePose*)self)->set(*((BoneLocal*)pose));
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_x(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getX();
|
||||
float spine_bone_pose_get_x(spine_bone_pose self) {
|
||||
return ((BoneLocal*)(BonePose*)self)->getX();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_x(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setX(value);
|
||||
void spine_bone_pose_set_x(spine_bone_pose self, float x) {
|
||||
((BoneLocal*)(BonePose*)self)->setX(x);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_y(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getY();
|
||||
float spine_bone_pose_get_y(spine_bone_pose self) {
|
||||
return ((BoneLocal*)(BonePose*)self)->getY();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_y(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setY(value);
|
||||
void spine_bone_pose_set_y(spine_bone_pose self, float y) {
|
||||
((BoneLocal*)(BonePose*)self)->setY(y);
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_position(spine_bone_pose obj, float x, float y) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setPosition(x, y);
|
||||
void spine_bone_pose_set_position(spine_bone_pose self, float x, float y) {
|
||||
((BoneLocal*)(BonePose*)self)->setPosition(x, y);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_rotation(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getRotation();
|
||||
float spine_bone_pose_get_rotation(spine_bone_pose self) {
|
||||
return ((BoneLocal*)(BonePose*)self)->getRotation();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_rotation(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setRotation(value);
|
||||
void spine_bone_pose_set_rotation(spine_bone_pose self, float rotation) {
|
||||
((BoneLocal*)(BonePose*)self)->setRotation(rotation);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_scale_x(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getScaleX();
|
||||
float spine_bone_pose_get_scale_x(spine_bone_pose self) {
|
||||
return ((BoneLocal*)(BonePose*)self)->getScaleX();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_scale_x(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setScaleX(value);
|
||||
void spine_bone_pose_set_scale_x(spine_bone_pose self, float scaleX) {
|
||||
((BoneLocal*)(BonePose*)self)->setScaleX(scaleX);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_scale_y(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getScaleY();
|
||||
float spine_bone_pose_get_scale_y(spine_bone_pose self) {
|
||||
return ((BoneLocal*)(BonePose*)self)->getScaleY();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_scale_y(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setScaleY(value);
|
||||
void spine_bone_pose_set_scale_y(spine_bone_pose self, float scaleY) {
|
||||
((BoneLocal*)(BonePose*)self)->setScaleY(scaleY);
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_scale(spine_bone_pose obj, float scaleX, float scaleY) {
|
||||
if (!obj) return ;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setScale(scaleX, scaleY);
|
||||
void spine_bone_pose_set_scale_1(spine_bone_pose self, float scaleX, float scaleY) {
|
||||
((BoneLocal*)(BonePose*)self)->setScale(scaleX, scaleY);
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_scale(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setScale(value);
|
||||
void spine_bone_pose_set_scale_2(spine_bone_pose self, float scale) {
|
||||
((BoneLocal*)(BonePose*)self)->setScale(scale);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_shear_x(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getShearX();
|
||||
float spine_bone_pose_get_shear_x(spine_bone_pose self) {
|
||||
return ((BoneLocal*)(BonePose*)self)->getShearX();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_shear_x(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setShearX(value);
|
||||
void spine_bone_pose_set_shear_x(spine_bone_pose self, float shearX) {
|
||||
((BoneLocal*)(BonePose*)self)->setShearX(shearX);
|
||||
}
|
||||
|
||||
float spine_bone_pose_get_shear_y(spine_bone_pose obj) {
|
||||
if (!obj) return 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return _obj->getShearY();
|
||||
float spine_bone_pose_get_shear_y(spine_bone_pose self) {
|
||||
return ((BoneLocal*)(BonePose*)self)->getShearY();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_shear_y(spine_bone_pose obj, float value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setShearY(value);
|
||||
void spine_bone_pose_set_shear_y(spine_bone_pose self, float shearY) {
|
||||
((BoneLocal*)(BonePose*)self)->setShearY(shearY);
|
||||
}
|
||||
|
||||
spine_inherit spine_bone_pose_get_inherit(spine_bone_pose obj) {
|
||||
if (!obj) return (spine_inherit) 0;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
return (spine_inherit) _obj->getInherit();
|
||||
spine_inherit spine_bone_pose_get_inherit(spine_bone_pose self) {
|
||||
return (spine_inherit)((BoneLocal*)(BonePose*)self)->getInherit();
|
||||
}
|
||||
|
||||
void spine_bone_pose_set_inherit(spine_bone_pose obj, spine_inherit value) {
|
||||
if (!obj) return;
|
||||
BonePose *_obj = (BonePose *) obj;
|
||||
_obj->setInherit((Inherit) value);
|
||||
void spine_bone_pose_set_inherit(spine_bone_pose self, spine_inherit inherit) {
|
||||
((BoneLocal*)(BonePose*)self)->setInherit((Inherit)inherit);
|
||||
}
|
||||
|
||||
spine_rtti spine_bone_pose_get_rtti() {
|
||||
return (spine_rtti) &BonePose::rtti;
|
||||
spine_rtti spine_bone_pose_get_rtti(spine_bone_pose self) {
|
||||
return (spine_rtti)&((Update*)(BonePose*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_rtti spine_bone_pose_rtti(void) {
|
||||
return (spine_rtti)&BonePose::rtti;
|
||||
}
|
||||
|
||||
@ -1,97 +1,72 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_BONE_POSE_H
|
||||
#define SPINE_SPINE_BONE_POSE_H
|
||||
|
||||
#ifndef SPINE_C_BONEPOSE_H
|
||||
#define SPINE_C_BONEPOSE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_bone_pose spine_bone_pose_create(void);
|
||||
|
||||
SPINE_C_EXPORT spine_bone_pose spine_bone_pose_create(void);
|
||||
SPINE_C_EXPORT void spine_bone_pose_dispose(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_update(spine_bone_pose obj, spine_skeleton skeleton, spine_physics physics);
|
||||
SPINE_C_EXPORT void spine_bone_pose_update_world_transform(spine_bone_pose obj, spine_skeleton skeleton);
|
||||
SPINE_C_EXPORT void spine_bone_pose_update_local_transform(spine_bone_pose obj, spine_skeleton skeleton);
|
||||
SPINE_C_EXPORT void spine_bone_pose_validate_local_transform(spine_bone_pose obj, spine_skeleton skeleton);
|
||||
SPINE_C_EXPORT void spine_bone_pose_modify_local(spine_bone_pose obj, spine_skeleton skeleton);
|
||||
SPINE_C_EXPORT void spine_bone_pose_modify_world(spine_bone_pose obj, int update);
|
||||
SPINE_C_EXPORT void spine_bone_pose_reset_world(spine_bone_pose obj, int update);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_a(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_a(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_b(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_b(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_c(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_c(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_d(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_d(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_world_x(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_world_x(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_world_y(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_world_y(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_world_rotation_x(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_world_rotation_y(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_world_scale_x(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_world_scale_y(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_world_to_local(spine_bone_pose obj, float worldX, float worldY, float* outLocalX, float* outLocalY);
|
||||
SPINE_C_EXPORT void spine_bone_pose_local_to_world(spine_bone_pose obj, float localX, float localY, float* outWorldX, float* outWorldY);
|
||||
SPINE_C_EXPORT void spine_bone_pose_world_to_parent(spine_bone_pose obj, float worldX, float worldY, float* outParentX, float* outParentY);
|
||||
SPINE_C_EXPORT void spine_bone_pose_parent_to_world(spine_bone_pose obj, float parentX, float parentY, float* outWorldX, float* outWorldY);
|
||||
SPINE_C_EXPORT float spine_bone_pose_world_to_local_rotation(spine_bone_pose obj, float worldRotation);
|
||||
SPINE_C_EXPORT float spine_bone_pose_local_to_world_rotation(spine_bone_pose obj, float localRotation);
|
||||
SPINE_C_EXPORT void spine_bone_pose_rotate_world(spine_bone_pose obj, float degrees);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set(spine_bone_pose obj, spine_bone_local value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_x(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_x(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_y(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_y(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_position(spine_bone_pose obj, float x, float y);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_rotation(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_rotation(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_scale_x(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_scale_x(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_scale_y(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_scale_y(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_scale(spine_bone_pose obj, float scaleX, float scaleY);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_scale(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_shear_x(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_shear_x(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT float spine_bone_pose_get_shear_y(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_shear_y(spine_bone_pose obj, float value);
|
||||
SPINE_C_EXPORT spine_inherit spine_bone_pose_get_inherit(spine_bone_pose obj);
|
||||
SPINE_C_EXPORT void spine_bone_pose_set_inherit(spine_bone_pose obj, spine_inherit value);
|
||||
SPINE_C_EXPORT spine_rtti spine_bone_pose_get_rtti();
|
||||
SPINE_C_API void spine_bone_pose_dispose(spine_bone_pose self);
|
||||
|
||||
SPINE_C_API void spine_bone_pose_update(spine_bone_pose self, spine_skeleton skeleton, spine_physics physics);
|
||||
SPINE_C_API void spine_bone_pose_update_world_transform(spine_bone_pose self, spine_skeleton skeleton);
|
||||
SPINE_C_API void spine_bone_pose_update_local_transform(spine_bone_pose self, spine_skeleton skeleton);
|
||||
SPINE_C_API void spine_bone_pose_validate_local_transform(spine_bone_pose self, spine_skeleton skeleton);
|
||||
SPINE_C_API void spine_bone_pose_modify_local(spine_bone_pose self, spine_skeleton skeleton);
|
||||
SPINE_C_API void spine_bone_pose_modify_world(spine_bone_pose self, int update);
|
||||
SPINE_C_API void spine_bone_pose_reset_world(spine_bone_pose self, int update);
|
||||
SPINE_C_API float spine_bone_pose_get_a(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_a(spine_bone_pose self, float a);
|
||||
SPINE_C_API float spine_bone_pose_get_b(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_b(spine_bone_pose self, float b);
|
||||
SPINE_C_API float spine_bone_pose_get_c(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_c(spine_bone_pose self, float c);
|
||||
SPINE_C_API float spine_bone_pose_get_d(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_d(spine_bone_pose self, float d);
|
||||
SPINE_C_API float spine_bone_pose_get_world_x(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_world_x(spine_bone_pose self, float worldX);
|
||||
SPINE_C_API float spine_bone_pose_get_world_y(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_world_y(spine_bone_pose self, float worldY);
|
||||
SPINE_C_API float spine_bone_pose_get_world_rotation_x(spine_bone_pose self);
|
||||
SPINE_C_API float spine_bone_pose_get_world_rotation_y(spine_bone_pose self);
|
||||
SPINE_C_API float spine_bone_pose_get_world_scale_x(spine_bone_pose self);
|
||||
SPINE_C_API float spine_bone_pose_get_world_scale_y(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_world_to_local(spine_bone_pose self, float worldX, float worldY, float* outLocalX, float* outLocalY);
|
||||
SPINE_C_API void spine_bone_pose_local_to_world(spine_bone_pose self, float localX, float localY, float* outWorldX, float* outWorldY);
|
||||
SPINE_C_API void spine_bone_pose_world_to_parent(spine_bone_pose self, float worldX, float worldY, float* outParentX, float* outParentY);
|
||||
SPINE_C_API void spine_bone_pose_parent_to_world(spine_bone_pose self, float parentX, float parentY, float* outWorldX, float* outWorldY);
|
||||
SPINE_C_API float spine_bone_pose_world_to_local_rotation(spine_bone_pose self, float worldRotation);
|
||||
SPINE_C_API float spine_bone_pose_local_to_world_rotation(spine_bone_pose self, float localRotation);
|
||||
SPINE_C_API void spine_bone_pose_rotate_world(spine_bone_pose self, float degrees);
|
||||
SPINE_C_API void spine_bone_pose_set(spine_bone_pose self, spine_bone_local pose);
|
||||
SPINE_C_API float spine_bone_pose_get_x(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_x(spine_bone_pose self, float x);
|
||||
SPINE_C_API float spine_bone_pose_get_y(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_y(spine_bone_pose self, float y);
|
||||
SPINE_C_API void spine_bone_pose_set_position(spine_bone_pose self, float x, float y);
|
||||
SPINE_C_API float spine_bone_pose_get_rotation(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_rotation(spine_bone_pose self, float rotation);
|
||||
SPINE_C_API float spine_bone_pose_get_scale_x(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_scale_x(spine_bone_pose self, float scaleX);
|
||||
SPINE_C_API float spine_bone_pose_get_scale_y(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_scale_y(spine_bone_pose self, float scaleY);
|
||||
SPINE_C_API void spine_bone_pose_set_scale_1(spine_bone_pose self, float scaleX, float scaleY);
|
||||
SPINE_C_API void spine_bone_pose_set_scale_2(spine_bone_pose self, float scale);
|
||||
SPINE_C_API float spine_bone_pose_get_shear_x(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_shear_x(spine_bone_pose self, float shearX);
|
||||
SPINE_C_API float spine_bone_pose_get_shear_y(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_shear_y(spine_bone_pose self, float shearY);
|
||||
SPINE_C_API spine_inherit spine_bone_pose_get_inherit(spine_bone_pose self);
|
||||
SPINE_C_API void spine_bone_pose_set_inherit(spine_bone_pose self, spine_inherit inherit);
|
||||
SPINE_C_API spine_rtti spine_bone_pose_get_rtti(spine_bone_pose self);
|
||||
SPINE_C_API spine_rtti spine_bone_pose_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BONEPOSE_H
|
||||
#endif /* SPINE_SPINE_BONE_POSE_H */
|
||||
@ -1,59 +1,24 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "bone_timeline.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_bone_timeline spine_bone_timeline_create(int boneIndex) {
|
||||
BoneTimeline *obj = new (__FILE__, __LINE__) BoneTimeline(boneIndex);
|
||||
return (spine_bone_timeline) obj;
|
||||
void spine_bone_timeline_dispose(spine_bone_timeline self) {
|
||||
delete (BoneTimeline*)self;
|
||||
}
|
||||
|
||||
void spine_bone_timeline_dispose(spine_bone_timeline obj) {
|
||||
if (!obj) return;
|
||||
delete (BoneTimeline *) obj;
|
||||
spine_rtti spine_bone_timeline_get_rtti(spine_bone_timeline self) {
|
||||
return (spine_rtti)&((BoneTimeline*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_rtti spine_bone_timeline_get_rtti() {
|
||||
return (spine_rtti) &BoneTimeline::rtti;
|
||||
int spine_bone_timeline_get_bone_index(spine_bone_timeline self) {
|
||||
return ((BoneTimeline*)self)->getBoneIndex();
|
||||
}
|
||||
|
||||
int spine_bone_timeline_get_bone_index(spine_bone_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
BoneTimeline *_obj = (BoneTimeline *) obj;
|
||||
return _obj->getBoneIndex();
|
||||
void spine_bone_timeline_set_bone_index(spine_bone_timeline self, int inValue) {
|
||||
((BoneTimeline*)self)->setBoneIndex(inValue);
|
||||
}
|
||||
|
||||
void spine_bone_timeline_set_bone_index(spine_bone_timeline obj, int value) {
|
||||
if (!obj) return;
|
||||
BoneTimeline *_obj = (BoneTimeline *) obj;
|
||||
_obj->setBoneIndex(value);
|
||||
spine_rtti spine_bone_timeline_rtti(void) {
|
||||
return (spine_rtti)&BoneTimeline::rtti;
|
||||
}
|
||||
|
||||
@ -1,49 +1,22 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_BONE_TIMELINE_H
|
||||
#define SPINE_SPINE_BONE_TIMELINE_H
|
||||
|
||||
#ifndef SPINE_C_BONETIMELINE_H
|
||||
#define SPINE_C_BONETIMELINE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_bone_timeline_dispose(spine_bone_timeline self);
|
||||
|
||||
SPINE_C_EXPORT spine_bone_timeline spine_bone_timeline_create(int boneIndex);
|
||||
SPINE_C_EXPORT void spine_bone_timeline_dispose(spine_bone_timeline obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_bone_timeline_get_rtti();
|
||||
SPINE_C_EXPORT int spine_bone_timeline_get_bone_index(spine_bone_timeline obj);
|
||||
SPINE_C_EXPORT void spine_bone_timeline_set_bone_index(spine_bone_timeline obj, int value);
|
||||
SPINE_C_API spine_rtti spine_bone_timeline_get_rtti(spine_bone_timeline self);
|
||||
SPINE_C_API int spine_bone_timeline_get_bone_index(spine_bone_timeline self);
|
||||
SPINE_C_API void spine_bone_timeline_set_bone_index(spine_bone_timeline self, int inValue);
|
||||
SPINE_C_API spine_rtti spine_bone_timeline_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BONETIMELINE_H
|
||||
#endif /* SPINE_SPINE_BONE_TIMELINE_H */
|
||||
@ -1,101 +1,92 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "bone_timeline1.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_bone_timeline1 spine_bone_timeline1_create(size_t frameCount, size_t bezierCount, int boneIndex, spine_property property) {
|
||||
BoneTimeline1 *obj = new (__FILE__, __LINE__) BoneTimeline1(frameCount, bezierCount, boneIndex, property);
|
||||
return (spine_bone_timeline1) obj;
|
||||
void spine_bone_timeline1_dispose(spine_bone_timeline1 self) {
|
||||
delete (BoneTimeline1*)self;
|
||||
}
|
||||
|
||||
void spine_bone_timeline1_dispose(spine_bone_timeline1 obj) {
|
||||
if (!obj) return;
|
||||
delete (BoneTimeline1 *) obj;
|
||||
spine_rtti spine_bone_timeline1_get_rtti(spine_bone_timeline1 self) {
|
||||
return (spine_rtti)&((BoneTimeline1*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_rtti spine_bone_timeline1_get_rtti() {
|
||||
return (spine_rtti) &BoneTimeline1::rtti;
|
||||
void spine_bone_timeline1_apply(spine_bone_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((BoneTimeline1*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
void spine_bone_timeline1_apply(spine_bone_timeline1 obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
void spine_bone_timeline1_set_frame(spine_bone_timeline1 self, size_t frame, float time, float value) {
|
||||
((CurveTimeline1*)(BoneTimeline1*)self)->setFrame(frame, time, value);
|
||||
}
|
||||
|
||||
void spine_bone_timeline1_set_frame(spine_bone_timeline1 obj, size_t frame, float time, float value) {
|
||||
if (!obj) return ;
|
||||
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
|
||||
_obj->setFrame(frame, time, value);
|
||||
float spine_bone_timeline1_get_curve_value(spine_bone_timeline1 self, float time) {
|
||||
return ((CurveTimeline1*)(BoneTimeline1*)self)->getCurveValue(time);
|
||||
}
|
||||
|
||||
float spine_bone_timeline1_get_curve_value(spine_bone_timeline1 obj, float time) {
|
||||
if (!obj) return 0;
|
||||
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
|
||||
return _obj->getCurveValue(time);
|
||||
float spine_bone_timeline1_get_relative_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
return ((CurveTimeline1*)(BoneTimeline1*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup);
|
||||
}
|
||||
|
||||
float spine_bone_timeline1_get_relative_value(spine_bone_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
|
||||
return _obj->getRelativeValue(time, alpha, (MixBlend) blend, current, setup);
|
||||
float spine_bone_timeline1_get_absolute_value_1(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
return ((CurveTimeline1*)(BoneTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup);
|
||||
}
|
||||
|
||||
float spine_bone_timeline1_get_absolute_value(spine_bone_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
|
||||
return _obj->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup);
|
||||
float spine_bone_timeline1_get_absolute_value_2(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) {
|
||||
return ((CurveTimeline1*)(BoneTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value);
|
||||
}
|
||||
|
||||
float spine_bone_timeline1_get_absolute_value_6(spine_bone_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) {
|
||||
if (!obj) return 0;
|
||||
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
|
||||
return _obj->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value);
|
||||
float spine_bone_timeline1_get_scale_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) {
|
||||
return ((CurveTimeline1*)(BoneTimeline1*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup);
|
||||
}
|
||||
|
||||
float spine_bone_timeline1_get_scale_value(spine_bone_timeline1 obj, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
|
||||
return _obj->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup);
|
||||
void spine_bone_timeline1_set_linear(spine_bone_timeline1 self, size_t frame) {
|
||||
((CurveTimeline1*)(BoneTimeline1*)self)->setLinear(frame);
|
||||
}
|
||||
|
||||
int spine_bone_timeline1_get_bone_index(spine_bone_timeline1 obj) {
|
||||
if (!obj) return 0;
|
||||
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
|
||||
return _obj->getBoneIndex();
|
||||
void spine_bone_timeline1_set_stepped(spine_bone_timeline1 self, size_t frame) {
|
||||
((CurveTimeline1*)(BoneTimeline1*)self)->setStepped(frame);
|
||||
}
|
||||
|
||||
void spine_bone_timeline1_set_bone_index(spine_bone_timeline1 obj, int value) {
|
||||
if (!obj) return;
|
||||
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
|
||||
_obj->setBoneIndex(value);
|
||||
void spine_bone_timeline1_set_bezier(spine_bone_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
((CurveTimeline1*)(BoneTimeline1*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
}
|
||||
|
||||
float spine_bone_timeline1_get_bezier_value(spine_bone_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
return ((CurveTimeline1*)(BoneTimeline1*)self)->getBezierValue(time, frame, valueOffset, i);
|
||||
}
|
||||
|
||||
spine_array_float spine_bone_timeline1_get_curves(spine_bone_timeline1 self) {
|
||||
return (spine_array_float)&((CurveTimeline1*)(BoneTimeline1*)self)->getCurves();
|
||||
}
|
||||
|
||||
size_t spine_bone_timeline1_get_frame_entries(spine_bone_timeline1 self) {
|
||||
return ((CurveTimeline1*)(BoneTimeline1*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
size_t spine_bone_timeline1_get_frame_count(spine_bone_timeline1 self) {
|
||||
return ((CurveTimeline1*)(BoneTimeline1*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
spine_array_float spine_bone_timeline1_get_frames(spine_bone_timeline1 self) {
|
||||
return (spine_array_float)&((CurveTimeline1*)(BoneTimeline1*)self)->getFrames();
|
||||
}
|
||||
|
||||
float spine_bone_timeline1_get_duration(spine_bone_timeline1 self) {
|
||||
return ((CurveTimeline1*)(BoneTimeline1*)self)->getDuration();
|
||||
}
|
||||
|
||||
spine_array_property_id spine_bone_timeline1_get_property_ids(spine_bone_timeline1 self) {
|
||||
return (spine_array_property_id)&((CurveTimeline1*)(BoneTimeline1*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
int spine_bone_timeline1_get_bone_index(spine_bone_timeline1 self) {
|
||||
return ((BoneTimeline*)(BoneTimeline1*)self)->getBoneIndex();
|
||||
}
|
||||
|
||||
void spine_bone_timeline1_set_bone_index(spine_bone_timeline1 self, int inValue) {
|
||||
((BoneTimeline*)(BoneTimeline1*)self)->setBoneIndex(inValue);
|
||||
}
|
||||
|
||||
spine_rtti spine_bone_timeline1_rtti(void) {
|
||||
return (spine_rtti)&BoneTimeline1::rtti;
|
||||
}
|
||||
|
||||
@ -1,56 +1,39 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_BONE_TIMELINE1_H
|
||||
#define SPINE_SPINE_BONE_TIMELINE1_H
|
||||
|
||||
#ifndef SPINE_C_BONETIMELINE1_H
|
||||
#define SPINE_C_BONETIMELINE1_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_bone_timeline1_dispose(spine_bone_timeline1 self);
|
||||
|
||||
SPINE_C_EXPORT spine_bone_timeline1 spine_bone_timeline1_create(size_t frameCount, size_t bezierCount, int boneIndex, spine_property property);
|
||||
SPINE_C_EXPORT void spine_bone_timeline1_dispose(spine_bone_timeline1 obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_bone_timeline1_get_rtti();
|
||||
SPINE_C_EXPORT void spine_bone_timeline1_apply(spine_bone_timeline1 obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT void spine_bone_timeline1_set_frame(spine_bone_timeline1 obj, size_t frame, float time, float value);
|
||||
SPINE_C_EXPORT float spine_bone_timeline1_get_curve_value(spine_bone_timeline1 obj, float time);
|
||||
SPINE_C_EXPORT float spine_bone_timeline1_get_relative_value(spine_bone_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_EXPORT float spine_bone_timeline1_get_absolute_value(spine_bone_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_EXPORT float spine_bone_timeline1_get_absolute_value_6(spine_bone_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup, float value);
|
||||
SPINE_C_EXPORT float spine_bone_timeline1_get_scale_value(spine_bone_timeline1 obj, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup);
|
||||
SPINE_C_EXPORT int spine_bone_timeline1_get_bone_index(spine_bone_timeline1 obj);
|
||||
SPINE_C_EXPORT void spine_bone_timeline1_set_bone_index(spine_bone_timeline1 obj, int value);
|
||||
SPINE_C_API spine_rtti spine_bone_timeline1_get_rtti(spine_bone_timeline1 self);
|
||||
SPINE_C_API void spine_bone_timeline1_apply(spine_bone_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API void spine_bone_timeline1_set_frame(spine_bone_timeline1 self, size_t frame, float time, float value);
|
||||
SPINE_C_API float spine_bone_timeline1_get_curve_value(spine_bone_timeline1 self, float time);
|
||||
SPINE_C_API float spine_bone_timeline1_get_relative_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_API float spine_bone_timeline1_get_absolute_value_1(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_API float spine_bone_timeline1_get_absolute_value_2(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value);
|
||||
SPINE_C_API float spine_bone_timeline1_get_scale_value(spine_bone_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup);
|
||||
SPINE_C_API void spine_bone_timeline1_set_linear(spine_bone_timeline1 self, size_t frame);
|
||||
SPINE_C_API void spine_bone_timeline1_set_stepped(spine_bone_timeline1 self, size_t frame);
|
||||
SPINE_C_API void spine_bone_timeline1_set_bezier(spine_bone_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_API float spine_bone_timeline1_get_bezier_value(spine_bone_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_API spine_array_float spine_bone_timeline1_get_curves(spine_bone_timeline1 self);
|
||||
SPINE_C_API size_t spine_bone_timeline1_get_frame_entries(spine_bone_timeline1 self);
|
||||
SPINE_C_API size_t spine_bone_timeline1_get_frame_count(spine_bone_timeline1 self);
|
||||
SPINE_C_API spine_array_float spine_bone_timeline1_get_frames(spine_bone_timeline1 self);
|
||||
SPINE_C_API float spine_bone_timeline1_get_duration(spine_bone_timeline1 self);
|
||||
SPINE_C_API spine_array_property_id spine_bone_timeline1_get_property_ids(spine_bone_timeline1 self);
|
||||
SPINE_C_API int spine_bone_timeline1_get_bone_index(spine_bone_timeline1 self);
|
||||
SPINE_C_API void spine_bone_timeline1_set_bone_index(spine_bone_timeline1 self, int inValue);
|
||||
SPINE_C_API spine_rtti spine_bone_timeline1_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BONETIMELINE1_H
|
||||
#endif /* SPINE_SPINE_BONE_TIMELINE1_H */
|
||||
@ -1,77 +1,76 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "bone_timeline2.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_bone_timeline2 spine_bone_timeline2_create(size_t frameCount, size_t bezierCount, int boneIndex, spine_property property1, spine_property property2) {
|
||||
BoneTimeline2 *obj = new (__FILE__, __LINE__) BoneTimeline2(frameCount, bezierCount, boneIndex, property1, property2);
|
||||
return (spine_bone_timeline2) obj;
|
||||
void spine_bone_timeline2_dispose(spine_bone_timeline2 self) {
|
||||
delete (BoneTimeline2*)self;
|
||||
}
|
||||
|
||||
void spine_bone_timeline2_dispose(spine_bone_timeline2 obj) {
|
||||
if (!obj) return;
|
||||
delete (BoneTimeline2 *) obj;
|
||||
spine_rtti spine_bone_timeline2_get_rtti(spine_bone_timeline2 self) {
|
||||
return (spine_rtti)&((BoneTimeline2*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_rtti spine_bone_timeline2_get_rtti() {
|
||||
return (spine_rtti) &BoneTimeline2::rtti;
|
||||
void spine_bone_timeline2_apply(spine_bone_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((BoneTimeline2*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
void spine_bone_timeline2_apply(spine_bone_timeline2 obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
BoneTimeline2 *_obj = (BoneTimeline2 *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
void spine_bone_timeline2_set_frame(spine_bone_timeline2 self, size_t frame, float time, float value1, float value2) {
|
||||
((CurveTimeline2*)(BoneTimeline2*)self)->setFrame(frame, time, value1, value2);
|
||||
}
|
||||
|
||||
void spine_bone_timeline2_set_frame(spine_bone_timeline2 obj, size_t frame, float time, float value1, float value2) {
|
||||
if (!obj) return ;
|
||||
BoneTimeline2 *_obj = (BoneTimeline2 *) obj;
|
||||
_obj->setFrame(frame, time, value1, value2);
|
||||
float spine_bone_timeline2_get_curve_value(spine_bone_timeline2 self, float time) {
|
||||
return ((CurveTimeline2*)(BoneTimeline2*)self)->getCurveValue(time);
|
||||
}
|
||||
|
||||
float spine_bone_timeline2_get_curve_value(spine_bone_timeline2 obj, float time) {
|
||||
if (!obj) return 0;
|
||||
BoneTimeline2 *_obj = (BoneTimeline2 *) obj;
|
||||
return _obj->getCurveValue(time);
|
||||
void spine_bone_timeline2_set_linear(spine_bone_timeline2 self, size_t frame) {
|
||||
((CurveTimeline2*)(BoneTimeline2*)self)->setLinear(frame);
|
||||
}
|
||||
|
||||
int spine_bone_timeline2_get_bone_index(spine_bone_timeline2 obj) {
|
||||
if (!obj) return 0;
|
||||
BoneTimeline2 *_obj = (BoneTimeline2 *) obj;
|
||||
return _obj->getBoneIndex();
|
||||
void spine_bone_timeline2_set_stepped(spine_bone_timeline2 self, size_t frame) {
|
||||
((CurveTimeline2*)(BoneTimeline2*)self)->setStepped(frame);
|
||||
}
|
||||
|
||||
void spine_bone_timeline2_set_bone_index(spine_bone_timeline2 obj, int value) {
|
||||
if (!obj) return;
|
||||
BoneTimeline2 *_obj = (BoneTimeline2 *) obj;
|
||||
_obj->setBoneIndex(value);
|
||||
void spine_bone_timeline2_set_bezier(spine_bone_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
((CurveTimeline2*)(BoneTimeline2*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
}
|
||||
|
||||
float spine_bone_timeline2_get_bezier_value(spine_bone_timeline2 self, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
return ((CurveTimeline2*)(BoneTimeline2*)self)->getBezierValue(time, frame, valueOffset, i);
|
||||
}
|
||||
|
||||
spine_array_float spine_bone_timeline2_get_curves(spine_bone_timeline2 self) {
|
||||
return (spine_array_float)&((CurveTimeline2*)(BoneTimeline2*)self)->getCurves();
|
||||
}
|
||||
|
||||
size_t spine_bone_timeline2_get_frame_entries(spine_bone_timeline2 self) {
|
||||
return ((CurveTimeline2*)(BoneTimeline2*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
size_t spine_bone_timeline2_get_frame_count(spine_bone_timeline2 self) {
|
||||
return ((CurveTimeline2*)(BoneTimeline2*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
spine_array_float spine_bone_timeline2_get_frames(spine_bone_timeline2 self) {
|
||||
return (spine_array_float)&((CurveTimeline2*)(BoneTimeline2*)self)->getFrames();
|
||||
}
|
||||
|
||||
float spine_bone_timeline2_get_duration(spine_bone_timeline2 self) {
|
||||
return ((CurveTimeline2*)(BoneTimeline2*)self)->getDuration();
|
||||
}
|
||||
|
||||
spine_array_property_id spine_bone_timeline2_get_property_ids(spine_bone_timeline2 self) {
|
||||
return (spine_array_property_id)&((CurveTimeline2*)(BoneTimeline2*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
int spine_bone_timeline2_get_bone_index(spine_bone_timeline2 self) {
|
||||
return ((BoneTimeline*)(BoneTimeline2*)self)->getBoneIndex();
|
||||
}
|
||||
|
||||
void spine_bone_timeline2_set_bone_index(spine_bone_timeline2 self, int inValue) {
|
||||
((BoneTimeline*)(BoneTimeline2*)self)->setBoneIndex(inValue);
|
||||
}
|
||||
|
||||
spine_rtti spine_bone_timeline2_rtti(void) {
|
||||
return (spine_rtti)&BoneTimeline2::rtti;
|
||||
}
|
||||
|
||||
@ -1,52 +1,35 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_BONE_TIMELINE2_H
|
||||
#define SPINE_SPINE_BONE_TIMELINE2_H
|
||||
|
||||
#ifndef SPINE_C_BONETIMELINE2_H
|
||||
#define SPINE_C_BONETIMELINE2_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_bone_timeline2_dispose(spine_bone_timeline2 self);
|
||||
|
||||
SPINE_C_EXPORT spine_bone_timeline2 spine_bone_timeline2_create(size_t frameCount, size_t bezierCount, int boneIndex, spine_property property1, spine_property property2);
|
||||
SPINE_C_EXPORT void spine_bone_timeline2_dispose(spine_bone_timeline2 obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_bone_timeline2_get_rtti();
|
||||
SPINE_C_EXPORT void spine_bone_timeline2_apply(spine_bone_timeline2 obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT void spine_bone_timeline2_set_frame(spine_bone_timeline2 obj, size_t frame, float time, float value1, float value2);
|
||||
SPINE_C_EXPORT float spine_bone_timeline2_get_curve_value(spine_bone_timeline2 obj, float time);
|
||||
SPINE_C_EXPORT int spine_bone_timeline2_get_bone_index(spine_bone_timeline2 obj);
|
||||
SPINE_C_EXPORT void spine_bone_timeline2_set_bone_index(spine_bone_timeline2 obj, int value);
|
||||
SPINE_C_API spine_rtti spine_bone_timeline2_get_rtti(spine_bone_timeline2 self);
|
||||
SPINE_C_API void spine_bone_timeline2_apply(spine_bone_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API void spine_bone_timeline2_set_frame(spine_bone_timeline2 self, size_t frame, float time, float value1, float value2);
|
||||
SPINE_C_API float spine_bone_timeline2_get_curve_value(spine_bone_timeline2 self, float time);
|
||||
SPINE_C_API void spine_bone_timeline2_set_linear(spine_bone_timeline2 self, size_t frame);
|
||||
SPINE_C_API void spine_bone_timeline2_set_stepped(spine_bone_timeline2 self, size_t frame);
|
||||
SPINE_C_API void spine_bone_timeline2_set_bezier(spine_bone_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_API float spine_bone_timeline2_get_bezier_value(spine_bone_timeline2 self, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_API spine_array_float spine_bone_timeline2_get_curves(spine_bone_timeline2 self);
|
||||
SPINE_C_API size_t spine_bone_timeline2_get_frame_entries(spine_bone_timeline2 self);
|
||||
SPINE_C_API size_t spine_bone_timeline2_get_frame_count(spine_bone_timeline2 self);
|
||||
SPINE_C_API spine_array_float spine_bone_timeline2_get_frames(spine_bone_timeline2 self);
|
||||
SPINE_C_API float spine_bone_timeline2_get_duration(spine_bone_timeline2 self);
|
||||
SPINE_C_API spine_array_property_id spine_bone_timeline2_get_property_ids(spine_bone_timeline2 self);
|
||||
SPINE_C_API int spine_bone_timeline2_get_bone_index(spine_bone_timeline2 self);
|
||||
SPINE_C_API void spine_bone_timeline2_set_bone_index(spine_bone_timeline2 self, int inValue);
|
||||
SPINE_C_API spine_rtti spine_bone_timeline2_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BONETIMELINE2_H
|
||||
#endif /* SPINE_SPINE_BONE_TIMELINE2_H */
|
||||
@ -1,143 +1,92 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "bounding_box_attachment.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_bounding_box_attachment spine_bounding_box_attachment_create(const char* name) {
|
||||
BoundingBoxAttachment *obj = new (__FILE__, __LINE__) BoundingBoxAttachment(String(name));
|
||||
return (spine_bounding_box_attachment) obj;
|
||||
return (spine_bounding_box_attachment) new (__FILE__, __LINE__) BoundingBoxAttachment(*((const String*)name));
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_dispose(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return;
|
||||
delete (BoundingBoxAttachment *) obj;
|
||||
void spine_bounding_box_attachment_dispose(spine_bounding_box_attachment self) {
|
||||
delete (BoundingBoxAttachment*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_bounding_box_attachment_get_rtti() {
|
||||
return (spine_rtti) &BoundingBoxAttachment::rtti;
|
||||
spine_rtti spine_bounding_box_attachment_get_rtti(spine_bounding_box_attachment self) {
|
||||
return (spine_rtti)&((BoundingBoxAttachment*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return (spine_color) 0;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
return (spine_color) &_obj->getColor();
|
||||
spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment self) {
|
||||
return (spine_color)&((BoundingBoxAttachment*)self)->getColor();
|
||||
}
|
||||
|
||||
spine_attachment spine_bounding_box_attachment_copy(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return (spine_attachment) 0;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
return (spine_attachment) _obj->copy();
|
||||
spine_attachment spine_bounding_box_attachment_copy(spine_bounding_box_attachment self) {
|
||||
return (spine_attachment)((BoundingBoxAttachment*)self)->copy();
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_compute_world_vertices(spine_bounding_box_attachment obj, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride) {
|
||||
if (!obj) return ;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
_obj->computeWorldVertices(*(Skeleton*) skeleton, *(Slot*) slot, start, count, (float *) worldVertices, offset, stride);
|
||||
void spine_bounding_box_attachment_compute_world_vertices_1(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride) {
|
||||
((VertexAttachment*)(BoundingBoxAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, worldVertices, offset, stride);
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_compute_world_vertices_7(spine_bounding_box_attachment obj, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride) {
|
||||
if (!obj) return ;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
_obj->computeWorldVertices(*(Skeleton*) skeleton, *(Slot*) slot, start, count, (Array<float> &) worldVertices, offset, stride);
|
||||
void spine_bounding_box_attachment_compute_world_vertices_2(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride) {
|
||||
((VertexAttachment*)(BoundingBoxAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, *((Array<float>*)worldVertices), offset, stride);
|
||||
}
|
||||
|
||||
int spine_bounding_box_attachment_get_id(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return 0;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
return _obj->getId();
|
||||
int spine_bounding_box_attachment_get_id(spine_bounding_box_attachment self) {
|
||||
return ((VertexAttachment*)(BoundingBoxAttachment*)self)->getId();
|
||||
}
|
||||
|
||||
int32_t spine_bounding_box_attachment_get_num_bones(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return 0;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
return (int32_t) _obj->getBones().size();
|
||||
spine_array_int spine_bounding_box_attachment_get_bones(spine_bounding_box_attachment self) {
|
||||
return (spine_array_int)&((VertexAttachment*)(BoundingBoxAttachment*)self)->getBones();
|
||||
}
|
||||
|
||||
int *spine_bounding_box_attachment_get_bones(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return nullptr;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
return (int *) _obj->getBones().buffer();
|
||||
void spine_bounding_box_attachment_set_bones(spine_bounding_box_attachment self, spine_array_int bones) {
|
||||
((VertexAttachment*)(BoundingBoxAttachment*)self)->setBones(*((Array<int>*)bones));
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_set_bones(spine_bounding_box_attachment obj, spine_array_int value) {
|
||||
if (!obj) return;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
_obj->setBones((Array<int> &) value);
|
||||
spine_array_float spine_bounding_box_attachment_get_vertices(spine_bounding_box_attachment self) {
|
||||
return (spine_array_float)&((VertexAttachment*)(BoundingBoxAttachment*)self)->getVertices();
|
||||
}
|
||||
|
||||
int32_t spine_bounding_box_attachment_get_num_vertices(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return 0;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
return (int32_t) _obj->getVertices().size();
|
||||
void spine_bounding_box_attachment_set_vertices(spine_bounding_box_attachment self, spine_array_float vertices) {
|
||||
((VertexAttachment*)(BoundingBoxAttachment*)self)->setVertices(*((Array<float>*)vertices));
|
||||
}
|
||||
|
||||
float *spine_bounding_box_attachment_get_vertices(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return nullptr;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
return (float *) _obj->getVertices().buffer();
|
||||
size_t spine_bounding_box_attachment_get_world_vertices_length(spine_bounding_box_attachment self) {
|
||||
return ((VertexAttachment*)(BoundingBoxAttachment*)self)->getWorldVerticesLength();
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_set_vertices(spine_bounding_box_attachment obj, spine_array_float value) {
|
||||
if (!obj) return;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
_obj->setVertices((Array<float> &) value);
|
||||
void spine_bounding_box_attachment_set_world_vertices_length(spine_bounding_box_attachment self, size_t inValue) {
|
||||
((VertexAttachment*)(BoundingBoxAttachment*)self)->setWorldVerticesLength(inValue);
|
||||
}
|
||||
|
||||
size_t spine_bounding_box_attachment_get_world_vertices_length(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return 0;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
return _obj->getWorldVerticesLength();
|
||||
spine_attachment spine_bounding_box_attachment_get_timeline_attachment(spine_bounding_box_attachment self) {
|
||||
return (spine_attachment)((VertexAttachment*)(BoundingBoxAttachment*)self)->getTimelineAttachment();
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_set_world_vertices_length(spine_bounding_box_attachment obj, size_t value) {
|
||||
if (!obj) return;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
_obj->setWorldVerticesLength(value);
|
||||
void spine_bounding_box_attachment_set_timeline_attachment(spine_bounding_box_attachment self, spine_attachment attachment) {
|
||||
((VertexAttachment*)(BoundingBoxAttachment*)self)->setTimelineAttachment((Attachment *)attachment);
|
||||
}
|
||||
|
||||
spine_attachment spine_bounding_box_attachment_get_timeline_attachment(spine_bounding_box_attachment obj) {
|
||||
if (!obj) return (spine_attachment) 0;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
return (spine_attachment) _obj->getTimelineAttachment();
|
||||
void spine_bounding_box_attachment_copy_to(spine_bounding_box_attachment self, spine_vertex_attachment other) {
|
||||
((VertexAttachment*)(BoundingBoxAttachment*)self)->copyTo((VertexAttachment *)other);
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_set_timeline_attachment(spine_bounding_box_attachment obj, spine_attachment value) {
|
||||
if (!obj) return;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
_obj->setTimelineAttachment((Attachment *) value);
|
||||
const char* spine_bounding_box_attachment_get_name(spine_bounding_box_attachment self) {
|
||||
return (const char*)&((VertexAttachment*)(BoundingBoxAttachment*)self)->getName();
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_copy_to(spine_bounding_box_attachment obj, spine_vertex_attachment other) {
|
||||
if (!obj) return ;
|
||||
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
|
||||
_obj->copyTo((VertexAttachment *) other);
|
||||
int spine_bounding_box_attachment_get_ref_count(spine_bounding_box_attachment self) {
|
||||
return ((VertexAttachment*)(BoundingBoxAttachment*)self)->getRefCount();
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_reference(spine_bounding_box_attachment self) {
|
||||
((VertexAttachment*)(BoundingBoxAttachment*)self)->reference();
|
||||
}
|
||||
|
||||
void spine_bounding_box_attachment_dereference(spine_bounding_box_attachment self) {
|
||||
((VertexAttachment*)(BoundingBoxAttachment*)self)->dereference();
|
||||
}
|
||||
|
||||
spine_rtti spine_bounding_box_attachment_rtti(void) {
|
||||
return (spine_rtti)&BoundingBoxAttachment::rtti;
|
||||
}
|
||||
|
||||
@ -1,63 +1,40 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_BOUNDING_BOX_ATTACHMENT_H
|
||||
#define SPINE_SPINE_BOUNDING_BOX_ATTACHMENT_H
|
||||
|
||||
#ifndef SPINE_C_BOUNDINGBOXATTACHMENT_H
|
||||
#define SPINE_C_BOUNDINGBOXATTACHMENT_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_bounding_box_attachment spine_bounding_box_attachment_create(const char* name);
|
||||
|
||||
SPINE_C_EXPORT spine_bounding_box_attachment spine_bounding_box_attachment_create(const char* name);
|
||||
SPINE_C_EXPORT void spine_bounding_box_attachment_dispose(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_bounding_box_attachment_get_rtti();
|
||||
SPINE_C_EXPORT spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT spine_attachment spine_bounding_box_attachment_copy(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT void spine_bounding_box_attachment_compute_world_vertices(spine_bounding_box_attachment obj, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride);
|
||||
SPINE_C_EXPORT void spine_bounding_box_attachment_compute_world_vertices_7(spine_bounding_box_attachment obj, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride);
|
||||
SPINE_C_EXPORT int spine_bounding_box_attachment_get_id(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT int32_t spine_bounding_box_attachment_get_num_bones(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT int *spine_bounding_box_attachment_get_bones(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT void spine_bounding_box_attachment_set_bones(spine_bounding_box_attachment obj, spine_array_int value);
|
||||
SPINE_C_EXPORT int32_t spine_bounding_box_attachment_get_num_vertices(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT float *spine_bounding_box_attachment_get_vertices(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT void spine_bounding_box_attachment_set_vertices(spine_bounding_box_attachment obj, spine_array_float value);
|
||||
SPINE_C_EXPORT size_t spine_bounding_box_attachment_get_world_vertices_length(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT void spine_bounding_box_attachment_set_world_vertices_length(spine_bounding_box_attachment obj, size_t value);
|
||||
SPINE_C_EXPORT spine_attachment spine_bounding_box_attachment_get_timeline_attachment(spine_bounding_box_attachment obj);
|
||||
SPINE_C_EXPORT void spine_bounding_box_attachment_set_timeline_attachment(spine_bounding_box_attachment obj, spine_attachment value);
|
||||
SPINE_C_EXPORT void spine_bounding_box_attachment_copy_to(spine_bounding_box_attachment obj, spine_vertex_attachment other);
|
||||
SPINE_C_API void spine_bounding_box_attachment_dispose(spine_bounding_box_attachment self);
|
||||
|
||||
SPINE_C_API spine_rtti spine_bounding_box_attachment_get_rtti(spine_bounding_box_attachment self);
|
||||
SPINE_C_API spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment self);
|
||||
SPINE_C_API spine_attachment spine_bounding_box_attachment_copy(spine_bounding_box_attachment self);
|
||||
SPINE_C_API void spine_bounding_box_attachment_compute_world_vertices_1(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride);
|
||||
SPINE_C_API void spine_bounding_box_attachment_compute_world_vertices_2(spine_bounding_box_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride);
|
||||
SPINE_C_API int spine_bounding_box_attachment_get_id(spine_bounding_box_attachment self);
|
||||
SPINE_C_API spine_array_int spine_bounding_box_attachment_get_bones(spine_bounding_box_attachment self);
|
||||
SPINE_C_API void spine_bounding_box_attachment_set_bones(spine_bounding_box_attachment self, spine_array_int bones);
|
||||
SPINE_C_API spine_array_float spine_bounding_box_attachment_get_vertices(spine_bounding_box_attachment self);
|
||||
SPINE_C_API void spine_bounding_box_attachment_set_vertices(spine_bounding_box_attachment self, spine_array_float vertices);
|
||||
SPINE_C_API size_t spine_bounding_box_attachment_get_world_vertices_length(spine_bounding_box_attachment self);
|
||||
SPINE_C_API void spine_bounding_box_attachment_set_world_vertices_length(spine_bounding_box_attachment self, size_t inValue);
|
||||
SPINE_C_API spine_attachment spine_bounding_box_attachment_get_timeline_attachment(spine_bounding_box_attachment self);
|
||||
SPINE_C_API void spine_bounding_box_attachment_set_timeline_attachment(spine_bounding_box_attachment self, spine_attachment attachment);
|
||||
SPINE_C_API void spine_bounding_box_attachment_copy_to(spine_bounding_box_attachment self, spine_vertex_attachment other);
|
||||
SPINE_C_API const char* spine_bounding_box_attachment_get_name(spine_bounding_box_attachment self);
|
||||
SPINE_C_API int spine_bounding_box_attachment_get_ref_count(spine_bounding_box_attachment self);
|
||||
SPINE_C_API void spine_bounding_box_attachment_reference(spine_bounding_box_attachment self);
|
||||
SPINE_C_API void spine_bounding_box_attachment_dereference(spine_bounding_box_attachment self);
|
||||
SPINE_C_API spine_rtti spine_bounding_box_attachment_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_BOUNDINGBOXATTACHMENT_H
|
||||
#endif /* SPINE_SPINE_BOUNDING_BOX_ATTACHMENT_H */
|
||||
@ -1,155 +1,100 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "clipping_attachment.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_clipping_attachment spine_clipping_attachment_create(const char* name) {
|
||||
ClippingAttachment *obj = new (__FILE__, __LINE__) ClippingAttachment(String(name));
|
||||
return (spine_clipping_attachment) obj;
|
||||
return (spine_clipping_attachment) new (__FILE__, __LINE__) ClippingAttachment(*((const String*)name));
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_dispose(spine_clipping_attachment obj) {
|
||||
if (!obj) return;
|
||||
delete (ClippingAttachment *) obj;
|
||||
void spine_clipping_attachment_dispose(spine_clipping_attachment self) {
|
||||
delete (ClippingAttachment*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_clipping_attachment_get_rtti() {
|
||||
return (spine_rtti) &ClippingAttachment::rtti;
|
||||
spine_rtti spine_clipping_attachment_get_rtti(spine_clipping_attachment self) {
|
||||
return (spine_rtti)&((ClippingAttachment*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_slot_data spine_clipping_attachment_get_end_slot(spine_clipping_attachment obj) {
|
||||
if (!obj) return (spine_slot_data) 0;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return (spine_slot_data) _obj->getEndSlot();
|
||||
spine_slot_data spine_clipping_attachment_get_end_slot(spine_clipping_attachment self) {
|
||||
return (spine_slot_data)((ClippingAttachment*)self)->getEndSlot();
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_set_end_slot(spine_clipping_attachment obj, spine_slot_data value) {
|
||||
if (!obj) return;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
_obj->setEndSlot((SlotData *) value);
|
||||
void spine_clipping_attachment_set_end_slot(spine_clipping_attachment self, spine_slot_data inValue) {
|
||||
((ClippingAttachment*)self)->setEndSlot((SlotData *)inValue);
|
||||
}
|
||||
|
||||
spine_color spine_clipping_attachment_get_color(spine_clipping_attachment obj) {
|
||||
if (!obj) return (spine_color) 0;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return (spine_color) &_obj->getColor();
|
||||
spine_color spine_clipping_attachment_get_color(spine_clipping_attachment self) {
|
||||
return (spine_color)&((ClippingAttachment*)self)->getColor();
|
||||
}
|
||||
|
||||
spine_attachment spine_clipping_attachment_copy(spine_clipping_attachment obj) {
|
||||
if (!obj) return (spine_attachment) 0;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return (spine_attachment) _obj->copy();
|
||||
spine_attachment spine_clipping_attachment_copy(spine_clipping_attachment self) {
|
||||
return (spine_attachment)((ClippingAttachment*)self)->copy();
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_compute_world_vertices(spine_clipping_attachment obj, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride) {
|
||||
if (!obj) return ;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
_obj->computeWorldVertices(*(Skeleton*) skeleton, *(Slot*) slot, start, count, (float *) worldVertices, offset, stride);
|
||||
void spine_clipping_attachment_compute_world_vertices_1(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride) {
|
||||
((VertexAttachment*)(ClippingAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, worldVertices, offset, stride);
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_compute_world_vertices_7(spine_clipping_attachment obj, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride) {
|
||||
if (!obj) return ;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
_obj->computeWorldVertices(*(Skeleton*) skeleton, *(Slot*) slot, start, count, (Array<float> &) worldVertices, offset, stride);
|
||||
void spine_clipping_attachment_compute_world_vertices_2(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride) {
|
||||
((VertexAttachment*)(ClippingAttachment*)self)->computeWorldVertices(*((Skeleton*)skeleton), *((Slot*)slot), start, count, *((Array<float>*)worldVertices), offset, stride);
|
||||
}
|
||||
|
||||
int spine_clipping_attachment_get_id(spine_clipping_attachment obj) {
|
||||
if (!obj) return 0;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return _obj->getId();
|
||||
int spine_clipping_attachment_get_id(spine_clipping_attachment self) {
|
||||
return ((VertexAttachment*)(ClippingAttachment*)self)->getId();
|
||||
}
|
||||
|
||||
int32_t spine_clipping_attachment_get_num_bones(spine_clipping_attachment obj) {
|
||||
if (!obj) return 0;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return (int32_t) _obj->getBones().size();
|
||||
spine_array_int spine_clipping_attachment_get_bones(spine_clipping_attachment self) {
|
||||
return (spine_array_int)&((VertexAttachment*)(ClippingAttachment*)self)->getBones();
|
||||
}
|
||||
|
||||
int *spine_clipping_attachment_get_bones(spine_clipping_attachment obj) {
|
||||
if (!obj) return nullptr;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return (int *) _obj->getBones().buffer();
|
||||
void spine_clipping_attachment_set_bones(spine_clipping_attachment self, spine_array_int bones) {
|
||||
((VertexAttachment*)(ClippingAttachment*)self)->setBones(*((Array<int>*)bones));
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_set_bones(spine_clipping_attachment obj, spine_array_int value) {
|
||||
if (!obj) return;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
_obj->setBones((Array<int> &) value);
|
||||
spine_array_float spine_clipping_attachment_get_vertices(spine_clipping_attachment self) {
|
||||
return (spine_array_float)&((VertexAttachment*)(ClippingAttachment*)self)->getVertices();
|
||||
}
|
||||
|
||||
int32_t spine_clipping_attachment_get_num_vertices(spine_clipping_attachment obj) {
|
||||
if (!obj) return 0;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return (int32_t) _obj->getVertices().size();
|
||||
void spine_clipping_attachment_set_vertices(spine_clipping_attachment self, spine_array_float vertices) {
|
||||
((VertexAttachment*)(ClippingAttachment*)self)->setVertices(*((Array<float>*)vertices));
|
||||
}
|
||||
|
||||
float *spine_clipping_attachment_get_vertices(spine_clipping_attachment obj) {
|
||||
if (!obj) return nullptr;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return (float *) _obj->getVertices().buffer();
|
||||
size_t spine_clipping_attachment_get_world_vertices_length(spine_clipping_attachment self) {
|
||||
return ((VertexAttachment*)(ClippingAttachment*)self)->getWorldVerticesLength();
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_set_vertices(spine_clipping_attachment obj, spine_array_float value) {
|
||||
if (!obj) return;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
_obj->setVertices((Array<float> &) value);
|
||||
void spine_clipping_attachment_set_world_vertices_length(spine_clipping_attachment self, size_t inValue) {
|
||||
((VertexAttachment*)(ClippingAttachment*)self)->setWorldVerticesLength(inValue);
|
||||
}
|
||||
|
||||
size_t spine_clipping_attachment_get_world_vertices_length(spine_clipping_attachment obj) {
|
||||
if (!obj) return 0;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return _obj->getWorldVerticesLength();
|
||||
spine_attachment spine_clipping_attachment_get_timeline_attachment(spine_clipping_attachment self) {
|
||||
return (spine_attachment)((VertexAttachment*)(ClippingAttachment*)self)->getTimelineAttachment();
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_set_world_vertices_length(spine_clipping_attachment obj, size_t value) {
|
||||
if (!obj) return;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
_obj->setWorldVerticesLength(value);
|
||||
void spine_clipping_attachment_set_timeline_attachment(spine_clipping_attachment self, spine_attachment attachment) {
|
||||
((VertexAttachment*)(ClippingAttachment*)self)->setTimelineAttachment((Attachment *)attachment);
|
||||
}
|
||||
|
||||
spine_attachment spine_clipping_attachment_get_timeline_attachment(spine_clipping_attachment obj) {
|
||||
if (!obj) return (spine_attachment) 0;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
return (spine_attachment) _obj->getTimelineAttachment();
|
||||
void spine_clipping_attachment_copy_to(spine_clipping_attachment self, spine_vertex_attachment other) {
|
||||
((VertexAttachment*)(ClippingAttachment*)self)->copyTo((VertexAttachment *)other);
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_set_timeline_attachment(spine_clipping_attachment obj, spine_attachment value) {
|
||||
if (!obj) return;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
_obj->setTimelineAttachment((Attachment *) value);
|
||||
const char* spine_clipping_attachment_get_name(spine_clipping_attachment self) {
|
||||
return (const char*)&((VertexAttachment*)(ClippingAttachment*)self)->getName();
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_copy_to(spine_clipping_attachment obj, spine_vertex_attachment other) {
|
||||
if (!obj) return ;
|
||||
ClippingAttachment *_obj = (ClippingAttachment *) obj;
|
||||
_obj->copyTo((VertexAttachment *) other);
|
||||
int spine_clipping_attachment_get_ref_count(spine_clipping_attachment self) {
|
||||
return ((VertexAttachment*)(ClippingAttachment*)self)->getRefCount();
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_reference(spine_clipping_attachment self) {
|
||||
((VertexAttachment*)(ClippingAttachment*)self)->reference();
|
||||
}
|
||||
|
||||
void spine_clipping_attachment_dereference(spine_clipping_attachment self) {
|
||||
((VertexAttachment*)(ClippingAttachment*)self)->dereference();
|
||||
}
|
||||
|
||||
spine_rtti spine_clipping_attachment_rtti(void) {
|
||||
return (spine_rtti)&ClippingAttachment::rtti;
|
||||
}
|
||||
|
||||
@ -1,65 +1,42 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_CLIPPING_ATTACHMENT_H
|
||||
#define SPINE_SPINE_CLIPPING_ATTACHMENT_H
|
||||
|
||||
#ifndef SPINE_C_CLIPPINGATTACHMENT_H
|
||||
#define SPINE_C_CLIPPINGATTACHMENT_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_clipping_attachment spine_clipping_attachment_create(const char* name);
|
||||
|
||||
SPINE_C_EXPORT spine_clipping_attachment spine_clipping_attachment_create(const char* name);
|
||||
SPINE_C_EXPORT void spine_clipping_attachment_dispose(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_clipping_attachment_get_rtti();
|
||||
SPINE_C_EXPORT spine_slot_data spine_clipping_attachment_get_end_slot(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT void spine_clipping_attachment_set_end_slot(spine_clipping_attachment obj, spine_slot_data value);
|
||||
SPINE_C_EXPORT spine_color spine_clipping_attachment_get_color(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT spine_attachment spine_clipping_attachment_copy(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT void spine_clipping_attachment_compute_world_vertices(spine_clipping_attachment obj, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride);
|
||||
SPINE_C_EXPORT void spine_clipping_attachment_compute_world_vertices_7(spine_clipping_attachment obj, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride);
|
||||
SPINE_C_EXPORT int spine_clipping_attachment_get_id(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT int32_t spine_clipping_attachment_get_num_bones(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT int *spine_clipping_attachment_get_bones(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT void spine_clipping_attachment_set_bones(spine_clipping_attachment obj, spine_array_int value);
|
||||
SPINE_C_EXPORT int32_t spine_clipping_attachment_get_num_vertices(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT float *spine_clipping_attachment_get_vertices(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT void spine_clipping_attachment_set_vertices(spine_clipping_attachment obj, spine_array_float value);
|
||||
SPINE_C_EXPORT size_t spine_clipping_attachment_get_world_vertices_length(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT void spine_clipping_attachment_set_world_vertices_length(spine_clipping_attachment obj, size_t value);
|
||||
SPINE_C_EXPORT spine_attachment spine_clipping_attachment_get_timeline_attachment(spine_clipping_attachment obj);
|
||||
SPINE_C_EXPORT void spine_clipping_attachment_set_timeline_attachment(spine_clipping_attachment obj, spine_attachment value);
|
||||
SPINE_C_EXPORT void spine_clipping_attachment_copy_to(spine_clipping_attachment obj, spine_vertex_attachment other);
|
||||
SPINE_C_API void spine_clipping_attachment_dispose(spine_clipping_attachment self);
|
||||
|
||||
SPINE_C_API spine_rtti spine_clipping_attachment_get_rtti(spine_clipping_attachment self);
|
||||
SPINE_C_API spine_slot_data spine_clipping_attachment_get_end_slot(spine_clipping_attachment self);
|
||||
SPINE_C_API void spine_clipping_attachment_set_end_slot(spine_clipping_attachment self, spine_slot_data inValue);
|
||||
SPINE_C_API spine_color spine_clipping_attachment_get_color(spine_clipping_attachment self);
|
||||
SPINE_C_API spine_attachment spine_clipping_attachment_copy(spine_clipping_attachment self);
|
||||
SPINE_C_API void spine_clipping_attachment_compute_world_vertices_1(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, float * worldVertices, size_t offset, size_t stride);
|
||||
SPINE_C_API void spine_clipping_attachment_compute_world_vertices_2(spine_clipping_attachment self, spine_skeleton skeleton, spine_slot slot, size_t start, size_t count, spine_array_float worldVertices, size_t offset, size_t stride);
|
||||
SPINE_C_API int spine_clipping_attachment_get_id(spine_clipping_attachment self);
|
||||
SPINE_C_API spine_array_int spine_clipping_attachment_get_bones(spine_clipping_attachment self);
|
||||
SPINE_C_API void spine_clipping_attachment_set_bones(spine_clipping_attachment self, spine_array_int bones);
|
||||
SPINE_C_API spine_array_float spine_clipping_attachment_get_vertices(spine_clipping_attachment self);
|
||||
SPINE_C_API void spine_clipping_attachment_set_vertices(spine_clipping_attachment self, spine_array_float vertices);
|
||||
SPINE_C_API size_t spine_clipping_attachment_get_world_vertices_length(spine_clipping_attachment self);
|
||||
SPINE_C_API void spine_clipping_attachment_set_world_vertices_length(spine_clipping_attachment self, size_t inValue);
|
||||
SPINE_C_API spine_attachment spine_clipping_attachment_get_timeline_attachment(spine_clipping_attachment self);
|
||||
SPINE_C_API void spine_clipping_attachment_set_timeline_attachment(spine_clipping_attachment self, spine_attachment attachment);
|
||||
SPINE_C_API void spine_clipping_attachment_copy_to(spine_clipping_attachment self, spine_vertex_attachment other);
|
||||
SPINE_C_API const char* spine_clipping_attachment_get_name(spine_clipping_attachment self);
|
||||
SPINE_C_API int spine_clipping_attachment_get_ref_count(spine_clipping_attachment self);
|
||||
SPINE_C_API void spine_clipping_attachment_reference(spine_clipping_attachment self);
|
||||
SPINE_C_API void spine_clipping_attachment_dereference(spine_clipping_attachment self);
|
||||
SPINE_C_API spine_rtti spine_clipping_attachment_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_CLIPPINGATTACHMENT_H
|
||||
#endif /* SPINE_SPINE_CLIPPING_ATTACHMENT_H */
|
||||
@ -1,90 +1,88 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "color.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_color spine_color_create(void) {
|
||||
Color *obj = new (__FILE__, __LINE__) Color();
|
||||
return (spine_color) obj;
|
||||
return (spine_color) new (__FILE__, __LINE__) Color();
|
||||
}
|
||||
|
||||
spine_color spine_color_create_with_float_float_float_float(float r, float g, float b, float a) {
|
||||
Color *obj = new (__FILE__, __LINE__) Color(r, g, b, a);
|
||||
return (spine_color) obj;
|
||||
spine_color spine_color_create2(float r, float g, float b, float a) {
|
||||
return (spine_color) new (__FILE__, __LINE__) Color(r, g, b, a);
|
||||
}
|
||||
|
||||
void spine_color_dispose(spine_color obj) {
|
||||
if (!obj) return;
|
||||
delete (Color *) obj;
|
||||
void spine_color_dispose(spine_color self) {
|
||||
delete (Color*)self;
|
||||
}
|
||||
|
||||
spine_color spine_color_set(spine_color obj, float _r, float _g, float _b, float _a) {
|
||||
if (!obj) return (spine_color) 0;
|
||||
Color *_obj = (Color *) obj;
|
||||
return (spine_color) &_obj->set(_r, _g, _b, _a);
|
||||
spine_color spine_color_set_1(spine_color self, float _r, float _g, float _b, float _a) {
|
||||
return (spine_color)&((Color*)self)->set(_r, _g, _b, _a);
|
||||
}
|
||||
|
||||
spine_color spine_color_set_3(spine_color obj, float _r, float _g, float _b) {
|
||||
if (!obj) return (spine_color) 0;
|
||||
Color *_obj = (Color *) obj;
|
||||
return (spine_color) &_obj->set(_r, _g, _b);
|
||||
spine_color spine_color_set_2(spine_color self, float _r, float _g, float _b) {
|
||||
return (spine_color)&((Color*)self)->set(_r, _g, _b);
|
||||
}
|
||||
|
||||
void spine_color_set(spine_color obj, spine_color value) {
|
||||
if (!obj) return;
|
||||
Color *_obj = (Color *) obj;
|
||||
_obj->set(value);
|
||||
spine_color spine_color_set_3(spine_color self, spine_color other) {
|
||||
return (spine_color)&((Color*)self)->set(*((const Color*)other));
|
||||
}
|
||||
|
||||
spine_color spine_color_add(spine_color obj, float _r, float _g, float _b, float _a) {
|
||||
if (!obj) return (spine_color) 0;
|
||||
Color *_obj = (Color *) obj;
|
||||
return (spine_color) &_obj->add(_r, _g, _b, _a);
|
||||
spine_color spine_color_add_1(spine_color self, float _r, float _g, float _b, float _a) {
|
||||
return (spine_color)&((Color*)self)->add(_r, _g, _b, _a);
|
||||
}
|
||||
|
||||
spine_color spine_color_add_3(spine_color obj, float _r, float _g, float _b) {
|
||||
if (!obj) return (spine_color) 0;
|
||||
Color *_obj = (Color *) obj;
|
||||
return (spine_color) &_obj->add(_r, _g, _b);
|
||||
spine_color spine_color_add_2(spine_color self, float _r, float _g, float _b) {
|
||||
return (spine_color)&((Color*)self)->add(_r, _g, _b);
|
||||
}
|
||||
|
||||
spine_color spine_color_add_1(spine_color obj, spine_color other) {
|
||||
if (!obj) return (spine_color) 0;
|
||||
Color *_obj = (Color *) obj;
|
||||
return (spine_color) &_obj->add(*(Color*) other);
|
||||
spine_color spine_color_add_3(spine_color self, spine_color other) {
|
||||
return (spine_color)&((Color*)self)->add(*((const Color*)other));
|
||||
}
|
||||
|
||||
spine_color spine_color_clamp(spine_color obj) {
|
||||
if (!obj) return (spine_color) 0;
|
||||
Color *_obj = (Color *) obj;
|
||||
return (spine_color) &_obj->clamp();
|
||||
spine_color spine_color_clamp(spine_color self) {
|
||||
return (spine_color)&((Color*)self)->clamp();
|
||||
}
|
||||
|
||||
float spine_color_parse_hex(const char * value, size_t index) {
|
||||
return Color::parseHex(value, index);
|
||||
}
|
||||
|
||||
void spine_color_rgba8888_to_color(spine_color color, int value) {
|
||||
Color::rgba8888ToColor(*((Color*)color), value);
|
||||
}
|
||||
|
||||
void spine_color_rgb888_to_color(spine_color color, int value) {
|
||||
Color::rgb888ToColor(*((Color*)color), value);
|
||||
}
|
||||
|
||||
float spine_color_get_r(spine_color self) {
|
||||
return ((Color*)self)->r;
|
||||
}
|
||||
|
||||
void spine_color_set_r(spine_color self, float value) {
|
||||
((Color*)self)->r = value;
|
||||
}
|
||||
|
||||
float spine_color_get_g(spine_color self) {
|
||||
return ((Color*)self)->g;
|
||||
}
|
||||
|
||||
void spine_color_set_g(spine_color self, float value) {
|
||||
((Color*)self)->g = value;
|
||||
}
|
||||
|
||||
float spine_color_get_b(spine_color self) {
|
||||
return ((Color*)self)->b;
|
||||
}
|
||||
|
||||
void spine_color_set_b(spine_color self, float value) {
|
||||
((Color*)self)->b = value;
|
||||
}
|
||||
|
||||
float spine_color_get_a(spine_color self) {
|
||||
return ((Color*)self)->a;
|
||||
}
|
||||
|
||||
void spine_color_set_a(spine_color self, float value) {
|
||||
((Color*)self)->a = value;
|
||||
}
|
||||
|
||||
@ -1,54 +1,39 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_COLOR_H
|
||||
#define SPINE_SPINE_COLOR_H
|
||||
|
||||
#ifndef SPINE_C_COLOR_H
|
||||
#define SPINE_C_COLOR_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_color spine_color_create(void);
|
||||
SPINE_C_API spine_color spine_color_create2(float r, float g, float b, float a);
|
||||
|
||||
SPINE_C_EXPORT spine_color spine_color_create(void);
|
||||
SPINE_C_EXPORT spine_color spine_color_create_with_float_float_float_float(float r, float g, float b, float a);
|
||||
SPINE_C_EXPORT void spine_color_dispose(spine_color obj);
|
||||
SPINE_C_EXPORT spine_color spine_color_set(spine_color obj, float _r, float _g, float _b, float _a);
|
||||
SPINE_C_EXPORT spine_color spine_color_set_3(spine_color obj, float _r, float _g, float _b);
|
||||
SPINE_C_EXPORT void spine_color_set(spine_color obj, spine_color value);
|
||||
SPINE_C_EXPORT spine_color spine_color_add(spine_color obj, float _r, float _g, float _b, float _a);
|
||||
SPINE_C_EXPORT spine_color spine_color_add_3(spine_color obj, float _r, float _g, float _b);
|
||||
SPINE_C_EXPORT spine_color spine_color_add_1(spine_color obj, spine_color other);
|
||||
SPINE_C_EXPORT spine_color spine_color_clamp(spine_color obj);
|
||||
SPINE_C_API void spine_color_dispose(spine_color self);
|
||||
|
||||
SPINE_C_API spine_color spine_color_set_1(spine_color self, float _r, float _g, float _b, float _a);
|
||||
SPINE_C_API spine_color spine_color_set_2(spine_color self, float _r, float _g, float _b);
|
||||
SPINE_C_API spine_color spine_color_set_3(spine_color self, spine_color other);
|
||||
SPINE_C_API spine_color spine_color_add_1(spine_color self, float _r, float _g, float _b, float _a);
|
||||
SPINE_C_API spine_color spine_color_add_2(spine_color self, float _r, float _g, float _b);
|
||||
SPINE_C_API spine_color spine_color_add_3(spine_color self, spine_color other);
|
||||
SPINE_C_API spine_color spine_color_clamp(spine_color self);
|
||||
SPINE_C_API float spine_color_parse_hex(const char * value, size_t index);
|
||||
SPINE_C_API void spine_color_rgba8888_to_color(spine_color color, int value);
|
||||
SPINE_C_API void spine_color_rgb888_to_color(spine_color color, int value);
|
||||
SPINE_C_API float spine_color_get_r(spine_color self);
|
||||
SPINE_C_API void spine_color_set_r(spine_color self, float value);
|
||||
SPINE_C_API float spine_color_get_g(spine_color self);
|
||||
SPINE_C_API void spine_color_set_g(spine_color self, float value);
|
||||
SPINE_C_API float spine_color_get_b(spine_color self);
|
||||
SPINE_C_API void spine_color_set_b(spine_color self, float value);
|
||||
SPINE_C_API float spine_color_get_a(spine_color self);
|
||||
SPINE_C_API void spine_color_set_a(spine_color self, float value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_COLOR_H
|
||||
#endif /* SPINE_SPINE_COLOR_H */
|
||||
@ -1,78 +1,32 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "constraint.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_constraint_dispose(spine_constraint obj) {
|
||||
if (!obj) return;
|
||||
delete (Constraint *) obj;
|
||||
void spine_constraint_dispose(spine_constraint self) {
|
||||
delete (Constraint*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_constraint_get_rtti() {
|
||||
return (spine_rtti) &Constraint::rtti;
|
||||
spine_rtti spine_constraint_get_rtti(spine_constraint self) {
|
||||
return (spine_rtti)&((Constraint*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_constraint_data spine_constraint_get_data(spine_constraint obj) {
|
||||
if (!obj) return 0;
|
||||
Constraint *_obj = (Constraint *) obj;
|
||||
return (spine_constraint_data) &_obj->getData();
|
||||
spine_constraint_data spine_constraint_get_data(spine_constraint self) {
|
||||
return (spine_constraint_data)&((Constraint*)self)->getData();
|
||||
}
|
||||
|
||||
void spine_constraint_sort(spine_constraint obj, spine_skeleton skeleton) {
|
||||
if (!obj) return ;
|
||||
Constraint *_obj = (Constraint *) obj;
|
||||
_obj->sort(*(Skeleton*) skeleton);
|
||||
void spine_constraint_sort(spine_constraint self, spine_skeleton skeleton) {
|
||||
((Constraint*)self)->sort(*((Skeleton*)skeleton));
|
||||
}
|
||||
|
||||
bool spine_constraint_is_source_active(spine_constraint obj) {
|
||||
if (!obj) return false;
|
||||
Constraint *_obj = (Constraint *) obj;
|
||||
return _obj->isSourceActive();
|
||||
bool spine_constraint_is_source_active(spine_constraint self) {
|
||||
return ((Constraint*)self)->isSourceActive();
|
||||
}
|
||||
|
||||
void spine_constraint_pose(spine_constraint obj) {
|
||||
if (!obj) return ;
|
||||
Constraint *_obj = (Constraint *) obj;
|
||||
_obj->pose();
|
||||
void spine_constraint_update(spine_constraint self, spine_skeleton skeleton, spine_physics physics) {
|
||||
((Constraint*)self)->update(*((Skeleton*)skeleton), (Physics)physics);
|
||||
}
|
||||
|
||||
void spine_constraint_setup_pose(spine_constraint obj) {
|
||||
if (!obj) return ;
|
||||
Constraint *_obj = (Constraint *) obj;
|
||||
_obj->setupPose();
|
||||
}
|
||||
|
||||
void spine_constraint_update(spine_constraint obj, spine_skeleton skeleton, spine_physics physics) {
|
||||
if (!obj) return ;
|
||||
Constraint *_obj = (Constraint *) obj;
|
||||
_obj->update(*(Skeleton*) skeleton, (Physics) physics);
|
||||
spine_rtti spine_constraint_rtti(void) {
|
||||
return (spine_rtti)&Constraint::rtti;
|
||||
}
|
||||
|
||||
@ -1,52 +1,24 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_CONSTRAINT_H
|
||||
#define SPINE_SPINE_CONSTRAINT_H
|
||||
|
||||
#ifndef SPINE_C_CONSTRAINT_H
|
||||
#define SPINE_C_CONSTRAINT_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_constraint_dispose(spine_constraint self);
|
||||
|
||||
SPINE_C_EXPORT void spine_constraint_dispose(spine_constraint obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_constraint_get_rtti();
|
||||
SPINE_C_EXPORT spine_constraint_data spine_constraint_get_data(spine_constraint obj);
|
||||
SPINE_C_EXPORT void spine_constraint_sort(spine_constraint obj, spine_skeleton skeleton);
|
||||
SPINE_C_EXPORT bool spine_constraint_is_source_active(spine_constraint obj);
|
||||
SPINE_C_EXPORT void spine_constraint_pose(spine_constraint obj);
|
||||
SPINE_C_EXPORT void spine_constraint_setup_pose(spine_constraint obj);
|
||||
SPINE_C_EXPORT void spine_constraint_update(spine_constraint obj, spine_skeleton skeleton, spine_physics physics);
|
||||
SPINE_C_API spine_rtti spine_constraint_get_rtti(spine_constraint self);
|
||||
SPINE_C_API spine_constraint_data spine_constraint_get_data(spine_constraint self);
|
||||
SPINE_C_API void spine_constraint_sort(spine_constraint self, spine_skeleton skeleton);
|
||||
SPINE_C_API bool spine_constraint_is_source_active(spine_constraint self);
|
||||
SPINE_C_API void spine_constraint_update(spine_constraint self, spine_skeleton skeleton, spine_physics physics);
|
||||
SPINE_C_API spine_rtti spine_constraint_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_CONSTRAINT_H
|
||||
#endif /* SPINE_SPINE_CONSTRAINT_H */
|
||||
@ -1,60 +1,28 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "constraint_data.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_constraint_data_dispose(spine_constraint_data obj) {
|
||||
if (!obj) return;
|
||||
delete (ConstraintData *) obj;
|
||||
void spine_constraint_data_dispose(spine_constraint_data self) {
|
||||
delete (ConstraintData*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_constraint_data_get_rtti() {
|
||||
return (spine_rtti) &ConstraintData::rtti;
|
||||
spine_rtti spine_constraint_data_get_rtti(spine_constraint_data self) {
|
||||
return (spine_rtti)&((ConstraintData*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_constraint spine_constraint_data_create(spine_constraint_data obj, spine_skeleton skeleton) {
|
||||
if (!obj) return 0;
|
||||
ConstraintData *_obj = (ConstraintData *) obj;
|
||||
return (spine_constraint) _obj->create(*(Skeleton*) skeleton);
|
||||
spine_constraint spine_constraint_data_create_method(spine_constraint_data self, spine_skeleton skeleton) {
|
||||
return (spine_constraint)((ConstraintData*)self)->create(*((Skeleton*)skeleton));
|
||||
}
|
||||
|
||||
const char* spine_constraint_data_get_name(spine_constraint_data obj) {
|
||||
if (!obj) return nullptr;
|
||||
ConstraintData *_obj = (ConstraintData *) obj;
|
||||
return (const char *) _obj->getName().buffer();
|
||||
const char* spine_constraint_data_get_name(spine_constraint_data self) {
|
||||
return (const char*)&((ConstraintData*)self)->getName();
|
||||
}
|
||||
|
||||
bool spine_constraint_data_is_skin_required(spine_constraint_data obj) {
|
||||
if (!obj) return false;
|
||||
ConstraintData *_obj = (ConstraintData *) obj;
|
||||
return _obj->isSkinRequired();
|
||||
bool spine_constraint_data_is_skin_required(spine_constraint_data self) {
|
||||
return ((ConstraintData*)self)->isSkinRequired();
|
||||
}
|
||||
|
||||
spine_rtti spine_constraint_data_rtti(void) {
|
||||
return (spine_rtti)&ConstraintData::rtti;
|
||||
}
|
||||
|
||||
@ -1,49 +1,23 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_CONSTRAINT_DATA_H
|
||||
#define SPINE_SPINE_CONSTRAINT_DATA_H
|
||||
|
||||
#ifndef SPINE_C_CONSTRAINTDATA_H
|
||||
#define SPINE_C_CONSTRAINTDATA_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_constraint_data_dispose(spine_constraint_data self);
|
||||
|
||||
SPINE_C_EXPORT void spine_constraint_data_dispose(spine_constraint_data obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_constraint_data_get_rtti();
|
||||
SPINE_C_EXPORT spine_constraint spine_constraint_data_create(spine_constraint_data obj, spine_skeleton skeleton);
|
||||
SPINE_C_EXPORT const char* spine_constraint_data_get_name(spine_constraint_data obj);
|
||||
SPINE_C_EXPORT bool spine_constraint_data_is_skin_required(spine_constraint_data obj);
|
||||
SPINE_C_API spine_rtti spine_constraint_data_get_rtti(spine_constraint_data self);
|
||||
SPINE_C_API spine_constraint spine_constraint_data_create_method(spine_constraint_data self, spine_skeleton skeleton);
|
||||
SPINE_C_API const char* spine_constraint_data_get_name(spine_constraint_data self);
|
||||
SPINE_C_API bool spine_constraint_data_is_skin_required(spine_constraint_data self);
|
||||
SPINE_C_API spine_rtti spine_constraint_data_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_CONSTRAINTDATA_H
|
||||
#endif /* SPINE_SPINE_CONSTRAINT_DATA_H */
|
||||
@ -1,59 +1,24 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "constraint_timeline.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_constraint_timeline spine_constraint_timeline_create(int constraintIndex) {
|
||||
ConstraintTimeline *obj = new (__FILE__, __LINE__) ConstraintTimeline(constraintIndex);
|
||||
return (spine_constraint_timeline) obj;
|
||||
void spine_constraint_timeline_dispose(spine_constraint_timeline self) {
|
||||
delete (ConstraintTimeline*)self;
|
||||
}
|
||||
|
||||
void spine_constraint_timeline_dispose(spine_constraint_timeline obj) {
|
||||
if (!obj) return;
|
||||
delete (ConstraintTimeline *) obj;
|
||||
spine_rtti spine_constraint_timeline_get_rtti(spine_constraint_timeline self) {
|
||||
return (spine_rtti)&((ConstraintTimeline*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_rtti spine_constraint_timeline_get_rtti() {
|
||||
return (spine_rtti) &ConstraintTimeline::rtti;
|
||||
int spine_constraint_timeline_get_constraint_index(spine_constraint_timeline self) {
|
||||
return ((ConstraintTimeline*)self)->getConstraintIndex();
|
||||
}
|
||||
|
||||
int spine_constraint_timeline_get_constraint_index(spine_constraint_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
ConstraintTimeline *_obj = (ConstraintTimeline *) obj;
|
||||
return _obj->getConstraintIndex();
|
||||
void spine_constraint_timeline_set_constraint_index(spine_constraint_timeline self, int inValue) {
|
||||
((ConstraintTimeline*)self)->setConstraintIndex(inValue);
|
||||
}
|
||||
|
||||
void spine_constraint_timeline_set_constraint_index(spine_constraint_timeline obj, int value) {
|
||||
if (!obj) return;
|
||||
ConstraintTimeline *_obj = (ConstraintTimeline *) obj;
|
||||
_obj->setConstraintIndex(value);
|
||||
spine_rtti spine_constraint_timeline_rtti(void) {
|
||||
return (spine_rtti)&ConstraintTimeline::rtti;
|
||||
}
|
||||
|
||||
@ -1,49 +1,22 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_CONSTRAINT_TIMELINE_H
|
||||
#define SPINE_SPINE_CONSTRAINT_TIMELINE_H
|
||||
|
||||
#ifndef SPINE_C_CONSTRAINTTIMELINE_H
|
||||
#define SPINE_C_CONSTRAINTTIMELINE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_constraint_timeline_dispose(spine_constraint_timeline self);
|
||||
|
||||
SPINE_C_EXPORT spine_constraint_timeline spine_constraint_timeline_create(int constraintIndex);
|
||||
SPINE_C_EXPORT void spine_constraint_timeline_dispose(spine_constraint_timeline obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_constraint_timeline_get_rtti();
|
||||
SPINE_C_EXPORT int spine_constraint_timeline_get_constraint_index(spine_constraint_timeline obj);
|
||||
SPINE_C_EXPORT void spine_constraint_timeline_set_constraint_index(spine_constraint_timeline obj, int value);
|
||||
SPINE_C_API spine_rtti spine_constraint_timeline_get_rtti(spine_constraint_timeline self);
|
||||
SPINE_C_API int spine_constraint_timeline_get_constraint_index(spine_constraint_timeline self);
|
||||
SPINE_C_API void spine_constraint_timeline_set_constraint_index(spine_constraint_timeline self, int inValue);
|
||||
SPINE_C_API spine_rtti spine_constraint_timeline_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_CONSTRAINTTIMELINE_H
|
||||
#endif /* SPINE_SPINE_CONSTRAINT_TIMELINE_H */
|
||||
@ -1,95 +1,92 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "constraint_timeline1.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_constraint_timeline1 spine_constraint_timeline1_create(size_t frameCount, size_t bezierCount, int constraintIndex, spine_property property) {
|
||||
ConstraintTimeline1 *obj = new (__FILE__, __LINE__) ConstraintTimeline1(frameCount, bezierCount, constraintIndex, property);
|
||||
return (spine_constraint_timeline1) obj;
|
||||
void spine_constraint_timeline1_dispose(spine_constraint_timeline1 self) {
|
||||
delete (ConstraintTimeline1*)self;
|
||||
}
|
||||
|
||||
void spine_constraint_timeline1_dispose(spine_constraint_timeline1 obj) {
|
||||
if (!obj) return;
|
||||
delete (ConstraintTimeline1 *) obj;
|
||||
spine_rtti spine_constraint_timeline1_get_rtti(spine_constraint_timeline1 self) {
|
||||
return (spine_rtti)&((ConstraintTimeline1*)self)->getRTTI();
|
||||
}
|
||||
|
||||
spine_rtti spine_constraint_timeline1_get_rtti() {
|
||||
return (spine_rtti) &ConstraintTimeline1::rtti;
|
||||
void spine_constraint_timeline1_set_frame(spine_constraint_timeline1 self, size_t frame, float time, float value) {
|
||||
((CurveTimeline1*)(ConstraintTimeline1*)self)->setFrame(frame, time, value);
|
||||
}
|
||||
|
||||
void spine_constraint_timeline1_set_frame(spine_constraint_timeline1 obj, size_t frame, float time, float value) {
|
||||
if (!obj) return ;
|
||||
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
|
||||
_obj->setFrame(frame, time, value);
|
||||
float spine_constraint_timeline1_get_curve_value(spine_constraint_timeline1 self, float time) {
|
||||
return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getCurveValue(time);
|
||||
}
|
||||
|
||||
float spine_constraint_timeline1_get_curve_value(spine_constraint_timeline1 obj, float time) {
|
||||
if (!obj) return 0;
|
||||
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
|
||||
return _obj->getCurveValue(time);
|
||||
float spine_constraint_timeline1_get_relative_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup);
|
||||
}
|
||||
|
||||
float spine_constraint_timeline1_get_relative_value(spine_constraint_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
|
||||
return _obj->getRelativeValue(time, alpha, (MixBlend) blend, current, setup);
|
||||
float spine_constraint_timeline1_get_absolute_value_1(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup);
|
||||
}
|
||||
|
||||
float spine_constraint_timeline1_get_absolute_value(spine_constraint_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
|
||||
return _obj->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup);
|
||||
float spine_constraint_timeline1_get_absolute_value_2(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) {
|
||||
return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value);
|
||||
}
|
||||
|
||||
float spine_constraint_timeline1_get_absolute_value_6(spine_constraint_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) {
|
||||
if (!obj) return 0;
|
||||
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
|
||||
return _obj->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value);
|
||||
float spine_constraint_timeline1_get_scale_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) {
|
||||
return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup);
|
||||
}
|
||||
|
||||
float spine_constraint_timeline1_get_scale_value(spine_constraint_timeline1 obj, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
|
||||
return _obj->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup);
|
||||
void spine_constraint_timeline1_set_linear(spine_constraint_timeline1 self, size_t frame) {
|
||||
((CurveTimeline1*)(ConstraintTimeline1*)self)->setLinear(frame);
|
||||
}
|
||||
|
||||
int spine_constraint_timeline1_get_constraint_index(spine_constraint_timeline1 obj) {
|
||||
if (!obj) return 0;
|
||||
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
|
||||
return _obj->getConstraintIndex();
|
||||
void spine_constraint_timeline1_set_stepped(spine_constraint_timeline1 self, size_t frame) {
|
||||
((CurveTimeline1*)(ConstraintTimeline1*)self)->setStepped(frame);
|
||||
}
|
||||
|
||||
void spine_constraint_timeline1_set_constraint_index(spine_constraint_timeline1 obj, int value) {
|
||||
if (!obj) return;
|
||||
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
|
||||
_obj->setConstraintIndex(value);
|
||||
void spine_constraint_timeline1_set_bezier(spine_constraint_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
((CurveTimeline1*)(ConstraintTimeline1*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
}
|
||||
|
||||
float spine_constraint_timeline1_get_bezier_value(spine_constraint_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getBezierValue(time, frame, valueOffset, i);
|
||||
}
|
||||
|
||||
spine_array_float spine_constraint_timeline1_get_curves(spine_constraint_timeline1 self) {
|
||||
return (spine_array_float)&((CurveTimeline1*)(ConstraintTimeline1*)self)->getCurves();
|
||||
}
|
||||
|
||||
void spine_constraint_timeline1_apply(spine_constraint_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((CurveTimeline1*)(ConstraintTimeline1*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
size_t spine_constraint_timeline1_get_frame_entries(spine_constraint_timeline1 self) {
|
||||
return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
size_t spine_constraint_timeline1_get_frame_count(spine_constraint_timeline1 self) {
|
||||
return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
spine_array_float spine_constraint_timeline1_get_frames(spine_constraint_timeline1 self) {
|
||||
return (spine_array_float)&((CurveTimeline1*)(ConstraintTimeline1*)self)->getFrames();
|
||||
}
|
||||
|
||||
float spine_constraint_timeline1_get_duration(spine_constraint_timeline1 self) {
|
||||
return ((CurveTimeline1*)(ConstraintTimeline1*)self)->getDuration();
|
||||
}
|
||||
|
||||
spine_array_property_id spine_constraint_timeline1_get_property_ids(spine_constraint_timeline1 self) {
|
||||
return (spine_array_property_id)&((CurveTimeline1*)(ConstraintTimeline1*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
int spine_constraint_timeline1_get_constraint_index(spine_constraint_timeline1 self) {
|
||||
return ((ConstraintTimeline*)(ConstraintTimeline1*)self)->getConstraintIndex();
|
||||
}
|
||||
|
||||
void spine_constraint_timeline1_set_constraint_index(spine_constraint_timeline1 self, int inValue) {
|
||||
((ConstraintTimeline*)(ConstraintTimeline1*)self)->setConstraintIndex(inValue);
|
||||
}
|
||||
|
||||
spine_rtti spine_constraint_timeline1_rtti(void) {
|
||||
return (spine_rtti)&ConstraintTimeline1::rtti;
|
||||
}
|
||||
|
||||
@ -1,55 +1,39 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_CONSTRAINT_TIMELINE1_H
|
||||
#define SPINE_SPINE_CONSTRAINT_TIMELINE1_H
|
||||
|
||||
#ifndef SPINE_C_CONSTRAINTTIMELINE1_H
|
||||
#define SPINE_C_CONSTRAINTTIMELINE1_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_constraint_timeline1_dispose(spine_constraint_timeline1 self);
|
||||
|
||||
SPINE_C_EXPORT spine_constraint_timeline1 spine_constraint_timeline1_create(size_t frameCount, size_t bezierCount, int constraintIndex, spine_property property);
|
||||
SPINE_C_EXPORT void spine_constraint_timeline1_dispose(spine_constraint_timeline1 obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_constraint_timeline1_get_rtti();
|
||||
SPINE_C_EXPORT void spine_constraint_timeline1_set_frame(spine_constraint_timeline1 obj, size_t frame, float time, float value);
|
||||
SPINE_C_EXPORT float spine_constraint_timeline1_get_curve_value(spine_constraint_timeline1 obj, float time);
|
||||
SPINE_C_EXPORT float spine_constraint_timeline1_get_relative_value(spine_constraint_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_EXPORT float spine_constraint_timeline1_get_absolute_value(spine_constraint_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_EXPORT float spine_constraint_timeline1_get_absolute_value_6(spine_constraint_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup, float value);
|
||||
SPINE_C_EXPORT float spine_constraint_timeline1_get_scale_value(spine_constraint_timeline1 obj, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup);
|
||||
SPINE_C_EXPORT int spine_constraint_timeline1_get_constraint_index(spine_constraint_timeline1 obj);
|
||||
SPINE_C_EXPORT void spine_constraint_timeline1_set_constraint_index(spine_constraint_timeline1 obj, int value);
|
||||
SPINE_C_API spine_rtti spine_constraint_timeline1_get_rtti(spine_constraint_timeline1 self);
|
||||
SPINE_C_API void spine_constraint_timeline1_set_frame(spine_constraint_timeline1 self, size_t frame, float time, float value);
|
||||
SPINE_C_API float spine_constraint_timeline1_get_curve_value(spine_constraint_timeline1 self, float time);
|
||||
SPINE_C_API float spine_constraint_timeline1_get_relative_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_API float spine_constraint_timeline1_get_absolute_value_1(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_API float spine_constraint_timeline1_get_absolute_value_2(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value);
|
||||
SPINE_C_API float spine_constraint_timeline1_get_scale_value(spine_constraint_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup);
|
||||
SPINE_C_API void spine_constraint_timeline1_set_linear(spine_constraint_timeline1 self, size_t frame);
|
||||
SPINE_C_API void spine_constraint_timeline1_set_stepped(spine_constraint_timeline1 self, size_t frame);
|
||||
SPINE_C_API void spine_constraint_timeline1_set_bezier(spine_constraint_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_API float spine_constraint_timeline1_get_bezier_value(spine_constraint_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_API spine_array_float spine_constraint_timeline1_get_curves(spine_constraint_timeline1 self);
|
||||
SPINE_C_API void spine_constraint_timeline1_apply(spine_constraint_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API size_t spine_constraint_timeline1_get_frame_entries(spine_constraint_timeline1 self);
|
||||
SPINE_C_API size_t spine_constraint_timeline1_get_frame_count(spine_constraint_timeline1 self);
|
||||
SPINE_C_API spine_array_float spine_constraint_timeline1_get_frames(spine_constraint_timeline1 self);
|
||||
SPINE_C_API float spine_constraint_timeline1_get_duration(spine_constraint_timeline1 self);
|
||||
SPINE_C_API spine_array_property_id spine_constraint_timeline1_get_property_ids(spine_constraint_timeline1 self);
|
||||
SPINE_C_API int spine_constraint_timeline1_get_constraint_index(spine_constraint_timeline1 self);
|
||||
SPINE_C_API void spine_constraint_timeline1_set_constraint_index(spine_constraint_timeline1 self, int inValue);
|
||||
SPINE_C_API spine_rtti spine_constraint_timeline1_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_CONSTRAINTTIMELINE1_H
|
||||
#endif /* SPINE_SPINE_CONSTRAINT_TIMELINE1_H */
|
||||
@ -1,126 +1,60 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "curve_timeline.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_curve_timeline_dispose(spine_curve_timeline obj) {
|
||||
if (!obj) return;
|
||||
delete (CurveTimeline *) obj;
|
||||
void spine_curve_timeline_dispose(spine_curve_timeline self) {
|
||||
delete (CurveTimeline*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_curve_timeline_get_rtti() {
|
||||
return (spine_rtti) &CurveTimeline::rtti;
|
||||
spine_rtti spine_curve_timeline_get_rtti(spine_curve_timeline self) {
|
||||
return (spine_rtti)&((CurveTimeline*)self)->getRTTI();
|
||||
}
|
||||
|
||||
void spine_curve_timeline_set_linear(spine_curve_timeline obj, size_t value) {
|
||||
if (!obj) return;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
_obj->setLinear(value);
|
||||
void spine_curve_timeline_set_linear(spine_curve_timeline self, size_t frame) {
|
||||
((CurveTimeline*)self)->setLinear(frame);
|
||||
}
|
||||
|
||||
void spine_curve_timeline_set_stepped(spine_curve_timeline obj, size_t value) {
|
||||
if (!obj) return;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
_obj->setStepped(value);
|
||||
void spine_curve_timeline_set_stepped(spine_curve_timeline self, size_t frame) {
|
||||
((CurveTimeline*)self)->setStepped(frame);
|
||||
}
|
||||
|
||||
void spine_curve_timeline_set_bezier(spine_curve_timeline obj, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
if (!obj) return ;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
_obj->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
void spine_curve_timeline_set_bezier(spine_curve_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
((CurveTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
}
|
||||
|
||||
float spine_curve_timeline_get_bezier_value(spine_curve_timeline obj, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return _obj->getBezierValue(time, frame, valueOffset, i);
|
||||
float spine_curve_timeline_get_bezier_value(spine_curve_timeline self, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
return ((CurveTimeline*)self)->getBezierValue(time, frame, valueOffset, i);
|
||||
}
|
||||
|
||||
int32_t spine_curve_timeline_get_num_curves(spine_curve_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return (int32_t) _obj->getCurves().size();
|
||||
spine_array_float spine_curve_timeline_get_curves(spine_curve_timeline self) {
|
||||
return (spine_array_float)&((CurveTimeline*)self)->getCurves();
|
||||
}
|
||||
|
||||
float *spine_curve_timeline_get_curves(spine_curve_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return (float *) _obj->getCurves().buffer();
|
||||
void spine_curve_timeline_apply(spine_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((Timeline*)(CurveTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
void spine_curve_timeline_apply(spine_curve_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
size_t spine_curve_timeline_get_frame_entries(spine_curve_timeline self) {
|
||||
return ((Timeline*)(CurveTimeline*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
size_t spine_curve_timeline_get_frame_entries(spine_curve_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return _obj->getFrameEntries();
|
||||
size_t spine_curve_timeline_get_frame_count(spine_curve_timeline self) {
|
||||
return ((Timeline*)(CurveTimeline*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
size_t spine_curve_timeline_get_frame_count(spine_curve_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return _obj->getFrameCount();
|
||||
spine_array_float spine_curve_timeline_get_frames(spine_curve_timeline self) {
|
||||
return (spine_array_float)&((Timeline*)(CurveTimeline*)self)->getFrames();
|
||||
}
|
||||
|
||||
int32_t spine_curve_timeline_get_num_frames(spine_curve_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return (int32_t) _obj->getFrames().size();
|
||||
float spine_curve_timeline_get_duration(spine_curve_timeline self) {
|
||||
return ((Timeline*)(CurveTimeline*)self)->getDuration();
|
||||
}
|
||||
|
||||
float *spine_curve_timeline_get_frames(spine_curve_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return (float *) _obj->getFrames().buffer();
|
||||
spine_array_property_id spine_curve_timeline_get_property_ids(spine_curve_timeline self) {
|
||||
return (spine_array_property_id)&((Timeline*)(CurveTimeline*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
float spine_curve_timeline_get_duration(spine_curve_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return _obj->getDuration();
|
||||
}
|
||||
|
||||
int32_t spine_curve_timeline_get_num_property_ids(spine_curve_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return (int32_t) _obj->getPropertyIds().size();
|
||||
}
|
||||
|
||||
int64_t *spine_curve_timeline_get_property_ids(spine_curve_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
CurveTimeline *_obj = (CurveTimeline *) obj;
|
||||
return (int64_t *) _obj->getPropertyIds().buffer();
|
||||
spine_rtti spine_curve_timeline_rtti(void) {
|
||||
return (spine_rtti)&CurveTimeline::rtti;
|
||||
}
|
||||
|
||||
@ -1,60 +1,31 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_CURVE_TIMELINE_H
|
||||
#define SPINE_SPINE_CURVE_TIMELINE_H
|
||||
|
||||
#ifndef SPINE_C_CURVETIMELINE_H
|
||||
#define SPINE_C_CURVETIMELINE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_curve_timeline_dispose(spine_curve_timeline self);
|
||||
|
||||
SPINE_C_EXPORT void spine_curve_timeline_dispose(spine_curve_timeline obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_curve_timeline_get_rtti();
|
||||
SPINE_C_EXPORT void spine_curve_timeline_set_linear(spine_curve_timeline obj, size_t value);
|
||||
SPINE_C_EXPORT void spine_curve_timeline_set_stepped(spine_curve_timeline obj, size_t value);
|
||||
SPINE_C_EXPORT void spine_curve_timeline_set_bezier(spine_curve_timeline obj, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_EXPORT float spine_curve_timeline_get_bezier_value(spine_curve_timeline obj, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_EXPORT int32_t spine_curve_timeline_get_num_curves(spine_curve_timeline obj);
|
||||
SPINE_C_EXPORT float *spine_curve_timeline_get_curves(spine_curve_timeline obj);
|
||||
SPINE_C_EXPORT void spine_curve_timeline_apply(spine_curve_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT size_t spine_curve_timeline_get_frame_entries(spine_curve_timeline obj);
|
||||
SPINE_C_EXPORT size_t spine_curve_timeline_get_frame_count(spine_curve_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_curve_timeline_get_num_frames(spine_curve_timeline obj);
|
||||
SPINE_C_EXPORT float *spine_curve_timeline_get_frames(spine_curve_timeline obj);
|
||||
SPINE_C_EXPORT float spine_curve_timeline_get_duration(spine_curve_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_curve_timeline_get_num_property_ids(spine_curve_timeline obj);
|
||||
SPINE_C_EXPORT int64_t *spine_curve_timeline_get_property_ids(spine_curve_timeline obj);
|
||||
SPINE_C_API spine_rtti spine_curve_timeline_get_rtti(spine_curve_timeline self);
|
||||
SPINE_C_API void spine_curve_timeline_set_linear(spine_curve_timeline self, size_t frame);
|
||||
SPINE_C_API void spine_curve_timeline_set_stepped(spine_curve_timeline self, size_t frame);
|
||||
SPINE_C_API void spine_curve_timeline_set_bezier(spine_curve_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_API float spine_curve_timeline_get_bezier_value(spine_curve_timeline self, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_API spine_array_float spine_curve_timeline_get_curves(spine_curve_timeline self);
|
||||
SPINE_C_API void spine_curve_timeline_apply(spine_curve_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API size_t spine_curve_timeline_get_frame_entries(spine_curve_timeline self);
|
||||
SPINE_C_API size_t spine_curve_timeline_get_frame_count(spine_curve_timeline self);
|
||||
SPINE_C_API spine_array_float spine_curve_timeline_get_frames(spine_curve_timeline self);
|
||||
SPINE_C_API float spine_curve_timeline_get_duration(spine_curve_timeline self);
|
||||
SPINE_C_API spine_array_property_id spine_curve_timeline_get_property_ids(spine_curve_timeline self);
|
||||
SPINE_C_API spine_rtti spine_curve_timeline_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_CURVETIMELINE_H
|
||||
#endif /* SPINE_SPINE_CURVE_TIMELINE_H */
|
||||
@ -1,162 +1,84 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "curve_timeline1.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_curve_timeline1_dispose(spine_curve_timeline1 obj) {
|
||||
if (!obj) return;
|
||||
delete (CurveTimeline1 *) obj;
|
||||
void spine_curve_timeline1_dispose(spine_curve_timeline1 self) {
|
||||
delete (CurveTimeline1*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_curve_timeline1_get_rtti() {
|
||||
return (spine_rtti) &CurveTimeline1::rtti;
|
||||
spine_rtti spine_curve_timeline1_get_rtti(spine_curve_timeline1 self) {
|
||||
return (spine_rtti)&((CurveTimeline1*)self)->getRTTI();
|
||||
}
|
||||
|
||||
void spine_curve_timeline1_set_frame(spine_curve_timeline1 obj, size_t frame, float time, float value) {
|
||||
if (!obj) return ;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
_obj->setFrame(frame, time, value);
|
||||
void spine_curve_timeline1_set_frame(spine_curve_timeline1 self, size_t frame, float time, float value) {
|
||||
((CurveTimeline1*)self)->setFrame(frame, time, value);
|
||||
}
|
||||
|
||||
float spine_curve_timeline1_get_curve_value(spine_curve_timeline1 obj, float time) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return _obj->getCurveValue(time);
|
||||
float spine_curve_timeline1_get_curve_value(spine_curve_timeline1 self, float time) {
|
||||
return ((CurveTimeline1*)self)->getCurveValue(time);
|
||||
}
|
||||
|
||||
float spine_curve_timeline1_get_relative_value(spine_curve_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return _obj->getRelativeValue(time, alpha, (MixBlend) blend, current, setup);
|
||||
float spine_curve_timeline1_get_relative_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
return ((CurveTimeline1*)self)->getRelativeValue(time, alpha, (MixBlend)blend, current, setup);
|
||||
}
|
||||
|
||||
float spine_curve_timeline1_get_absolute_value(spine_curve_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return _obj->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup);
|
||||
float spine_curve_timeline1_get_absolute_value_1(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup) {
|
||||
return ((CurveTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup);
|
||||
}
|
||||
|
||||
float spine_curve_timeline1_get_absolute_value_6(spine_curve_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return _obj->getAbsoluteValue(time, alpha, (MixBlend) blend, current, setup, value);
|
||||
float spine_curve_timeline1_get_absolute_value_2(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value) {
|
||||
return ((CurveTimeline1*)self)->getAbsoluteValue(time, alpha, (MixBlend)blend, current, setup, value);
|
||||
}
|
||||
|
||||
float spine_curve_timeline1_get_scale_value(spine_curve_timeline1 obj, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return _obj->getScaleValue(time, alpha, (MixBlend) blend, (MixDirection) direction, current, setup);
|
||||
float spine_curve_timeline1_get_scale_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup) {
|
||||
return ((CurveTimeline1*)self)->getScaleValue(time, alpha, (MixBlend)blend, (MixDirection)direction, current, setup);
|
||||
}
|
||||
|
||||
void spine_curve_timeline1_set_linear(spine_curve_timeline1 obj, size_t value) {
|
||||
if (!obj) return;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
_obj->setLinear(value);
|
||||
void spine_curve_timeline1_set_linear(spine_curve_timeline1 self, size_t frame) {
|
||||
((CurveTimeline*)(CurveTimeline1*)self)->setLinear(frame);
|
||||
}
|
||||
|
||||
void spine_curve_timeline1_set_stepped(spine_curve_timeline1 obj, size_t value) {
|
||||
if (!obj) return;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
_obj->setStepped(value);
|
||||
void spine_curve_timeline1_set_stepped(spine_curve_timeline1 self, size_t frame) {
|
||||
((CurveTimeline*)(CurveTimeline1*)self)->setStepped(frame);
|
||||
}
|
||||
|
||||
void spine_curve_timeline1_set_bezier(spine_curve_timeline1 obj, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
if (!obj) return ;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
_obj->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
void spine_curve_timeline1_set_bezier(spine_curve_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
((CurveTimeline*)(CurveTimeline1*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
}
|
||||
|
||||
float spine_curve_timeline1_get_bezier_value(spine_curve_timeline1 obj, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return _obj->getBezierValue(time, frame, valueOffset, i);
|
||||
float spine_curve_timeline1_get_bezier_value(spine_curve_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
return ((CurveTimeline*)(CurveTimeline1*)self)->getBezierValue(time, frame, valueOffset, i);
|
||||
}
|
||||
|
||||
int32_t spine_curve_timeline1_get_num_curves(spine_curve_timeline1 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return (int32_t) _obj->getCurves().size();
|
||||
spine_array_float spine_curve_timeline1_get_curves(spine_curve_timeline1 self) {
|
||||
return (spine_array_float)&((CurveTimeline*)(CurveTimeline1*)self)->getCurves();
|
||||
}
|
||||
|
||||
float *spine_curve_timeline1_get_curves(spine_curve_timeline1 obj) {
|
||||
if (!obj) return nullptr;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return (float *) _obj->getCurves().buffer();
|
||||
void spine_curve_timeline1_apply(spine_curve_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((CurveTimeline*)(CurveTimeline1*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
void spine_curve_timeline1_apply(spine_curve_timeline1 obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
size_t spine_curve_timeline1_get_frame_entries(spine_curve_timeline1 self) {
|
||||
return ((CurveTimeline*)(CurveTimeline1*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
size_t spine_curve_timeline1_get_frame_entries(spine_curve_timeline1 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return _obj->getFrameEntries();
|
||||
size_t spine_curve_timeline1_get_frame_count(spine_curve_timeline1 self) {
|
||||
return ((CurveTimeline*)(CurveTimeline1*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
size_t spine_curve_timeline1_get_frame_count(spine_curve_timeline1 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return _obj->getFrameCount();
|
||||
spine_array_float spine_curve_timeline1_get_frames(spine_curve_timeline1 self) {
|
||||
return (spine_array_float)&((CurveTimeline*)(CurveTimeline1*)self)->getFrames();
|
||||
}
|
||||
|
||||
int32_t spine_curve_timeline1_get_num_frames(spine_curve_timeline1 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return (int32_t) _obj->getFrames().size();
|
||||
float spine_curve_timeline1_get_duration(spine_curve_timeline1 self) {
|
||||
return ((CurveTimeline*)(CurveTimeline1*)self)->getDuration();
|
||||
}
|
||||
|
||||
float *spine_curve_timeline1_get_frames(spine_curve_timeline1 obj) {
|
||||
if (!obj) return nullptr;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return (float *) _obj->getFrames().buffer();
|
||||
spine_array_property_id spine_curve_timeline1_get_property_ids(spine_curve_timeline1 self) {
|
||||
return (spine_array_property_id)&((CurveTimeline*)(CurveTimeline1*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
float spine_curve_timeline1_get_duration(spine_curve_timeline1 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return _obj->getDuration();
|
||||
}
|
||||
|
||||
int32_t spine_curve_timeline1_get_num_property_ids(spine_curve_timeline1 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return (int32_t) _obj->getPropertyIds().size();
|
||||
}
|
||||
|
||||
int64_t *spine_curve_timeline1_get_property_ids(spine_curve_timeline1 obj) {
|
||||
if (!obj) return nullptr;
|
||||
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
|
||||
return (int64_t *) _obj->getPropertyIds().buffer();
|
||||
spine_rtti spine_curve_timeline1_rtti(void) {
|
||||
return (spine_rtti)&CurveTimeline1::rtti;
|
||||
}
|
||||
|
||||
@ -1,66 +1,37 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_CURVE_TIMELINE1_H
|
||||
#define SPINE_SPINE_CURVE_TIMELINE1_H
|
||||
|
||||
#ifndef SPINE_C_CURVETIMELINE1_H
|
||||
#define SPINE_C_CURVETIMELINE1_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_curve_timeline1_dispose(spine_curve_timeline1 self);
|
||||
|
||||
SPINE_C_EXPORT void spine_curve_timeline1_dispose(spine_curve_timeline1 obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_curve_timeline1_get_rtti();
|
||||
SPINE_C_EXPORT void spine_curve_timeline1_set_frame(spine_curve_timeline1 obj, size_t frame, float time, float value);
|
||||
SPINE_C_EXPORT float spine_curve_timeline1_get_curve_value(spine_curve_timeline1 obj, float time);
|
||||
SPINE_C_EXPORT float spine_curve_timeline1_get_relative_value(spine_curve_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_EXPORT float spine_curve_timeline1_get_absolute_value(spine_curve_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_EXPORT float spine_curve_timeline1_get_absolute_value_6(spine_curve_timeline1 obj, float time, float alpha, spine_mix_blend blend, float current, float setup, float value);
|
||||
SPINE_C_EXPORT float spine_curve_timeline1_get_scale_value(spine_curve_timeline1 obj, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup);
|
||||
SPINE_C_EXPORT void spine_curve_timeline1_set_linear(spine_curve_timeline1 obj, size_t value);
|
||||
SPINE_C_EXPORT void spine_curve_timeline1_set_stepped(spine_curve_timeline1 obj, size_t value);
|
||||
SPINE_C_EXPORT void spine_curve_timeline1_set_bezier(spine_curve_timeline1 obj, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_EXPORT float spine_curve_timeline1_get_bezier_value(spine_curve_timeline1 obj, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_EXPORT int32_t spine_curve_timeline1_get_num_curves(spine_curve_timeline1 obj);
|
||||
SPINE_C_EXPORT float *spine_curve_timeline1_get_curves(spine_curve_timeline1 obj);
|
||||
SPINE_C_EXPORT void spine_curve_timeline1_apply(spine_curve_timeline1 obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT size_t spine_curve_timeline1_get_frame_entries(spine_curve_timeline1 obj);
|
||||
SPINE_C_EXPORT size_t spine_curve_timeline1_get_frame_count(spine_curve_timeline1 obj);
|
||||
SPINE_C_EXPORT int32_t spine_curve_timeline1_get_num_frames(spine_curve_timeline1 obj);
|
||||
SPINE_C_EXPORT float *spine_curve_timeline1_get_frames(spine_curve_timeline1 obj);
|
||||
SPINE_C_EXPORT float spine_curve_timeline1_get_duration(spine_curve_timeline1 obj);
|
||||
SPINE_C_EXPORT int32_t spine_curve_timeline1_get_num_property_ids(spine_curve_timeline1 obj);
|
||||
SPINE_C_EXPORT int64_t *spine_curve_timeline1_get_property_ids(spine_curve_timeline1 obj);
|
||||
SPINE_C_API spine_rtti spine_curve_timeline1_get_rtti(spine_curve_timeline1 self);
|
||||
SPINE_C_API void spine_curve_timeline1_set_frame(spine_curve_timeline1 self, size_t frame, float time, float value);
|
||||
SPINE_C_API float spine_curve_timeline1_get_curve_value(spine_curve_timeline1 self, float time);
|
||||
SPINE_C_API float spine_curve_timeline1_get_relative_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_API float spine_curve_timeline1_get_absolute_value_1(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup);
|
||||
SPINE_C_API float spine_curve_timeline1_get_absolute_value_2(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, float current, float setup, float value);
|
||||
SPINE_C_API float spine_curve_timeline1_get_scale_value(spine_curve_timeline1 self, float time, float alpha, spine_mix_blend blend, spine_mix_direction direction, float current, float setup);
|
||||
SPINE_C_API void spine_curve_timeline1_set_linear(spine_curve_timeline1 self, size_t frame);
|
||||
SPINE_C_API void spine_curve_timeline1_set_stepped(spine_curve_timeline1 self, size_t frame);
|
||||
SPINE_C_API void spine_curve_timeline1_set_bezier(spine_curve_timeline1 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_API float spine_curve_timeline1_get_bezier_value(spine_curve_timeline1 self, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_API spine_array_float spine_curve_timeline1_get_curves(spine_curve_timeline1 self);
|
||||
SPINE_C_API void spine_curve_timeline1_apply(spine_curve_timeline1 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API size_t spine_curve_timeline1_get_frame_entries(spine_curve_timeline1 self);
|
||||
SPINE_C_API size_t spine_curve_timeline1_get_frame_count(spine_curve_timeline1 self);
|
||||
SPINE_C_API spine_array_float spine_curve_timeline1_get_frames(spine_curve_timeline1 self);
|
||||
SPINE_C_API float spine_curve_timeline1_get_duration(spine_curve_timeline1 self);
|
||||
SPINE_C_API spine_array_property_id spine_curve_timeline1_get_property_ids(spine_curve_timeline1 self);
|
||||
SPINE_C_API spine_rtti spine_curve_timeline1_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_CURVETIMELINE1_H
|
||||
#endif /* SPINE_SPINE_CURVE_TIMELINE1_H */
|
||||
@ -1,138 +1,68 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "curve_timeline2.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_curve_timeline2_dispose(spine_curve_timeline2 obj) {
|
||||
if (!obj) return;
|
||||
delete (CurveTimeline2 *) obj;
|
||||
void spine_curve_timeline2_dispose(spine_curve_timeline2 self) {
|
||||
delete (CurveTimeline2*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_curve_timeline2_get_rtti() {
|
||||
return (spine_rtti) &CurveTimeline2::rtti;
|
||||
spine_rtti spine_curve_timeline2_get_rtti(spine_curve_timeline2 self) {
|
||||
return (spine_rtti)&((CurveTimeline2*)self)->getRTTI();
|
||||
}
|
||||
|
||||
void spine_curve_timeline2_set_frame(spine_curve_timeline2 obj, size_t frame, float time, float value1, float value2) {
|
||||
if (!obj) return ;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
_obj->setFrame(frame, time, value1, value2);
|
||||
void spine_curve_timeline2_set_frame(spine_curve_timeline2 self, size_t frame, float time, float value1, float value2) {
|
||||
((CurveTimeline2*)self)->setFrame(frame, time, value1, value2);
|
||||
}
|
||||
|
||||
float spine_curve_timeline2_get_curve_value(spine_curve_timeline2 obj, float time) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return _obj->getCurveValue(time);
|
||||
float spine_curve_timeline2_get_curve_value(spine_curve_timeline2 self, float time) {
|
||||
return ((CurveTimeline2*)self)->getCurveValue(time);
|
||||
}
|
||||
|
||||
void spine_curve_timeline2_set_linear(spine_curve_timeline2 obj, size_t value) {
|
||||
if (!obj) return;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
_obj->setLinear(value);
|
||||
void spine_curve_timeline2_set_linear(spine_curve_timeline2 self, size_t frame) {
|
||||
((CurveTimeline*)(CurveTimeline2*)self)->setLinear(frame);
|
||||
}
|
||||
|
||||
void spine_curve_timeline2_set_stepped(spine_curve_timeline2 obj, size_t value) {
|
||||
if (!obj) return;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
_obj->setStepped(value);
|
||||
void spine_curve_timeline2_set_stepped(spine_curve_timeline2 self, size_t frame) {
|
||||
((CurveTimeline*)(CurveTimeline2*)self)->setStepped(frame);
|
||||
}
|
||||
|
||||
void spine_curve_timeline2_set_bezier(spine_curve_timeline2 obj, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
if (!obj) return ;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
_obj->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
void spine_curve_timeline2_set_bezier(spine_curve_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
((CurveTimeline*)(CurveTimeline2*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
}
|
||||
|
||||
float spine_curve_timeline2_get_bezier_value(spine_curve_timeline2 obj, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return _obj->getBezierValue(time, frame, valueOffset, i);
|
||||
float spine_curve_timeline2_get_bezier_value(spine_curve_timeline2 self, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
return ((CurveTimeline*)(CurveTimeline2*)self)->getBezierValue(time, frame, valueOffset, i);
|
||||
}
|
||||
|
||||
int32_t spine_curve_timeline2_get_num_curves(spine_curve_timeline2 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return (int32_t) _obj->getCurves().size();
|
||||
spine_array_float spine_curve_timeline2_get_curves(spine_curve_timeline2 self) {
|
||||
return (spine_array_float)&((CurveTimeline*)(CurveTimeline2*)self)->getCurves();
|
||||
}
|
||||
|
||||
float *spine_curve_timeline2_get_curves(spine_curve_timeline2 obj) {
|
||||
if (!obj) return nullptr;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return (float *) _obj->getCurves().buffer();
|
||||
void spine_curve_timeline2_apply(spine_curve_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((CurveTimeline*)(CurveTimeline2*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
void spine_curve_timeline2_apply(spine_curve_timeline2 obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
size_t spine_curve_timeline2_get_frame_entries(spine_curve_timeline2 self) {
|
||||
return ((CurveTimeline*)(CurveTimeline2*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
size_t spine_curve_timeline2_get_frame_entries(spine_curve_timeline2 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return _obj->getFrameEntries();
|
||||
size_t spine_curve_timeline2_get_frame_count(spine_curve_timeline2 self) {
|
||||
return ((CurveTimeline*)(CurveTimeline2*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
size_t spine_curve_timeline2_get_frame_count(spine_curve_timeline2 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return _obj->getFrameCount();
|
||||
spine_array_float spine_curve_timeline2_get_frames(spine_curve_timeline2 self) {
|
||||
return (spine_array_float)&((CurveTimeline*)(CurveTimeline2*)self)->getFrames();
|
||||
}
|
||||
|
||||
int32_t spine_curve_timeline2_get_num_frames(spine_curve_timeline2 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return (int32_t) _obj->getFrames().size();
|
||||
float spine_curve_timeline2_get_duration(spine_curve_timeline2 self) {
|
||||
return ((CurveTimeline*)(CurveTimeline2*)self)->getDuration();
|
||||
}
|
||||
|
||||
float *spine_curve_timeline2_get_frames(spine_curve_timeline2 obj) {
|
||||
if (!obj) return nullptr;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return (float *) _obj->getFrames().buffer();
|
||||
spine_array_property_id spine_curve_timeline2_get_property_ids(spine_curve_timeline2 self) {
|
||||
return (spine_array_property_id)&((CurveTimeline*)(CurveTimeline2*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
float spine_curve_timeline2_get_duration(spine_curve_timeline2 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return _obj->getDuration();
|
||||
}
|
||||
|
||||
int32_t spine_curve_timeline2_get_num_property_ids(spine_curve_timeline2 obj) {
|
||||
if (!obj) return 0;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return (int32_t) _obj->getPropertyIds().size();
|
||||
}
|
||||
|
||||
int64_t *spine_curve_timeline2_get_property_ids(spine_curve_timeline2 obj) {
|
||||
if (!obj) return nullptr;
|
||||
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
|
||||
return (int64_t *) _obj->getPropertyIds().buffer();
|
||||
spine_rtti spine_curve_timeline2_rtti(void) {
|
||||
return (spine_rtti)&CurveTimeline2::rtti;
|
||||
}
|
||||
|
||||
@ -1,62 +1,33 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_CURVE_TIMELINE2_H
|
||||
#define SPINE_SPINE_CURVE_TIMELINE2_H
|
||||
|
||||
#ifndef SPINE_C_CURVETIMELINE2_H
|
||||
#define SPINE_C_CURVETIMELINE2_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_curve_timeline2_dispose(spine_curve_timeline2 self);
|
||||
|
||||
SPINE_C_EXPORT void spine_curve_timeline2_dispose(spine_curve_timeline2 obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_curve_timeline2_get_rtti();
|
||||
SPINE_C_EXPORT void spine_curve_timeline2_set_frame(spine_curve_timeline2 obj, size_t frame, float time, float value1, float value2);
|
||||
SPINE_C_EXPORT float spine_curve_timeline2_get_curve_value(spine_curve_timeline2 obj, float time);
|
||||
SPINE_C_EXPORT void spine_curve_timeline2_set_linear(spine_curve_timeline2 obj, size_t value);
|
||||
SPINE_C_EXPORT void spine_curve_timeline2_set_stepped(spine_curve_timeline2 obj, size_t value);
|
||||
SPINE_C_EXPORT void spine_curve_timeline2_set_bezier(spine_curve_timeline2 obj, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_EXPORT float spine_curve_timeline2_get_bezier_value(spine_curve_timeline2 obj, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_EXPORT int32_t spine_curve_timeline2_get_num_curves(spine_curve_timeline2 obj);
|
||||
SPINE_C_EXPORT float *spine_curve_timeline2_get_curves(spine_curve_timeline2 obj);
|
||||
SPINE_C_EXPORT void spine_curve_timeline2_apply(spine_curve_timeline2 obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT size_t spine_curve_timeline2_get_frame_entries(spine_curve_timeline2 obj);
|
||||
SPINE_C_EXPORT size_t spine_curve_timeline2_get_frame_count(spine_curve_timeline2 obj);
|
||||
SPINE_C_EXPORT int32_t spine_curve_timeline2_get_num_frames(spine_curve_timeline2 obj);
|
||||
SPINE_C_EXPORT float *spine_curve_timeline2_get_frames(spine_curve_timeline2 obj);
|
||||
SPINE_C_EXPORT float spine_curve_timeline2_get_duration(spine_curve_timeline2 obj);
|
||||
SPINE_C_EXPORT int32_t spine_curve_timeline2_get_num_property_ids(spine_curve_timeline2 obj);
|
||||
SPINE_C_EXPORT int64_t *spine_curve_timeline2_get_property_ids(spine_curve_timeline2 obj);
|
||||
SPINE_C_API spine_rtti spine_curve_timeline2_get_rtti(spine_curve_timeline2 self);
|
||||
SPINE_C_API void spine_curve_timeline2_set_frame(spine_curve_timeline2 self, size_t frame, float time, float value1, float value2);
|
||||
SPINE_C_API float spine_curve_timeline2_get_curve_value(spine_curve_timeline2 self, float time);
|
||||
SPINE_C_API void spine_curve_timeline2_set_linear(spine_curve_timeline2 self, size_t frame);
|
||||
SPINE_C_API void spine_curve_timeline2_set_stepped(spine_curve_timeline2 self, size_t frame);
|
||||
SPINE_C_API void spine_curve_timeline2_set_bezier(spine_curve_timeline2 self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_API float spine_curve_timeline2_get_bezier_value(spine_curve_timeline2 self, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_API spine_array_float spine_curve_timeline2_get_curves(spine_curve_timeline2 self);
|
||||
SPINE_C_API void spine_curve_timeline2_apply(spine_curve_timeline2 self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API size_t spine_curve_timeline2_get_frame_entries(spine_curve_timeline2 self);
|
||||
SPINE_C_API size_t spine_curve_timeline2_get_frame_count(spine_curve_timeline2 self);
|
||||
SPINE_C_API spine_array_float spine_curve_timeline2_get_frames(spine_curve_timeline2 self);
|
||||
SPINE_C_API float spine_curve_timeline2_get_duration(spine_curve_timeline2 self);
|
||||
SPINE_C_API spine_array_property_id spine_curve_timeline2_get_property_ids(spine_curve_timeline2 self);
|
||||
SPINE_C_API spine_rtti spine_curve_timeline2_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_CURVETIMELINE2_H
|
||||
#endif /* SPINE_SPINE_CURVE_TIMELINE2_H */
|
||||
@ -1,101 +1,88 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "deform_timeline.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, spine_vertex_attachment attachment) {
|
||||
DeformTimeline *obj = new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, (VertexAttachment *) attachment);
|
||||
return (spine_deform_timeline) obj;
|
||||
return (spine_deform_timeline) new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, (VertexAttachment *)attachment);
|
||||
}
|
||||
|
||||
void spine_deform_timeline_dispose(spine_deform_timeline obj) {
|
||||
if (!obj) return;
|
||||
delete (DeformTimeline *) obj;
|
||||
void spine_deform_timeline_dispose(spine_deform_timeline self) {
|
||||
delete (DeformTimeline*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_deform_timeline_get_rtti() {
|
||||
return (spine_rtti) &DeformTimeline::rtti;
|
||||
spine_rtti spine_deform_timeline_get_rtti(spine_deform_timeline self) {
|
||||
return (spine_rtti)&((DeformTimeline*)self)->getRTTI();
|
||||
}
|
||||
|
||||
void spine_deform_timeline_set_frame(spine_deform_timeline obj, int frameIndex, float time, spine_array_float vertices) {
|
||||
if (!obj) return ;
|
||||
DeformTimeline *_obj = (DeformTimeline *) obj;
|
||||
_obj->setFrame(frameIndex, time, (Array<float> &) vertices);
|
||||
void spine_deform_timeline_set_frame(spine_deform_timeline self, int frameIndex, float time, spine_array_float vertices) {
|
||||
((DeformTimeline*)self)->setFrame(frameIndex, time, *((Array<float>*)vertices));
|
||||
}
|
||||
|
||||
int32_t spine_deform_timeline_get_num_vertices(spine_deform_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
DeformTimeline *_obj = (DeformTimeline *) obj;
|
||||
return (int32_t) _obj->getVertices().size();
|
||||
spine_vertex_attachment spine_deform_timeline_get_attachment(spine_deform_timeline self) {
|
||||
return (spine_vertex_attachment)((DeformTimeline*)self)->getAttachment();
|
||||
}
|
||||
|
||||
spine_array<float *spine_deform_timeline_get_vertices(spine_deform_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
DeformTimeline *_obj = (DeformTimeline *) obj;
|
||||
return (spine_array<float *) _obj->getVertices().buffer();
|
||||
void spine_deform_timeline_set_attachment(spine_deform_timeline self, spine_vertex_attachment inValue) {
|
||||
((DeformTimeline*)self)->setAttachment((VertexAttachment *)inValue);
|
||||
}
|
||||
|
||||
spine_vertex_attachment spine_deform_timeline_get_attachment(spine_deform_timeline obj) {
|
||||
if (!obj) return (spine_vertex_attachment) 0;
|
||||
DeformTimeline *_obj = (DeformTimeline *) obj;
|
||||
return (spine_vertex_attachment) _obj->getAttachment();
|
||||
void spine_deform_timeline_set_bezier(spine_deform_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
((DeformTimeline*)self)->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
}
|
||||
|
||||
void spine_deform_timeline_set_attachment(spine_deform_timeline obj, spine_vertex_attachment value) {
|
||||
if (!obj) return;
|
||||
DeformTimeline *_obj = (DeformTimeline *) obj;
|
||||
_obj->setAttachment((VertexAttachment *) value);
|
||||
float spine_deform_timeline_get_curve_percent(spine_deform_timeline self, float time, int frame) {
|
||||
return ((DeformTimeline*)self)->getCurvePercent(time, frame);
|
||||
}
|
||||
|
||||
void spine_deform_timeline_set_bezier(spine_deform_timeline obj, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2) {
|
||||
if (!obj) return ;
|
||||
DeformTimeline *_obj = (DeformTimeline *) obj;
|
||||
_obj->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);
|
||||
size_t spine_deform_timeline_get_frame_count(spine_deform_timeline self) {
|
||||
return ((DeformTimeline*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
float spine_deform_timeline_get_curve_percent(spine_deform_timeline obj, float time, int frame) {
|
||||
if (!obj) return 0;
|
||||
DeformTimeline *_obj = (DeformTimeline *) obj;
|
||||
return _obj->getCurvePercent(time, frame);
|
||||
void spine_deform_timeline_apply(spine_deform_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((SlotCurveTimeline*)(DeformTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
size_t spine_deform_timeline_get_frame_count(spine_deform_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
DeformTimeline *_obj = (DeformTimeline *) obj;
|
||||
return _obj->getFrameCount();
|
||||
void spine_deform_timeline_set_linear(spine_deform_timeline self, size_t frame) {
|
||||
((SlotCurveTimeline*)(DeformTimeline*)self)->setLinear(frame);
|
||||
}
|
||||
|
||||
void spine_deform_timeline_apply(spine_deform_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
DeformTimeline *_obj = (DeformTimeline *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
void spine_deform_timeline_set_stepped(spine_deform_timeline self, size_t frame) {
|
||||
((SlotCurveTimeline*)(DeformTimeline*)self)->setStepped(frame);
|
||||
}
|
||||
|
||||
float spine_deform_timeline_get_bezier_value(spine_deform_timeline self, float time, size_t frame, size_t valueOffset, size_t i) {
|
||||
return ((SlotCurveTimeline*)(DeformTimeline*)self)->getBezierValue(time, frame, valueOffset, i);
|
||||
}
|
||||
|
||||
spine_array_float spine_deform_timeline_get_curves(spine_deform_timeline self) {
|
||||
return (spine_array_float)&((SlotCurveTimeline*)(DeformTimeline*)self)->getCurves();
|
||||
}
|
||||
|
||||
size_t spine_deform_timeline_get_frame_entries(spine_deform_timeline self) {
|
||||
return ((SlotCurveTimeline*)(DeformTimeline*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
spine_array_float spine_deform_timeline_get_frames(spine_deform_timeline self) {
|
||||
return (spine_array_float)&((SlotCurveTimeline*)(DeformTimeline*)self)->getFrames();
|
||||
}
|
||||
|
||||
float spine_deform_timeline_get_duration(spine_deform_timeline self) {
|
||||
return ((SlotCurveTimeline*)(DeformTimeline*)self)->getDuration();
|
||||
}
|
||||
|
||||
spine_array_property_id spine_deform_timeline_get_property_ids(spine_deform_timeline self) {
|
||||
return (spine_array_property_id)&((SlotCurveTimeline*)(DeformTimeline*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
int spine_deform_timeline_get_slot_index(spine_deform_timeline self) {
|
||||
return ((SlotCurveTimeline*)(DeformTimeline*)self)->getSlotIndex();
|
||||
}
|
||||
|
||||
void spine_deform_timeline_set_slot_index(spine_deform_timeline self, int inValue) {
|
||||
((SlotCurveTimeline*)(DeformTimeline*)self)->setSlotIndex(inValue);
|
||||
}
|
||||
|
||||
spine_rtti spine_deform_timeline_rtti(void) {
|
||||
return (spine_rtti)&DeformTimeline::rtti;
|
||||
}
|
||||
|
||||
@ -1,56 +1,39 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_DEFORM_TIMELINE_H
|
||||
#define SPINE_SPINE_DEFORM_TIMELINE_H
|
||||
|
||||
#ifndef SPINE_C_DEFORMTIMELINE_H
|
||||
#define SPINE_C_DEFORMTIMELINE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, spine_vertex_attachment attachment);
|
||||
|
||||
SPINE_C_EXPORT spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, spine_vertex_attachment attachment);
|
||||
SPINE_C_EXPORT void spine_deform_timeline_dispose(spine_deform_timeline obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_deform_timeline_get_rtti();
|
||||
SPINE_C_EXPORT void spine_deform_timeline_set_frame(spine_deform_timeline obj, int frameIndex, float time, spine_array_float vertices);
|
||||
SPINE_C_EXPORT int32_t spine_deform_timeline_get_num_vertices(spine_deform_timeline obj);
|
||||
SPINE_C_EXPORT spine_array<float *spine_deform_timeline_get_vertices(spine_deform_timeline obj);
|
||||
SPINE_C_EXPORT spine_vertex_attachment spine_deform_timeline_get_attachment(spine_deform_timeline obj);
|
||||
SPINE_C_EXPORT void spine_deform_timeline_set_attachment(spine_deform_timeline obj, spine_vertex_attachment value);
|
||||
SPINE_C_EXPORT void spine_deform_timeline_set_bezier(spine_deform_timeline obj, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_EXPORT float spine_deform_timeline_get_curve_percent(spine_deform_timeline obj, float time, int frame);
|
||||
SPINE_C_EXPORT size_t spine_deform_timeline_get_frame_count(spine_deform_timeline obj);
|
||||
SPINE_C_EXPORT void spine_deform_timeline_apply(spine_deform_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API void spine_deform_timeline_dispose(spine_deform_timeline self);
|
||||
|
||||
SPINE_C_API spine_rtti spine_deform_timeline_get_rtti(spine_deform_timeline self);
|
||||
SPINE_C_API void spine_deform_timeline_set_frame(spine_deform_timeline self, int frameIndex, float time, spine_array_float vertices);
|
||||
SPINE_C_API spine_vertex_attachment spine_deform_timeline_get_attachment(spine_deform_timeline self);
|
||||
SPINE_C_API void spine_deform_timeline_set_attachment(spine_deform_timeline self, spine_vertex_attachment inValue);
|
||||
SPINE_C_API void spine_deform_timeline_set_bezier(spine_deform_timeline self, size_t bezier, size_t frame, float value, float time1, float value1, float cx1, float cy1, float cx2, float cy2, float time2, float value2);
|
||||
SPINE_C_API float spine_deform_timeline_get_curve_percent(spine_deform_timeline self, float time, int frame);
|
||||
SPINE_C_API size_t spine_deform_timeline_get_frame_count(spine_deform_timeline self);
|
||||
SPINE_C_API void spine_deform_timeline_apply(spine_deform_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API void spine_deform_timeline_set_linear(spine_deform_timeline self, size_t frame);
|
||||
SPINE_C_API void spine_deform_timeline_set_stepped(spine_deform_timeline self, size_t frame);
|
||||
SPINE_C_API float spine_deform_timeline_get_bezier_value(spine_deform_timeline self, float time, size_t frame, size_t valueOffset, size_t i);
|
||||
SPINE_C_API spine_array_float spine_deform_timeline_get_curves(spine_deform_timeline self);
|
||||
SPINE_C_API size_t spine_deform_timeline_get_frame_entries(spine_deform_timeline self);
|
||||
SPINE_C_API spine_array_float spine_deform_timeline_get_frames(spine_deform_timeline self);
|
||||
SPINE_C_API float spine_deform_timeline_get_duration(spine_deform_timeline self);
|
||||
SPINE_C_API spine_array_property_id spine_deform_timeline_get_property_ids(spine_deform_timeline self);
|
||||
SPINE_C_API int spine_deform_timeline_get_slot_index(spine_deform_timeline self);
|
||||
SPINE_C_API void spine_deform_timeline_set_slot_index(spine_deform_timeline self, int inValue);
|
||||
SPINE_C_API spine_rtti spine_deform_timeline_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_DEFORMTIMELINE_H
|
||||
#endif /* SPINE_SPINE_DEFORM_TIMELINE_H */
|
||||
@ -1,113 +1,48 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "draw_order_timeline.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_draw_order_timeline spine_draw_order_timeline_create(size_t frameCount) {
|
||||
DrawOrderTimeline *obj = new (__FILE__, __LINE__) DrawOrderTimeline(frameCount);
|
||||
return (spine_draw_order_timeline) obj;
|
||||
return (spine_draw_order_timeline) new (__FILE__, __LINE__) DrawOrderTimeline(frameCount);
|
||||
}
|
||||
|
||||
void spine_draw_order_timeline_dispose(spine_draw_order_timeline obj) {
|
||||
if (!obj) return;
|
||||
delete (DrawOrderTimeline *) obj;
|
||||
void spine_draw_order_timeline_dispose(spine_draw_order_timeline self) {
|
||||
delete (DrawOrderTimeline*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_draw_order_timeline_get_rtti() {
|
||||
return (spine_rtti) &DrawOrderTimeline::rtti;
|
||||
spine_rtti spine_draw_order_timeline_get_rtti(spine_draw_order_timeline self) {
|
||||
return (spine_rtti)&((DrawOrderTimeline*)self)->getRTTI();
|
||||
}
|
||||
|
||||
void spine_draw_order_timeline_apply(spine_draw_order_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
void spine_draw_order_timeline_apply(spine_draw_order_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((DrawOrderTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
size_t spine_draw_order_timeline_get_frame_count(spine_draw_order_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
return _obj->getFrameCount();
|
||||
size_t spine_draw_order_timeline_get_frame_count(spine_draw_order_timeline self) {
|
||||
return ((DrawOrderTimeline*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
int32_t spine_draw_order_timeline_get_num_draw_orders(spine_draw_order_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
return (int32_t) _obj->getDrawOrders().size();
|
||||
void spine_draw_order_timeline_set_frame(spine_draw_order_timeline self, size_t frame, float time, spine_array_int drawOrder) {
|
||||
((DrawOrderTimeline*)self)->setFrame(frame, time, (Array<int> *)drawOrder);
|
||||
}
|
||||
|
||||
spine_array<int *spine_draw_order_timeline_get_draw_orders(spine_draw_order_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
return (spine_array<int *) _obj->getDrawOrders().buffer();
|
||||
size_t spine_draw_order_timeline_get_frame_entries(spine_draw_order_timeline self) {
|
||||
return ((Timeline*)(DrawOrderTimeline*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
void spine_draw_order_timeline_set_frame(spine_draw_order_timeline obj, size_t frame, float time, spine_array_int drawOrder) {
|
||||
if (!obj) return ;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
_obj->setFrame(frame, time, (Array<int> *) drawOrder);
|
||||
spine_array_float spine_draw_order_timeline_get_frames(spine_draw_order_timeline self) {
|
||||
return (spine_array_float)&((Timeline*)(DrawOrderTimeline*)self)->getFrames();
|
||||
}
|
||||
|
||||
size_t spine_draw_order_timeline_get_frame_entries(spine_draw_order_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
return _obj->getFrameEntries();
|
||||
float spine_draw_order_timeline_get_duration(spine_draw_order_timeline self) {
|
||||
return ((Timeline*)(DrawOrderTimeline*)self)->getDuration();
|
||||
}
|
||||
|
||||
int32_t spine_draw_order_timeline_get_num_frames(spine_draw_order_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
return (int32_t) _obj->getFrames().size();
|
||||
spine_array_property_id spine_draw_order_timeline_get_property_ids(spine_draw_order_timeline self) {
|
||||
return (spine_array_property_id)&((Timeline*)(DrawOrderTimeline*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
float *spine_draw_order_timeline_get_frames(spine_draw_order_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
return (float *) _obj->getFrames().buffer();
|
||||
}
|
||||
|
||||
float spine_draw_order_timeline_get_duration(spine_draw_order_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
return _obj->getDuration();
|
||||
}
|
||||
|
||||
int32_t spine_draw_order_timeline_get_num_property_ids(spine_draw_order_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
return (int32_t) _obj->getPropertyIds().size();
|
||||
}
|
||||
|
||||
int64_t *spine_draw_order_timeline_get_property_ids(spine_draw_order_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
|
||||
return (int64_t *) _obj->getPropertyIds().buffer();
|
||||
spine_rtti spine_draw_order_timeline_rtti(void) {
|
||||
return (spine_rtti)&DrawOrderTimeline::rtti;
|
||||
}
|
||||
|
||||
@ -1,58 +1,29 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_DRAW_ORDER_TIMELINE_H
|
||||
#define SPINE_SPINE_DRAW_ORDER_TIMELINE_H
|
||||
|
||||
#ifndef SPINE_C_DRAWORDERTIMELINE_H
|
||||
#define SPINE_C_DRAWORDERTIMELINE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_draw_order_timeline spine_draw_order_timeline_create(size_t frameCount);
|
||||
|
||||
SPINE_C_EXPORT spine_draw_order_timeline spine_draw_order_timeline_create(size_t frameCount);
|
||||
SPINE_C_EXPORT void spine_draw_order_timeline_dispose(spine_draw_order_timeline obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_draw_order_timeline_get_rtti();
|
||||
SPINE_C_EXPORT void spine_draw_order_timeline_apply(spine_draw_order_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT size_t spine_draw_order_timeline_get_frame_count(spine_draw_order_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_draw_order_timeline_get_num_draw_orders(spine_draw_order_timeline obj);
|
||||
SPINE_C_EXPORT spine_array<int *spine_draw_order_timeline_get_draw_orders(spine_draw_order_timeline obj);
|
||||
SPINE_C_EXPORT void spine_draw_order_timeline_set_frame(spine_draw_order_timeline obj, size_t frame, float time, spine_array_int drawOrder);
|
||||
SPINE_C_EXPORT size_t spine_draw_order_timeline_get_frame_entries(spine_draw_order_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_draw_order_timeline_get_num_frames(spine_draw_order_timeline obj);
|
||||
SPINE_C_EXPORT float *spine_draw_order_timeline_get_frames(spine_draw_order_timeline obj);
|
||||
SPINE_C_EXPORT float spine_draw_order_timeline_get_duration(spine_draw_order_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_draw_order_timeline_get_num_property_ids(spine_draw_order_timeline obj);
|
||||
SPINE_C_EXPORT int64_t *spine_draw_order_timeline_get_property_ids(spine_draw_order_timeline obj);
|
||||
SPINE_C_API void spine_draw_order_timeline_dispose(spine_draw_order_timeline self);
|
||||
|
||||
SPINE_C_API spine_rtti spine_draw_order_timeline_get_rtti(spine_draw_order_timeline self);
|
||||
SPINE_C_API void spine_draw_order_timeline_apply(spine_draw_order_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API size_t spine_draw_order_timeline_get_frame_count(spine_draw_order_timeline self);
|
||||
SPINE_C_API void spine_draw_order_timeline_set_frame(spine_draw_order_timeline self, size_t frame, float time, spine_array_int drawOrder);
|
||||
SPINE_C_API size_t spine_draw_order_timeline_get_frame_entries(spine_draw_order_timeline self);
|
||||
SPINE_C_API spine_array_float spine_draw_order_timeline_get_frames(spine_draw_order_timeline self);
|
||||
SPINE_C_API float spine_draw_order_timeline_get_duration(spine_draw_order_timeline self);
|
||||
SPINE_C_API spine_array_property_id spine_draw_order_timeline_get_property_ids(spine_draw_order_timeline self);
|
||||
SPINE_C_API spine_rtti spine_draw_order_timeline_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_DRAWORDERTIMELINE_H
|
||||
#endif /* SPINE_SPINE_DRAW_ORDER_TIMELINE_H */
|
||||
@ -1,115 +1,60 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "event.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_event spine_event_create(float time, spine_event_data data) {
|
||||
Event *obj = new (__FILE__, __LINE__) Event(time, *(EventData*) data);
|
||||
return (spine_event) obj;
|
||||
return (spine_event) new (__FILE__, __LINE__) Event(time, *((const EventData*)data));
|
||||
}
|
||||
|
||||
void spine_event_dispose(spine_event obj) {
|
||||
if (!obj) return;
|
||||
delete (Event *) obj;
|
||||
void spine_event_dispose(spine_event self) {
|
||||
delete (Event*)self;
|
||||
}
|
||||
|
||||
spine_event_data spine_event_get_data(spine_event obj) {
|
||||
if (!obj) return (spine_event_data) 0;
|
||||
Event *_obj = (Event *) obj;
|
||||
return (spine_event_data) &_obj->getData();
|
||||
spine_event_data spine_event_get_data(spine_event self) {
|
||||
return (spine_event_data)&((Event*)self)->getData();
|
||||
}
|
||||
|
||||
float spine_event_get_time(spine_event obj) {
|
||||
if (!obj) return 0;
|
||||
Event *_obj = (Event *) obj;
|
||||
return _obj->getTime();
|
||||
float spine_event_get_time(spine_event self) {
|
||||
return ((Event*)self)->getTime();
|
||||
}
|
||||
|
||||
int spine_event_get_int(spine_event obj) {
|
||||
if (!obj) return 0;
|
||||
Event *_obj = (Event *) obj;
|
||||
return _obj->getInt();
|
||||
int spine_event_get_int(spine_event self) {
|
||||
return ((Event*)self)->getInt();
|
||||
}
|
||||
|
||||
void spine_event_set_int(spine_event obj, int value) {
|
||||
if (!obj) return;
|
||||
Event *_obj = (Event *) obj;
|
||||
_obj->setInt(value);
|
||||
void spine_event_set_int(spine_event self, int inValue) {
|
||||
((Event*)self)->setInt(inValue);
|
||||
}
|
||||
|
||||
float spine_event_get_float(spine_event obj) {
|
||||
if (!obj) return 0;
|
||||
Event *_obj = (Event *) obj;
|
||||
return _obj->getFloat();
|
||||
float spine_event_get_float(spine_event self) {
|
||||
return ((Event*)self)->getFloat();
|
||||
}
|
||||
|
||||
void spine_event_set_float(spine_event obj, float value) {
|
||||
if (!obj) return;
|
||||
Event *_obj = (Event *) obj;
|
||||
_obj->setFloat(value);
|
||||
void spine_event_set_float(spine_event self, float inValue) {
|
||||
((Event*)self)->setFloat(inValue);
|
||||
}
|
||||
|
||||
const char* spine_event_get_string(spine_event obj) {
|
||||
if (!obj) return nullptr;
|
||||
Event *_obj = (Event *) obj;
|
||||
return (const char *) _obj->getString().buffer();
|
||||
const char* spine_event_get_string(spine_event self) {
|
||||
return (const char*)&((Event*)self)->getString();
|
||||
}
|
||||
|
||||
void spine_event_set_string(spine_event obj, const char* value) {
|
||||
if (!obj) return;
|
||||
Event *_obj = (Event *) obj;
|
||||
_obj->setString(String(value));
|
||||
void spine_event_set_string(spine_event self, const char* inValue) {
|
||||
((Event*)self)->setString(*((const String*)inValue));
|
||||
}
|
||||
|
||||
float spine_event_get_volume(spine_event obj) {
|
||||
if (!obj) return 0;
|
||||
Event *_obj = (Event *) obj;
|
||||
return _obj->getVolume();
|
||||
float spine_event_get_volume(spine_event self) {
|
||||
return ((Event*)self)->getVolume();
|
||||
}
|
||||
|
||||
void spine_event_set_volume(spine_event obj, float value) {
|
||||
if (!obj) return;
|
||||
Event *_obj = (Event *) obj;
|
||||
_obj->setVolume(value);
|
||||
void spine_event_set_volume(spine_event self, float inValue) {
|
||||
((Event*)self)->setVolume(inValue);
|
||||
}
|
||||
|
||||
float spine_event_get_balance(spine_event obj) {
|
||||
if (!obj) return 0;
|
||||
Event *_obj = (Event *) obj;
|
||||
return _obj->getBalance();
|
||||
float spine_event_get_balance(spine_event self) {
|
||||
return ((Event*)self)->getBalance();
|
||||
}
|
||||
|
||||
void spine_event_set_balance(spine_event obj, float value) {
|
||||
if (!obj) return;
|
||||
Event *_obj = (Event *) obj;
|
||||
_obj->setBalance(value);
|
||||
void spine_event_set_balance(spine_event self, float inValue) {
|
||||
((Event*)self)->setBalance(inValue);
|
||||
}
|
||||
|
||||
@ -1,58 +1,32 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_EVENT_H
|
||||
#define SPINE_SPINE_EVENT_H
|
||||
|
||||
#ifndef SPINE_C_EVENT_H
|
||||
#define SPINE_C_EVENT_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_event spine_event_create(float time, spine_event_data data);
|
||||
|
||||
SPINE_C_EXPORT spine_event spine_event_create(float time, spine_event_data data);
|
||||
SPINE_C_EXPORT void spine_event_dispose(spine_event obj);
|
||||
SPINE_C_EXPORT spine_event_data spine_event_get_data(spine_event obj);
|
||||
SPINE_C_EXPORT float spine_event_get_time(spine_event obj);
|
||||
SPINE_C_EXPORT int spine_event_get_int(spine_event obj);
|
||||
SPINE_C_EXPORT void spine_event_set_int(spine_event obj, int value);
|
||||
SPINE_C_EXPORT float spine_event_get_float(spine_event obj);
|
||||
SPINE_C_EXPORT void spine_event_set_float(spine_event obj, float value);
|
||||
SPINE_C_EXPORT const char* spine_event_get_string(spine_event obj);
|
||||
SPINE_C_EXPORT void spine_event_set_string(spine_event obj, const char* value);
|
||||
SPINE_C_EXPORT float spine_event_get_volume(spine_event obj);
|
||||
SPINE_C_EXPORT void spine_event_set_volume(spine_event obj, float value);
|
||||
SPINE_C_EXPORT float spine_event_get_balance(spine_event obj);
|
||||
SPINE_C_EXPORT void spine_event_set_balance(spine_event obj, float value);
|
||||
SPINE_C_API void spine_event_dispose(spine_event self);
|
||||
|
||||
SPINE_C_API spine_event_data spine_event_get_data(spine_event self);
|
||||
SPINE_C_API float spine_event_get_time(spine_event self);
|
||||
SPINE_C_API int spine_event_get_int(spine_event self);
|
||||
SPINE_C_API void spine_event_set_int(spine_event self, int inValue);
|
||||
SPINE_C_API float spine_event_get_float(spine_event self);
|
||||
SPINE_C_API void spine_event_set_float(spine_event self, float inValue);
|
||||
SPINE_C_API const char* spine_event_get_string(spine_event self);
|
||||
SPINE_C_API void spine_event_set_string(spine_event self, const char* inValue);
|
||||
SPINE_C_API float spine_event_get_volume(spine_event self);
|
||||
SPINE_C_API void spine_event_set_volume(spine_event self, float inValue);
|
||||
SPINE_C_API float spine_event_get_balance(spine_event self);
|
||||
SPINE_C_API void spine_event_set_balance(spine_event self, float inValue);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_EVENT_H
|
||||
#endif /* SPINE_SPINE_EVENT_H */
|
||||
@ -1,121 +1,64 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "event_data.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_event_data spine_event_data_create(const char* name) {
|
||||
EventData *obj = new (__FILE__, __LINE__) EventData(String(name));
|
||||
return (spine_event_data) obj;
|
||||
return (spine_event_data) new (__FILE__, __LINE__) EventData(*((const String*)name));
|
||||
}
|
||||
|
||||
void spine_event_data_dispose(spine_event_data obj) {
|
||||
if (!obj) return;
|
||||
delete (EventData *) obj;
|
||||
void spine_event_data_dispose(spine_event_data self) {
|
||||
delete (EventData*)self;
|
||||
}
|
||||
|
||||
const char* spine_event_data_get_name(spine_event_data obj) {
|
||||
if (!obj) return nullptr;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
return (const char *) _obj->getName().buffer();
|
||||
const char* spine_event_data_get_name(spine_event_data self) {
|
||||
return (const char*)&((EventData*)self)->getName();
|
||||
}
|
||||
|
||||
int spine_event_data_get_int_value(spine_event_data obj) {
|
||||
if (!obj) return 0;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
return _obj->getIntValue();
|
||||
int spine_event_data_get_int_value(spine_event_data self) {
|
||||
return ((EventData*)self)->getIntValue();
|
||||
}
|
||||
|
||||
void spine_event_data_set_int_value(spine_event_data obj, int value) {
|
||||
if (!obj) return;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
_obj->setIntValue(value);
|
||||
void spine_event_data_set_int_value(spine_event_data self, int inValue) {
|
||||
((EventData*)self)->setIntValue(inValue);
|
||||
}
|
||||
|
||||
float spine_event_data_get_float_value(spine_event_data obj) {
|
||||
if (!obj) return 0;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
return _obj->getFloatValue();
|
||||
float spine_event_data_get_float_value(spine_event_data self) {
|
||||
return ((EventData*)self)->getFloatValue();
|
||||
}
|
||||
|
||||
void spine_event_data_set_float_value(spine_event_data obj, float value) {
|
||||
if (!obj) return;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
_obj->setFloatValue(value);
|
||||
void spine_event_data_set_float_value(spine_event_data self, float inValue) {
|
||||
((EventData*)self)->setFloatValue(inValue);
|
||||
}
|
||||
|
||||
const char* spine_event_data_get_string_value(spine_event_data obj) {
|
||||
if (!obj) return nullptr;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
return (const char *) _obj->getStringValue().buffer();
|
||||
const char* spine_event_data_get_string_value(spine_event_data self) {
|
||||
return (const char*)&((EventData*)self)->getStringValue();
|
||||
}
|
||||
|
||||
void spine_event_data_set_string_value(spine_event_data obj, const char* value) {
|
||||
if (!obj) return;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
_obj->setStringValue(String(value));
|
||||
void spine_event_data_set_string_value(spine_event_data self, const char* inValue) {
|
||||
((EventData*)self)->setStringValue(*((const String*)inValue));
|
||||
}
|
||||
|
||||
const char* spine_event_data_get_audio_path(spine_event_data obj) {
|
||||
if (!obj) return nullptr;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
return (const char *) _obj->getAudioPath().buffer();
|
||||
const char* spine_event_data_get_audio_path(spine_event_data self) {
|
||||
return (const char*)&((EventData*)self)->getAudioPath();
|
||||
}
|
||||
|
||||
void spine_event_data_set_audio_path(spine_event_data obj, const char* value) {
|
||||
if (!obj) return;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
_obj->setAudioPath(String(value));
|
||||
void spine_event_data_set_audio_path(spine_event_data self, const char* inValue) {
|
||||
((EventData*)self)->setAudioPath(*((const String*)inValue));
|
||||
}
|
||||
|
||||
float spine_event_data_get_volume(spine_event_data obj) {
|
||||
if (!obj) return 0;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
return _obj->getVolume();
|
||||
float spine_event_data_get_volume(spine_event_data self) {
|
||||
return ((EventData*)self)->getVolume();
|
||||
}
|
||||
|
||||
void spine_event_data_set_volume(spine_event_data obj, float value) {
|
||||
if (!obj) return;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
_obj->setVolume(value);
|
||||
void spine_event_data_set_volume(spine_event_data self, float inValue) {
|
||||
((EventData*)self)->setVolume(inValue);
|
||||
}
|
||||
|
||||
float spine_event_data_get_balance(spine_event_data obj) {
|
||||
if (!obj) return 0;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
return _obj->getBalance();
|
||||
float spine_event_data_get_balance(spine_event_data self) {
|
||||
return ((EventData*)self)->getBalance();
|
||||
}
|
||||
|
||||
void spine_event_data_set_balance(spine_event_data obj, float value) {
|
||||
if (!obj) return;
|
||||
EventData *_obj = (EventData *) obj;
|
||||
_obj->setBalance(value);
|
||||
void spine_event_data_set_balance(spine_event_data self, float inValue) {
|
||||
((EventData*)self)->setBalance(inValue);
|
||||
}
|
||||
|
||||
@ -1,59 +1,33 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_EVENT_DATA_H
|
||||
#define SPINE_SPINE_EVENT_DATA_H
|
||||
|
||||
#ifndef SPINE_C_EVENTDATA_H
|
||||
#define SPINE_C_EVENTDATA_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_event_data spine_event_data_create(const char* name);
|
||||
|
||||
SPINE_C_EXPORT spine_event_data spine_event_data_create(const char* name);
|
||||
SPINE_C_EXPORT void spine_event_data_dispose(spine_event_data obj);
|
||||
SPINE_C_EXPORT const char* spine_event_data_get_name(spine_event_data obj);
|
||||
SPINE_C_EXPORT int spine_event_data_get_int_value(spine_event_data obj);
|
||||
SPINE_C_EXPORT void spine_event_data_set_int_value(spine_event_data obj, int value);
|
||||
SPINE_C_EXPORT float spine_event_data_get_float_value(spine_event_data obj);
|
||||
SPINE_C_EXPORT void spine_event_data_set_float_value(spine_event_data obj, float value);
|
||||
SPINE_C_EXPORT const char* spine_event_data_get_string_value(spine_event_data obj);
|
||||
SPINE_C_EXPORT void spine_event_data_set_string_value(spine_event_data obj, const char* value);
|
||||
SPINE_C_EXPORT const char* spine_event_data_get_audio_path(spine_event_data obj);
|
||||
SPINE_C_EXPORT void spine_event_data_set_audio_path(spine_event_data obj, const char* value);
|
||||
SPINE_C_EXPORT float spine_event_data_get_volume(spine_event_data obj);
|
||||
SPINE_C_EXPORT void spine_event_data_set_volume(spine_event_data obj, float value);
|
||||
SPINE_C_EXPORT float spine_event_data_get_balance(spine_event_data obj);
|
||||
SPINE_C_EXPORT void spine_event_data_set_balance(spine_event_data obj, float value);
|
||||
SPINE_C_API void spine_event_data_dispose(spine_event_data self);
|
||||
|
||||
SPINE_C_API const char* spine_event_data_get_name(spine_event_data self);
|
||||
SPINE_C_API int spine_event_data_get_int_value(spine_event_data self);
|
||||
SPINE_C_API void spine_event_data_set_int_value(spine_event_data self, int inValue);
|
||||
SPINE_C_API float spine_event_data_get_float_value(spine_event_data self);
|
||||
SPINE_C_API void spine_event_data_set_float_value(spine_event_data self, float inValue);
|
||||
SPINE_C_API const char* spine_event_data_get_string_value(spine_event_data self);
|
||||
SPINE_C_API void spine_event_data_set_string_value(spine_event_data self, const char* inValue);
|
||||
SPINE_C_API const char* spine_event_data_get_audio_path(spine_event_data self);
|
||||
SPINE_C_API void spine_event_data_set_audio_path(spine_event_data self, const char* inValue);
|
||||
SPINE_C_API float spine_event_data_get_volume(spine_event_data self);
|
||||
SPINE_C_API void spine_event_data_set_volume(spine_event_data self, float inValue);
|
||||
SPINE_C_API float spine_event_data_get_balance(spine_event_data self);
|
||||
SPINE_C_API void spine_event_data_set_balance(spine_event_data self, float inValue);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_EVENTDATA_H
|
||||
#endif /* SPINE_SPINE_EVENT_DATA_H */
|
||||
@ -1,43 +1,36 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "event_queue_entry.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_event_queue_entry spine_event_queue_entry_create(spine_event_type eventType, spine_track_entry trackEntry, spine_event event) {
|
||||
EventQueueEntry *obj = new (__FILE__, __LINE__) EventQueueEntry(eventType, (TrackEntry *) trackEntry, (Event *) event);
|
||||
return (spine_event_queue_entry) obj;
|
||||
return (spine_event_queue_entry) new (__FILE__, __LINE__) EventQueueEntry((EventType)eventType, (TrackEntry *)trackEntry, (Event *)event);
|
||||
}
|
||||
|
||||
void spine_event_queue_entry_dispose(spine_event_queue_entry obj) {
|
||||
if (!obj) return;
|
||||
delete (EventQueueEntry *) obj;
|
||||
void spine_event_queue_entry_dispose(spine_event_queue_entry self) {
|
||||
delete (EventQueueEntry*)self;
|
||||
}
|
||||
|
||||
spine_event_type spine_event_queue_entry_get__type(spine_event_queue_entry self) {
|
||||
return (spine_event_type)((EventQueueEntry*)self)->_type;
|
||||
}
|
||||
|
||||
void spine_event_queue_entry_set__type(spine_event_queue_entry self, spine_event_type value) {
|
||||
((EventQueueEntry*)self)->_type = (EventType)value;
|
||||
}
|
||||
|
||||
spine_track_entry spine_event_queue_entry_get__entry(spine_event_queue_entry self) {
|
||||
return (spine_track_entry)((EventQueueEntry*)self)->_entry;
|
||||
}
|
||||
|
||||
void spine_event_queue_entry_set__entry(spine_event_queue_entry self, spine_track_entry value) {
|
||||
((EventQueueEntry*)self)->_entry = (TrackEntry*)value;
|
||||
}
|
||||
|
||||
spine_event spine_event_queue_entry_get__event(spine_event_queue_entry self) {
|
||||
return (spine_event)((EventQueueEntry*)self)->_event;
|
||||
}
|
||||
|
||||
void spine_event_queue_entry_set__event(spine_event_queue_entry self, spine_event value) {
|
||||
((EventQueueEntry*)self)->_event = (Event*)value;
|
||||
}
|
||||
|
||||
@ -1,46 +1,26 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_EVENT_QUEUE_ENTRY_H
|
||||
#define SPINE_SPINE_EVENT_QUEUE_ENTRY_H
|
||||
|
||||
#ifndef SPINE_C_EVENTQUEUEENTRY_H
|
||||
#define SPINE_C_EVENTQUEUEENTRY_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_event_queue_entry spine_event_queue_entry_create(spine_event_type eventType, spine_track_entry trackEntry, spine_event event);
|
||||
|
||||
SPINE_C_EXPORT spine_event_queue_entry spine_event_queue_entry_create(spine_event_type eventType, spine_track_entry trackEntry, spine_event event);
|
||||
SPINE_C_EXPORT void spine_event_queue_entry_dispose(spine_event_queue_entry obj);
|
||||
SPINE_C_API void spine_event_queue_entry_dispose(spine_event_queue_entry self);
|
||||
|
||||
SPINE_C_API spine_event_type spine_event_queue_entry_get__type(spine_event_queue_entry self);
|
||||
SPINE_C_API void spine_event_queue_entry_set__type(spine_event_queue_entry self, spine_event_type value);
|
||||
SPINE_C_API spine_track_entry spine_event_queue_entry_get__entry(spine_event_queue_entry self);
|
||||
SPINE_C_API void spine_event_queue_entry_set__entry(spine_event_queue_entry self, spine_track_entry value);
|
||||
SPINE_C_API spine_event spine_event_queue_entry_get__event(spine_event_queue_entry self);
|
||||
SPINE_C_API void spine_event_queue_entry_set__event(spine_event_queue_entry self, spine_event value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_EVENTQUEUEENTRY_H
|
||||
#endif /* SPINE_SPINE_EVENT_QUEUE_ENTRY_H */
|
||||
@ -1,113 +1,52 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "event_timeline.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_event_timeline spine_event_timeline_create(size_t frameCount) {
|
||||
EventTimeline *obj = new (__FILE__, __LINE__) EventTimeline(frameCount);
|
||||
return (spine_event_timeline) obj;
|
||||
return (spine_event_timeline) new (__FILE__, __LINE__) EventTimeline(frameCount);
|
||||
}
|
||||
|
||||
void spine_event_timeline_dispose(spine_event_timeline obj) {
|
||||
if (!obj) return;
|
||||
delete (EventTimeline *) obj;
|
||||
void spine_event_timeline_dispose(spine_event_timeline self) {
|
||||
delete (EventTimeline*)self;
|
||||
}
|
||||
|
||||
spine_rtti spine_event_timeline_get_rtti() {
|
||||
return (spine_rtti) &EventTimeline::rtti;
|
||||
spine_rtti spine_event_timeline_get_rtti(spine_event_timeline self) {
|
||||
return (spine_rtti)&((EventTimeline*)self)->getRTTI();
|
||||
}
|
||||
|
||||
void spine_event_timeline_apply(spine_event_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
if (!obj) return ;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
_obj->apply(*(Skeleton*) skeleton, lastTime, time, (Array<Event *> *) pEvents, alpha, (MixBlend) blend, (MixDirection) direction, appliedPose);
|
||||
void spine_event_timeline_apply(spine_event_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose) {
|
||||
((EventTimeline*)self)->apply(*((Skeleton*)skeleton), lastTime, time, (Array<Event *> *)pEvents, alpha, (MixBlend)blend, (MixDirection)direction, appliedPose);
|
||||
}
|
||||
|
||||
size_t spine_event_timeline_get_frame_count(spine_event_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
return _obj->getFrameCount();
|
||||
size_t spine_event_timeline_get_frame_count(spine_event_timeline self) {
|
||||
return ((EventTimeline*)self)->getFrameCount();
|
||||
}
|
||||
|
||||
int32_t spine_event_timeline_get_num_events(spine_event_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
return (int32_t) _obj->getEvents().size();
|
||||
spine_array_event spine_event_timeline_get_events(spine_event_timeline self) {
|
||||
return (spine_array_event)&((EventTimeline*)self)->getEvents();
|
||||
}
|
||||
|
||||
spine_event *spine_event_timeline_get_events(spine_event_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
return (spine_event *) _obj->getEvents().buffer();
|
||||
void spine_event_timeline_set_frame(spine_event_timeline self, size_t frame, spine_event event) {
|
||||
((EventTimeline*)self)->setFrame(frame, (Event *)event);
|
||||
}
|
||||
|
||||
void spine_event_timeline_set_frame(spine_event_timeline obj, size_t frame, spine_event event) {
|
||||
if (!obj) return ;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
_obj->setFrame(frame, (Event *) event);
|
||||
size_t spine_event_timeline_get_frame_entries(spine_event_timeline self) {
|
||||
return ((Timeline*)(EventTimeline*)self)->getFrameEntries();
|
||||
}
|
||||
|
||||
size_t spine_event_timeline_get_frame_entries(spine_event_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
return _obj->getFrameEntries();
|
||||
spine_array_float spine_event_timeline_get_frames(spine_event_timeline self) {
|
||||
return (spine_array_float)&((Timeline*)(EventTimeline*)self)->getFrames();
|
||||
}
|
||||
|
||||
int32_t spine_event_timeline_get_num_frames(spine_event_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
return (int32_t) _obj->getFrames().size();
|
||||
float spine_event_timeline_get_duration(spine_event_timeline self) {
|
||||
return ((Timeline*)(EventTimeline*)self)->getDuration();
|
||||
}
|
||||
|
||||
float *spine_event_timeline_get_frames(spine_event_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
return (float *) _obj->getFrames().buffer();
|
||||
spine_array_property_id spine_event_timeline_get_property_ids(spine_event_timeline self) {
|
||||
return (spine_array_property_id)&((Timeline*)(EventTimeline*)self)->getPropertyIds();
|
||||
}
|
||||
|
||||
float spine_event_timeline_get_duration(spine_event_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
return _obj->getDuration();
|
||||
}
|
||||
|
||||
int32_t spine_event_timeline_get_num_property_ids(spine_event_timeline obj) {
|
||||
if (!obj) return 0;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
return (int32_t) _obj->getPropertyIds().size();
|
||||
}
|
||||
|
||||
int64_t *spine_event_timeline_get_property_ids(spine_event_timeline obj) {
|
||||
if (!obj) return nullptr;
|
||||
EventTimeline *_obj = (EventTimeline *) obj;
|
||||
return (int64_t *) _obj->getPropertyIds().buffer();
|
||||
spine_rtti spine_event_timeline_rtti(void) {
|
||||
return (spine_rtti)&EventTimeline::rtti;
|
||||
}
|
||||
|
||||
@ -1,58 +1,30 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_EVENT_TIMELINE_H
|
||||
#define SPINE_SPINE_EVENT_TIMELINE_H
|
||||
|
||||
#ifndef SPINE_C_EVENTTIMELINE_H
|
||||
#define SPINE_C_EVENTTIMELINE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_event_timeline spine_event_timeline_create(size_t frameCount);
|
||||
|
||||
SPINE_C_EXPORT spine_event_timeline spine_event_timeline_create(size_t frameCount);
|
||||
SPINE_C_EXPORT void spine_event_timeline_dispose(spine_event_timeline obj);
|
||||
SPINE_C_EXPORT spine_rtti spine_event_timeline_get_rtti();
|
||||
SPINE_C_EXPORT void spine_event_timeline_apply(spine_event_timeline obj, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_EXPORT size_t spine_event_timeline_get_frame_count(spine_event_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_event_timeline_get_num_events(spine_event_timeline obj);
|
||||
SPINE_C_EXPORT spine_event *spine_event_timeline_get_events(spine_event_timeline obj);
|
||||
SPINE_C_EXPORT void spine_event_timeline_set_frame(spine_event_timeline obj, size_t frame, spine_event event);
|
||||
SPINE_C_EXPORT size_t spine_event_timeline_get_frame_entries(spine_event_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_event_timeline_get_num_frames(spine_event_timeline obj);
|
||||
SPINE_C_EXPORT float *spine_event_timeline_get_frames(spine_event_timeline obj);
|
||||
SPINE_C_EXPORT float spine_event_timeline_get_duration(spine_event_timeline obj);
|
||||
SPINE_C_EXPORT int32_t spine_event_timeline_get_num_property_ids(spine_event_timeline obj);
|
||||
SPINE_C_EXPORT int64_t *spine_event_timeline_get_property_ids(spine_event_timeline obj);
|
||||
SPINE_C_API void spine_event_timeline_dispose(spine_event_timeline self);
|
||||
|
||||
SPINE_C_API spine_rtti spine_event_timeline_get_rtti(spine_event_timeline self);
|
||||
SPINE_C_API void spine_event_timeline_apply(spine_event_timeline self, spine_skeleton skeleton, float lastTime, float time, spine_array_event pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, bool appliedPose);
|
||||
SPINE_C_API size_t spine_event_timeline_get_frame_count(spine_event_timeline self);
|
||||
SPINE_C_API spine_array_event spine_event_timeline_get_events(spine_event_timeline self);
|
||||
SPINE_C_API void spine_event_timeline_set_frame(spine_event_timeline self, size_t frame, spine_event event);
|
||||
SPINE_C_API size_t spine_event_timeline_get_frame_entries(spine_event_timeline self);
|
||||
SPINE_C_API spine_array_float spine_event_timeline_get_frames(spine_event_timeline self);
|
||||
SPINE_C_API float spine_event_timeline_get_duration(spine_event_timeline self);
|
||||
SPINE_C_API spine_array_property_id spine_event_timeline_get_property_ids(spine_event_timeline self);
|
||||
SPINE_C_API spine_rtti spine_event_timeline_rtti(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_EVENTTIMELINE_H
|
||||
#endif /* SPINE_SPINE_EVENT_TIMELINE_H */
|
||||
@ -1,36 +1,5 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SPINE_C_EVENTTYPE_H
|
||||
#define SPINE_C_EVENTTYPE_H
|
||||
|
||||
#include "../base.h"
|
||||
#ifndef SPINE_SPINE_EVENT_TYPE_H
|
||||
#define SPINE_SPINE_EVENT_TYPE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -49,4 +18,4 @@ typedef enum spine_event_type {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_EVENTTYPE_H
|
||||
#endif /* SPINE_SPINE_EVENT_TYPE_H */
|
||||
@ -1,36 +1,5 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SPINE_C_FORMAT_H
|
||||
#define SPINE_C_FORMAT_H
|
||||
|
||||
#include "../base.h"
|
||||
#ifndef SPINE_SPINE_FORMAT_H
|
||||
#define SPINE_SPINE_FORMAT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -50,4 +19,4 @@ typedef enum spine_format {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_FORMAT_H
|
||||
#endif /* SPINE_SPINE_FORMAT_H */
|
||||
@ -1,44 +1,28 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "from_property.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_from_property_dispose(spine_from_property obj) {
|
||||
if (!obj) return;
|
||||
delete (FromProperty *) obj;
|
||||
void spine_from_property_dispose(spine_from_property self) {
|
||||
delete (FromProperty*)self;
|
||||
}
|
||||
|
||||
float spine_from_property_value(spine_from_property obj, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) {
|
||||
if (!obj) return 0;
|
||||
FromProperty *_obj = (FromProperty *) obj;
|
||||
return _obj->value(*(Skeleton*) skeleton, *(BonePose*) source, local, (float *) offsets);
|
||||
float spine_from_property_value(spine_from_property self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) {
|
||||
return ((FromProperty*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets);
|
||||
}
|
||||
|
||||
float spine_from_property_get__offset(spine_from_property self) {
|
||||
return ((FromProperty*)self)->_offset;
|
||||
}
|
||||
|
||||
void spine_from_property_set__offset(spine_from_property self, float value) {
|
||||
((FromProperty*)self)->_offset = value;
|
||||
}
|
||||
|
||||
spine_array_to_property spine_from_property_get__to(spine_from_property self) {
|
||||
return (spine_array_to_property)&((FromProperty*)self)->_to;
|
||||
}
|
||||
|
||||
void spine_from_property_set__to(spine_from_property self, spine_array_to_property value) {
|
||||
((FromProperty*)self)->_to = *((Array<ToProperty *>*)value);
|
||||
}
|
||||
|
||||
@ -1,46 +1,23 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_FROM_PROPERTY_H
|
||||
#define SPINE_SPINE_FROM_PROPERTY_H
|
||||
|
||||
#ifndef SPINE_C_FROMPROPERTY_H
|
||||
#define SPINE_C_FROMPROPERTY_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API void spine_from_property_dispose(spine_from_property self);
|
||||
|
||||
SPINE_C_EXPORT void spine_from_property_dispose(spine_from_property obj);
|
||||
SPINE_C_EXPORT float spine_from_property_value(spine_from_property obj, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets);
|
||||
SPINE_C_API float spine_from_property_value(spine_from_property self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets);
|
||||
SPINE_C_API float spine_from_property_get__offset(spine_from_property self);
|
||||
SPINE_C_API void spine_from_property_set__offset(spine_from_property self, float value);
|
||||
SPINE_C_API spine_array_to_property spine_from_property_get__to(spine_from_property self);
|
||||
SPINE_C_API void spine_from_property_set__to(spine_from_property self, spine_array_to_property value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_FROMPROPERTY_H
|
||||
#endif /* SPINE_SPINE_FROM_PROPERTY_H */
|
||||
@ -1,44 +1,16 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "from_rotate.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_from_rotate_dispose(spine_from_rotate obj) {
|
||||
if (!obj) return;
|
||||
delete (FromRotate *) obj;
|
||||
spine_from_rotate spine_from_rotate_create(void) {
|
||||
return (spine_from_rotate) new (__FILE__, __LINE__) FromRotate();
|
||||
}
|
||||
|
||||
float spine_from_rotate_value(spine_from_rotate obj, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) {
|
||||
if (!obj) return 0;
|
||||
FromRotate *_obj = (FromRotate *) obj;
|
||||
return _obj->value(*(Skeleton*) skeleton, *(BonePose*) source, local, (float *) offsets);
|
||||
void spine_from_rotate_dispose(spine_from_rotate self) {
|
||||
delete (FromRotate*)self;
|
||||
}
|
||||
|
||||
float spine_from_rotate_value(spine_from_rotate self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) {
|
||||
return ((FromRotate*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets);
|
||||
}
|
||||
|
||||
@ -1,46 +1,21 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_FROM_ROTATE_H
|
||||
#define SPINE_SPINE_FROM_ROTATE_H
|
||||
|
||||
#ifndef SPINE_C_FROMROTATE_H
|
||||
#define SPINE_C_FROMROTATE_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_from_rotate spine_from_rotate_create(void);
|
||||
|
||||
SPINE_C_EXPORT void spine_from_rotate_dispose(spine_from_rotate obj);
|
||||
SPINE_C_EXPORT float spine_from_rotate_value(spine_from_rotate obj, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets);
|
||||
SPINE_C_API void spine_from_rotate_dispose(spine_from_rotate self);
|
||||
|
||||
SPINE_C_API float spine_from_rotate_value(spine_from_rotate self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_FROMROTATE_H
|
||||
#endif /* SPINE_SPINE_FROM_ROTATE_H */
|
||||
@ -1,44 +1,16 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "from_scale_x.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_from_scale_x_dispose(spine_from_scale_x obj) {
|
||||
if (!obj) return;
|
||||
delete (FromScaleX *) obj;
|
||||
spine_from_scale_x spine_from_scale_x_create(void) {
|
||||
return (spine_from_scale_x) new (__FILE__, __LINE__) FromScaleX();
|
||||
}
|
||||
|
||||
float spine_from_scale_x_value(spine_from_scale_x obj, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) {
|
||||
if (!obj) return 0;
|
||||
FromScaleX *_obj = (FromScaleX *) obj;
|
||||
return _obj->value(*(Skeleton*) skeleton, *(BonePose*) source, local, (float *) offsets);
|
||||
void spine_from_scale_x_dispose(spine_from_scale_x self) {
|
||||
delete (FromScaleX*)self;
|
||||
}
|
||||
|
||||
float spine_from_scale_x_value(spine_from_scale_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) {
|
||||
return ((FromScaleX*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets);
|
||||
}
|
||||
|
||||
@ -1,46 +1,21 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_FROM_SCALE_X_H
|
||||
#define SPINE_SPINE_FROM_SCALE_X_H
|
||||
|
||||
#ifndef SPINE_C_FROMSCALEX_H
|
||||
#define SPINE_C_FROMSCALEX_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_from_scale_x spine_from_scale_x_create(void);
|
||||
|
||||
SPINE_C_EXPORT void spine_from_scale_x_dispose(spine_from_scale_x obj);
|
||||
SPINE_C_EXPORT float spine_from_scale_x_value(spine_from_scale_x obj, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets);
|
||||
SPINE_C_API void spine_from_scale_x_dispose(spine_from_scale_x self);
|
||||
|
||||
SPINE_C_API float spine_from_scale_x_value(spine_from_scale_x self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_FROMSCALEX_H
|
||||
#endif /* SPINE_SPINE_FROM_SCALE_X_H */
|
||||
@ -1,44 +1,16 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "from_scale_y.h"
|
||||
#include <spine/spine.h>
|
||||
|
||||
using namespace spine;
|
||||
|
||||
void spine_from_scale_y_dispose(spine_from_scale_y obj) {
|
||||
if (!obj) return;
|
||||
delete (FromScaleY *) obj;
|
||||
spine_from_scale_y spine_from_scale_y_create(void) {
|
||||
return (spine_from_scale_y) new (__FILE__, __LINE__) FromScaleY();
|
||||
}
|
||||
|
||||
float spine_from_scale_y_value(spine_from_scale_y obj, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) {
|
||||
if (!obj) return 0;
|
||||
FromScaleY *_obj = (FromScaleY *) obj;
|
||||
return _obj->value(*(Skeleton*) skeleton, *(BonePose*) source, local, (float *) offsets);
|
||||
void spine_from_scale_y_dispose(spine_from_scale_y self) {
|
||||
delete (FromScaleY*)self;
|
||||
}
|
||||
|
||||
float spine_from_scale_y_value(spine_from_scale_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets) {
|
||||
return ((FromScaleY*)self)->value(*((Skeleton*)skeleton), *((BonePose*)source), local, offsets);
|
||||
}
|
||||
|
||||
@ -1,46 +1,21 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated April 5, 2025. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
#ifndef SPINE_SPINE_FROM_SCALE_Y_H
|
||||
#define SPINE_SPINE_FROM_SCALE_Y_H
|
||||
|
||||
#ifndef SPINE_C_FROMSCALEY_H
|
||||
#define SPINE_C_FROMSCALEY_H
|
||||
#include "../base.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
SPINE_C_API spine_from_scale_y spine_from_scale_y_create(void);
|
||||
|
||||
SPINE_C_EXPORT void spine_from_scale_y_dispose(spine_from_scale_y obj);
|
||||
SPINE_C_EXPORT float spine_from_scale_y_value(spine_from_scale_y obj, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets);
|
||||
SPINE_C_API void spine_from_scale_y_dispose(spine_from_scale_y self);
|
||||
|
||||
SPINE_C_API float spine_from_scale_y_value(spine_from_scale_y self, spine_skeleton skeleton, spine_bone_pose source, bool local, float * offsets);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SPINE_C_FROMSCALEY_H
|
||||
#endif /* SPINE_SPINE_FROM_SCALE_Y_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user