[cpp] First pass of C wrapper generator and generated sources, WIP

This commit is contained in:
Mario Zechner 2025-07-08 14:34:10 +02:00
parent 46410f4b8a
commit c75fd64189
309 changed files with 27560 additions and 5 deletions

View File

@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 3.10)
project(spine-c-new C CXX)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 11)
# Include spine-cpp
add_subdirectory(../spine-cpp ${CMAKE_CURRENT_BINARY_DIR}/spine-cpp)
# Collect all source files
file(GLOB SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
)
file(GLOB GENERATED_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/src/generated/*.cpp"
)
list(APPEND SOURCES ${GENERATED_SOURCES})
# Create the library
add_library(spine-c-new STATIC ${SOURCES})
# Include directories
target_include_directories(spine-c-new PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Link with spine-cpp
target_link_libraries(spine-c-new PRIVATE spine-cpp)
# Add spine-cpp include directories
target_include_directories(spine-c-new PRIVATE
../spine-cpp/spine-cpp/include
)
# Export compile commands for better IDE support
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Create test executable
add_executable(spine-c-test test/test.c)
target_link_libraries(spine-c-test spine-c-new)
target_include_directories(spine-c-test PRIVATE include)

View File

@ -0,0 +1,49 @@
# Excluded types (whole type is skipped)
type: SkeletonClipping
type: Triangulator
type: SpineObject
type: TextureLoader
type: DebugExtension
type: DefaultSpineExtension
type: SpineExtension
type: Updateable
type: Pair
type: EventListener
type: AnimationStateListener
type: AnimationStateListenerObject
type: Pool
type: ContainerUtil
type: BlockAllocator
type: MathUtil
type: Vector
type: PoolObject
type: HasRendererObject
type: String
type: StringBuffer
type: EventQueue
type: Json
type: BaseTimeline
# Excluded methods (specific methods on otherwise included types)
method: AnimationState::setListener
method: AnimationState::addListener
method: AnimationState::removeListener
method: AnimationState::clearListeners
method: AnimationState::disableQueue
method: AnimationState::enableQueue
method: AnimationState::setManualTrackEntryDisposal
method: AnimationState::getManualTrackEntryDisposal
method: Skeleton::updateCache
method: Skeleton::printUpdateCache
method: SkeletonData::setName
method: SkeletonData::setVersion
method: SkeletonData::setHash
method: SkeletonData::setImagesPath
method: SkeletonData::setAudioPath
method: SkeletonData::setFps
method: EventData::setIntValue
method: EventData::setFloatValue
method: EventData::setStringValue
method: EventData::setAudioPath
method: EventData::setVolume
method: EventData::setBalance

48
spine-c-new/codegen/package-lock.json generated Normal file
View File

@ -0,0 +1,48 @@
{
"name": "codegen",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "codegen",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
"@types/node": "^24.0.10",
"typescript": "^5.8.3"
}
},
"node_modules/@types/node": {
"version": "24.0.10",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.10.tgz",
"integrity": "sha512-ENHwaH+JIRTDIEEbDK6QSQntAYGtbvdDXnMXnZaZ6k13Du1dPMmprkEHIL7ok2Wl2aZevetwTAb5S+7yIF+enA==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~7.8.0"
}
},
"node_modules/typescript": {
"version": "5.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "7.8.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
"dev": true,
"license": "MIT"
}
}
}

View File

@ -0,0 +1,18 @@
{
"name": "codegen",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"build": "tsc",
"generate": "npm run build && node dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"@types/node": "^24.0.10",
"typescript": "^5.8.3"
}
}

View File

@ -0,0 +1,8 @@
# Base types that need RTTI emulation
Attachment
Constraint
ConstraintData
Pose
Posed
PosedData
Timeline

View File

@ -0,0 +1,49 @@
import * as fs from 'fs';
import { Exclusion } from './types';
export function loadExclusions(filePath: string): Exclusion[] {
const content = fs.readFileSync(filePath, 'utf8');
const lines = content.split('\n');
const exclusions: Exclusion[] = [];
for (const line of lines) {
const trimmed = line.trim();
// Skip empty lines and comments
if (!trimmed || trimmed.startsWith('#')) continue;
// Parse type exclusion
const typeMatch = trimmed.match(/^type:\s*(.+)$/);
if (typeMatch) {
exclusions.push({
kind: 'type',
typeName: typeMatch[1].trim()
});
continue;
}
// Parse method exclusion
const methodMatch = trimmed.match(/^method:\s*(.+?)::(.+)$/);
if (methodMatch) {
exclusions.push({
kind: 'method',
typeName: methodMatch[1].trim(),
methodName: methodMatch[2].trim()
});
}
}
return exclusions;
}
export function isTypeExcluded(typeName: string, exclusions: Exclusion[]): boolean {
return exclusions.some(ex => ex.kind === 'type' && ex.typeName === typeName);
}
export function isMethodExcluded(typeName: string, methodName: string, exclusions: Exclusion[]): boolean {
return exclusions.some(ex =>
ex.kind === 'method' &&
ex.typeName === typeName &&
ex.methodName === methodName
);
}

View File

@ -0,0 +1,158 @@
import * as fs from 'fs';
import * as path from 'path';
import { Type, toSnakeCase } from './types';
const LICENSE_HEADER = `/******************************************************************************
* 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.
*****************************************************************************/`;
export class FileWriter {
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 });
}
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`);
const headerGuard = `SPINE_C_${typeName.toUpperCase()}_H`;
const headerLines = [
LICENSE_HEADER,
'',
`#ifndef ${headerGuard}`,
`#define ${headerGuard}`,
'',
'#ifdef __cplusplus',
'extern "C" {',
'#endif',
'',
...headerContent,
'',
'#ifdef __cplusplus',
'}',
'#endif',
'',
`#endif // ${headerGuard}`
];
fs.writeFileSync(headerPath, headerLines.join('\n'));
// Write source file (as .cpp since it contains C++ code)
const sourcePath = path.join(this.outputDir, `${fileName}.cpp`);
const sourceLines = [
LICENSE_HEADER,
'',
...sourceContent
];
fs.writeFileSync(sourcePath, sourceLines.join('\n'));
}
async writeEnum(enumName: string, content: string[]): Promise<void> {
const fileName = toSnakeCase(enumName);
const headerPath = path.join(this.outputDir, `${fileName}.h`);
const headerGuard = `SPINE_C_${enumName.toUpperCase()}_H`;
const headerLines = [
LICENSE_HEADER,
'',
`#ifndef ${headerGuard}`,
`#define ${headerGuard}`,
'',
'#include "../../custom.h"',
'',
'#ifdef __cplusplus',
'extern "C" {',
'#endif',
'',
...content,
'',
'#ifdef __cplusplus',
'}',
'#endif',
'',
`#endif // ${headerGuard}`
];
fs.writeFileSync(headerPath, headerLines.join('\n'));
}
async writeMainHeader(classes: Type[], enums: Type[]): 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',
'',
'// Custom types and functions',
'#include "../src/custom.h"',
'',
'// Generated enum types'
];
// Add enum includes
for (const enumType of enums) {
lines.push(`#include "../src/generated/${toSnakeCase(enumType.name)}.h"`);
}
lines.push('');
lines.push('// Generated class types');
// Add class includes
for (const classType of classes) {
lines.push(`#include "../src/generated/${toSnakeCase(classType.name)}.h"`);
}
lines.push('');
lines.push('#endif // SPINE_C_H');
fs.writeFileSync(mainHeaderPath, lines.join('\n'));
}
}

View File

@ -0,0 +1,111 @@
import { Type, Member, toSnakeCase, toCFunctionName, toCTypeName } from '../types';
export interface GeneratorResult {
declarations: string[];
implementations: string[];
}
export class ConstructorGenerator {
generate(type: Type): GeneratorResult {
const declarations: string[] = [];
const implementations: string[] = [];
if (!type.members) return { declarations, implementations };
const constructors = type.members.filter(m => m.kind === 'constructor');
const cTypeName = `spine_${toSnakeCase(type.name)}`;
// Generate create functions for each constructor
let constructorIndex = 0;
for (const constructor of constructors) {
const funcName = this.getCreateFunctionName(type.name, constructor, constructorIndex);
const params = this.generateParameters(constructor);
// Declaration
declarations.push(`SPINE_C_EXPORT ${cTypeName} ${funcName}(${params.declaration});`);
// Implementation
implementations.push(`${cTypeName} ${funcName}(${params.declaration}) {`);
implementations.push(` ${type.name} *obj = new (__FILE__, __LINE__) ${type.name}(${params.call});`);
implementations.push(` return (${cTypeName}) obj;`);
implementations.push(`}`);
implementations.push('');
constructorIndex++;
}
// Always generate dispose function
declarations.push(`SPINE_C_EXPORT void ${cTypeName}_dispose(${cTypeName} obj);`);
implementations.push(`void ${cTypeName}_dispose(${cTypeName} obj) {`);
implementations.push(` if (!obj) return;`);
implementations.push(` delete (${type.name} *) obj;`);
implementations.push(`}`);
implementations.push('');
return { declarations, implementations };
}
private getCreateFunctionName(typeName: string, constructor: Member, index: number): string {
const baseName = `spine_${toSnakeCase(typeName)}_create`;
if (!constructor.parameters || constructor.parameters.length === 0) {
return baseName;
}
if (index === 0) {
return baseName;
}
// Generate name based on parameter types
const paramNames = constructor.parameters
.map(p => this.getParamTypeSuffix(p.type))
.join('_');
return `${baseName}_with_${paramNames}`;
}
private getParamTypeSuffix(type: string): string {
if (type.includes('float')) return 'float';
if (type.includes('int')) return 'int';
if (type.includes('bool')) return 'bool';
if (type.includes('String') || type.includes('char')) return 'string';
// Extract class name from pointers/references
const match = type.match(/(?:const\s+)?(\w+)(?:\s*[*&])?/);
if (match) {
return toSnakeCase(match[1]);
}
return 'param';
}
private generateParameters(constructor: Member): { declaration: string; call: string } {
if (!constructor.parameters || constructor.parameters.length === 0) {
return { declaration: 'void', call: '' };
}
const declParts: string[] = [];
const callParts: string[] = [];
for (const param of constructor.parameters) {
const cType = toCTypeName(param.type);
declParts.push(`${cType} ${param.name}`);
// Convert C type back to C++ for the call
let callExpr = param.name;
if (param.type === 'const String &' || param.type === 'String') {
callExpr = `String(${param.name})`;
} else if (param.type.includes('*')) {
callExpr = `(${param.type}) ${param.name}`;
}
callParts.push(callExpr);
}
return {
declaration: declParts.join(', '),
call: callParts.join(', ')
};
}
}

View File

@ -0,0 +1,27 @@
import { Type, toSnakeCase } from '../types';
export class EnumGenerator {
generate(enumType: Type): string[] {
const lines: string[] = [];
const enumName = `spine_${toSnakeCase(enumType.name)}`;
lines.push(`typedef enum ${enumName} {`);
if (enumType.values) {
for (let i = 0; i < enumType.values.length; i++) {
const value = enumType.values[i];
const cName = `SPINE_${toSnakeCase(enumType.name).toUpperCase()}_${toSnakeCase(value.name).toUpperCase()}`;
if (value.value !== undefined) {
lines.push(` ${cName} = ${value.value}${i < enumType.values.length - 1 ? ',' : ''}`);
} else {
lines.push(` ${cName}${i < enumType.values.length - 1 ? ',' : ''}`);
}
}
}
lines.push(`} ${enumName};`);
return lines;
}
}

View File

@ -0,0 +1,199 @@
import { Type, Member, toSnakeCase, toCFunctionName, toCTypeName, Exclusion } from '../types';
import { isMethodExcluded } from '../exclusions';
import { GeneratorResult } from './constructor-generator';
export class MethodGenerator {
constructor(private exclusions: Exclusion[]) {}
generate(type: Type): GeneratorResult {
const declarations: string[] = [];
const implementations: string[] = [];
if (!type.members) return { declarations, implementations };
const methods = type.members.filter(m =>
m.kind === 'method' &&
!m.isStatic &&
!isMethodExcluded(type.name, m.name, this.exclusions)
);
const cTypeName = `spine_${toSnakeCase(type.name)}`;
for (const method of methods) {
// Handle getters
if (method.name.startsWith('get') && (!method.parameters || method.parameters.length === 0)) {
const propName = method.name.substring(3);
const funcName = toCFunctionName(type.name, method.name);
const returnType = toCTypeName(method.returnType || 'void');
declarations.push(`SPINE_C_EXPORT ${returnType} ${funcName}(${cTypeName} obj);`);
implementations.push(`${returnType} ${funcName}(${cTypeName} obj) {`);
implementations.push(` if (!obj) return ${this.getDefaultReturn(returnType)};`);
implementations.push(` ${type.name} *_obj = (${type.name} *) obj;`);
const callExpr = this.generateMethodCall('_obj', method);
implementations.push(` return ${callExpr};`);
implementations.push(`}`);
implementations.push('');
// Generate collection accessors if return type is Vector
if (method.returnType && method.returnType.includes('Vector<')) {
this.generateCollectionAccessors(type, method, propName, declarations, implementations);
}
}
// Handle setters
else if (method.name.startsWith('set') && method.parameters && method.parameters.length === 1) {
const funcName = toCFunctionName(type.name, method.name);
const paramType = toCTypeName(method.parameters[0].type);
declarations.push(`SPINE_C_EXPORT void ${funcName}(${cTypeName} obj, ${paramType} value);`);
implementations.push(`void ${funcName}(${cTypeName} obj, ${paramType} value) {`);
implementations.push(` if (!obj) return;`);
implementations.push(` ${type.name} *_obj = (${type.name} *) obj;`);
const callExpr = this.generateSetterCall('_obj', method, 'value');
implementations.push(` ${callExpr};`);
implementations.push(`}`);
implementations.push('');
}
// Handle other methods
else {
const funcName = toCFunctionName(type.name, method.name);
const returnType = toCTypeName(method.returnType || 'void');
const params = this.generateMethodParameters(cTypeName, method);
declarations.push(`SPINE_C_EXPORT ${returnType} ${funcName}(${params.declaration});`);
implementations.push(`${returnType} ${funcName}(${params.declaration}) {`);
implementations.push(` if (!obj) return ${this.getDefaultReturn(returnType)};`);
implementations.push(` ${type.name} *_obj = (${type.name} *) obj;`);
const callExpr = this.generateMethodCall('_obj', method, params.call);
if (returnType === 'void') {
implementations.push(` ${callExpr};`);
} else {
implementations.push(` return ${callExpr};`);
}
implementations.push(`}`);
implementations.push('');
}
}
return { declarations, implementations };
}
private generateCollectionAccessors(type: Type, method: Member, propName: string,
declarations: string[], implementations: string[]) {
const cTypeName = `spine_${toSnakeCase(type.name)}`;
const propSnake = toSnakeCase(propName);
const vectorMatch = method.returnType!.match(/Vector<(.+?)>/);
if (!vectorMatch) return;
const elementType = vectorMatch[1].trim().replace(/\s*\*$/, '');
let cElementType: string;
if (elementType === 'int') {
cElementType = 'int32_t';
} else {
cElementType = `spine_${toSnakeCase(elementType)}`;
}
// Get count function
const getCountFunc = `spine_${toSnakeCase(type.name)}_get_num_${propSnake}`;
declarations.push(`SPINE_C_EXPORT int32_t ${getCountFunc}(${cTypeName} obj);`);
implementations.push(`int32_t ${getCountFunc}(${cTypeName} obj) {`);
implementations.push(` if (!obj) return 0;`);
implementations.push(` ${type.name} *_obj = (${type.name} *) obj;`);
implementations.push(` return (int32_t) _obj->get${propName}().size();`);
implementations.push(`}`);
implementations.push('');
// Get array function
const getArrayFunc = `spine_${toSnakeCase(type.name)}_get_${propSnake}`;
declarations.push(`SPINE_C_EXPORT ${cElementType} *${getArrayFunc}(${cTypeName} obj);`);
implementations.push(`${cElementType} *${getArrayFunc}(${cTypeName} obj) {`);
implementations.push(` if (!obj) return nullptr;`);
implementations.push(` ${type.name} *_obj = (${type.name} *) obj;`);
implementations.push(` return (${cElementType} *) _obj->get${propName}().buffer();`);
implementations.push(`}`);
implementations.push('');
}
private generateMethodCall(objName: string, method: Member, args?: string): string {
let call = `${objName}->${method.name}(${args || ''})`;
// Handle return type conversions
if (method.returnType) {
if (method.returnType === 'const String &' || method.returnType === 'String') {
call = `(const utf8 *) ${call}.buffer()`;
} else if (method.returnType === 'const spine::RTTI &' || method.returnType === 'const RTTI &') {
// RTTI needs special handling - return as opaque pointer
call = `(spine_rtti) &${call}`;
} else if (method.returnType.includes('*')) {
const cType = toCTypeName(method.returnType);
call = `(${cType}) ${call}`;
} else if (method.returnType === 'Color &' || method.returnType === 'const Color &') {
call = `(spine_color) &${call}`;
}
}
return call;
}
private generateSetterCall(objName: string, method: Member, valueName: string): string {
const param = method.parameters![0];
let value = valueName;
// Convert from C type to C++
if (param.type === 'const String &' || param.type === 'String') {
value = `String(${valueName})`;
} else if (param.type.includes('Vector<')) {
// Vector types are passed as void* and need to be cast back
value = `(${param.type}) ${valueName}`;
} else if (param.type.includes('*')) {
value = `(${param.type}) ${valueName}`;
}
return `${objName}->${method.name}(${value})`;
}
private generateMethodParameters(objTypeName: string, method: Member): { declaration: string; call: string } {
const declParts = [`${objTypeName} obj`];
const callParts: string[] = [];
if (method.parameters) {
for (const param of method.parameters) {
const cType = toCTypeName(param.type);
declParts.push(`${cType} ${param.name}`);
// Convert C type back to C++ for the call
let callExpr = param.name;
if (param.type === 'const String &' || param.type === 'String') {
callExpr = `String(${param.name})`;
} else if (param.type.includes('Vector<')) {
// Vector types are passed as void* and need to be cast back
callExpr = `(${param.type}) ${param.name}`;
} else if (param.type.includes('*')) {
callExpr = `(${param.type}) ${param.name}`;
}
callParts.push(callExpr);
}
}
return {
declaration: declParts.join(', '),
call: callParts.join(', ')
};
}
private getDefaultReturn(returnType: string): string {
if (returnType === 'void') return '';
if (returnType === 'spine_bool') return '0';
if (returnType.includes('int') || returnType === 'float' || returnType === 'double') return '0';
return 'nullptr';
}
}

View File

@ -0,0 +1,8 @@
import { Type, toSnakeCase } from '../types';
export class OpaqueTypeGenerator {
generate(type: Type): string {
const cName = `spine_${toSnakeCase(type.name)}`;
return `SPINE_OPAQUE_TYPE(${cName})`;
}
}

View File

@ -0,0 +1,85 @@
import { Type, toSnakeCase } from '../types';
import { getTypeHierarchy, getLeafTypes } from '../rtti';
import { GeneratorResult } from './constructor-generator';
export class RttiGenerator {
constructor(
private rttiBases: Set<string>,
private allTypes: Type[]
) {}
needsRtti(type: Type): boolean {
const hierarchy = getTypeHierarchy(type, this.allTypes);
return hierarchy.some(t => this.rttiBases.has(t));
}
generateForType(baseType: Type): GeneratorResult {
const declarations: string[] = [];
const implementations: string[] = [];
// Only generate RTTI for base types in rttiBases
if (!this.rttiBases.has(baseType.name)) {
return { declarations, implementations };
}
const leafTypes = getLeafTypes(baseType.name, this.allTypes);
const baseSnake = toSnakeCase(baseType.name);
const enumName = `spine_${baseSnake}_type`;
// Add forward declarations for all leaf types
for (const leafType of leafTypes) {
const leafTypeName = `spine_${toSnakeCase(leafType.name)}`;
declarations.push(`struct ${leafTypeName}_wrapper;`);
declarations.push(`typedef struct ${leafTypeName}_wrapper *${leafTypeName};`);
}
declarations.push('');
// Generate enum
declarations.push(`typedef enum ${enumName} {`);
leafTypes.forEach((type, index) => {
const enumValue = `SPINE_TYPE_${baseSnake.toUpperCase()}_${toSnakeCase(type.name).toUpperCase()}`;
declarations.push(` ${enumValue} = ${index}${index < leafTypes.length - 1 ? ',' : ''}`);
});
declarations.push(`} ${enumName};`);
declarations.push('');
// Generate is_type method
const isTypeFunc = `spine_${baseSnake}_is_type`;
declarations.push(`SPINE_C_EXPORT spine_bool ${isTypeFunc}(spine_${baseSnake} obj, ${enumName} type);`);
implementations.push(`spine_bool ${isTypeFunc}(spine_${baseSnake} obj, ${enumName} type) {`);
implementations.push(` if (!obj) return 0;`);
implementations.push(` ${baseType.name} *_obj = (${baseType.name} *) obj;`);
implementations.push(` `);
implementations.push(` switch (type) {`);
leafTypes.forEach((type, index) => {
const enumValue = `SPINE_TYPE_${baseSnake.toUpperCase()}_${toSnakeCase(type.name).toUpperCase()}`;
implementations.push(` case ${enumValue}:`);
implementations.push(` return _obj->getRTTI().instanceOf(${type.name}::rtti);`);
});
implementations.push(` }`);
implementations.push(` return 0;`);
implementations.push(`}`);
implementations.push('');
// Generate cast methods for each leaf type
for (const leafType of leafTypes) {
const castFunc = `spine_${baseSnake}_as_${toSnakeCase(leafType.name)}`;
const returnType = `spine_${toSnakeCase(leafType.name)}`;
declarations.push(`SPINE_C_EXPORT ${returnType} ${castFunc}(spine_${baseSnake} obj);`);
implementations.push(`${returnType} ${castFunc}(spine_${baseSnake} obj) {`);
implementations.push(` if (!obj) return nullptr;`);
implementations.push(` ${baseType.name} *_obj = (${baseType.name} *) obj;`);
implementations.push(` if (!_obj->getRTTI().instanceOf(${leafType.name}::rtti)) return nullptr;`);
implementations.push(` return (${returnType}) obj;`);
implementations.push(`}`);
implementations.push('');
}
return { declarations, implementations };
}
}

View File

@ -0,0 +1,109 @@
#!/usr/bin/env node
import * as fs from 'fs';
import * as path from 'path';
import { Type, Member, SpineTypes, toSnakeCase } from './types';
import { loadExclusions, isTypeExcluded, isMethodExcluded } from './exclusions';
import { loadRttiBases } from './rtti';
import { OpaqueTypeGenerator } from './generators/opaque-type-generator';
import { ConstructorGenerator } from './generators/constructor-generator';
import { MethodGenerator } from './generators/method-generator';
import { EnumGenerator } from './generators/enum-generator';
import { RttiGenerator } from './generators/rtti-generator';
import { FileWriter } from './file-writer';
async function main() {
console.log('Loading type information...');
// Load all necessary data
const typesJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../all-spine-types.json'), 'utf8')) as SpineTypes;
const exclusions = loadExclusions(path.join(__dirname, '../exclusions.txt'));
const rttiBases = loadRttiBases(path.join(__dirname, '../rtti-bases.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]);
}
// Filter out excluded types
const includedTypes = allTypes.filter(type => !isTypeExcluded(type.name, exclusions));
// Separate classes and enums
const classes = includedTypes.filter(t => t.kind === 'class' || t.kind === 'struct');
const enums = includedTypes.filter(t => t.kind === 'enum');
console.log(`Found ${classes.length} classes/structs and ${enums.length} enums to generate`);
// Initialize generators
const opaqueTypeGen = new OpaqueTypeGenerator();
const constructorGen = new ConstructorGenerator();
const methodGen = new MethodGenerator(exclusions);
const enumGen = new EnumGenerator();
const rttiGen = new RttiGenerator(rttiBases, allTypes);
const fileWriter = new FileWriter(path.join(__dirname, '../../src/generated'));
// Generate code for each type
for (const type of classes) {
console.log(`Generating ${type.name}...`);
const headerContent: string[] = [];
const sourceContent: string[] = [];
// Add includes
headerContent.push('#include "../custom.h"');
headerContent.push('');
sourceContent.push(`#include "${toSnakeCase(type.name)}.h"`);
sourceContent.push('#include <spine/spine.h>');
sourceContent.push('');
sourceContent.push('using namespace spine;');
sourceContent.push('');
// Generate opaque type
headerContent.push(opaqueTypeGen.generate(type));
headerContent.push('');
// 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);
}
// Check if this type needs RTTI
if (rttiGen.needsRtti(type)) {
const rtti = rttiGen.generateForType(type);
if (rtti.declarations.length > 0) {
headerContent.push(...rtti.declarations);
sourceContent.push(...rtti.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 main header file
await fileWriter.writeMainHeader(classes, enums);
console.log('Code generation complete!');
}
main().catch(error => {
console.error('Error:', error);
process.exit(1);
});

View File

@ -0,0 +1,61 @@
import * as fs from 'fs';
import { Type } from './types';
export function loadRttiBases(filePath: string): Set<string> {
const content = fs.readFileSync(filePath, 'utf8');
const lines = content.split('\n');
const bases = new Set<string>();
for (const line of lines) {
const trimmed = line.trim();
if (trimmed && !trimmed.startsWith('#')) {
bases.add(trimmed);
}
}
return bases;
}
export function getTypeHierarchy(type: Type, allTypes: Type[]): string[] {
const hierarchy: string[] = [type.name];
if (type.superTypes) {
for (const superName of type.superTypes) {
const superType = allTypes.find(t => t.name === superName);
if (superType) {
hierarchy.push(...getTypeHierarchy(superType, allTypes));
}
}
}
return hierarchy;
}
export function getAllDerivedTypes(baseName: string, allTypes: Type[]): Type[] {
const derived: Type[] = [];
for (const type of allTypes) {
if (type.superTypes && type.superTypes.includes(baseName)) {
derived.push(type);
// Recursively find all derived types
derived.push(...getAllDerivedTypes(type.name, allTypes));
}
}
return derived;
}
export function getLeafTypes(baseName: string, allTypes: Type[]): Type[] {
const allDerived = getAllDerivedTypes(baseName, allTypes);
const leafTypes: Type[] = [];
for (const type of allDerived) {
// A type is a leaf if no other type derives from it
const hasChildren = allTypes.some(t => t.superTypes && t.superTypes.includes(type.name));
if (!hasChildren && !type.isAbstract) {
leafTypes.push(type);
}
}
return leafTypes;
}

View File

@ -0,0 +1,118 @@
export interface Parameter {
name: string;
type: string;
defaultValue?: string;
}
export interface Member {
kind: 'field' | 'method' | 'constructor' | 'destructor';
name: string;
type?: string; // For fields
returnType?: string; // For methods
parameters?: Parameter[];
isStatic?: boolean;
isVirtual?: boolean;
isPure?: boolean;
isConst?: boolean;
fromSupertype?: string; // Indicates this member was inherited
}
export interface EnumValue {
name: string;
value?: string;
}
export interface Type {
name: string;
kind: 'class' | 'struct' | 'enum';
loc?: {
line: number;
col: number;
};
superTypes?: string[];
members?: Member[];
values?: EnumValue[]; // For enums
isAbstract?: boolean;
isTemplate?: boolean;
templateParams?: string[];
}
export interface SpineTypes {
[header: string]: Type[];
}
export interface Exclusion {
kind: 'type' | 'method';
typeName: string;
methodName?: string;
}
export function toSnakeCase(name: string): string {
// Handle acronyms and consecutive capitals
let result = name.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2');
// Insert underscore before capital letters
result = result.replace(/([a-z\d])([A-Z])/g, '$1_$2');
return result.toLowerCase();
}
export function toCFunctionName(typeName: string, methodName: string): string {
return `spine_${toSnakeCase(typeName)}_${toSnakeCase(methodName)}`;
}
export function toCTypeName(cppType: string): string {
// Handle basic types
if (cppType === 'float') return 'float';
if (cppType === 'double') return 'double';
if (cppType === 'int' || cppType === 'int32_t') return 'int32_t';
if (cppType === 'unsigned int' || cppType === 'uint32_t') return 'uint32_t';
if (cppType === 'short' || cppType === 'int16_t') return 'int16_t';
if (cppType === 'unsigned short' || cppType === 'uint16_t') return 'uint16_t';
if (cppType === 'bool') return 'spine_bool';
if (cppType === 'void') return 'void';
if (cppType === 'size_t') return 'spine_size_t';
if (cppType === 'const char *' || cppType === 'String' || cppType === 'const String &') return 'const utf8 *';
// Handle RTTI type specially
if (cppType === 'const spine::RTTI &' || cppType === 'RTTI &' || cppType === 'const RTTI &') return 'spine_rtti';
// Handle Vector types FIRST before checking for pointers - these should be converted to void* in C API
const vectorMatch = cppType.match(/Vector<(.+?)>/);
if (vectorMatch) {
const elementType = vectorMatch[1].trim();
// Special case for Vector<int> - use int32_t*
if (elementType === 'int') {
return 'int32_t *';
}
// For now, use void* for other vector parameters since we can't expose templates
return 'void *';
}
// Handle pointers
const pointerMatch = cppType.match(/^(.+?)\s*\*$/);
if (pointerMatch) {
const baseType = pointerMatch[1].trim();
return `spine_${toSnakeCase(baseType)}`;
}
// Handle references
const refMatch = cppType.match(/^(?:const\s+)?(.+?)\s*&$/);
if (refMatch) {
const baseType = refMatch[1].trim();
if (baseType === 'String') return 'const utf8 *';
if (baseType === 'RTTI' || baseType === 'spine::RTTI') return 'spine_rtti';
return toCTypeName(baseType);
}
// Handle enum types from spine namespace
const enumTypes = ['MixBlend', 'MixDirection', 'BlendMode', 'AttachmentType', 'EventType',
'Format', 'TextureFilter', 'TextureWrap', 'Inherit', 'Physics',
'PositionMode', 'Property', 'RotateMode', 'SequenceMode', 'SpacingMode'];
for (const enumType of enumTypes) {
if (cppType === enumType || cppType === `spine::${enumType}`) {
return `spine_${toSnakeCase(enumType)}`;
}
}
// Default: assume it's a spine type
return `spine_${toSnakeCase(cppType)}`;
}

View File

@ -0,0 +1,81 @@
#!/usr/bin/env node
import * as fs from 'fs';
import * as path from 'path';
import { Type, SpineTypes } from './types';
import { loadExclusions, isTypeExcluded } from './exclusions';
function main() {
console.log('Validating type coverage...\n');
// Load all necessary data
const typesJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../all-spine-types.json'), 'utf8')) as SpineTypes;
const exclusions = loadExclusions(path.join(__dirname, '../exclusions.txt'));
// Flatten all types
const allTypes: Type[] = [];
for (const header of Object.keys(typesJson)) {
allTypes.push(...typesJson[header]);
}
// Categorize types
const classes = allTypes.filter(t => t.kind === 'class' || t.kind === 'struct');
const enums = allTypes.filter(t => t.kind === 'enum');
// Check excluded types
const excludedTypes = classes.filter(t => isTypeExcluded(t.name, exclusions));
const includedTypes = classes.filter(t => !isTypeExcluded(t.name, exclusions));
// Find abstract types
const abstractTypes = includedTypes.filter(t => t.isAbstract);
const concreteTypes = includedTypes.filter(t => !t.isAbstract);
console.log('=== Type Coverage Report ===\n');
console.log(`Total types found: ${allTypes.length}`);
console.log(` Classes/Structs: ${classes.length}`);
console.log(` Enums: ${enums.length}`);
console.log('');
console.log(`Excluded types: ${excludedTypes.length}`);
excludedTypes.forEach(t => console.log(` - ${t.name}`));
console.log('');
console.log(`Included types: ${includedTypes.length}`);
console.log(` Abstract: ${abstractTypes.length}`);
abstractTypes.forEach(t => console.log(` - ${t.name}`));
console.log(` Concrete: ${concreteTypes.length}`);
console.log('');
// Check for missing important types
const importantTypes = [
'Skeleton', 'SkeletonData', 'Animation', 'AnimationState',
'Bone', 'Slot', 'Attachment', 'Skin', 'Event'
];
console.log('Important types check:');
for (const typeName of importantTypes) {
const found = concreteTypes.find(t => t.name === typeName);
const status = found ? '✓' : '✗';
console.log(` ${status} ${typeName}`);
}
console.log('\n=== Method Exclusion Report ===\n');
// Count excluded methods per type
const methodExclusions = exclusions.filter(e => e.kind === 'method');
const methodsByType = new Map<string, string[]>();
for (const exc of methodExclusions) {
if (!methodsByType.has(exc.typeName)) {
methodsByType.set(exc.typeName, []);
}
methodsByType.get(exc.typeName)!.push(exc.methodName!);
}
console.log(`Total method exclusions: ${methodExclusions.length}`);
for (const [typeName, methods] of methodsByType) {
console.log(` ${typeName}: ${methods.length} methods`);
methods.forEach(m => console.log(` - ${m}`));
}
}
main();

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"lib": ["ES2020"],
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}

View File

@ -0,0 +1,190 @@
/******************************************************************************
* 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_H
#define SPINE_C_H
// Custom types and functions
#include "../src/custom.h"
// Generated enum types
#include "../src/generated/event_type.h"
#include "../src/generated/format.h"
#include "../src/generated/texture_filter.h"
#include "../src/generated/texture_wrap.h"
#include "../src/generated/attachment_type.h"
#include "../src/generated/blend_mode.h"
#include "../src/generated/inherit.h"
#include "../src/generated/mix_blend.h"
#include "../src/generated/mix_direction.h"
#include "../src/generated/physics.h"
#include "../src/generated/position_mode.h"
#include "../src/generated/property.h"
#include "../src/generated/rotate_mode.h"
#include "../src/generated/sequence_mode.h"
#include "../src/generated/spacing_mode.h"
// Generated class types
#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/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"
#include "../src/generated/bone_pose.h"
#include "../src/generated/bone_timeline.h"
#include "../src/generated/bone_timeline1.h"
#include "../src/generated/bone_timeline2.h"
#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_generic.h"
#include "../src/generated/constraint_data.h"
#include "../src/generated/constraint_data_generic.h"
#include "../src/generated/constraint_timeline.h"
#include "../src/generated/constraint_timeline1.h"
#include "../src/generated/curve_timeline.h"
#include "../src/generated/curve_timeline1.h"
#include "../src/generated/curve_timeline2.h"
#include "../src/generated/deform_timeline.h"
#include "../src/generated/draw_order_timeline.h"
#include "../src/generated/event.h"
#include "../src/generated/event_data.h"
#include "../src/generated/event_timeline.h"
#include "../src/generated/hash_map.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"
#include "../src/generated/path_constraint_data.h"
#include "../src/generated/path_constraint_mix_timeline.h"
#include "../src/generated/path_constraint_pose.h"
#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_gravity_timeline.h"
#include "../src/generated/physics_constraint_mix_timeline.h"
#include "../src/generated/physics_constraint_reset_timeline.h"
#include "../src/generated/point_attachment.h"
#include "../src/generated/pose.h"
#include "../src/generated/posed.h"
#include "../src/generated/posed_generic.h"
#include "../src/generated/posed_active.h"
#include "../src/generated/posed_data.h"
#include "../src/generated/posed_data_generic.h"
#include "../src/generated/rtti.h"
#include "../src/generated/region_attachment.h"
#include "../src/generated/rotate_timeline.h"
#include "../src/generated/scale_timeline.h"
#include "../src/generated/scale_x_timeline.h"
#include "../src/generated/scale_y_timeline.h"
#include "../src/generated/sequence.h"
#include "../src/generated/sequence_timeline.h"
#include "../src/generated/shear_timeline.h"
#include "../src/generated/shear_x_timeline.h"
#include "../src/generated/shear_y_timeline.h"
#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_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"
#include "../src/generated/slider_data.h"
#include "../src/generated/slider_mix_timeline.h"
#include "../src/generated/slider_pose.h"
#include "../src/generated/slider_timeline.h"
#include "../src/generated/slot.h"
#include "../src/generated/slot_curve_timeline.h"
#include "../src/generated/slot_data.h"
#include "../src/generated/slot_pose.h"
#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/transform_constraint_data.h"
#include "../src/generated/transform_constraint_pose.h"
#include "../src/generated/transform_constraint_timeline.h"
#include "../src/generated/translate_timeline.h"
#include "../src/generated/translate_x_timeline.h"
#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

529
spine-c-new/src/custom.cpp Normal file
View File

@ -0,0 +1,529 @@
/******************************************************************************
* 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 "custom.h"
#include <spine/spine.h>
#include <spine/Version.h>
#include <spine/Debug.h>
#include <spine/SkeletonRenderer.h>
#include <spine/AnimationState.h>
#include <cstring>
using namespace spine;
// Internal structures
struct _spine_atlas {
void *atlas;
utf8 **imagePaths;
int32_t numImagePaths;
utf8 *error;
};
struct _spine_skeleton_data_result {
spine_skeleton_data skeletonData;
utf8 *error;
};
struct _spine_bounds {
float x, y, width, height;
};
struct _spine_vector {
float x, y;
};
struct _spine_skeleton_drawable : public SpineObject {
spine_skeleton skeleton;
spine_animation_state animationState;
spine_animation_state_data animationStateData;
spine_animation_state_events animationStateEvents;
SkeletonRenderer *renderer;
};
struct _spine_skin_entry {
int32_t slotIndex;
utf8 *name;
spine_attachment attachment;
};
struct _spine_skin_entries {
int32_t numEntries;
_spine_skin_entry *entries;
};
// Animation state event tracking
struct AnimationStateEvent {
EventType type;
TrackEntry *entry;
Event *event;
AnimationStateEvent(EventType type, TrackEntry *entry, Event *event) : type(type), entry(entry), event(event){};
};
class EventListener : public AnimationStateListenerObject, public SpineObject {
public:
Vector<AnimationStateEvent> events;
void callback(AnimationState *state, EventType type, TrackEntry *entry, Event *event) override {
events.add(AnimationStateEvent(type, entry, event));
SP_UNUSED(state);
}
};
// Static variables
static Color NULL_COLOR(0, 0, 0, 0);
static SpineExtension *defaultExtension = nullptr;
static DebugExtension *debugExtension = nullptr;
static void initExtensions() {
if (defaultExtension == nullptr) {
defaultExtension = new DefaultSpineExtension();
debugExtension = new DebugExtension(defaultExtension);
}
}
namespace spine {
SpineExtension *getDefaultExtension() {
initExtensions();
return defaultExtension;
}
}
// Version functions
int32_t spine_major_version() {
return SPINE_MAJOR_VERSION;
}
int32_t spine_minor_version() {
return SPINE_MINOR_VERSION;
}
void spine_enable_debug_extension(spine_bool enable) {
initExtensions();
SpineExtension::setInstance(enable ? debugExtension : defaultExtension);
}
void spine_report_leaks() {
initExtensions();
debugExtension->reportLeaks();
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;
return ((_spine_bounds *) bounds)->x;
}
float spine_bounds_get_y(spine_bounds bounds) {
if (!bounds) return 0;
return ((_spine_bounds *) bounds)->y;
}
float spine_bounds_get_width(spine_bounds bounds) {
if (!bounds) return 0;
return ((_spine_bounds *) bounds)->width;
}
float spine_bounds_get_height(spine_bounds bounds) {
if (!bounds) return 0;
return ((_spine_bounds *) bounds)->height;
}
// Vector functions
float spine_vector_get_x(spine_vector vector) {
if (!vector) return 0;
return ((_spine_vector *) vector)->x;
}
float spine_vector_get_y(spine_vector vector) {
if (!vector) return 0;
return ((_spine_vector *) vector)->y;
}
// Atlas functions
class LiteTextureLoad : public TextureLoader {
void load(AtlasPage &page, const String &path) {
page.texture = (void *) (intptr_t) page.index;
}
void unload(void *texture) {
}
};
static LiteTextureLoad liteLoader;
spine_atlas spine_atlas_load(const utf8 *atlasData) {
if (!atlasData) return nullptr;
int32_t length = (int32_t) strlen(atlasData);
auto atlas = new (__FILE__, __LINE__) Atlas(atlasData, length, "", &liteLoader, true);
_spine_atlas *result = SpineExtension::calloc<_spine_atlas>(1, __FILE__, __LINE__);
result->atlas = atlas;
result->numImagePaths = (int32_t) atlas->getPages().size();
result->imagePaths = SpineExtension::calloc<utf8 *>(result->numImagePaths, __FILE__, __LINE__);
for (int i = 0; i < result->numImagePaths; i++) {
result->imagePaths[i] = (utf8 *) strdup(atlas->getPages()[i]->texturePath.buffer());
}
return (spine_atlas) result;
}
class CallbackTextureLoad : public TextureLoader {
spine_texture_loader_load_func loadCb;
spine_texture_loader_unload_func unloadCb;
public:
CallbackTextureLoad() : loadCb(nullptr), unloadCb(nullptr) {}
void setCallbacks(spine_texture_loader_load_func load, spine_texture_loader_unload_func unload) {
loadCb = load;
unloadCb = unload;
}
void load(AtlasPage &page, const String &path) {
page.texture = this->loadCb(path.buffer());
}
void unload(void *texture) {
this->unloadCb(texture);
}
};
static CallbackTextureLoad callbackLoader;
spine_atlas spine_atlas_load_callback(const utf8 *atlasData, const utf8 *atlasDir,
spine_texture_loader_load_func load,
spine_texture_loader_unload_func unload) {
if (!atlasData) return nullptr;
int32_t length = (int32_t) strlen(atlasData);
callbackLoader.setCallbacks(load, unload);
auto atlas = new (__FILE__, __LINE__) Atlas(atlasData, length, (const char *) atlasDir, &callbackLoader, true);
_spine_atlas *result = SpineExtension::calloc<_spine_atlas>(1, __FILE__, __LINE__);
result->atlas = atlas;
result->numImagePaths = (int32_t) atlas->getPages().size();
result->imagePaths = SpineExtension::calloc<utf8 *>(result->numImagePaths, __FILE__, __LINE__);
for (int i = 0; i < result->numImagePaths; i++) {
result->imagePaths[i] = (utf8 *) strdup(atlas->getPages()[i]->texturePath.buffer());
}
return (spine_atlas) result;
}
int32_t spine_atlas_get_num_image_paths(spine_atlas atlas) {
if (!atlas) return 0;
return ((_spine_atlas *) atlas)->numImagePaths;
}
utf8 *spine_atlas_get_image_path(spine_atlas atlas, int32_t index) {
if (!atlas) return nullptr;
_spine_atlas *_atlas = (_spine_atlas *) atlas;
if (index < 0 || index >= _atlas->numImagePaths) return nullptr;
return _atlas->imagePaths[index];
}
spine_bool spine_atlas_is_pma(spine_atlas atlas) {
if (!atlas) return 0;
Atlas *_atlas = (Atlas *) ((_spine_atlas *) atlas)->atlas;
for (size_t i = 0; i < _atlas->getPages().size(); i++) {
AtlasPage *page = _atlas->getPages()[i];
if (page->pma) return -1;
}
return 0;
}
utf8 *spine_atlas_get_error(spine_atlas atlas) {
if (!atlas) return nullptr;
return ((_spine_atlas *) atlas)->error;
}
void spine_atlas_dispose(spine_atlas atlas) {
if (!atlas) return;
_spine_atlas *_atlas = (_spine_atlas *) atlas;
if (_atlas->atlas) {
delete (Atlas *) _atlas->atlas;
}
if (_atlas->imagePaths) {
for (int i = 0; i < _atlas->numImagePaths; i++) {
if (_atlas->imagePaths[i]) {
SpineExtension::free(_atlas->imagePaths[i], __FILE__, __LINE__);
}
}
SpineExtension::free(_atlas->imagePaths, __FILE__, __LINE__);
}
if (_atlas->error) {
SpineExtension::free(_atlas->error, __FILE__, __LINE__);
}
SpineExtension::free(_atlas, __FILE__, __LINE__);
}
// Skeleton data loading
spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const utf8 *skeletonData) {
if (!atlas || !skeletonData) return nullptr;
_spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__);
SkeletonJson json((Atlas *) ((_spine_atlas *) atlas)->atlas);
json.setScale(1);
SkeletonData *data = json.readSkeletonData(skeletonData);
if (!data) {
result->error = (utf8 *) strdup("Failed to load skeleton data");
return (spine_skeleton_data_result) result;
}
result->skeletonData = (spine_skeleton_data) data;
return (spine_skeleton_data_result) result;
}
spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length) {
if (!atlas || !skeletonData) return nullptr;
_spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__);
SkeletonBinary binary((Atlas *) ((_spine_atlas *) atlas)->atlas);
binary.setScale(1);
SkeletonData *data = binary.readSkeletonData((const unsigned char *) skeletonData, length);
if (!data) {
result->error = (utf8 *) strdup("Failed to load skeleton data");
return (spine_skeleton_data_result) result;
}
result->skeletonData = (spine_skeleton_data) data;
return (spine_skeleton_data_result) result;
}
utf8 *spine_skeleton_data_result_get_error(spine_skeleton_data_result result) {
if (!result) return nullptr;
return ((_spine_skeleton_data_result *) result)->error;
}
spine_skeleton_data spine_skeleton_data_result_get_data(spine_skeleton_data_result result) {
if (!result) return nullptr;
return ((_spine_skeleton_data_result *) result)->skeletonData;
}
void spine_skeleton_data_result_dispose(spine_skeleton_data_result result) {
if (!result) return;
_spine_skeleton_data_result *_result = (_spine_skeleton_data_result *) result;
if (_result->error) {
SpineExtension::free(_result->error, __FILE__, __LINE__);
}
SpineExtension::free(_result, __FILE__, __LINE__);
}
// Skeleton drawable
spine_skeleton_drawable spine_skeleton_drawable_create(spine_skeleton_data skeletonData) {
if (!skeletonData) return nullptr;
_spine_skeleton_drawable *drawable = new (__FILE__, __LINE__) _spine_skeleton_drawable();
Skeleton *skeleton = new (__FILE__, __LINE__) Skeleton(*((SkeletonData *) skeletonData));
AnimationStateData *stateData = new (__FILE__, __LINE__) AnimationStateData((SkeletonData *) skeletonData);
AnimationState *state = new (__FILE__, __LINE__) AnimationState(stateData);
EventListener *listener = new (__FILE__, __LINE__) EventListener();
state->setListener(listener);
drawable->skeleton = (spine_skeleton) skeleton;
drawable->animationStateData = (spine_animation_state_data) stateData;
drawable->animationState = (spine_animation_state) state;
drawable->animationStateEvents = (spine_animation_state_events) listener;
drawable->renderer = new (__FILE__, __LINE__) SkeletonRenderer();
return (spine_skeleton_drawable) drawable;
}
spine_render_command spine_skeleton_drawable_render(spine_skeleton_drawable drawable) {
if (!drawable) return nullptr;
_spine_skeleton_drawable *_drawable = (_spine_skeleton_drawable *) drawable;
Skeleton *skeleton = (Skeleton *) _drawable->skeleton;
SkeletonRenderer *renderer = _drawable->renderer;
RenderCommand *commands = renderer->render(*skeleton);
return (spine_render_command) commands;
}
void spine_skeleton_drawable_dispose(spine_skeleton_drawable drawable) {
if (!drawable) return;
_spine_skeleton_drawable *_drawable = (_spine_skeleton_drawable *) drawable;
if (_drawable->renderer) {
delete _drawable->renderer;
}
if (_drawable->animationState) {
delete (AnimationState *) _drawable->animationState;
}
if (_drawable->animationStateData) {
delete (AnimationStateData *) _drawable->animationStateData;
}
if (_drawable->skeleton) {
delete (Skeleton *) _drawable->skeleton;
}
if (_drawable->animationStateEvents) {
delete (EventListener *) _drawable->animationStateEvents;
}
delete _drawable;
}
spine_skeleton spine_skeleton_drawable_get_skeleton(spine_skeleton_drawable drawable) {
if (!drawable) return nullptr;
return ((_spine_skeleton_drawable *) drawable)->skeleton;
}
spine_animation_state spine_skeleton_drawable_get_animation_state(spine_skeleton_drawable drawable) {
if (!drawable) return nullptr;
return ((_spine_skeleton_drawable *) drawable)->animationState;
}
spine_animation_state_data spine_skeleton_drawable_get_animation_state_data(spine_skeleton_drawable drawable) {
if (!drawable) return nullptr;
return ((_spine_skeleton_drawable *) drawable)->animationStateData;
}
spine_animation_state_events spine_skeleton_drawable_get_animation_state_events(spine_skeleton_drawable drawable) {
if (!drawable) return nullptr;
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__);
return (spine_skin_entries) entries;
}
void spine_skin_entries_dispose(spine_skin_entries entries) {
if (!entries) return;
_spine_skin_entries *_entries = (_spine_skin_entries *) entries;
if (_entries->entries) {
for (int i = 0; i < _entries->numEntries; i++) {
if (_entries->entries[i].name) {
SpineExtension::free(_entries->entries[i].name, __FILE__, __LINE__);
}
}
SpineExtension::free(_entries->entries, __FILE__, __LINE__);
}
SpineExtension::free(_entries, __FILE__, __LINE__);
}
int32_t spine_skin_entries_get_num_entries(spine_skin_entries entries) {
if (!entries) return 0;
return ((_spine_skin_entries *) entries)->numEntries;
}
spine_skin_entry spine_skin_entries_get_entry(spine_skin_entries entries, int32_t index) {
if (!entries) return nullptr;
_spine_skin_entries *_entries = (_spine_skin_entries *) entries;
if (index < 0 || index >= _entries->numEntries) return nullptr;
return (spine_skin_entry) &_entries->entries[index];
}
int32_t spine_skin_entry_get_slot_index(spine_skin_entry entry) {
if (!entry) return 0;
return ((_spine_skin_entry *) entry)->slotIndex;
}
const utf8 *spine_skin_entry_get_name(spine_skin_entry entry) {
if (!entry) return nullptr;
return ((_spine_skin_entry *) entry)->name;
}
spine_attachment spine_skin_entry_get_attachment(spine_skin_entry entry) {
if (!entry) return nullptr;
return ((_spine_skin_entry *) entry)->attachment;
}

194
spine-c-new/src/custom.h Normal file
View File

@ -0,0 +1,194 @@
/******************************************************************************
* 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_NEW_CUSTOM_H
#define SPINE_C_NEW_CUSTOM_H
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
#if _WIN32
#define SPINE_C_EXPORT extern "C" __declspec(dllexport)
#else
#ifdef __EMSCRIPTEN__
#define SPINE_C_EXPORT extern "C" __attribute__((used))
#else
#define SPINE_C_EXPORT extern "C"
#endif
#endif
#else
#if _WIN32
#define SPINE_C_EXPORT __declspec(dllexport)
#else
#ifdef __EMSCRIPTEN__
#define SPINE_C_EXPORT __attribute__((used))
#else
#define SPINE_C_EXPORT
#endif
#endif
#endif
#define SPINE_OPAQUE_TYPE(name) \
typedef struct name##_wrapper { \
} name##_wrapper; \
typedef name##_wrapper *name;
typedef char utf8;
typedef int32_t spine_bool;
typedef size_t spine_size_t;
// Custom types for spine-c-new
SPINE_OPAQUE_TYPE(spine_atlas)
SPINE_OPAQUE_TYPE(spine_skeleton_data_result)
SPINE_OPAQUE_TYPE(spine_bounds)
SPINE_OPAQUE_TYPE(spine_vector)
SPINE_OPAQUE_TYPE(spine_color)
SPINE_OPAQUE_TYPE(spine_skeleton_drawable)
SPINE_OPAQUE_TYPE(spine_render_command)
SPINE_OPAQUE_TYPE(spine_skin_entry)
SPINE_OPAQUE_TYPE(spine_skin_entries)
SPINE_OPAQUE_TYPE(spine_rtti)
// Texture loader callbacks
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(spine_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);
// 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);
// Vector functions
SPINE_C_EXPORT float spine_vector_get_x(spine_vector vector);
SPINE_C_EXPORT float spine_vector_get_y(spine_vector vector);
// Atlas functions
SPINE_C_EXPORT spine_atlas spine_atlas_load(const utf8 *atlasData);
SPINE_C_EXPORT spine_atlas spine_atlas_load_callback(const utf8 *atlasData, const utf8 *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 utf8 *spine_atlas_get_image_path(spine_atlas atlas, int32_t index);
SPINE_C_EXPORT spine_bool spine_atlas_is_pma(spine_atlas atlas);
SPINE_C_EXPORT utf8 *spine_atlas_get_error(spine_atlas atlas);
SPINE_C_EXPORT void spine_atlas_dispose(spine_atlas atlas);
// Forward declarations for types used in generated headers
struct spine_skeleton_data_wrapper;
typedef struct spine_skeleton_data_wrapper *spine_skeleton_data;
struct spine_timeline_wrapper;
typedef struct spine_timeline_wrapper *spine_timeline;
struct spine_skeleton_wrapper;
typedef struct spine_skeleton_wrapper *spine_skeleton;
struct spine_event_wrapper;
typedef struct spine_event_wrapper *spine_event;
struct spine_skin_wrapper;
typedef struct spine_skin_wrapper *spine_skin;
struct spine_sequence_wrapper;
typedef struct spine_sequence_wrapper *spine_sequence;
struct spine_attachment_wrapper;
typedef struct spine_attachment_wrapper *spine_attachment;
SPINE_C_EXPORT spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const utf8 *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 utf8 *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);
// Skeleton drawable - these need forward declarations
struct spine_skeleton_wrapper;
typedef struct spine_skeleton_wrapper *spine_skeleton;
struct spine_animation_state_wrapper;
typedef struct spine_animation_state_wrapper *spine_animation_state;
struct spine_animation_state_data_wrapper;
typedef struct spine_animation_state_data_wrapper *spine_animation_state_data;
struct spine_animation_state_events_wrapper;
typedef struct spine_animation_state_events_wrapper *spine_animation_state_events;
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);
// Forward declaration for spine_blend_mode enum
typedef enum spine_blend_mode {
SPINE_BLEND_MODE_NORMAL = 0,
SPINE_BLEND_MODE_ADDITIVE,
SPINE_BLEND_MODE_MULTIPLY,
SPINE_BLEND_MODE_SCREEN
} spine_blend_mode;
// Forward declarations for other enum types used in generated headers
typedef enum spine_mix_blend spine_mix_blend;
typedef enum spine_mix_direction spine_mix_direction;
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);
// Skin entries - these need forward declarations
struct spine_attachment_wrapper;
typedef struct spine_attachment_wrapper *spine_attachment;
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_EXPORT int32_t spine_skin_entry_get_slot_index(spine_skin_entry entry);
SPINE_C_EXPORT const utf8 *spine_skin_entry_get_name(spine_skin_entry entry);
SPINE_C_EXPORT spine_attachment spine_skin_entry_get_attachment(spine_skin_entry entry);
#endif // SPINE_C_NEW_CUSTOM_H

View File

@ -0,0 +1,103 @@
/******************************************************************************
* 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(spine_size_t frameCount, spine_size_t bezierCount, int32_t slotIndex) {
AlphaTimeline *obj = new (__FILE__, __LINE__) AlphaTimeline(frameCount, bezierCount, slotIndex);
return (spine_alpha_timeline) obj;
}
void spine_alpha_timeline_dispose(spine_alpha_timeline obj) {
if (!obj) return;
delete (AlphaTimeline *) obj;
}
spine_rtti spine_alpha_timeline_get_rtti(spine_alpha_timeline obj) {
if (!obj) return nullptr;
AlphaTimeline *_obj = (AlphaTimeline *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_alpha_timeline_apply(spine_alpha_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
AlphaTimeline *_obj = (AlphaTimeline *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
void spine_alpha_timeline_set_frame(spine_alpha_timeline obj, spine_size_t frame, float time, float value) {
if (!obj) return ;
AlphaTimeline *_obj = (AlphaTimeline *) obj;
_obj->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_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, 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, 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, float value) {
if (!obj) return 0;
AlphaTimeline *_obj = (AlphaTimeline *) obj;
return _obj->getAbsoluteValue(time, alpha, 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, blend, direction, current, setup);
}
int32_t 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_slot_index(spine_alpha_timeline obj, int32_t value) {
if (!obj) return;
AlphaTimeline *_obj = (AlphaTimeline *) obj;
_obj->setSlotIndex(value);
}

View File

@ -0,0 +1,58 @@
/******************************************************************************
* 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_ALPHATIMELINE_H
#define SPINE_C_ALPHATIMELINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_alpha_timeline)
SPINE_C_EXPORT spine_alpha_timeline spine_alpha_timeline_create(spine_size_t frameCount, spine_size_t bezierCount, int32_t slotIndex);
SPINE_C_EXPORT void spine_alpha_timeline_dispose(spine_alpha_timeline obj);
SPINE_C_EXPORT spine_rtti spine_alpha_timeline_get_rtti(spine_alpha_timeline obj);
SPINE_C_EXPORT void spine_alpha_timeline_apply(spine_alpha_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT void spine_alpha_timeline_set_frame(spine_alpha_timeline obj, spine_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(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 int32_t spine_alpha_timeline_get_slot_index(spine_alpha_timeline obj);
SPINE_C_EXPORT void spine_alpha_timeline_set_slot_index(spine_alpha_timeline obj, int32_t value);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ALPHATIMELINE_H

View File

@ -0,0 +1,115 @@
/******************************************************************************
* 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 utf8 * name, void * timelines, float duration) {
Animation *obj = new (__FILE__, __LINE__) Animation(String(name), (Vector<Timeline *> &) timelines, duration);
return (spine_animation) obj;
}
void spine_animation_dispose(spine_animation obj) {
if (!obj) return;
delete (Animation *) obj;
}
void * spine_animation_get_timelines(spine_animation obj) {
if (!obj) return nullptr;
Animation *_obj = (Animation *) obj;
return (void *) _obj->getTimelines();
}
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_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 obj, void * value) {
if (!obj) return;
Animation *_obj = (Animation *) obj;
_obj->setTimelines((Vector<Timeline *> &) value);
}
spine_bool spine_animation_has_timeline(spine_animation obj, void * ids) {
if (!obj) return 0;
Animation *_obj = (Animation *) obj;
return _obj->hasTimeline((Vector<PropertyId> &) ids);
}
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 obj, float value) {
if (!obj) return;
Animation *_obj = (Animation *) obj;
_obj->setDuration(value);
}
void spine_animation_apply(spine_animation obj, spine_skeleton skeleton, float lastTime, float time, spine_bool loop, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
Animation *_obj = (Animation *) obj;
_obj->apply(skeleton, lastTime, time, loop, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
const utf8 * spine_animation_get_name(spine_animation obj) {
if (!obj) return nullptr;
Animation *_obj = (Animation *) obj;
return (const utf8 *) _obj->getName().buffer();
}
int32_t * spine_animation_get_bones(spine_animation obj) {
if (!obj) return 0;
Animation *_obj = (Animation *) obj;
return _obj->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();
}
int32_t *spine_animation_get_bones(spine_animation obj) {
if (!obj) return nullptr;
Animation *_obj = (Animation *) obj;
return (int32_t *) _obj->getBones().buffer();
}

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_ANIMATION_H
#define SPINE_C_ANIMATION_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_animation)
SPINE_C_EXPORT spine_animation spine_animation_create(const utf8 * name, void * timelines, float duration);
SPINE_C_EXPORT void spine_animation_dispose(spine_animation obj);
SPINE_C_EXPORT void * spine_animation_get_timelines(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, void * value);
SPINE_C_EXPORT spine_bool spine_animation_has_timeline(spine_animation obj, void * 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, spine_bool loop, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT const utf8 * spine_animation_get_name(spine_animation obj);
SPINE_C_EXPORT int32_t * spine_animation_get_bones(spine_animation obj);
SPINE_C_EXPORT int32_t spine_animation_get_num_bones(spine_animation obj);
SPINE_C_EXPORT int32_t *spine_animation_get_bones(spine_animation obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ANIMATION_H

View File

@ -0,0 +1,169 @@
/******************************************************************************
* 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;
}
void spine_animation_state_dispose(spine_animation_state obj) {
if (!obj) return;
delete (AnimationState *) obj;
}
void spine_animation_state_update(spine_animation_state obj, float delta) {
if (!obj) return ;
AnimationState *_obj = (AnimationState *) obj;
_obj->update(delta);
}
spine_bool spine_animation_state_apply(spine_animation_state obj, spine_skeleton skeleton) {
if (!obj) return 0;
AnimationState *_obj = (AnimationState *) obj;
return _obj->apply(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_track(spine_animation_state obj, spine_size_t trackIndex) {
if (!obj) return ;
AnimationState *_obj = (AnimationState *) obj;
_obj->clearTrack(trackIndex);
}
spine_track_entry spine_animation_state_set_animation(spine_animation_state obj, spine_size_t trackIndex, const utf8 * animationName, spine_bool loop) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (spine_track_entry) _obj->setAnimation(trackIndex, String(animationName), loop);
}
spine_track_entry spine_animation_state_set_animation(spine_animation_state obj, spine_size_t trackIndex, spine_animation animation, spine_bool loop) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (spine_track_entry) _obj->setAnimation(trackIndex, (Animation *) animation, loop);
}
spine_track_entry spine_animation_state_add_animation(spine_animation_state obj, spine_size_t trackIndex, const utf8 * animationName, spine_bool loop, float delay) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (spine_track_entry) _obj->addAnimation(trackIndex, String(animationName), loop, delay);
}
spine_track_entry spine_animation_state_add_animation(spine_animation_state obj, spine_size_t trackIndex, spine_animation animation, spine_bool loop, float delay) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (spine_track_entry) _obj->addAnimation(trackIndex, (Animation *) animation, loop, delay);
}
spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state obj, spine_size_t trackIndex, float mixDuration) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (spine_track_entry) _obj->setEmptyAnimation(trackIndex, mixDuration);
}
spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state obj, spine_size_t trackIndex, float mixDuration, float delay) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (spine_track_entry) _obj->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);
}
spine_track_entry spine_animation_state_get_current(spine_animation_state obj, spine_size_t trackIndex) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (spine_track_entry) _obj->getCurrent(trackIndex);
}
spine_animation_state_data spine_animation_state_get_data(spine_animation_state obj) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (spine_animation_state_data) _obj->getData();
}
void * spine_animation_state_get_tracks(spine_animation_state obj) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (void *) _obj->getTracks();
}
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_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 obj) {
if (!obj) return 0;
AnimationState *_obj = (AnimationState *) obj;
return _obj->getTimeScale();
}
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_dispose_track_entry(spine_animation_state obj, spine_track_entry entry) {
if (!obj) return ;
AnimationState *_obj = (AnimationState *) obj;
_obj->disposeTrackEntry((TrackEntry *) entry);
}
spine_void spine_animation_state_get_renderer_object(spine_animation_state obj) {
if (!obj) return nullptr;
AnimationState *_obj = (AnimationState *) obj;
return (spine_void) _obj->getRendererObject();
}
void spine_animation_state_set_renderer_object(spine_animation_state obj, spine_void rendererObject, spine_dispose_renderer_object dispose) {
if (!obj) return ;
AnimationState *_obj = (AnimationState *) obj;
_obj->setRendererObject((void *) rendererObject, dispose);
}

View File

@ -0,0 +1,69 @@
/******************************************************************************
* 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_ANIMATIONSTATE_H
#define SPINE_C_ANIMATIONSTATE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_animation_state)
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 spine_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, spine_size_t trackIndex);
SPINE_C_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state obj, spine_size_t trackIndex, const utf8 * animationName, spine_bool loop);
SPINE_C_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state obj, spine_size_t trackIndex, spine_animation animation, spine_bool loop);
SPINE_C_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state obj, spine_size_t trackIndex, const utf8 * animationName, spine_bool loop, float delay);
SPINE_C_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state obj, spine_size_t trackIndex, spine_animation animation, spine_bool loop, float delay);
SPINE_C_EXPORT spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state obj, spine_size_t trackIndex, float mixDuration);
SPINE_C_EXPORT spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state obj, spine_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, spine_size_t trackIndex);
SPINE_C_EXPORT spine_animation_state_data spine_animation_state_get_data(spine_animation_state obj);
SPINE_C_EXPORT void * spine_animation_state_get_tracks(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_dispose_track_entry(spine_animation_state obj, spine_track_entry entry);
SPINE_C_EXPORT spine_void spine_animation_state_get_renderer_object(spine_animation_state obj);
SPINE_C_EXPORT void spine_animation_state_set_renderer_object(spine_animation_state obj, spine_void rendererObject, spine_dispose_renderer_object dispose);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ANIMATIONSTATE_H

View File

@ -0,0 +1,85 @@
/******************************************************************************
* 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;
}
void spine_animation_state_data_dispose(spine_animation_state_data obj) {
if (!obj) return;
delete (AnimationStateData *) obj;
}
spine_skeleton_data spine_animation_state_data_get_skeleton_data(spine_animation_state_data obj) {
if (!obj) return nullptr;
AnimationStateData *_obj = (AnimationStateData *) obj;
return (spine_skeleton_data) _obj->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();
}
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_mix(spine_animation_state_data obj, const utf8 * fromName, const utf8 * toName, float duration) {
if (!obj) return ;
AnimationStateData *_obj = (AnimationStateData *) obj;
_obj->setMix(String(fromName), String(toName), duration);
}
void spine_animation_state_data_set_mix(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);
}
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);
}
void spine_animation_state_data_clear(spine_animation_state_data obj) {
if (!obj) return ;
AnimationStateData *_obj = (AnimationStateData *) obj;
_obj->clear();
}

View File

@ -0,0 +1,55 @@
/******************************************************************************
* 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_ANIMATIONSTATEDATA_H
#define SPINE_C_ANIMATIONSTATEDATA_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_animation_state_data)
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 utf8 * fromName, const utf8 * toName, float duration);
SPINE_C_EXPORT void spine_animation_state_data_set_mix(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);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ANIMATIONSTATEDATA_H

View File

@ -0,0 +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 "atlas.h"
#include <spine/spine.h>
using namespace spine;
spine_atlas spine_atlas_create(const utf8 * path, spine_texture_loader textureLoader, spine_bool createTexture) {
Atlas *obj = new (__FILE__, __LINE__) Atlas(String(path), (TextureLoader *) textureLoader, createTexture);
return (spine_atlas) obj;
}
spine_atlas spine_atlas_create_with_string_int_string_texture_loader_bool(const utf8 * data, int32_t length, const utf8 * dir, spine_texture_loader textureLoader, spine_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_dispose(spine_atlas obj) {
if (!obj) return;
delete (Atlas *) obj;
}
void spine_atlas_flip_v(spine_atlas obj) {
if (!obj) return ;
Atlas *_obj = (Atlas *) obj;
_obj->flipV();
}
spine_atlas_region spine_atlas_find_region(spine_atlas obj, const utf8 * name) {
if (!obj) return nullptr;
Atlas *_obj = (Atlas *) obj;
return (spine_atlas_region) _obj->findRegion(String(name));
}
void * spine_atlas_get_pages(spine_atlas obj) {
if (!obj) return nullptr;
Atlas *_obj = (Atlas *) obj;
return (void *) _obj->getPages();
}
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();
}
void * spine_atlas_get_regions(spine_atlas obj) {
if (!obj) return nullptr;
Atlas *_obj = (Atlas *) obj;
return (void *) _obj->getRegions();
}
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();
}

View File

@ -0,0 +1,57 @@
/******************************************************************************
* 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_ATLAS_H
#define SPINE_C_ATLAS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_atlas)
SPINE_C_EXPORT spine_atlas spine_atlas_create(const utf8 * path, spine_texture_loader textureLoader, spine_bool createTexture);
SPINE_C_EXPORT spine_atlas spine_atlas_create_with_string_int_string_texture_loader_bool(const utf8 * data, int32_t length, const utf8 * dir, spine_texture_loader textureLoader, spine_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 utf8 * name);
SPINE_C_EXPORT void * spine_atlas_get_pages(spine_atlas obj);
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 void * spine_atlas_get_regions(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);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ATLAS_H

View File

@ -0,0 +1,85 @@
/******************************************************************************
* 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;
}
void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader obj) {
if (!obj) return;
delete (AtlasAttachmentLoader *) obj;
}
spine_region_attachment spine_atlas_attachment_loader_new_region_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const utf8 * name, const utf8 * path, spine_sequence sequence) {
if (!obj) return nullptr;
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
return (spine_region_attachment) _obj->newRegionAttachment(skin, String(name), String(path), (Sequence *) sequence);
}
spine_mesh_attachment spine_atlas_attachment_loader_new_mesh_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const utf8 * name, const utf8 * path, spine_sequence sequence) {
if (!obj) return nullptr;
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
return (spine_mesh_attachment) _obj->newMeshAttachment(skin, String(name), 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 utf8 * name) {
if (!obj) return nullptr;
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
return (spine_bounding_box_attachment) _obj->newBoundingBoxAttachment(skin, String(name));
}
spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const utf8 * name) {
if (!obj) return nullptr;
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
return (spine_path_attachment) _obj->newPathAttachment(skin, String(name));
}
spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const utf8 * name) {
if (!obj) return 0;
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
return (spine_point_attachment) _obj->newPointAttachment(skin, String(name));
}
spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const utf8 * name) {
if (!obj) return nullptr;
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
return (spine_clipping_attachment) _obj->newClippingAttachment(skin, String(name));
}
spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader obj, const utf8 * name) {
if (!obj) return nullptr;
AtlasAttachmentLoader *_obj = (AtlasAttachmentLoader *) obj;
return (spine_atlas_region) _obj->findRegion(String(name));
}

View File

@ -0,0 +1,55 @@
/******************************************************************************
* 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_ATLASATTACHMENTLOADER_H
#define SPINE_C_ATLASATTACHMENTLOADER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_atlas_attachment_loader)
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 utf8 * name, const utf8 * 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 utf8 * name, const utf8 * 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 utf8 * name);
SPINE_C_EXPORT spine_path_attachment spine_atlas_attachment_loader_new_path_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const utf8 * name);
SPINE_C_EXPORT spine_point_attachment spine_atlas_attachment_loader_new_point_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const utf8 * name);
SPINE_C_EXPORT spine_clipping_attachment spine_atlas_attachment_loader_new_clipping_attachment(spine_atlas_attachment_loader obj, spine_skin skin, const utf8 * name);
SPINE_C_EXPORT spine_atlas_region spine_atlas_attachment_loader_find_region(spine_atlas_attachment_loader obj, const utf8 * name);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ATLASATTACHMENTLOADER_H

View File

@ -0,0 +1,43 @@
/******************************************************************************
* 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 utf8 * inName) {
AtlasPage *obj = new (__FILE__, __LINE__) AtlasPage(String(inName));
return (spine_atlas_page) obj;
}
void spine_atlas_page_dispose(spine_atlas_page obj) {
if (!obj) return;
delete (AtlasPage *) obj;
}

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_ATLASPAGE_H
#define SPINE_C_ATLASPAGE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_atlas_page)
SPINE_C_EXPORT spine_atlas_page spine_atlas_page_create(const utf8 * inName);
SPINE_C_EXPORT void spine_atlas_page_dispose(spine_atlas_page obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ATLASPAGE_H

View File

@ -0,0 +1,38 @@
/******************************************************************************
* 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;
}

View File

@ -0,0 +1,47 @@
/******************************************************************************
* 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_ATLASREGION_H
#define SPINE_C_ATLASREGION_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_atlas_region)
SPINE_C_EXPORT void spine_atlas_region_dispose(spine_atlas_region obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ATLASREGION_H

View File

@ -0,0 +1,142 @@
/******************************************************************************
* 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;
spine_attachment spine_attachment_create(const utf8 * name) {
Attachment *obj = new (__FILE__, __LINE__) Attachment(String(name));
return (spine_attachment) obj;
}
void spine_attachment_dispose(spine_attachment obj) {
if (!obj) return;
delete (Attachment *) obj;
}
spine_rtti spine_attachment_get_rtti(spine_attachment obj) {
if (!obj) return nullptr;
Attachment *_obj = (Attachment *) obj;
return (spine_rtti) &_obj->getRTTI();
}
const utf8 * spine_attachment_get_name(spine_attachment obj) {
if (!obj) return nullptr;
Attachment *_obj = (Attachment *) obj;
return (const utf8 *) _obj->getName().buffer();
}
spine_attachment spine_attachment_copy(spine_attachment obj) {
if (!obj) return nullptr;
Attachment *_obj = (Attachment *) obj;
return (spine_attachment) _obj->copy();
}
int32_t spine_attachment_get_ref_count(spine_attachment obj) {
if (!obj) return 0;
Attachment *_obj = (Attachment *) obj;
return _obj->getRefCount();
}
void spine_attachment_reference(spine_attachment obj) {
if (!obj) return ;
Attachment *_obj = (Attachment *) obj;
_obj->reference();
}
void spine_attachment_dereference(spine_attachment obj) {
if (!obj) return ;
Attachment *_obj = (Attachment *) obj;
_obj->dereference();
}
spine_bool spine_attachment_is_type(spine_attachment obj, spine_attachment_type type) {
if (!obj) return 0;
Attachment *_obj = (Attachment *) obj;
switch (type) {
case SPINE_TYPE_ATTACHMENT_POINT_ATTACHMENT:
return _obj->getRTTI().instanceOf(PointAttachment::rtti);
case SPINE_TYPE_ATTACHMENT_REGION_ATTACHMENT:
return _obj->getRTTI().instanceOf(RegionAttachment::rtti);
case SPINE_TYPE_ATTACHMENT_BOUNDING_BOX_ATTACHMENT:
return _obj->getRTTI().instanceOf(BoundingBoxAttachment::rtti);
case SPINE_TYPE_ATTACHMENT_CLIPPING_ATTACHMENT:
return _obj->getRTTI().instanceOf(ClippingAttachment::rtti);
case SPINE_TYPE_ATTACHMENT_MESH_ATTACHMENT:
return _obj->getRTTI().instanceOf(MeshAttachment::rtti);
case SPINE_TYPE_ATTACHMENT_PATH_ATTACHMENT:
return _obj->getRTTI().instanceOf(PathAttachment::rtti);
}
return 0;
}
spine_point_attachment spine_attachment_as_point_attachment(spine_attachment obj) {
if (!obj) return nullptr;
Attachment *_obj = (Attachment *) obj;
if (!_obj->getRTTI().instanceOf(PointAttachment::rtti)) return nullptr;
return (spine_point_attachment) obj;
}
spine_region_attachment spine_attachment_as_region_attachment(spine_attachment obj) {
if (!obj) return nullptr;
Attachment *_obj = (Attachment *) obj;
if (!_obj->getRTTI().instanceOf(RegionAttachment::rtti)) return nullptr;
return (spine_region_attachment) obj;
}
spine_bounding_box_attachment spine_attachment_as_bounding_box_attachment(spine_attachment obj) {
if (!obj) return nullptr;
Attachment *_obj = (Attachment *) obj;
if (!_obj->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) return nullptr;
return (spine_bounding_box_attachment) obj;
}
spine_clipping_attachment spine_attachment_as_clipping_attachment(spine_attachment obj) {
if (!obj) return nullptr;
Attachment *_obj = (Attachment *) obj;
if (!_obj->getRTTI().instanceOf(ClippingAttachment::rtti)) return nullptr;
return (spine_clipping_attachment) obj;
}
spine_mesh_attachment spine_attachment_as_mesh_attachment(spine_attachment obj) {
if (!obj) return nullptr;
Attachment *_obj = (Attachment *) obj;
if (!_obj->getRTTI().instanceOf(MeshAttachment::rtti)) return nullptr;
return (spine_mesh_attachment) obj;
}
spine_path_attachment spine_attachment_as_path_attachment(spine_attachment obj) {
if (!obj) return nullptr;
Attachment *_obj = (Attachment *) obj;
if (!_obj->getRTTI().instanceOf(PathAttachment::rtti)) return nullptr;
return (spine_path_attachment) obj;
}

View File

@ -0,0 +1,83 @@
/******************************************************************************
* 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_ATTACHMENT_H
#define SPINE_C_ATTACHMENT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_attachment)
SPINE_C_EXPORT spine_attachment spine_attachment_create(const utf8 * name);
SPINE_C_EXPORT void spine_attachment_dispose(spine_attachment obj);
SPINE_C_EXPORT spine_rtti spine_attachment_get_rtti(spine_attachment obj);
SPINE_C_EXPORT const utf8 * spine_attachment_get_name(spine_attachment obj);
SPINE_C_EXPORT spine_attachment spine_attachment_copy(spine_attachment obj);
SPINE_C_EXPORT int32_t 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);
struct spine_point_attachment_wrapper;
typedef struct spine_point_attachment_wrapper *spine_point_attachment;
struct spine_region_attachment_wrapper;
typedef struct spine_region_attachment_wrapper *spine_region_attachment;
struct spine_bounding_box_attachment_wrapper;
typedef struct spine_bounding_box_attachment_wrapper *spine_bounding_box_attachment;
struct spine_clipping_attachment_wrapper;
typedef struct spine_clipping_attachment_wrapper *spine_clipping_attachment;
struct spine_mesh_attachment_wrapper;
typedef struct spine_mesh_attachment_wrapper *spine_mesh_attachment;
struct spine_path_attachment_wrapper;
typedef struct spine_path_attachment_wrapper *spine_path_attachment;
typedef enum spine_attachment_type {
SPINE_TYPE_ATTACHMENT_POINT_ATTACHMENT = 0,
SPINE_TYPE_ATTACHMENT_REGION_ATTACHMENT = 1,
SPINE_TYPE_ATTACHMENT_BOUNDING_BOX_ATTACHMENT = 2,
SPINE_TYPE_ATTACHMENT_CLIPPING_ATTACHMENT = 3,
SPINE_TYPE_ATTACHMENT_MESH_ATTACHMENT = 4,
SPINE_TYPE_ATTACHMENT_PATH_ATTACHMENT = 5
} spine_attachment_type;
SPINE_C_EXPORT spine_bool spine_attachment_is_type(spine_attachment obj, spine_attachment_type type);
SPINE_C_EXPORT spine_point_attachment spine_attachment_as_point_attachment(spine_attachment obj);
SPINE_C_EXPORT spine_region_attachment spine_attachment_as_region_attachment(spine_attachment obj);
SPINE_C_EXPORT spine_bounding_box_attachment spine_attachment_as_bounding_box_attachment(spine_attachment obj);
SPINE_C_EXPORT spine_clipping_attachment spine_attachment_as_clipping_attachment(spine_attachment obj);
SPINE_C_EXPORT spine_mesh_attachment spine_attachment_as_mesh_attachment(spine_attachment obj);
SPINE_C_EXPORT spine_path_attachment spine_attachment_as_path_attachment(spine_attachment obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ATTACHMENT_H

View File

@ -0,0 +1,79 @@
/******************************************************************************
* 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;
spine_attachment_loader spine_attachment_loader_create(void) {
AttachmentLoader *obj = new (__FILE__, __LINE__) AttachmentLoader();
return (spine_attachment_loader) obj;
}
void spine_attachment_loader_dispose(spine_attachment_loader obj) {
if (!obj) return;
delete (AttachmentLoader *) obj;
}
spine_region_attachment spine_attachment_loader_new_region_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name, const utf8 * path, spine_sequence sequence) {
if (!obj) return nullptr;
AttachmentLoader *_obj = (AttachmentLoader *) obj;
return (spine_region_attachment) _obj->newRegionAttachment(skin, String(name), String(path), (Sequence *) sequence);
}
spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name, const utf8 * path, spine_sequence sequence) {
if (!obj) return nullptr;
AttachmentLoader *_obj = (AttachmentLoader *) obj;
return (spine_mesh_attachment) _obj->newMeshAttachment(skin, String(name), String(path), (Sequence *) sequence);
}
spine_bounding_box_attachment spine_attachment_loader_new_bounding_box_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name) {
if (!obj) return nullptr;
AttachmentLoader *_obj = (AttachmentLoader *) obj;
return (spine_bounding_box_attachment) _obj->newBoundingBoxAttachment(skin, String(name));
}
spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name) {
if (!obj) return nullptr;
AttachmentLoader *_obj = (AttachmentLoader *) obj;
return (spine_path_attachment) _obj->newPathAttachment(skin, String(name));
}
spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name) {
if (!obj) return 0;
AttachmentLoader *_obj = (AttachmentLoader *) obj;
return (spine_point_attachment) _obj->newPointAttachment(skin, String(name));
}
spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name) {
if (!obj) return nullptr;
AttachmentLoader *_obj = (AttachmentLoader *) obj;
return (spine_clipping_attachment) _obj->newClippingAttachment(skin, String(name));
}

View File

@ -0,0 +1,54 @@
/******************************************************************************
* 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_ATTACHMENTLOADER_H
#define SPINE_C_ATTACHMENTLOADER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_attachment_loader)
SPINE_C_EXPORT spine_attachment_loader spine_attachment_loader_create(void);
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 utf8 * name, const utf8 * path, spine_sequence sequence);
SPINE_C_EXPORT spine_mesh_attachment spine_attachment_loader_new_mesh_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name, const utf8 * 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 utf8 * name);
SPINE_C_EXPORT spine_path_attachment spine_attachment_loader_new_path_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name);
SPINE_C_EXPORT spine_point_attachment spine_attachment_loader_new_point_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name);
SPINE_C_EXPORT spine_clipping_attachment spine_attachment_loader_new_clipping_attachment(spine_attachment_loader obj, spine_skin skin, const utf8 * name);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ATTACHMENTLOADER_H

View File

@ -0,0 +1,145 @@
/******************************************************************************
* 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(spine_size_t frameCount, int32_t slotIndex) {
AttachmentTimeline *obj = new (__FILE__, __LINE__) AttachmentTimeline(frameCount, slotIndex);
return (spine_attachment_timeline) obj;
}
void spine_attachment_timeline_dispose(spine_attachment_timeline obj) {
if (!obj) return;
delete (AttachmentTimeline *) obj;
}
spine_rtti spine_attachment_timeline_get_rtti(spine_attachment_timeline obj) {
if (!obj) return nullptr;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_attachment_timeline_apply(spine_attachment_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
void spine_attachment_timeline_set_frame(spine_attachment_timeline obj, int32_t frame, float time, const utf8 * attachmentName) {
if (!obj) return ;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
_obj->setFrame(frame, time, String(attachmentName));
}
void * spine_attachment_timeline_get_attachment_names(spine_attachment_timeline obj) {
if (!obj) return nullptr;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
return _obj->getAttachmentNames();
}
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();
}
spine_string *spine_attachment_timeline_get_attachment_names(spine_attachment_timeline obj) {
if (!obj) return nullptr;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
return (spine_string *) _obj->getAttachmentNames().buffer();
}
spine_size_t spine_attachment_timeline_get_frame_entries(spine_attachment_timeline obj) {
if (!obj) return nullptr;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
return _obj->getFrameEntries();
}
spine_size_t spine_attachment_timeline_get_frame_count(spine_attachment_timeline obj) {
if (!obj) return nullptr;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
return _obj->getFrameCount();
}
void * spine_attachment_timeline_get_frames(spine_attachment_timeline obj) {
if (!obj) return nullptr;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
return _obj->getFrames();
}
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_float *spine_attachment_timeline_get_frames(spine_attachment_timeline obj) {
if (!obj) return nullptr;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
return (spine_float *) _obj->getFrames().buffer();
}
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_get_property_ids(spine_attachment_timeline obj) {
if (!obj) return nullptr;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
return _obj->getPropertyIds();
}
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();
}
spine_property_id *spine_attachment_timeline_get_property_ids(spine_attachment_timeline obj) {
if (!obj) return nullptr;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
return (spine_property_id *) _obj->getPropertyIds().buffer();
}
int32_t 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, int32_t value) {
if (!obj) return;
AttachmentTimeline *_obj = (AttachmentTimeline *) obj;
_obj->setSlotIndex(value);
}

View File

@ -0,0 +1,65 @@
/******************************************************************************
* 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_ATTACHMENTTIMELINE_H
#define SPINE_C_ATTACHMENTTIMELINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_attachment_timeline)
SPINE_C_EXPORT spine_attachment_timeline spine_attachment_timeline_create(spine_size_t frameCount, int32_t slotIndex);
SPINE_C_EXPORT void spine_attachment_timeline_dispose(spine_attachment_timeline obj);
SPINE_C_EXPORT spine_rtti spine_attachment_timeline_get_rtti(spine_attachment_timeline obj);
SPINE_C_EXPORT void spine_attachment_timeline_apply(spine_attachment_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT void spine_attachment_timeline_set_frame(spine_attachment_timeline obj, int32_t frame, float time, const utf8 * attachmentName);
SPINE_C_EXPORT void * spine_attachment_timeline_get_attachment_names(spine_attachment_timeline obj);
SPINE_C_EXPORT int32_t spine_attachment_timeline_get_num_attachment_names(spine_attachment_timeline obj);
SPINE_C_EXPORT spine_string *spine_attachment_timeline_get_attachment_names(spine_attachment_timeline obj);
SPINE_C_EXPORT spine_size_t spine_attachment_timeline_get_frame_entries(spine_attachment_timeline obj);
SPINE_C_EXPORT spine_size_t spine_attachment_timeline_get_frame_count(spine_attachment_timeline obj);
SPINE_C_EXPORT void * spine_attachment_timeline_get_frames(spine_attachment_timeline obj);
SPINE_C_EXPORT int32_t spine_attachment_timeline_get_num_frames(spine_attachment_timeline obj);
SPINE_C_EXPORT spine_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 void * spine_attachment_timeline_get_property_ids(spine_attachment_timeline obj);
SPINE_C_EXPORT int32_t spine_attachment_timeline_get_num_property_ids(spine_attachment_timeline obj);
SPINE_C_EXPORT spine_property_id *spine_attachment_timeline_get_property_ids(spine_attachment_timeline obj);
SPINE_C_EXPORT int32_t spine_attachment_timeline_get_slot_index(spine_attachment_timeline obj);
SPINE_C_EXPORT void spine_attachment_timeline_set_slot_index(spine_attachment_timeline obj, int32_t value);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ATTACHMENTTIMELINE_H

View File

@ -0,0 +1,53 @@
/******************************************************************************
* 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 "../../custom.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum spine_attachment_type {
SPINE_ATTACHMENT_TYPE_ATTACHMENT_TYPE_REGION,
SPINE_ATTACHMENT_TYPE_ATTACHMENT_TYPE_BOUNDINGBOX,
SPINE_ATTACHMENT_TYPE_ATTACHMENT_TYPE_MESH,
SPINE_ATTACHMENT_TYPE_ATTACHMENT_TYPE_LINKEDMESH,
SPINE_ATTACHMENT_TYPE_ATTACHMENT_TYPE_PATH,
SPINE_ATTACHMENT_TYPE_ATTACHMENT_TYPE_POINT,
SPINE_ATTACHMENT_TYPE_ATTACHMENT_TYPE_CLIPPING
} spine_attachment_type;
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_ATTACHMENTTYPE_H

View File

@ -0,0 +1,50 @@
/******************************************************************************
* 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 "../../custom.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum spine_blend_mode {
SPINE_BLEND_MODE_BLEND_MODE_NORMAL = 0,
SPINE_BLEND_MODE_BLEND_MODE_ADDITIVE,
SPINE_BLEND_MODE_BLEND_MODE_MULTIPLY,
SPINE_BLEND_MODE_BLEND_MODE_SCREEN
} spine_blend_mode;
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BLENDMODE_H

View File

@ -0,0 +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 "block.h"
#include <spine/spine.h>
using namespace spine;
void spine_block_dispose(spine_block obj) {
if (!obj) return;
delete (Block *) obj;
}
int32_t spine_block_free(spine_block obj) {
if (!obj) return 0;
Block *_obj = (Block *) obj;
return _obj->free();
}
spine_bool spine_block_can_fit(spine_block obj, int32_t numBytes) {
if (!obj) return 0;
Block *_obj = (Block *) obj;
return _obj->canFit(numBytes);
}
spine_uint8_t spine_block_allocate(spine_block obj, int32_t numBytes) {
if (!obj) return 0;
Block *_obj = (Block *) obj;
return (spine_uint8_t) _obj->allocate(numBytes);
}

View File

@ -0,0 +1,50 @@
/******************************************************************************
* 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 "../custom.h"
SPINE_OPAQUE_TYPE(spine_block)
SPINE_C_EXPORT void spine_block_dispose(spine_block obj);
SPINE_C_EXPORT int32_t spine_block_free(spine_block obj);
SPINE_C_EXPORT spine_bool spine_block_can_fit(spine_block obj, int32_t numBytes);
SPINE_C_EXPORT spine_uint8_t spine_block_allocate(spine_block obj, int32_t numBytes);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BLOCK_H

View File

@ -0,0 +1,138 @@
/******************************************************************************
* 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(data, (Bone *) parent);
return (spine_bone) obj;
}
spine_bone spine_bone_create_with_bone_bone(spine_bone bone, spine_bone parent) {
Bone *obj = new (__FILE__, __LINE__) Bone(bone, (Bone *) parent);
return (spine_bone) obj;
}
void spine_bone_dispose(spine_bone obj) {
if (!obj) return;
delete (Bone *) obj;
}
spine_rtti spine_bone_get_rtti(spine_bone obj) {
if (!obj) return nullptr;
Bone *_obj = (Bone *) obj;
return (spine_rtti) &_obj->getRTTI();
}
spine_bone spine_bone_get_parent(spine_bone obj) {
if (!obj) return nullptr;
Bone *_obj = (Bone *) obj;
return (spine_bone) _obj->getParent();
}
void * spine_bone_get_children(spine_bone obj) {
if (!obj) return nullptr;
Bone *_obj = (Bone *) obj;
return (void *) _obj->getChildren();
}
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_bone *spine_bone_get_children(spine_bone obj) {
if (!obj) return nullptr;
Bone *_obj = (Bone *) obj;
return (spine_bone *) _obj->getChildren().buffer();
}
void spine_bone_setup_pose(spine_bone obj) {
if (!obj) return ;
Bone *_obj = (Bone *) obj;
_obj->setupPose();
}
spine_bone_data spine_bone_get_data(spine_bone obj) {
if (!obj) return nullptr;
Bone *_obj = (Bone *) obj;
return _obj->getData();
}
spine_bone_local spine_bone_get_pose(spine_bone obj) {
if (!obj) return nullptr;
Bone *_obj = (Bone *) obj;
return _obj->getPose();
}
spine_bone_pose spine_bone_get_applied_pose(spine_bone obj) {
if (!obj) return nullptr;
Bone *_obj = (Bone *) obj;
return _obj->getAppliedPose();
}
void spine_bone_reset_constrained(spine_bone obj) {
if (!obj) return ;
Bone *_obj = (Bone *) obj;
_obj->resetConstrained();
}
void spine_bone_pose(spine_bone obj) {
if (!obj) return ;
Bone *_obj = (Bone *) obj;
_obj->pose();
}
void spine_bone_constrained(spine_bone obj) {
if (!obj) return ;
Bone *_obj = (Bone *) obj;
_obj->constrained();
}
spine_bool spine_bone_is_pose_equal_to_applied(spine_bone obj) {
if (!obj) return 0;
Bone *_obj = (Bone *) obj;
return _obj->isPoseEqualToApplied();
}
spine_bool spine_bone_is_active(spine_bone obj) {
if (!obj) return 0;
Bone *_obj = (Bone *) obj;
return _obj->isActive();
}
void spine_bone_set_active(spine_bone obj, spine_bool value) {
if (!obj) return;
Bone *_obj = (Bone *) obj;
_obj->setActive(value);
}

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_BONE_H
#define SPINE_C_BONE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_bone)
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_bone obj);
SPINE_C_EXPORT spine_bone spine_bone_get_parent(spine_bone obj);
SPINE_C_EXPORT void * spine_bone_get_children(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_pose(spine_bone obj);
SPINE_C_EXPORT void spine_bone_constrained(spine_bone obj);
SPINE_C_EXPORT spine_bool spine_bone_is_pose_equal_to_applied(spine_bone obj);
SPINE_C_EXPORT spine_bool spine_bone_is_active(spine_bone obj);
SPINE_C_EXPORT void spine_bone_set_active(spine_bone obj, spine_bool value);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BONE_H

View File

@ -0,0 +1,109 @@
/******************************************************************************
* 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(int32_t index, const utf8 * name, spine_bone_data parent) {
BoneData *obj = new (__FILE__, __LINE__) BoneData(index, String(name), (BoneData *) parent);
return (spine_bone_data) obj;
}
void spine_bone_data_dispose(spine_bone_data obj) {
if (!obj) return;
delete (BoneData *) obj;
}
int32_t spine_bone_data_get_index(spine_bone_data obj) {
if (!obj) return 0;
BoneData *_obj = (BoneData *) obj;
return _obj->getIndex();
}
spine_bone_data spine_bone_data_get_parent(spine_bone_data obj) {
if (!obj) return nullptr;
BoneData *_obj = (BoneData *) obj;
return (spine_bone_data) _obj->getParent();
}
float spine_bone_data_get_length(spine_bone_data obj) {
if (!obj) return 0;
BoneData *_obj = (BoneData *) obj;
return _obj->getLength();
}
void spine_bone_data_set_length(spine_bone_data obj, float value) {
if (!obj) return;
BoneData *_obj = (BoneData *) obj;
_obj->setLength(value);
}
spine_color spine_bone_data_get_color(spine_bone_data obj) {
if (!obj) return nullptr;
BoneData *_obj = (BoneData *) obj;
return (spine_color) &_obj->getColor();
}
const utf8 * spine_bone_data_get_icon(spine_bone_data obj) {
if (!obj) return nullptr;
BoneData *_obj = (BoneData *) obj;
return (const utf8 *) _obj->getIcon().buffer();
}
void spine_bone_data_set_icon(spine_bone_data obj, const utf8 * value) {
if (!obj) return;
BoneData *_obj = (BoneData *) obj;
_obj->setIcon(String(value));
}
spine_bool spine_bone_data_get_visible(spine_bone_data obj) {
if (!obj) return 0;
BoneData *_obj = (BoneData *) obj;
return _obj->getVisible();
}
void spine_bone_data_set_visible(spine_bone_data obj, spine_bool value) {
if (!obj) return;
BoneData *_obj = (BoneData *) obj;
_obj->setVisible(value);
}
spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data obj) {
if (!obj) return nullptr;
BoneData *_obj = (BoneData *) obj;
return _obj->getSetupPose();
}
spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data obj) {
if (!obj) return nullptr;
BoneData *_obj = (BoneData *) obj;
return _obj->getSetupPose();
}

View File

@ -0,0 +1,59 @@
/******************************************************************************
* 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_BONEDATA_H
#define SPINE_C_BONEDATA_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_bone_data)
SPINE_C_EXPORT spine_bone_data spine_bone_data_create(int32_t index, const utf8 * name, spine_bone_data parent);
SPINE_C_EXPORT void spine_bone_data_dispose(spine_bone_data obj);
SPINE_C_EXPORT int32_t 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 utf8 * spine_bone_data_get_icon(spine_bone_data obj);
SPINE_C_EXPORT void spine_bone_data_set_icon(spine_bone_data obj, const utf8 * value);
SPINE_C_EXPORT spine_bool spine_bone_data_get_visible(spine_bone_data obj);
SPINE_C_EXPORT void spine_bone_data_set_visible(spine_bone_data obj, spine_bool value);
SPINE_C_EXPORT spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data obj);
SPINE_C_EXPORT spine_bone_local spine_bone_data_get_setup_pose(spine_bone_data obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BONEDATA_H

View File

@ -0,0 +1,163 @@
/******************************************************************************
* 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;
}
void spine_bone_local_dispose(spine_bone_local obj) {
if (!obj) return;
delete (BoneLocal *) obj;
}
void spine_bone_local_set(spine_bone_local obj, spine_bone_local value) {
if (!obj) return;
BoneLocal *_obj = (BoneLocal *) obj;
_obj->set(value);
}
float spine_bone_local_get_x(spine_bone_local obj) {
if (!obj) return 0;
BoneLocal *_obj = (BoneLocal *) obj;
return _obj->getX();
}
void spine_bone_local_set_x(spine_bone_local obj, float value) {
if (!obj) return;
BoneLocal *_obj = (BoneLocal *) obj;
_obj->setX(value);
}
float spine_bone_local_get_y(spine_bone_local obj) {
if (!obj) return 0;
BoneLocal *_obj = (BoneLocal *) obj;
return _obj->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_position(spine_bone_local obj, float x, float y) {
if (!obj) return ;
BoneLocal *_obj = (BoneLocal *) obj;
_obj->setPosition(x, y);
}
float spine_bone_local_get_rotation(spine_bone_local obj) {
if (!obj) return 0;
BoneLocal *_obj = (BoneLocal *) obj;
return _obj->getRotation();
}
void spine_bone_local_set_rotation(spine_bone_local obj, float value) {
if (!obj) return;
BoneLocal *_obj = (BoneLocal *) obj;
_obj->setRotation(value);
}
float spine_bone_local_get_scale_x(spine_bone_local obj) {
if (!obj) return 0;
BoneLocal *_obj = (BoneLocal *) obj;
return _obj->getScaleX();
}
void spine_bone_local_set_scale_x(spine_bone_local obj, float value) {
if (!obj) return;
BoneLocal *_obj = (BoneLocal *) obj;
_obj->setScaleX(value);
}
float spine_bone_local_get_scale_y(spine_bone_local obj) {
if (!obj) return 0;
BoneLocal *_obj = (BoneLocal *) obj;
return _obj->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(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(spine_bone_local obj, float value) {
if (!obj) return;
BoneLocal *_obj = (BoneLocal *) obj;
_obj->setScale(value);
}
float spine_bone_local_get_shear_x(spine_bone_local obj) {
if (!obj) return 0;
BoneLocal *_obj = (BoneLocal *) obj;
return _obj->getShearX();
}
void spine_bone_local_set_shear_x(spine_bone_local obj, float value) {
if (!obj) return;
BoneLocal *_obj = (BoneLocal *) obj;
_obj->setShearX(value);
}
float spine_bone_local_get_shear_y(spine_bone_local obj) {
if (!obj) return 0;
BoneLocal *_obj = (BoneLocal *) obj;
return _obj->getShearY();
}
void spine_bone_local_set_shear_y(spine_bone_local obj, float value) {
if (!obj) return;
BoneLocal *_obj = (BoneLocal *) obj;
_obj->setShearY(value);
}
spine_inherit spine_bone_local_get_inherit(spine_bone_local obj) {
if (!obj) return nullptr;
BoneLocal *_obj = (BoneLocal *) obj;
return _obj->getInherit();
}
void spine_bone_local_set_inherit(spine_bone_local obj, spine_inherit value) {
if (!obj) return;
BoneLocal *_obj = (BoneLocal *) obj;
_obj->setInherit(value);
}

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_BONELOCAL_H
#define SPINE_C_BONELOCAL_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_bone_local)
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);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BONELOCAL_H

View File

@ -0,0 +1,349 @@
/******************************************************************************
* 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;
}
void spine_bone_pose_dispose(spine_bone_pose obj) {
if (!obj) return;
delete (BonePose *) obj;
}
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, 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);
}
void spine_bone_pose_update_local_transform(spine_bone_pose obj, spine_skeleton skeleton) {
if (!obj) return ;
BonePose *_obj = (BonePose *) obj;
_obj->updateLocalTransform(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);
}
void spine_bone_pose_modify_local(spine_bone_pose obj, spine_skeleton skeleton) {
if (!obj) return ;
BonePose *_obj = (BonePose *) obj;
_obj->modifyLocal(skeleton);
}
void spine_bone_pose_modify_world(spine_bone_pose obj, int32_t update) {
if (!obj) return ;
BonePose *_obj = (BonePose *) obj;
_obj->modifyWorld(update);
}
void spine_bone_pose_reset_world(spine_bone_pose obj, int32_t update) {
if (!obj) return ;
BonePose *_obj = (BonePose *) obj;
_obj->resetWorld(update);
}
float spine_bone_pose_get_a(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getA();
}
void spine_bone_pose_set_a(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setA(value);
}
float spine_bone_pose_get_b(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getB();
}
void spine_bone_pose_set_b(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setB(value);
}
float spine_bone_pose_get_c(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getC();
}
void spine_bone_pose_set_c(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setC(value);
}
float spine_bone_pose_get_d(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getD();
}
void spine_bone_pose_set_d(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setD(value);
}
float spine_bone_pose_get_world_x(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getWorldX();
}
void spine_bone_pose_set_world_x(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setWorldX(value);
}
float spine_bone_pose_get_world_y(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getWorldY();
}
void spine_bone_pose_set_world_y(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setWorldY(value);
}
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_y(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->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_y(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->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_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_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_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);
}
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_local_to_world_rotation(spine_bone_pose obj, float localRotation) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->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_set(spine_bone_pose obj, spine_bone_local value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->set(value);
}
float spine_bone_pose_get_x(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getX();
}
void spine_bone_pose_set_x(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setX(value);
}
float spine_bone_pose_get_y(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->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_position(spine_bone_pose obj, float x, float y) {
if (!obj) return ;
BonePose *_obj = (BonePose *) obj;
_obj->setPosition(x, y);
}
float spine_bone_pose_get_rotation(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getRotation();
}
void spine_bone_pose_set_rotation(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setRotation(value);
}
float spine_bone_pose_get_scale_x(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getScaleX();
}
void spine_bone_pose_set_scale_x(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setScaleX(value);
}
float spine_bone_pose_get_scale_y(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->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(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(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setScale(value);
}
float spine_bone_pose_get_shear_x(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getShearX();
}
void spine_bone_pose_set_shear_x(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setShearX(value);
}
float spine_bone_pose_get_shear_y(spine_bone_pose obj) {
if (!obj) return 0;
BonePose *_obj = (BonePose *) obj;
return _obj->getShearY();
}
void spine_bone_pose_set_shear_y(spine_bone_pose obj, float value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setShearY(value);
}
spine_inherit spine_bone_pose_get_inherit(spine_bone_pose obj) {
if (!obj) return nullptr;
BonePose *_obj = (BonePose *) obj;
return _obj->getInherit();
}
void spine_bone_pose_set_inherit(spine_bone_pose obj, spine_inherit value) {
if (!obj) return;
BonePose *_obj = (BonePose *) obj;
_obj->setInherit(value);
}
spine_rtti spine_bone_pose_get_rtti(spine_bone_pose obj) {
if (!obj) return nullptr;
BonePose *_obj = (BonePose *) obj;
return (spine_rtti) &_obj->getRTTI();
}

View File

@ -0,0 +1,99 @@
/******************************************************************************
* 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_BONEPOSE_H
#define SPINE_C_BONEPOSE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_bone_pose)
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, int32_t update);
SPINE_C_EXPORT void spine_bone_pose_reset_world(spine_bone_pose obj, int32_t 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_bone_pose obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BONEPOSE_H

View File

@ -0,0 +1,61 @@
/******************************************************************************
* 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(int32_t boneIndex) {
BoneTimeline *obj = new (__FILE__, __LINE__) BoneTimeline(boneIndex);
return (spine_bone_timeline) obj;
}
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 obj) {
if (!obj) return nullptr;
BoneTimeline *_obj = (BoneTimeline *) obj;
return (spine_rtti) &_obj->getRTTI();
}
int32_t 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 obj, int32_t value) {
if (!obj) return;
BoneTimeline *_obj = (BoneTimeline *) obj;
_obj->setBoneIndex(value);
}

View File

@ -0,0 +1,51 @@
/******************************************************************************
* 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_BONETIMELINE_H
#define SPINE_C_BONETIMELINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_bone_timeline)
SPINE_C_EXPORT spine_bone_timeline spine_bone_timeline_create(int32_t boneIndex);
SPINE_C_EXPORT void spine_bone_timeline_dispose(spine_bone_timeline obj);
SPINE_C_EXPORT spine_rtti spine_bone_timeline_get_rtti(spine_bone_timeline obj);
SPINE_C_EXPORT int32_t spine_bone_timeline_get_bone_index(spine_bone_timeline obj);
SPINE_C_EXPORT void spine_bone_timeline_set_bone_index(spine_bone_timeline obj, int32_t value);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BONETIMELINE_H

View File

@ -0,0 +1,103 @@
/******************************************************************************
* 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(spine_size_t frameCount, spine_size_t bezierCount, int32_t 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 obj) {
if (!obj) return;
delete (BoneTimeline1 *) obj;
}
spine_rtti spine_bone_timeline1_get_rtti(spine_bone_timeline1 obj) {
if (!obj) return nullptr;
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_bone_timeline1_apply(spine_bone_timeline1 obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
void spine_bone_timeline1_set_frame(spine_bone_timeline1 obj, spine_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 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 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, 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, 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, float value) {
if (!obj) return 0;
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
return _obj->getAbsoluteValue(time, alpha, blend, current, setup, value);
}
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, blend, direction, current, setup);
}
int32_t 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_bone_index(spine_bone_timeline1 obj, int32_t value) {
if (!obj) return;
BoneTimeline1 *_obj = (BoneTimeline1 *) obj;
_obj->setBoneIndex(value);
}

View File

@ -0,0 +1,58 @@
/******************************************************************************
* 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_BONETIMELINE1_H
#define SPINE_C_BONETIMELINE1_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_bone_timeline1)
SPINE_C_EXPORT spine_bone_timeline1 spine_bone_timeline1_create(spine_size_t frameCount, spine_size_t bezierCount, int32_t 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_bone_timeline1 obj);
SPINE_C_EXPORT void spine_bone_timeline1_apply(spine_bone_timeline1 obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT void spine_bone_timeline1_set_frame(spine_bone_timeline1 obj, spine_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(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 int32_t spine_bone_timeline1_get_bone_index(spine_bone_timeline1 obj);
SPINE_C_EXPORT void spine_bone_timeline1_set_bone_index(spine_bone_timeline1 obj, int32_t value);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BONETIMELINE1_H

View File

@ -0,0 +1,79 @@
/******************************************************************************
* 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(spine_size_t frameCount, spine_size_t bezierCount, int32_t 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 obj) {
if (!obj) return;
delete (BoneTimeline2 *) obj;
}
spine_rtti spine_bone_timeline2_get_rtti(spine_bone_timeline2 obj) {
if (!obj) return nullptr;
BoneTimeline2 *_obj = (BoneTimeline2 *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_bone_timeline2_apply(spine_bone_timeline2 obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
BoneTimeline2 *_obj = (BoneTimeline2 *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
void spine_bone_timeline2_set_frame(spine_bone_timeline2 obj, spine_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 obj, float time) {
if (!obj) return 0;
BoneTimeline2 *_obj = (BoneTimeline2 *) obj;
return _obj->getCurveValue(time);
}
int32_t 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_bone_index(spine_bone_timeline2 obj, int32_t value) {
if (!obj) return;
BoneTimeline2 *_obj = (BoneTimeline2 *) obj;
_obj->setBoneIndex(value);
}

View File

@ -0,0 +1,54 @@
/******************************************************************************
* 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_BONETIMELINE2_H
#define SPINE_C_BONETIMELINE2_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_bone_timeline2)
SPINE_C_EXPORT spine_bone_timeline2 spine_bone_timeline2_create(spine_size_t frameCount, spine_size_t bezierCount, int32_t 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_bone_timeline2 obj);
SPINE_C_EXPORT void spine_bone_timeline2_apply(spine_bone_timeline2 obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT void spine_bone_timeline2_set_frame(spine_bone_timeline2 obj, spine_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 int32_t spine_bone_timeline2_get_bone_index(spine_bone_timeline2 obj);
SPINE_C_EXPORT void spine_bone_timeline2_set_bone_index(spine_bone_timeline2 obj, int32_t value);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BONETIMELINE2_H

View File

@ -0,0 +1,157 @@
/******************************************************************************
* 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 utf8 * name) {
BoundingBoxAttachment *obj = new (__FILE__, __LINE__) BoundingBoxAttachment(String(name));
return (spine_bounding_box_attachment) obj;
}
void spine_bounding_box_attachment_dispose(spine_bounding_box_attachment obj) {
if (!obj) return;
delete (BoundingBoxAttachment *) obj;
}
spine_rtti spine_bounding_box_attachment_get_rtti(spine_bounding_box_attachment obj) {
if (!obj) return nullptr;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return (spine_rtti) &_obj->getRTTI();
}
spine_color spine_bounding_box_attachment_get_color(spine_bounding_box_attachment obj) {
if (!obj) return nullptr;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return (spine_color) &_obj->getColor();
}
spine_attachment spine_bounding_box_attachment_copy(spine_bounding_box_attachment obj) {
if (!obj) return nullptr;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return (spine_attachment) _obj->copy();
}
void spine_bounding_box_attachment_compute_world_vertices(spine_bounding_box_attachment obj, spine_skeleton skeleton, spine_slot slot, spine_size_t start, spine_size_t count, spine_float worldVertices, spine_size_t offset, spine_size_t stride) {
if (!obj) return ;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
_obj->computeWorldVertices(skeleton, slot, start, count, (float *) worldVertices, offset, stride);
}
void spine_bounding_box_attachment_compute_world_vertices(spine_bounding_box_attachment obj, spine_skeleton skeleton, spine_slot slot, spine_size_t start, spine_size_t count, void * worldVertices, spine_size_t offset, spine_size_t stride) {
if (!obj) return ;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
_obj->computeWorldVertices(skeleton, slot, start, count, (Vector<float> &) worldVertices, offset, stride);
}
int32_t spine_bounding_box_attachment_get_id(spine_bounding_box_attachment obj) {
if (!obj) return 0;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return _obj->getId();
}
int32_t * spine_bounding_box_attachment_get_bones(spine_bounding_box_attachment obj) {
if (!obj) return 0;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return _obj->getBones();
}
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();
}
int32_t *spine_bounding_box_attachment_get_bones(spine_bounding_box_attachment obj) {
if (!obj) return nullptr;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return (int32_t *) _obj->getBones().buffer();
}
void spine_bounding_box_attachment_set_bones(spine_bounding_box_attachment obj, int32_t * value) {
if (!obj) return;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
_obj->setBones((Vector<int> &) value);
}
void * spine_bounding_box_attachment_get_vertices(spine_bounding_box_attachment obj) {
if (!obj) return nullptr;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return _obj->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();
}
spine_float *spine_bounding_box_attachment_get_vertices(spine_bounding_box_attachment obj) {
if (!obj) return nullptr;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return (spine_float *) _obj->getVertices().buffer();
}
void spine_bounding_box_attachment_set_vertices(spine_bounding_box_attachment obj, void * value) {
if (!obj) return;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
_obj->setVertices((Vector<float> &) value);
}
spine_size_t spine_bounding_box_attachment_get_world_vertices_length(spine_bounding_box_attachment obj) {
if (!obj) return nullptr;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return _obj->getWorldVerticesLength();
}
void spine_bounding_box_attachment_set_world_vertices_length(spine_bounding_box_attachment obj, spine_size_t value) {
if (!obj) return;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
_obj->setWorldVerticesLength(value);
}
spine_attachment spine_bounding_box_attachment_get_timeline_attachment(spine_bounding_box_attachment obj) {
if (!obj) return nullptr;
BoundingBoxAttachment *_obj = (BoundingBoxAttachment *) obj;
return (spine_attachment) _obj->getTimelineAttachment();
}
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);
}
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);
}

View File

@ -0,0 +1,67 @@
/******************************************************************************
* 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_BOUNDINGBOXATTACHMENT_H
#define SPINE_C_BOUNDINGBOXATTACHMENT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_bounding_box_attachment)
SPINE_C_EXPORT spine_bounding_box_attachment spine_bounding_box_attachment_create(const utf8 * 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_bounding_box_attachment obj);
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, spine_size_t start, spine_size_t count, spine_float worldVertices, spine_size_t offset, spine_size_t stride);
SPINE_C_EXPORT void spine_bounding_box_attachment_compute_world_vertices(spine_bounding_box_attachment obj, spine_skeleton skeleton, spine_slot slot, spine_size_t start, spine_size_t count, void * worldVertices, spine_size_t offset, spine_size_t stride);
SPINE_C_EXPORT int32_t spine_bounding_box_attachment_get_id(spine_bounding_box_attachment obj);
SPINE_C_EXPORT int32_t * spine_bounding_box_attachment_get_bones(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 int32_t *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, int32_t * value);
SPINE_C_EXPORT void * spine_bounding_box_attachment_get_vertices(spine_bounding_box_attachment obj);
SPINE_C_EXPORT int32_t spine_bounding_box_attachment_get_num_vertices(spine_bounding_box_attachment obj);
SPINE_C_EXPORT spine_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, void * value);
SPINE_C_EXPORT spine_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, spine_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);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_BOUNDINGBOXATTACHMENT_H

View File

@ -0,0 +1,169 @@
/******************************************************************************
* 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 utf8 * name) {
ClippingAttachment *obj = new (__FILE__, __LINE__) ClippingAttachment(String(name));
return (spine_clipping_attachment) obj;
}
void spine_clipping_attachment_dispose(spine_clipping_attachment obj) {
if (!obj) return;
delete (ClippingAttachment *) obj;
}
spine_rtti spine_clipping_attachment_get_rtti(spine_clipping_attachment obj) {
if (!obj) return nullptr;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return (spine_rtti) &_obj->getRTTI();
}
spine_slot_data spine_clipping_attachment_get_end_slot(spine_clipping_attachment obj) {
if (!obj) return nullptr;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return (spine_slot_data) _obj->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);
}
spine_color spine_clipping_attachment_get_color(spine_clipping_attachment obj) {
if (!obj) return nullptr;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return (spine_color) &_obj->getColor();
}
spine_attachment spine_clipping_attachment_copy(spine_clipping_attachment obj) {
if (!obj) return nullptr;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return (spine_attachment) _obj->copy();
}
void spine_clipping_attachment_compute_world_vertices(spine_clipping_attachment obj, spine_skeleton skeleton, spine_slot slot, spine_size_t start, spine_size_t count, spine_float worldVertices, spine_size_t offset, spine_size_t stride) {
if (!obj) return ;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
_obj->computeWorldVertices(skeleton, slot, start, count, (float *) worldVertices, offset, stride);
}
void spine_clipping_attachment_compute_world_vertices(spine_clipping_attachment obj, spine_skeleton skeleton, spine_slot slot, spine_size_t start, spine_size_t count, void * worldVertices, spine_size_t offset, spine_size_t stride) {
if (!obj) return ;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
_obj->computeWorldVertices(skeleton, slot, start, count, (Vector<float> &) worldVertices, offset, stride);
}
int32_t spine_clipping_attachment_get_id(spine_clipping_attachment obj) {
if (!obj) return 0;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return _obj->getId();
}
int32_t * spine_clipping_attachment_get_bones(spine_clipping_attachment obj) {
if (!obj) return 0;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return _obj->getBones();
}
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();
}
int32_t *spine_clipping_attachment_get_bones(spine_clipping_attachment obj) {
if (!obj) return nullptr;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return (int32_t *) _obj->getBones().buffer();
}
void spine_clipping_attachment_set_bones(spine_clipping_attachment obj, int32_t * value) {
if (!obj) return;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
_obj->setBones((Vector<int> &) value);
}
void * spine_clipping_attachment_get_vertices(spine_clipping_attachment obj) {
if (!obj) return nullptr;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return _obj->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();
}
spine_float *spine_clipping_attachment_get_vertices(spine_clipping_attachment obj) {
if (!obj) return nullptr;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return (spine_float *) _obj->getVertices().buffer();
}
void spine_clipping_attachment_set_vertices(spine_clipping_attachment obj, void * value) {
if (!obj) return;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
_obj->setVertices((Vector<float> &) value);
}
spine_size_t spine_clipping_attachment_get_world_vertices_length(spine_clipping_attachment obj) {
if (!obj) return nullptr;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return _obj->getWorldVerticesLength();
}
void spine_clipping_attachment_set_world_vertices_length(spine_clipping_attachment obj, spine_size_t value) {
if (!obj) return;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
_obj->setWorldVerticesLength(value);
}
spine_attachment spine_clipping_attachment_get_timeline_attachment(spine_clipping_attachment obj) {
if (!obj) return nullptr;
ClippingAttachment *_obj = (ClippingAttachment *) obj;
return (spine_attachment) _obj->getTimelineAttachment();
}
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);
}
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);
}

View File

@ -0,0 +1,69 @@
/******************************************************************************
* 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_CLIPPINGATTACHMENT_H
#define SPINE_C_CLIPPINGATTACHMENT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_clipping_attachment)
SPINE_C_EXPORT spine_clipping_attachment spine_clipping_attachment_create(const utf8 * name);
SPINE_C_EXPORT void spine_clipping_attachment_dispose(spine_clipping_attachment obj);
SPINE_C_EXPORT spine_rtti spine_clipping_attachment_get_rtti(spine_clipping_attachment obj);
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, spine_size_t start, spine_size_t count, spine_float worldVertices, spine_size_t offset, spine_size_t stride);
SPINE_C_EXPORT void spine_clipping_attachment_compute_world_vertices(spine_clipping_attachment obj, spine_skeleton skeleton, spine_slot slot, spine_size_t start, spine_size_t count, void * worldVertices, spine_size_t offset, spine_size_t stride);
SPINE_C_EXPORT int32_t spine_clipping_attachment_get_id(spine_clipping_attachment obj);
SPINE_C_EXPORT int32_t * spine_clipping_attachment_get_bones(spine_clipping_attachment obj);
SPINE_C_EXPORT int32_t spine_clipping_attachment_get_num_bones(spine_clipping_attachment obj);
SPINE_C_EXPORT int32_t *spine_clipping_attachment_get_bones(spine_clipping_attachment obj);
SPINE_C_EXPORT void spine_clipping_attachment_set_bones(spine_clipping_attachment obj, int32_t * value);
SPINE_C_EXPORT void * spine_clipping_attachment_get_vertices(spine_clipping_attachment obj);
SPINE_C_EXPORT int32_t spine_clipping_attachment_get_num_vertices(spine_clipping_attachment obj);
SPINE_C_EXPORT spine_float *spine_clipping_attachment_get_vertices(spine_clipping_attachment obj);
SPINE_C_EXPORT void spine_clipping_attachment_set_vertices(spine_clipping_attachment obj, void * value);
SPINE_C_EXPORT spine_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, spine_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);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CLIPPINGATTACHMENT_H

View File

@ -0,0 +1,90 @@
/******************************************************************************
* 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;
}
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;
}
void spine_color_dispose(spine_color obj) {
if (!obj) return;
delete (Color *) obj;
}
spine_color spine_color_set(spine_color obj, float _r, float _g, float _b, float _a) {
if (!obj) return nullptr;
Color *_obj = (Color *) obj;
return (spine_color) &_obj->set(_r, _g, _b, _a);
}
spine_color spine_color_set(spine_color obj, float _r, float _g, float _b) {
if (!obj) return nullptr;
Color *_obj = (Color *) obj;
return (spine_color) &_obj->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_add(spine_color obj, float _r, float _g, float _b, float _a) {
if (!obj) return nullptr;
Color *_obj = (Color *) obj;
return (spine_color) &_obj->add(_r, _g, _b, _a);
}
spine_color spine_color_add(spine_color obj, float _r, float _g, float _b) {
if (!obj) return nullptr;
Color *_obj = (Color *) obj;
return (spine_color) &_obj->add(_r, _g, _b);
}
spine_color spine_color_add(spine_color obj, spine_color other) {
if (!obj) return nullptr;
Color *_obj = (Color *) obj;
return (spine_color) &_obj->add(other);
}
spine_color spine_color_clamp(spine_color obj) {
if (!obj) return nullptr;
Color *_obj = (Color *) obj;
return (spine_color) &_obj->clamp();
}

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_COLOR_H
#define SPINE_C_COLOR_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_color)
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(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(spine_color obj, float _r, float _g, float _b);
SPINE_C_EXPORT spine_color spine_color_add(spine_color obj, spine_color other);
SPINE_C_EXPORT spine_color spine_color_clamp(spine_color obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_COLOR_H

View File

@ -0,0 +1,103 @@
/******************************************************************************
* 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;
spine_constraint spine_constraint_create(void) {
Constraint *obj = new (__FILE__, __LINE__) Constraint();
return (spine_constraint) obj;
}
void spine_constraint_dispose(spine_constraint obj) {
if (!obj) return;
delete (Constraint *) obj;
}
spine_rtti spine_constraint_get_rtti(spine_constraint obj) {
if (!obj) return nullptr;
Constraint *_obj = (Constraint *) obj;
return (spine_rtti) &_obj->getRTTI();
}
spine_constraint_data spine_constraint_get_data(spine_constraint obj) {
if (!obj) return 0;
Constraint *_obj = (Constraint *) obj;
return _obj->getData();
}
void spine_constraint_sort(spine_constraint obj, spine_skeleton skeleton) {
if (!obj) return ;
Constraint *_obj = (Constraint *) obj;
_obj->sort(skeleton);
}
spine_bool spine_constraint_is_source_active(spine_constraint obj) {
if (!obj) return 0;
Constraint *_obj = (Constraint *) obj;
return _obj->isSourceActive();
}
void spine_constraint_pose(spine_constraint obj) {
if (!obj) return ;
Constraint *_obj = (Constraint *) obj;
_obj->pose();
}
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, physics);
}
spine_bool spine_constraint_is_type(spine_constraint obj, spine_constraint_type type) {
if (!obj) return 0;
Constraint *_obj = (Constraint *) obj;
switch (type) {
case SPINE_TYPE_CONSTRAINT_CONSTRAINT_GENERIC:
return _obj->getRTTI().instanceOf(ConstraintGeneric::rtti);
}
return 0;
}
spine_constraint_generic spine_constraint_as_constraint_generic(spine_constraint obj) {
if (!obj) return nullptr;
Constraint *_obj = (Constraint *) obj;
if (!_obj->getRTTI().instanceOf(ConstraintGeneric::rtti)) return nullptr;
return (spine_constraint_generic) obj;
}

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_CONSTRAINT_H
#define SPINE_C_CONSTRAINT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_constraint)
SPINE_C_EXPORT spine_constraint spine_constraint_create(void);
SPINE_C_EXPORT void spine_constraint_dispose(spine_constraint obj);
SPINE_C_EXPORT spine_rtti spine_constraint_get_rtti(spine_constraint obj);
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 spine_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);
struct spine_constraint_generic_wrapper;
typedef struct spine_constraint_generic_wrapper *spine_constraint_generic;
typedef enum spine_constraint_type {
SPINE_TYPE_CONSTRAINT_CONSTRAINT_GENERIC = 0
} spine_constraint_type;
SPINE_C_EXPORT spine_bool spine_constraint_is_type(spine_constraint obj, spine_constraint_type type);
SPINE_C_EXPORT spine_constraint_generic spine_constraint_as_constraint_generic(spine_constraint obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CONSTRAINT_H

View File

@ -0,0 +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 "constraint_data.h"
#include <spine/spine.h>
using namespace spine;
spine_constraint_data spine_constraint_data_create(const utf8 * name) {
ConstraintData *obj = new (__FILE__, __LINE__) ConstraintData(String(name));
return (spine_constraint_data) obj;
}
void spine_constraint_data_dispose(spine_constraint_data obj) {
if (!obj) return;
delete (ConstraintData *) obj;
}
spine_rtti spine_constraint_data_get_rtti(spine_constraint_data obj) {
if (!obj) return nullptr;
ConstraintData *_obj = (ConstraintData *) obj;
return (spine_rtti) &_obj->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);
}
const utf8 * spine_constraint_data_get_name(spine_constraint_data obj) {
if (!obj) return nullptr;
ConstraintData *_obj = (ConstraintData *) obj;
return (const utf8 *) _obj->getName().buffer();
}
spine_bool spine_constraint_data_is_skin_required(spine_constraint_data obj) {
if (!obj) return 0;
ConstraintData *_obj = (ConstraintData *) obj;
return _obj->isSkinRequired();
}
spine_bool spine_constraint_data_is_type(spine_constraint_data obj, spine_constraint_data_type type) {
if (!obj) return 0;
ConstraintData *_obj = (ConstraintData *) obj;
switch (type) {
}
return 0;
}

View File

@ -0,0 +1,57 @@
/******************************************************************************
* 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_CONSTRAINTDATA_H
#define SPINE_C_CONSTRAINTDATA_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_constraint_data)
SPINE_C_EXPORT spine_constraint_data spine_constraint_data_create(const utf8 * name);
SPINE_C_EXPORT void spine_constraint_data_dispose(spine_constraint_data obj);
SPINE_C_EXPORT spine_rtti spine_constraint_data_get_rtti(spine_constraint_data obj);
SPINE_C_EXPORT spine_constraint spine_constraint_data_create(spine_constraint_data obj, spine_skeleton skeleton);
SPINE_C_EXPORT const utf8 * spine_constraint_data_get_name(spine_constraint_data obj);
SPINE_C_EXPORT spine_bool spine_constraint_data_is_skin_required(spine_constraint_data obj);
typedef enum spine_constraint_data_type {
} spine_constraint_data_type;
SPINE_C_EXPORT spine_bool spine_constraint_data_is_type(spine_constraint_data obj, spine_constraint_data_type type);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CONSTRAINTDATA_H

View File

@ -0,0 +1,79 @@
/******************************************************************************
* 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_generic.h"
#include <spine/spine.h>
using namespace spine;
spine_constraint_data_generic spine_constraint_data_generic_create(const utf8 * name) {
ConstraintDataGeneric *obj = new (__FILE__, __LINE__) ConstraintDataGeneric(String(name));
return (spine_constraint_data_generic) obj;
}
void spine_constraint_data_generic_dispose(spine_constraint_data_generic obj) {
if (!obj) return;
delete (ConstraintDataGeneric *) obj;
}
spine_constraint spine_constraint_data_generic_create(spine_constraint_data_generic obj, spine_skeleton skeleton) {
if (!obj) return 0;
ConstraintDataGeneric *_obj = (ConstraintDataGeneric *) obj;
return (spine_constraint) _obj->create(skeleton);
}
const utf8 * spine_constraint_data_generic_get_name(spine_constraint_data_generic obj) {
if (!obj) return nullptr;
ConstraintDataGeneric *_obj = (ConstraintDataGeneric *) obj;
return (const utf8 *) _obj->getName().buffer();
}
spine_bool spine_constraint_data_generic_is_skin_required(spine_constraint_data_generic obj) {
if (!obj) return 0;
ConstraintDataGeneric *_obj = (ConstraintDataGeneric *) obj;
return _obj->isSkinRequired();
}
spine_p spine_constraint_data_generic_get_setup_pose(spine_constraint_data_generic obj) {
if (!obj) return nullptr;
ConstraintDataGeneric *_obj = (ConstraintDataGeneric *) obj;
return _obj->getSetupPose();
}
spine_p spine_constraint_data_generic_get_setup_pose(spine_constraint_data_generic obj) {
if (!obj) return nullptr;
ConstraintDataGeneric *_obj = (ConstraintDataGeneric *) obj;
return _obj->getSetupPose();
}
spine_rtti spine_constraint_data_generic_get_rtti(spine_constraint_data_generic obj) {
if (!obj) return nullptr;
ConstraintDataGeneric *_obj = (ConstraintDataGeneric *) obj;
return (spine_rtti) &_obj->getRTTI();
}

View File

@ -0,0 +1,54 @@
/******************************************************************************
* 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_CONSTRAINTDATAGENERIC_H
#define SPINE_C_CONSTRAINTDATAGENERIC_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_constraint_data_generic)
SPINE_C_EXPORT spine_constraint_data_generic spine_constraint_data_generic_create(const utf8 * name);
SPINE_C_EXPORT void spine_constraint_data_generic_dispose(spine_constraint_data_generic obj);
SPINE_C_EXPORT spine_constraint spine_constraint_data_generic_create(spine_constraint_data_generic obj, spine_skeleton skeleton);
SPINE_C_EXPORT const utf8 * spine_constraint_data_generic_get_name(spine_constraint_data_generic obj);
SPINE_C_EXPORT spine_bool spine_constraint_data_generic_is_skin_required(spine_constraint_data_generic obj);
SPINE_C_EXPORT spine_p spine_constraint_data_generic_get_setup_pose(spine_constraint_data_generic obj);
SPINE_C_EXPORT spine_p spine_constraint_data_generic_get_setup_pose(spine_constraint_data_generic obj);
SPINE_C_EXPORT spine_rtti spine_constraint_data_generic_get_rtti(spine_constraint_data_generic obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CONSTRAINTDATAGENERIC_H

View File

@ -0,0 +1,127 @@
/******************************************************************************
* 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_generic.h"
#include <spine/spine.h>
using namespace spine;
spine_constraint_generic spine_constraint_generic_create(spine_d data) {
ConstraintGeneric *obj = new (__FILE__, __LINE__) ConstraintGeneric(data);
return (spine_constraint_generic) obj;
}
void spine_constraint_generic_dispose(spine_constraint_generic obj) {
if (!obj) return;
delete (ConstraintGeneric *) obj;
}
spine_constraint_data spine_constraint_generic_get_data(spine_constraint_generic obj) {
if (!obj) return 0;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
return _obj->getData();
}
void spine_constraint_generic_pose(spine_constraint_generic obj) {
if (!obj) return ;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
_obj->pose();
}
void spine_constraint_generic_setup_pose(spine_constraint_generic obj) {
if (!obj) return ;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
_obj->setupPose();
}
spine_p spine_constraint_generic_get_pose(spine_constraint_generic obj) {
if (!obj) return nullptr;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
return _obj->getPose();
}
spine_p spine_constraint_generic_get_applied_pose(spine_constraint_generic obj) {
if (!obj) return nullptr;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
return _obj->getAppliedPose();
}
void spine_constraint_generic_reset_constrained(spine_constraint_generic obj) {
if (!obj) return ;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
_obj->resetConstrained();
}
void spine_constraint_generic_constrained(spine_constraint_generic obj) {
if (!obj) return ;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
_obj->constrained();
}
spine_bool spine_constraint_generic_is_pose_equal_to_applied(spine_constraint_generic obj) {
if (!obj) return 0;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
return _obj->isPoseEqualToApplied();
}
spine_bool spine_constraint_generic_is_active(spine_constraint_generic obj) {
if (!obj) return 0;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
return _obj->isActive();
}
void spine_constraint_generic_set_active(spine_constraint_generic obj, spine_bool value) {
if (!obj) return;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
_obj->setActive(value);
}
spine_rtti spine_constraint_generic_get_rtti(spine_constraint_generic obj) {
if (!obj) return nullptr;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_constraint_generic_sort(spine_constraint_generic obj, spine_skeleton skeleton) {
if (!obj) return ;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
_obj->sort(skeleton);
}
spine_bool spine_constraint_generic_is_source_active(spine_constraint_generic obj) {
if (!obj) return 0;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
return _obj->isSourceActive();
}
void spine_constraint_generic_update(spine_constraint_generic obj, spine_skeleton skeleton, spine_physics physics) {
if (!obj) return ;
ConstraintGeneric *_obj = (ConstraintGeneric *) obj;
_obj->update(skeleton, physics);
}

View File

@ -0,0 +1,62 @@
/******************************************************************************
* 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_CONSTRAINTGENERIC_H
#define SPINE_C_CONSTRAINTGENERIC_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_constraint_generic)
SPINE_C_EXPORT spine_constraint_generic spine_constraint_generic_create(spine_d data);
SPINE_C_EXPORT void spine_constraint_generic_dispose(spine_constraint_generic obj);
SPINE_C_EXPORT spine_constraint_data spine_constraint_generic_get_data(spine_constraint_generic obj);
SPINE_C_EXPORT void spine_constraint_generic_pose(spine_constraint_generic obj);
SPINE_C_EXPORT void spine_constraint_generic_setup_pose(spine_constraint_generic obj);
SPINE_C_EXPORT spine_p spine_constraint_generic_get_pose(spine_constraint_generic obj);
SPINE_C_EXPORT spine_p spine_constraint_generic_get_applied_pose(spine_constraint_generic obj);
SPINE_C_EXPORT void spine_constraint_generic_reset_constrained(spine_constraint_generic obj);
SPINE_C_EXPORT void spine_constraint_generic_constrained(spine_constraint_generic obj);
SPINE_C_EXPORT spine_bool spine_constraint_generic_is_pose_equal_to_applied(spine_constraint_generic obj);
SPINE_C_EXPORT spine_bool spine_constraint_generic_is_active(spine_constraint_generic obj);
SPINE_C_EXPORT void spine_constraint_generic_set_active(spine_constraint_generic obj, spine_bool value);
SPINE_C_EXPORT spine_rtti spine_constraint_generic_get_rtti(spine_constraint_generic obj);
SPINE_C_EXPORT void spine_constraint_generic_sort(spine_constraint_generic obj, spine_skeleton skeleton);
SPINE_C_EXPORT spine_bool spine_constraint_generic_is_source_active(spine_constraint_generic obj);
SPINE_C_EXPORT void spine_constraint_generic_update(spine_constraint_generic obj, spine_skeleton skeleton, spine_physics physics);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CONSTRAINTGENERIC_H

View File

@ -0,0 +1,61 @@
/******************************************************************************
* 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(int32_t constraintIndex) {
ConstraintTimeline *obj = new (__FILE__, __LINE__) ConstraintTimeline(constraintIndex);
return (spine_constraint_timeline) obj;
}
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 obj) {
if (!obj) return nullptr;
ConstraintTimeline *_obj = (ConstraintTimeline *) obj;
return (spine_rtti) &_obj->getRTTI();
}
int32_t 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 obj, int32_t value) {
if (!obj) return;
ConstraintTimeline *_obj = (ConstraintTimeline *) obj;
_obj->setConstraintIndex(value);
}

View File

@ -0,0 +1,51 @@
/******************************************************************************
* 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_CONSTRAINTTIMELINE_H
#define SPINE_C_CONSTRAINTTIMELINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_constraint_timeline)
SPINE_C_EXPORT spine_constraint_timeline spine_constraint_timeline_create(int32_t constraintIndex);
SPINE_C_EXPORT void spine_constraint_timeline_dispose(spine_constraint_timeline obj);
SPINE_C_EXPORT spine_rtti spine_constraint_timeline_get_rtti(spine_constraint_timeline obj);
SPINE_C_EXPORT int32_t spine_constraint_timeline_get_constraint_index(spine_constraint_timeline obj);
SPINE_C_EXPORT void spine_constraint_timeline_set_constraint_index(spine_constraint_timeline obj, int32_t value);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CONSTRAINTTIMELINE_H

View File

@ -0,0 +1,97 @@
/******************************************************************************
* 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(spine_size_t frameCount, spine_size_t bezierCount, int32_t 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 obj) {
if (!obj) return;
delete (ConstraintTimeline1 *) obj;
}
spine_rtti spine_constraint_timeline1_get_rtti(spine_constraint_timeline1 obj) {
if (!obj) return nullptr;
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_constraint_timeline1_set_frame(spine_constraint_timeline1 obj, spine_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 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 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, 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, 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, float value) {
if (!obj) return 0;
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
return _obj->getAbsoluteValue(time, alpha, blend, current, setup, value);
}
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, blend, direction, current, setup);
}
int32_t 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_constraint_index(spine_constraint_timeline1 obj, int32_t value) {
if (!obj) return;
ConstraintTimeline1 *_obj = (ConstraintTimeline1 *) obj;
_obj->setConstraintIndex(value);
}

View File

@ -0,0 +1,57 @@
/******************************************************************************
* 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_CONSTRAINTTIMELINE1_H
#define SPINE_C_CONSTRAINTTIMELINE1_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_constraint_timeline1)
SPINE_C_EXPORT spine_constraint_timeline1 spine_constraint_timeline1_create(spine_size_t frameCount, spine_size_t bezierCount, int32_t 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_constraint_timeline1 obj);
SPINE_C_EXPORT void spine_constraint_timeline1_set_frame(spine_constraint_timeline1 obj, spine_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(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 int32_t spine_constraint_timeline1_get_constraint_index(spine_constraint_timeline1 obj);
SPINE_C_EXPORT void spine_constraint_timeline1_set_constraint_index(spine_constraint_timeline1 obj, int32_t value);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CONSTRAINTTIMELINE1_H

View File

@ -0,0 +1,151 @@
/******************************************************************************
* 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;
spine_curve_timeline spine_curve_timeline_create(spine_size_t frameCount, spine_size_t frameEntries, spine_size_t bezierCount) {
CurveTimeline *obj = new (__FILE__, __LINE__) CurveTimeline(frameCount, frameEntries, bezierCount);
return (spine_curve_timeline) obj;
}
void spine_curve_timeline_dispose(spine_curve_timeline obj) {
if (!obj) return;
delete (CurveTimeline *) obj;
}
spine_rtti spine_curve_timeline_get_rtti(spine_curve_timeline obj) {
if (!obj) return nullptr;
CurveTimeline *_obj = (CurveTimeline *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_curve_timeline_set_linear(spine_curve_timeline obj, spine_size_t value) {
if (!obj) return;
CurveTimeline *_obj = (CurveTimeline *) obj;
_obj->setLinear(value);
}
void spine_curve_timeline_set_stepped(spine_curve_timeline obj, spine_size_t value) {
if (!obj) return;
CurveTimeline *_obj = (CurveTimeline *) obj;
_obj->setStepped(value);
}
void spine_curve_timeline_set_bezier(spine_curve_timeline obj, spine_size_t bezier, spine_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);
}
float spine_curve_timeline_get_bezier_value(spine_curve_timeline obj, float time, spine_size_t frame, spine_size_t valueOffset, spine_size_t i) {
if (!obj) return 0;
CurveTimeline *_obj = (CurveTimeline *) obj;
return _obj->getBezierValue(time, frame, valueOffset, i);
}
void * spine_curve_timeline_get_curves(spine_curve_timeline obj) {
if (!obj) return nullptr;
CurveTimeline *_obj = (CurveTimeline *) obj;
return _obj->getCurves();
}
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_float *spine_curve_timeline_get_curves(spine_curve_timeline obj) {
if (!obj) return nullptr;
CurveTimeline *_obj = (CurveTimeline *) obj;
return (spine_float *) _obj->getCurves().buffer();
}
void spine_curve_timeline_apply(spine_curve_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
CurveTimeline *_obj = (CurveTimeline *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
spine_size_t spine_curve_timeline_get_frame_entries(spine_curve_timeline obj) {
if (!obj) return nullptr;
CurveTimeline *_obj = (CurveTimeline *) obj;
return _obj->getFrameEntries();
}
spine_size_t spine_curve_timeline_get_frame_count(spine_curve_timeline obj) {
if (!obj) return nullptr;
CurveTimeline *_obj = (CurveTimeline *) obj;
return _obj->getFrameCount();
}
void * spine_curve_timeline_get_frames(spine_curve_timeline obj) {
if (!obj) return nullptr;
CurveTimeline *_obj = (CurveTimeline *) obj;
return _obj->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();
}
spine_float *spine_curve_timeline_get_frames(spine_curve_timeline obj) {
if (!obj) return nullptr;
CurveTimeline *_obj = (CurveTimeline *) obj;
return (spine_float *) _obj->getFrames().buffer();
}
float spine_curve_timeline_get_duration(spine_curve_timeline obj) {
if (!obj) return 0;
CurveTimeline *_obj = (CurveTimeline *) obj;
return _obj->getDuration();
}
void * spine_curve_timeline_get_property_ids(spine_curve_timeline obj) {
if (!obj) return nullptr;
CurveTimeline *_obj = (CurveTimeline *) obj;
return _obj->getPropertyIds();
}
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();
}
spine_property_id *spine_curve_timeline_get_property_ids(spine_curve_timeline obj) {
if (!obj) return nullptr;
CurveTimeline *_obj = (CurveTimeline *) obj;
return (spine_property_id *) _obj->getPropertyIds().buffer();
}

View File

@ -0,0 +1,66 @@
/******************************************************************************
* 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_CURVETIMELINE_H
#define SPINE_C_CURVETIMELINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_curve_timeline)
SPINE_C_EXPORT spine_curve_timeline spine_curve_timeline_create(spine_size_t frameCount, spine_size_t frameEntries, spine_size_t bezierCount);
SPINE_C_EXPORT void spine_curve_timeline_dispose(spine_curve_timeline obj);
SPINE_C_EXPORT spine_rtti spine_curve_timeline_get_rtti(spine_curve_timeline obj);
SPINE_C_EXPORT void spine_curve_timeline_set_linear(spine_curve_timeline obj, spine_size_t value);
SPINE_C_EXPORT void spine_curve_timeline_set_stepped(spine_curve_timeline obj, spine_size_t value);
SPINE_C_EXPORT void spine_curve_timeline_set_bezier(spine_curve_timeline obj, spine_size_t bezier, spine_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, spine_size_t frame, spine_size_t valueOffset, spine_size_t i);
SPINE_C_EXPORT void * spine_curve_timeline_get_curves(spine_curve_timeline obj);
SPINE_C_EXPORT int32_t spine_curve_timeline_get_num_curves(spine_curve_timeline obj);
SPINE_C_EXPORT spine_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, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT spine_size_t spine_curve_timeline_get_frame_entries(spine_curve_timeline obj);
SPINE_C_EXPORT spine_size_t spine_curve_timeline_get_frame_count(spine_curve_timeline obj);
SPINE_C_EXPORT void * spine_curve_timeline_get_frames(spine_curve_timeline obj);
SPINE_C_EXPORT int32_t spine_curve_timeline_get_num_frames(spine_curve_timeline obj);
SPINE_C_EXPORT spine_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 void * spine_curve_timeline_get_property_ids(spine_curve_timeline obj);
SPINE_C_EXPORT int32_t spine_curve_timeline_get_num_property_ids(spine_curve_timeline obj);
SPINE_C_EXPORT spine_property_id *spine_curve_timeline_get_property_ids(spine_curve_timeline obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CURVETIMELINE_H

View File

@ -0,0 +1,187 @@
/******************************************************************************
* 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;
spine_curve_timeline1 spine_curve_timeline1_create(spine_size_t frameCount, spine_size_t bezierCount) {
CurveTimeline1 *obj = new (__FILE__, __LINE__) CurveTimeline1(frameCount, bezierCount);
return (spine_curve_timeline1) obj;
}
void spine_curve_timeline1_dispose(spine_curve_timeline1 obj) {
if (!obj) return;
delete (CurveTimeline1 *) obj;
}
spine_rtti spine_curve_timeline1_get_rtti(spine_curve_timeline1 obj) {
if (!obj) return nullptr;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_curve_timeline1_set_frame(spine_curve_timeline1 obj, spine_size_t frame, float time, float value) {
if (!obj) return ;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
_obj->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_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, 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, 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, float value) {
if (!obj) return 0;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return _obj->getAbsoluteValue(time, alpha, 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, blend, direction, current, setup);
}
void spine_curve_timeline1_set_linear(spine_curve_timeline1 obj, spine_size_t value) {
if (!obj) return;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
_obj->setLinear(value);
}
void spine_curve_timeline1_set_stepped(spine_curve_timeline1 obj, spine_size_t value) {
if (!obj) return;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
_obj->setStepped(value);
}
void spine_curve_timeline1_set_bezier(spine_curve_timeline1 obj, spine_size_t bezier, spine_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);
}
float spine_curve_timeline1_get_bezier_value(spine_curve_timeline1 obj, float time, spine_size_t frame, spine_size_t valueOffset, spine_size_t i) {
if (!obj) return 0;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return _obj->getBezierValue(time, frame, valueOffset, i);
}
void * spine_curve_timeline1_get_curves(spine_curve_timeline1 obj) {
if (!obj) return nullptr;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return _obj->getCurves();
}
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_float *spine_curve_timeline1_get_curves(spine_curve_timeline1 obj) {
if (!obj) return nullptr;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return (spine_float *) _obj->getCurves().buffer();
}
void spine_curve_timeline1_apply(spine_curve_timeline1 obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
spine_size_t spine_curve_timeline1_get_frame_entries(spine_curve_timeline1 obj) {
if (!obj) return nullptr;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return _obj->getFrameEntries();
}
spine_size_t spine_curve_timeline1_get_frame_count(spine_curve_timeline1 obj) {
if (!obj) return nullptr;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return _obj->getFrameCount();
}
void * spine_curve_timeline1_get_frames(spine_curve_timeline1 obj) {
if (!obj) return nullptr;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return _obj->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();
}
spine_float *spine_curve_timeline1_get_frames(spine_curve_timeline1 obj) {
if (!obj) return nullptr;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return (spine_float *) _obj->getFrames().buffer();
}
float spine_curve_timeline1_get_duration(spine_curve_timeline1 obj) {
if (!obj) return 0;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return _obj->getDuration();
}
void * spine_curve_timeline1_get_property_ids(spine_curve_timeline1 obj) {
if (!obj) return nullptr;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return _obj->getPropertyIds();
}
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();
}
spine_property_id *spine_curve_timeline1_get_property_ids(spine_curve_timeline1 obj) {
if (!obj) return nullptr;
CurveTimeline1 *_obj = (CurveTimeline1 *) obj;
return (spine_property_id *) _obj->getPropertyIds().buffer();
}

View File

@ -0,0 +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_C_CURVETIMELINE1_H
#define SPINE_C_CURVETIMELINE1_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_curve_timeline1)
SPINE_C_EXPORT spine_curve_timeline1 spine_curve_timeline1_create(spine_size_t frameCount, spine_size_t bezierCount);
SPINE_C_EXPORT void spine_curve_timeline1_dispose(spine_curve_timeline1 obj);
SPINE_C_EXPORT spine_rtti spine_curve_timeline1_get_rtti(spine_curve_timeline1 obj);
SPINE_C_EXPORT void spine_curve_timeline1_set_frame(spine_curve_timeline1 obj, spine_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(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, spine_size_t value);
SPINE_C_EXPORT void spine_curve_timeline1_set_stepped(spine_curve_timeline1 obj, spine_size_t value);
SPINE_C_EXPORT void spine_curve_timeline1_set_bezier(spine_curve_timeline1 obj, spine_size_t bezier, spine_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, spine_size_t frame, spine_size_t valueOffset, spine_size_t i);
SPINE_C_EXPORT void * spine_curve_timeline1_get_curves(spine_curve_timeline1 obj);
SPINE_C_EXPORT int32_t spine_curve_timeline1_get_num_curves(spine_curve_timeline1 obj);
SPINE_C_EXPORT spine_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, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT spine_size_t spine_curve_timeline1_get_frame_entries(spine_curve_timeline1 obj);
SPINE_C_EXPORT spine_size_t spine_curve_timeline1_get_frame_count(spine_curve_timeline1 obj);
SPINE_C_EXPORT void * spine_curve_timeline1_get_frames(spine_curve_timeline1 obj);
SPINE_C_EXPORT int32_t spine_curve_timeline1_get_num_frames(spine_curve_timeline1 obj);
SPINE_C_EXPORT spine_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 void * spine_curve_timeline1_get_property_ids(spine_curve_timeline1 obj);
SPINE_C_EXPORT int32_t spine_curve_timeline1_get_num_property_ids(spine_curve_timeline1 obj);
SPINE_C_EXPORT spine_property_id *spine_curve_timeline1_get_property_ids(spine_curve_timeline1 obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CURVETIMELINE1_H

View File

@ -0,0 +1,163 @@
/******************************************************************************
* 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;
spine_curve_timeline2 spine_curve_timeline2_create(spine_size_t frameCount, spine_size_t bezierCount) {
CurveTimeline2 *obj = new (__FILE__, __LINE__) CurveTimeline2(frameCount, bezierCount);
return (spine_curve_timeline2) obj;
}
void spine_curve_timeline2_dispose(spine_curve_timeline2 obj) {
if (!obj) return;
delete (CurveTimeline2 *) obj;
}
spine_rtti spine_curve_timeline2_get_rtti(spine_curve_timeline2 obj) {
if (!obj) return nullptr;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_curve_timeline2_set_frame(spine_curve_timeline2 obj, spine_size_t frame, float time, float value1, float value2) {
if (!obj) return ;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
_obj->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);
}
void spine_curve_timeline2_set_linear(spine_curve_timeline2 obj, spine_size_t value) {
if (!obj) return;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
_obj->setLinear(value);
}
void spine_curve_timeline2_set_stepped(spine_curve_timeline2 obj, spine_size_t value) {
if (!obj) return;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
_obj->setStepped(value);
}
void spine_curve_timeline2_set_bezier(spine_curve_timeline2 obj, spine_size_t bezier, spine_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);
}
float spine_curve_timeline2_get_bezier_value(spine_curve_timeline2 obj, float time, spine_size_t frame, spine_size_t valueOffset, spine_size_t i) {
if (!obj) return 0;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return _obj->getBezierValue(time, frame, valueOffset, i);
}
void * spine_curve_timeline2_get_curves(spine_curve_timeline2 obj) {
if (!obj) return nullptr;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return _obj->getCurves();
}
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_float *spine_curve_timeline2_get_curves(spine_curve_timeline2 obj) {
if (!obj) return nullptr;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return (spine_float *) _obj->getCurves().buffer();
}
void spine_curve_timeline2_apply(spine_curve_timeline2 obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
spine_size_t spine_curve_timeline2_get_frame_entries(spine_curve_timeline2 obj) {
if (!obj) return nullptr;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return _obj->getFrameEntries();
}
spine_size_t spine_curve_timeline2_get_frame_count(spine_curve_timeline2 obj) {
if (!obj) return nullptr;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return _obj->getFrameCount();
}
void * spine_curve_timeline2_get_frames(spine_curve_timeline2 obj) {
if (!obj) return nullptr;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return _obj->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();
}
spine_float *spine_curve_timeline2_get_frames(spine_curve_timeline2 obj) {
if (!obj) return nullptr;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return (spine_float *) _obj->getFrames().buffer();
}
float spine_curve_timeline2_get_duration(spine_curve_timeline2 obj) {
if (!obj) return 0;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return _obj->getDuration();
}
void * spine_curve_timeline2_get_property_ids(spine_curve_timeline2 obj) {
if (!obj) return nullptr;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return _obj->getPropertyIds();
}
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();
}
spine_property_id *spine_curve_timeline2_get_property_ids(spine_curve_timeline2 obj) {
if (!obj) return nullptr;
CurveTimeline2 *_obj = (CurveTimeline2 *) obj;
return (spine_property_id *) _obj->getPropertyIds().buffer();
}

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_CURVETIMELINE2_H
#define SPINE_C_CURVETIMELINE2_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_curve_timeline2)
SPINE_C_EXPORT spine_curve_timeline2 spine_curve_timeline2_create(spine_size_t frameCount, spine_size_t bezierCount);
SPINE_C_EXPORT void spine_curve_timeline2_dispose(spine_curve_timeline2 obj);
SPINE_C_EXPORT spine_rtti spine_curve_timeline2_get_rtti(spine_curve_timeline2 obj);
SPINE_C_EXPORT void spine_curve_timeline2_set_frame(spine_curve_timeline2 obj, spine_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, spine_size_t value);
SPINE_C_EXPORT void spine_curve_timeline2_set_stepped(spine_curve_timeline2 obj, spine_size_t value);
SPINE_C_EXPORT void spine_curve_timeline2_set_bezier(spine_curve_timeline2 obj, spine_size_t bezier, spine_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, spine_size_t frame, spine_size_t valueOffset, spine_size_t i);
SPINE_C_EXPORT void * spine_curve_timeline2_get_curves(spine_curve_timeline2 obj);
SPINE_C_EXPORT int32_t spine_curve_timeline2_get_num_curves(spine_curve_timeline2 obj);
SPINE_C_EXPORT spine_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, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT spine_size_t spine_curve_timeline2_get_frame_entries(spine_curve_timeline2 obj);
SPINE_C_EXPORT spine_size_t spine_curve_timeline2_get_frame_count(spine_curve_timeline2 obj);
SPINE_C_EXPORT void * spine_curve_timeline2_get_frames(spine_curve_timeline2 obj);
SPINE_C_EXPORT int32_t spine_curve_timeline2_get_num_frames(spine_curve_timeline2 obj);
SPINE_C_EXPORT spine_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 void * spine_curve_timeline2_get_property_ids(spine_curve_timeline2 obj);
SPINE_C_EXPORT int32_t spine_curve_timeline2_get_num_property_ids(spine_curve_timeline2 obj);
SPINE_C_EXPORT spine_property_id *spine_curve_timeline2_get_property_ids(spine_curve_timeline2 obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_CURVETIMELINE2_H

View File

@ -0,0 +1,109 @@
/******************************************************************************
* 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(spine_size_t frameCount, spine_size_t bezierCount, int32_t slotIndex, spine_vertex_attachment attachment) {
DeformTimeline *obj = new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, (VertexAttachment *) attachment);
return (spine_deform_timeline) obj;
}
void spine_deform_timeline_dispose(spine_deform_timeline obj) {
if (!obj) return;
delete (DeformTimeline *) obj;
}
spine_rtti spine_deform_timeline_get_rtti(spine_deform_timeline obj) {
if (!obj) return nullptr;
DeformTimeline *_obj = (DeformTimeline *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_deform_timeline_set_frame(spine_deform_timeline obj, int32_t frameIndex, float time, void * vertices) {
if (!obj) return ;
DeformTimeline *_obj = (DeformTimeline *) obj;
_obj->setFrame(frameIndex, time, (Vector<float> &) vertices);
}
void * spine_deform_timeline_get_vertices(spine_deform_timeline obj) {
if (!obj) return nullptr;
DeformTimeline *_obj = (DeformTimeline *) obj;
return _obj->getVertices();
}
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_vector<float *spine_deform_timeline_get_vertices(spine_deform_timeline obj) {
if (!obj) return nullptr;
DeformTimeline *_obj = (DeformTimeline *) obj;
return (spine_vector<float *) _obj->getVertices().buffer();
}
spine_vertex_attachment spine_deform_timeline_get_attachment(spine_deform_timeline obj) {
if (!obj) return nullptr;
DeformTimeline *_obj = (DeformTimeline *) obj;
return (spine_vertex_attachment) _obj->getAttachment();
}
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);
}
void spine_deform_timeline_set_bezier(spine_deform_timeline obj, spine_size_t bezier, spine_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);
}
float spine_deform_timeline_get_curve_percent(spine_deform_timeline obj, float time, int32_t frame) {
if (!obj) return 0;
DeformTimeline *_obj = (DeformTimeline *) obj;
return _obj->getCurvePercent(time, frame);
}
spine_size_t spine_deform_timeline_get_frame_count(spine_deform_timeline obj) {
if (!obj) return nullptr;
DeformTimeline *_obj = (DeformTimeline *) obj;
return _obj->getFrameCount();
}
void spine_deform_timeline_apply(spine_deform_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
DeformTimeline *_obj = (DeformTimeline *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}

View File

@ -0,0 +1,59 @@
/******************************************************************************
* 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_DEFORMTIMELINE_H
#define SPINE_C_DEFORMTIMELINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_deform_timeline)
SPINE_C_EXPORT spine_deform_timeline spine_deform_timeline_create(spine_size_t frameCount, spine_size_t bezierCount, int32_t 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_deform_timeline obj);
SPINE_C_EXPORT void spine_deform_timeline_set_frame(spine_deform_timeline obj, int32_t frameIndex, float time, void * vertices);
SPINE_C_EXPORT void * spine_deform_timeline_get_vertices(spine_deform_timeline obj);
SPINE_C_EXPORT int32_t spine_deform_timeline_get_num_vertices(spine_deform_timeline obj);
SPINE_C_EXPORT spine_vector<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, spine_size_t bezier, spine_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, int32_t frame);
SPINE_C_EXPORT spine_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, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_DEFORMTIMELINE_H

View File

@ -0,0 +1,133 @@
/******************************************************************************
* 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(spine_size_t frameCount) {
DrawOrderTimeline *obj = new (__FILE__, __LINE__) DrawOrderTimeline(frameCount);
return (spine_draw_order_timeline) obj;
}
void spine_draw_order_timeline_dispose(spine_draw_order_timeline obj) {
if (!obj) return;
delete (DrawOrderTimeline *) obj;
}
spine_rtti spine_draw_order_timeline_get_rtti(spine_draw_order_timeline obj) {
if (!obj) return nullptr;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_draw_order_timeline_apply(spine_draw_order_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
spine_size_t spine_draw_order_timeline_get_frame_count(spine_draw_order_timeline obj) {
if (!obj) return nullptr;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
return _obj->getFrameCount();
}
void * spine_draw_order_timeline_get_draw_orders(spine_draw_order_timeline obj) {
if (!obj) return nullptr;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
return _obj->getDrawOrders();
}
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();
}
spine_vector<int *spine_draw_order_timeline_get_draw_orders(spine_draw_order_timeline obj) {
if (!obj) return nullptr;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
return (spine_vector<int *) _obj->getDrawOrders().buffer();
}
void spine_draw_order_timeline_set_frame(spine_draw_order_timeline obj, spine_size_t frame, float time, int32_t * drawOrder) {
if (!obj) return ;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
_obj->setFrame(frame, time, (Vector<int> *) drawOrder);
}
spine_size_t spine_draw_order_timeline_get_frame_entries(spine_draw_order_timeline obj) {
if (!obj) return nullptr;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
return _obj->getFrameEntries();
}
void * spine_draw_order_timeline_get_frames(spine_draw_order_timeline obj) {
if (!obj) return nullptr;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
return _obj->getFrames();
}
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_float *spine_draw_order_timeline_get_frames(spine_draw_order_timeline obj) {
if (!obj) return nullptr;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
return (spine_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();
}
void * spine_draw_order_timeline_get_property_ids(spine_draw_order_timeline obj) {
if (!obj) return nullptr;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
return _obj->getPropertyIds();
}
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();
}
spine_property_id *spine_draw_order_timeline_get_property_ids(spine_draw_order_timeline obj) {
if (!obj) return nullptr;
DrawOrderTimeline *_obj = (DrawOrderTimeline *) obj;
return (spine_property_id *) _obj->getPropertyIds().buffer();
}

View File

@ -0,0 +1,63 @@
/******************************************************************************
* 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_DRAWORDERTIMELINE_H
#define SPINE_C_DRAWORDERTIMELINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_draw_order_timeline)
SPINE_C_EXPORT spine_draw_order_timeline spine_draw_order_timeline_create(spine_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_draw_order_timeline obj);
SPINE_C_EXPORT void spine_draw_order_timeline_apply(spine_draw_order_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT spine_size_t spine_draw_order_timeline_get_frame_count(spine_draw_order_timeline obj);
SPINE_C_EXPORT void * spine_draw_order_timeline_get_draw_orders(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_vector<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, spine_size_t frame, float time, int32_t * drawOrder);
SPINE_C_EXPORT spine_size_t spine_draw_order_timeline_get_frame_entries(spine_draw_order_timeline obj);
SPINE_C_EXPORT void * spine_draw_order_timeline_get_frames(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 spine_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 void * spine_draw_order_timeline_get_property_ids(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 spine_property_id *spine_draw_order_timeline_get_property_ids(spine_draw_order_timeline obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_DRAWORDERTIMELINE_H

View File

@ -0,0 +1,115 @@
/******************************************************************************
* 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, data);
return (spine_event) obj;
}
void spine_event_dispose(spine_event obj) {
if (!obj) return;
delete (Event *) obj;
}
spine_event_data spine_event_get_data(spine_event obj) {
if (!obj) return nullptr;
Event *_obj = (Event *) obj;
return _obj->getData();
}
float spine_event_get_time(spine_event obj) {
if (!obj) return 0;
Event *_obj = (Event *) obj;
return _obj->getTime();
}
int32_t spine_event_get_int(spine_event obj) {
if (!obj) return 0;
Event *_obj = (Event *) obj;
return _obj->getInt();
}
void spine_event_set_int(spine_event obj, int32_t value) {
if (!obj) return;
Event *_obj = (Event *) obj;
_obj->setInt(value);
}
float spine_event_get_float(spine_event obj) {
if (!obj) return 0;
Event *_obj = (Event *) obj;
return _obj->getFloat();
}
void spine_event_set_float(spine_event obj, float value) {
if (!obj) return;
Event *_obj = (Event *) obj;
_obj->setFloat(value);
}
const utf8 * spine_event_get_string(spine_event obj) {
if (!obj) return nullptr;
Event *_obj = (Event *) obj;
return (const utf8 *) _obj->getString().buffer();
}
void spine_event_set_string(spine_event obj, const utf8 * value) {
if (!obj) return;
Event *_obj = (Event *) obj;
_obj->setString(String(value));
}
float spine_event_get_volume(spine_event obj) {
if (!obj) return 0;
Event *_obj = (Event *) obj;
return _obj->getVolume();
}
void spine_event_set_volume(spine_event obj, float value) {
if (!obj) return;
Event *_obj = (Event *) obj;
_obj->setVolume(value);
}
float spine_event_get_balance(spine_event obj) {
if (!obj) return 0;
Event *_obj = (Event *) obj;
return _obj->getBalance();
}
void spine_event_set_balance(spine_event obj, float value) {
if (!obj) return;
Event *_obj = (Event *) obj;
_obj->setBalance(value);
}

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_EVENT_H
#define SPINE_C_EVENT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_event)
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 int32_t spine_event_get_int(spine_event obj);
SPINE_C_EXPORT void spine_event_set_int(spine_event obj, int32_t 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 utf8 * spine_event_get_string(spine_event obj);
SPINE_C_EXPORT void spine_event_set_string(spine_event obj, const utf8 * 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);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_EVENT_H

View File

@ -0,0 +1,85 @@
/******************************************************************************
* 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 utf8 * name) {
EventData *obj = new (__FILE__, __LINE__) EventData(String(name));
return (spine_event_data) obj;
}
void spine_event_data_dispose(spine_event_data obj) {
if (!obj) return;
delete (EventData *) obj;
}
const utf8 * spine_event_data_get_name(spine_event_data obj) {
if (!obj) return nullptr;
EventData *_obj = (EventData *) obj;
return (const utf8 *) _obj->getName().buffer();
}
int32_t spine_event_data_get_int_value(spine_event_data obj) {
if (!obj) return 0;
EventData *_obj = (EventData *) obj;
return _obj->getIntValue();
}
float spine_event_data_get_float_value(spine_event_data obj) {
if (!obj) return 0;
EventData *_obj = (EventData *) obj;
return _obj->getFloatValue();
}
const utf8 * spine_event_data_get_string_value(spine_event_data obj) {
if (!obj) return nullptr;
EventData *_obj = (EventData *) obj;
return (const utf8 *) _obj->getStringValue().buffer();
}
const utf8 * spine_event_data_get_audio_path(spine_event_data obj) {
if (!obj) return nullptr;
EventData *_obj = (EventData *) obj;
return (const utf8 *) _obj->getAudioPath().buffer();
}
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_balance(spine_event_data obj) {
if (!obj) return 0;
EventData *_obj = (EventData *) obj;
return _obj->getBalance();
}

View File

@ -0,0 +1,55 @@
/******************************************************************************
* 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_EVENTDATA_H
#define SPINE_C_EVENTDATA_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_event_data)
SPINE_C_EXPORT spine_event_data spine_event_data_create(const utf8 * name);
SPINE_C_EXPORT void spine_event_data_dispose(spine_event_data obj);
SPINE_C_EXPORT const utf8 * spine_event_data_get_name(spine_event_data obj);
SPINE_C_EXPORT int32_t spine_event_data_get_int_value(spine_event_data obj);
SPINE_C_EXPORT float spine_event_data_get_float_value(spine_event_data obj);
SPINE_C_EXPORT const utf8 * spine_event_data_get_string_value(spine_event_data obj);
SPINE_C_EXPORT const utf8 * spine_event_data_get_audio_path(spine_event_data obj);
SPINE_C_EXPORT float spine_event_data_get_volume(spine_event_data obj);
SPINE_C_EXPORT float spine_event_data_get_balance(spine_event_data obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_EVENTDATA_H

View File

@ -0,0 +1,43 @@
/******************************************************************************
* 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;
}
void spine_event_queue_entry_dispose(spine_event_queue_entry obj) {
if (!obj) return;
delete (EventQueueEntry *) obj;
}

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_EVENTQUEUEENTRY_H
#define SPINE_C_EVENTQUEUEENTRY_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_event_queue_entry)
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);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_EVENTQUEUEENTRY_H

View File

@ -0,0 +1,133 @@
/******************************************************************************
* 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(spine_size_t frameCount) {
EventTimeline *obj = new (__FILE__, __LINE__) EventTimeline(frameCount);
return (spine_event_timeline) obj;
}
void spine_event_timeline_dispose(spine_event_timeline obj) {
if (!obj) return;
delete (EventTimeline *) obj;
}
spine_rtti spine_event_timeline_get_rtti(spine_event_timeline obj) {
if (!obj) return nullptr;
EventTimeline *_obj = (EventTimeline *) obj;
return (spine_rtti) &_obj->getRTTI();
}
void spine_event_timeline_apply(spine_event_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose) {
if (!obj) return ;
EventTimeline *_obj = (EventTimeline *) obj;
_obj->apply(skeleton, lastTime, time, (Vector<Event *> *) pEvents, alpha, blend, direction, appliedPose);
}
spine_size_t spine_event_timeline_get_frame_count(spine_event_timeline obj) {
if (!obj) return nullptr;
EventTimeline *_obj = (EventTimeline *) obj;
return _obj->getFrameCount();
}
void * spine_event_timeline_get_events(spine_event_timeline obj) {
if (!obj) return nullptr;
EventTimeline *_obj = (EventTimeline *) obj;
return (void *) _obj->getEvents();
}
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_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 obj, spine_size_t frame, spine_event event) {
if (!obj) return ;
EventTimeline *_obj = (EventTimeline *) obj;
_obj->setFrame(frame, (Event *) event);
}
spine_size_t spine_event_timeline_get_frame_entries(spine_event_timeline obj) {
if (!obj) return nullptr;
EventTimeline *_obj = (EventTimeline *) obj;
return _obj->getFrameEntries();
}
void * spine_event_timeline_get_frames(spine_event_timeline obj) {
if (!obj) return nullptr;
EventTimeline *_obj = (EventTimeline *) obj;
return _obj->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();
}
spine_float *spine_event_timeline_get_frames(spine_event_timeline obj) {
if (!obj) return nullptr;
EventTimeline *_obj = (EventTimeline *) obj;
return (spine_float *) _obj->getFrames().buffer();
}
float spine_event_timeline_get_duration(spine_event_timeline obj) {
if (!obj) return 0;
EventTimeline *_obj = (EventTimeline *) obj;
return _obj->getDuration();
}
void * spine_event_timeline_get_property_ids(spine_event_timeline obj) {
if (!obj) return nullptr;
EventTimeline *_obj = (EventTimeline *) obj;
return _obj->getPropertyIds();
}
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();
}
spine_property_id *spine_event_timeline_get_property_ids(spine_event_timeline obj) {
if (!obj) return nullptr;
EventTimeline *_obj = (EventTimeline *) obj;
return (spine_property_id *) _obj->getPropertyIds().buffer();
}

View File

@ -0,0 +1,63 @@
/******************************************************************************
* 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_EVENTTIMELINE_H
#define SPINE_C_EVENTTIMELINE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_event_timeline)
SPINE_C_EXPORT spine_event_timeline spine_event_timeline_create(spine_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_event_timeline obj);
SPINE_C_EXPORT void spine_event_timeline_apply(spine_event_timeline obj, spine_skeleton skeleton, float lastTime, float time, void * pEvents, float alpha, spine_mix_blend blend, spine_mix_direction direction, spine_bool appliedPose);
SPINE_C_EXPORT spine_size_t spine_event_timeline_get_frame_count(spine_event_timeline obj);
SPINE_C_EXPORT void * spine_event_timeline_get_events(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, spine_size_t frame, spine_event event);
SPINE_C_EXPORT spine_size_t spine_event_timeline_get_frame_entries(spine_event_timeline obj);
SPINE_C_EXPORT void * spine_event_timeline_get_frames(spine_event_timeline obj);
SPINE_C_EXPORT int32_t spine_event_timeline_get_num_frames(spine_event_timeline obj);
SPINE_C_EXPORT spine_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 void * spine_event_timeline_get_property_ids(spine_event_timeline obj);
SPINE_C_EXPORT int32_t spine_event_timeline_get_num_property_ids(spine_event_timeline obj);
SPINE_C_EXPORT spine_property_id *spine_event_timeline_get_property_ids(spine_event_timeline obj);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_EVENTTIMELINE_H

View File

@ -0,0 +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.
*****************************************************************************/
#ifndef SPINE_C_EVENTTYPE_H
#define SPINE_C_EVENTTYPE_H
#include "../../custom.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum spine_event_type {
SPINE_EVENT_TYPE_EVENT_TYPE_START = 0,
SPINE_EVENT_TYPE_EVENT_TYPE_INTERRUPT,
SPINE_EVENT_TYPE_EVENT_TYPE_END,
SPINE_EVENT_TYPE_EVENT_TYPE_DISPOSE,
SPINE_EVENT_TYPE_EVENT_TYPE_COMPLETE,
SPINE_EVENT_TYPE_EVENT_TYPE_EVENT
} spine_event_type;
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_EVENTTYPE_H

View File

@ -0,0 +1,53 @@
/******************************************************************************
* 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 "../../custom.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum spine_format {
SPINE_FORMAT_FORMAT_ALPHA,
SPINE_FORMAT_FORMAT_INTENSITY,
SPINE_FORMAT_FORMAT_LUMINANCE_ALPHA,
SPINE_FORMAT_FORMAT_RGB565,
SPINE_FORMAT_FORMAT_RGBA4444,
SPINE_FORMAT_FORMAT_RGB888,
SPINE_FORMAT_FORMAT_RGBA8888
} spine_format;
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_FORMAT_H

View File

@ -0,0 +1,49 @@
/******************************************************************************
* 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;
spine_from_property spine_from_property_create(void) {
FromProperty *obj = new (__FILE__, __LINE__) FromProperty();
return (spine_from_property) obj;
}
void spine_from_property_dispose(spine_from_property obj) {
if (!obj) return;
delete (FromProperty *) obj;
}
float spine_from_property_value(spine_from_property obj, spine_skeleton skeleton, spine_bone_pose source, spine_bool local, spine_float offsets) {
if (!obj) return 0;
FromProperty *_obj = (FromProperty *) obj;
return _obj->value(skeleton, source, local, (float *) offsets);
}

View File

@ -0,0 +1,49 @@
/******************************************************************************
* 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_FROMPROPERTY_H
#define SPINE_C_FROMPROPERTY_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../custom.h"
SPINE_OPAQUE_TYPE(spine_from_property)
SPINE_C_EXPORT spine_from_property spine_from_property_create(void);
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, spine_bool local, spine_float offsets);
#ifdef __cplusplus
}
#endif
#endif // SPINE_C_FROMPROPERTY_H

Some files were not shown because too many files have changed in this diff Show More