mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[c] Split Enum and ClassOrStruct
This commit is contained in:
parent
dbd2c2bb37
commit
cd24e558e2
@ -37,9 +37,9 @@ export function scanArraySpecializations(includedTypes: Type[]): ArraySpecializa
|
||||
|
||||
// Process all included types
|
||||
for (const type of includedTypes) {
|
||||
if (!type.members) continue;
|
||||
if (type.kind === 'enum') continue;
|
||||
|
||||
for (const member of type.members) {
|
||||
for (const member of type.members || []) {
|
||||
switch (member.kind) {
|
||||
case 'method':
|
||||
extractArrayTypes(member.returnType, arrayTypes, type, member);
|
||||
@ -73,7 +73,7 @@ export function scanArraySpecializations(includedTypes: Type[]): ArraySpecializa
|
||||
// For template types, check if element type is a template parameter
|
||||
const firstSource = sources[0];
|
||||
const sourceType = firstSource.type;
|
||||
if (sourceType.isTemplate && sourceType.templateParams?.includes(elementType)) {
|
||||
if (sourceType.kind !== "enum" && sourceType.isTemplate && sourceType.templateParams?.includes(elementType)) {
|
||||
// Warn about template placeholders like T, K
|
||||
warnings.addWarning(arrayType, `Template class uses generic array with template parameter '${elementType}'`, sources);
|
||||
continue;
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { Type, Member, toSnakeCase, Method } from '../types';
|
||||
import { ArraySpecialization } from '../array-scanner';
|
||||
import { ArraySpecialization, ClassOrStruct, Method, toSnakeCase, Type } from '../types';
|
||||
|
||||
export class ArrayGenerator {
|
||||
private arrayType: Type | undefined;
|
||||
private arrayType: ClassOrStruct | undefined;
|
||||
|
||||
constructor(private typesJson: any) {
|
||||
// Find the Array type definition
|
||||
for (const header of Object.keys(typesJson)) {
|
||||
const arrayType = typesJson[header].find((t: Type) => t.name === 'Array');
|
||||
const arrayType = typesJson[header].find((t: Type) => t.kind === 'class' && t.name === 'Array');
|
||||
if (arrayType) {
|
||||
this.arrayType = arrayType;
|
||||
break;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Type, Member, toSnakeCase, toCFunctionName, toCTypeName, Constructor } from '../types';
|
||||
import { Type, Member, toSnakeCase, toCFunctionName, toCTypeName, Constructor, ClassOrStruct } from '../types';
|
||||
|
||||
export interface GeneratorResult {
|
||||
declarations: string[];
|
||||
@ -8,7 +8,7 @@ export interface GeneratorResult {
|
||||
export class ConstructorGenerator {
|
||||
constructor(private validTypes: Set<string>) {}
|
||||
|
||||
generate(type: Type): GeneratorResult {
|
||||
generate(type: ClassOrStruct): GeneratorResult {
|
||||
const declarations: string[] = [];
|
||||
const implementations: string[] = [];
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { Type, toSnakeCase } from '../types';
|
||||
import { Enum, toSnakeCase } from '../types';
|
||||
|
||||
export class EnumGenerator {
|
||||
generate(enumType: Type): string[] {
|
||||
generate(enumType: Enum): 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];
|
||||
@ -20,7 +20,7 @@ export class EnumGenerator {
|
||||
}
|
||||
}
|
||||
const cName = `SPINE_${toSnakeCase(enumType.name).toUpperCase()}_${toSnakeCase(valueName).toUpperCase()}`;
|
||||
|
||||
|
||||
if (value.value !== undefined) {
|
||||
lines.push(` ${cName} = ${value.value}${i < enumType.values.length - 1 ? ',' : ''}`);
|
||||
} else {
|
||||
@ -28,9 +28,9 @@ export class EnumGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lines.push(`} ${enumName};`);
|
||||
|
||||
|
||||
return lines;
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
import { Type, Member, toSnakeCase, toCFunctionName, toCTypeName, Exclusion, Method } from '../types';
|
||||
import { Type, Member, toSnakeCase, toCFunctionName, toCTypeName, Exclusion, Method, ClassOrStruct } from '../types';
|
||||
import { isMethodExcluded } from '../exclusions';
|
||||
import { GeneratorResult } from './constructor-generator';
|
||||
|
||||
export class MethodGenerator {
|
||||
constructor(private exclusions: Exclusion[], private validTypes: Set<string>) { }
|
||||
|
||||
generate(type: Type): GeneratorResult {
|
||||
generate(type: ClassOrStruct): GeneratorResult {
|
||||
const declarations: string[] = [];
|
||||
const implementations: string[] = [];
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { Type, Member, SpineTypes, toSnakeCase, Exclusion } from './types';
|
||||
import { Type, Member, SpineTypes, toSnakeCase, Exclusion, ClassOrStruct } from './types';
|
||||
import { loadExclusions, isTypeExcluded, isMethodExcluded } from './exclusions';
|
||||
import { ConstructorGenerator } from './generators/constructor-generator';
|
||||
import { MethodGenerator } from './generators/method-generator';
|
||||
@ -26,7 +26,7 @@ import { scanArraySpecializations } from './array-scanner';
|
||||
* @param exclusions - Exclusion rules to skip specific methods
|
||||
* @returns Array of conflicts found, or exits if conflicts exist
|
||||
*/
|
||||
function checkConstNonConstConflicts(classes: Type[], exclusions: Exclusion[]): void {
|
||||
function checkConstNonConstConflicts(classes: ClassOrStruct[], exclusions: Exclusion[]): void {
|
||||
const conflicts: Array<{ type: string, method: string }> = [];
|
||||
|
||||
for (const type of classes) {
|
||||
@ -89,19 +89,19 @@ function checkConstNonConstConflicts(classes: Type[], exclusions: Exclusion[]):
|
||||
/**
|
||||
* Checks for multi-level pointers in method signatures and errors if found
|
||||
*/
|
||||
function checkMultiLevelPointers(types: Type[]) {
|
||||
function checkMultiLevelPointers(types: ClassOrStruct[]) {
|
||||
const errors: {type: string, member: string, signature: string}[] = [];
|
||||
|
||||
// Helper to check if a type has multi-level pointers
|
||||
function hasMultiLevelPointers(typeStr: string): boolean {
|
||||
// First check the outer type (after removing template content)
|
||||
let outerType = typeStr;
|
||||
|
||||
|
||||
// Extract all template contents for separate checking
|
||||
const templateContents: string[] = [];
|
||||
let depth = 0;
|
||||
let templateStart = -1;
|
||||
|
||||
|
||||
for (let i = 0; i < typeStr.length; i++) {
|
||||
if (typeStr[i] === '<') {
|
||||
if (depth === 0) {
|
||||
@ -116,22 +116,22 @@ function checkMultiLevelPointers(types: Type[]) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Remove all template content from outer type
|
||||
outerType = outerType.replace(/<[^>]+>/g, '<>');
|
||||
|
||||
|
||||
// Check outer type for consecutive pointers
|
||||
if (/\*\s*\*/.test(outerType)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Recursively check template contents
|
||||
for (const content of templateContents) {
|
||||
if (hasMultiLevelPointers(content)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ async function main() {
|
||||
}
|
||||
|
||||
// Only exclude template types
|
||||
if (type.isTemplate === true) {
|
||||
if (type.kind !== 'enum' && type.isTemplate === true) {
|
||||
console.log(`Auto-excluding template type: ${type.name}`);
|
||||
return false;
|
||||
}
|
||||
@ -235,7 +235,7 @@ async function main() {
|
||||
});
|
||||
|
||||
// Separate classes and enums
|
||||
const classes = includedTypes.filter(t => t.kind === 'class' || t.kind === 'struct');
|
||||
const classes = includedTypes.filter(t => t.kind !== "enum");
|
||||
const enums = includedTypes.filter(t => t.kind === 'enum');
|
||||
|
||||
console.log(`Found ${classes.length} classes/structs and ${enums.length} enums to generate`);
|
||||
@ -244,7 +244,7 @@ async function main() {
|
||||
checkConstNonConstConflicts(classes, exclusions);
|
||||
|
||||
// Check for multi-level pointers
|
||||
checkMultiLevelPointers(includedTypes);
|
||||
checkMultiLevelPointers(classes);
|
||||
|
||||
// Create a set of valid type names for type checking
|
||||
const validTypes = new Set<string>(includedTypes.map(t => t.name));
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { execSync } from 'child_process';
|
||||
import { Type, Member, Method, Field, Constructor, Destructor, Parameter, EnumValue, SpineTypes } from './types';
|
||||
import { Type, Member, Method, Field, Constructor, Destructor, Parameter, EnumValue, SpineTypes, ClassOrStruct, Enum } from './types';
|
||||
|
||||
const SPINE_CPP_PATH = path.join(__dirname, '../../../spine-cpp');
|
||||
const SPINE_INCLUDE_DIR = path.join(SPINE_CPP_PATH, 'spine-cpp/include');
|
||||
@ -155,9 +155,35 @@ function extractMember(inner: any, parent: any): Member | null {
|
||||
* Extracts type information from an AST node
|
||||
*/
|
||||
function extractTypeInfo(node: any, sourceLines: string[]): Type {
|
||||
const info: Type = {
|
||||
// Handle enums separately
|
||||
if (node.kind === 'EnumDecl') {
|
||||
const enumInfo: Enum = {
|
||||
kind: 'enum',
|
||||
name: node.name || '',
|
||||
values: (node.inner || [])
|
||||
.filter((n: any) => n.kind === 'EnumConstantDecl')
|
||||
.map((n: any) => {
|
||||
const enumValue: EnumValue = { name: n.name || '' };
|
||||
const sourceValue = extractEnumValueFromSource(n, sourceLines);
|
||||
|
||||
if (sourceValue === null) {
|
||||
// Implicit value - no value property
|
||||
} else if (sourceValue) {
|
||||
enumValue.value = sourceValue;
|
||||
} else if (n.inner?.length > 0) {
|
||||
enumValue.value = "<<extraction failed>>";
|
||||
}
|
||||
|
||||
return enumValue;
|
||||
})
|
||||
};
|
||||
return enumInfo;
|
||||
}
|
||||
|
||||
// Handle classes and structs
|
||||
const info: ClassOrStruct = {
|
||||
name: node.name || '',
|
||||
kind: node.kind === 'EnumDecl' ? 'enum' : (node.tagUsed || 'class') as 'class' | 'struct' | 'enum',
|
||||
kind: (node.tagUsed || 'class') as 'class' | 'struct',
|
||||
loc: {
|
||||
line: node.loc?.line || 0,
|
||||
col: node.loc?.col || 0
|
||||
@ -169,28 +195,7 @@ function extractTypeInfo(node: any, sourceLines: string[]): Type {
|
||||
info.superTypes = node.bases.map((b: any) => b.type?.qualType || '').filter(Boolean);
|
||||
}
|
||||
|
||||
// For enums, extract the values
|
||||
if (node.kind === 'EnumDecl') {
|
||||
info.values = (node.inner || [])
|
||||
.filter((n: any) => n.kind === 'EnumConstantDecl')
|
||||
.map((n: any) => {
|
||||
const enumValue: EnumValue = { name: n.name || '' };
|
||||
const sourceValue = extractEnumValueFromSource(n, sourceLines);
|
||||
|
||||
if (sourceValue === null) {
|
||||
// Implicit value - no value property
|
||||
} else if (sourceValue) {
|
||||
enumValue.value = sourceValue;
|
||||
} else if (n.inner?.length > 0) {
|
||||
enumValue.value = "<<extraction failed>>";
|
||||
}
|
||||
|
||||
return enumValue;
|
||||
});
|
||||
return info;
|
||||
}
|
||||
|
||||
// For classes/structs, extract public members
|
||||
// Extract public members
|
||||
info.members = [];
|
||||
let currentAccess = node.tagUsed === 'struct' ? 'public' : 'private';
|
||||
let hasPureVirtual = false;
|
||||
@ -262,6 +267,9 @@ function processNode(
|
||||
const classNode = (node.inner || []).find((n: any) => n.kind === 'CXXRecordDecl');
|
||||
if (classNode) {
|
||||
const typeInfo = extractTypeInfo(classNode, sourceLines);
|
||||
if (typeInfo.kind === 'enum') {
|
||||
throw new Error(`Template class ${node.name} is an enum, internal error, this should not happen`);
|
||||
}
|
||||
typeInfo.isTemplate = true;
|
||||
|
||||
// Extract template parameters
|
||||
@ -279,6 +287,9 @@ function processNode(
|
||||
}
|
||||
} else if (node.kind === 'CXXRecordDecl' && node.inner?.length > 0) {
|
||||
const typeInfo = extractTypeInfo(node, sourceLines);
|
||||
if (typeInfo.kind === 'enum') {
|
||||
throw new Error(`Class ${node.name} is an enum, which is not supported, internal error, this should not happen`);
|
||||
}
|
||||
// Ensure isTemplate is always set for non-template classes
|
||||
if (typeInfo.isTemplate === undefined) {
|
||||
typeInfo.isTemplate = false;
|
||||
@ -318,13 +329,14 @@ function extractLocalTypes(headerFile: string, typeMap: Map<string, Type> | null
|
||||
|
||||
// Filter out forward declarations and SpineObject
|
||||
const filteredTypes = types
|
||||
.filter(t => t.kind !== 'enum')
|
||||
.filter(t => {
|
||||
// Skip types with no members (forward declarations)
|
||||
if (t.members && t.members.length === 0) return false;
|
||||
|
||||
|
||||
// Skip SpineObject - it's not needed for C wrapper generation
|
||||
if (t.name === 'SpineObject') return false;
|
||||
|
||||
|
||||
return true;
|
||||
})
|
||||
.sort((a, b) => (a.loc?.line || 0) - (b.loc?.line || 0));
|
||||
@ -382,8 +394,8 @@ function substituteTemplateParams(typeStr: string, paramMap: Map<string, string>
|
||||
* Adds methods inherited from template supertypes
|
||||
*/
|
||||
function addTemplateInheritedMethods(
|
||||
_type: Type,
|
||||
templateType: Type,
|
||||
_type: ClassOrStruct,
|
||||
templateType: ClassOrStruct,
|
||||
templateClassName: string,
|
||||
templateArgs: string,
|
||||
inheritedMethods: Member[],
|
||||
@ -414,7 +426,7 @@ function addTemplateInheritedMethods(
|
||||
|
||||
// Use the actual template parameters if we have them
|
||||
if (templateType.templateParams && templateType.templateParams.length === argsList.length) {
|
||||
templateType.templateParams.forEach((param, i) => {
|
||||
templateType.templateParams.forEach((param: string, i: number) => {
|
||||
paramMap.set(param, argsList[i]);
|
||||
});
|
||||
} else {
|
||||
@ -461,7 +473,7 @@ function addTemplateInheritedMethods(
|
||||
/**
|
||||
* Adds inherited methods to a type
|
||||
*/
|
||||
function addInheritedMethods(type: Type, typeMap: Map<string, Type>): void {
|
||||
function addInheritedMethods(type: ClassOrStruct, typeMap: Map<string, Type>): void {
|
||||
const inheritedMethods: Member[] = [];
|
||||
const ownMethodSignatures = new Set<string>();
|
||||
|
||||
@ -488,7 +500,7 @@ function addInheritedMethods(type: Type, typeMap: Map<string, Type>): void {
|
||||
const templateArgs = templateMatch[2];
|
||||
|
||||
const templateType = typeMap.get(templateClassName);
|
||||
if (templateType && templateType.members) {
|
||||
if (templateType && templateType.kind !== 'enum' && templateType.members) {
|
||||
// Process template inheritance
|
||||
addTemplateInheritedMethods(
|
||||
type, templateType, templateClassName, templateArgs,
|
||||
@ -499,7 +511,7 @@ function addInheritedMethods(type: Type, typeMap: Map<string, Type>): void {
|
||||
// Non-template supertype
|
||||
const superType = typeMap.get(cleanName);
|
||||
|
||||
if (!superType || !superType.members) continue;
|
||||
if (!superType || superType.kind === 'enum' || !superType.members) continue;
|
||||
|
||||
// Add non-overridden methods from supertype
|
||||
for (const member of superType.members) {
|
||||
@ -635,13 +647,13 @@ export function extractTypes(): void {
|
||||
process.stderr.write(`\r\x1b[K Pass 2 - Processing ${++processed}/${Object.keys(allTypes).length}: ${relPath}...`);
|
||||
|
||||
for (const type of allTypes[relPath]) {
|
||||
if (type.superTypes && type.members) {
|
||||
if (type.kind !== 'enum' && type.superTypes && type.members) {
|
||||
addInheritedMethods(type, typeMap);
|
||||
|
||||
// Check if any inherited methods are pure virtual
|
||||
// If so, and the class doesn't override them, it's abstract
|
||||
if (!type.isAbstract) {
|
||||
const hasPureVirtual = type.members.some(m =>
|
||||
const hasPureVirtual = type.members.some((m: Member) =>
|
||||
m.kind === 'method' && m.isPure === true
|
||||
);
|
||||
if (hasPureVirtual) {
|
||||
|
||||
@ -44,26 +44,33 @@ export type Member =
|
||||
| Constructor
|
||||
| Destructor
|
||||
|
||||
export type Enum = {
|
||||
kind: 'enum';
|
||||
name: string;
|
||||
values: EnumValue[];
|
||||
}
|
||||
|
||||
export interface EnumValue {
|
||||
name: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export interface Type {
|
||||
export interface ClassOrStruct {
|
||||
name: string;
|
||||
kind: 'class' | 'struct' | 'enum';
|
||||
kind: 'class' | 'struct';
|
||||
loc?: {
|
||||
line: number;
|
||||
col: number;
|
||||
};
|
||||
superTypes?: string[];
|
||||
members?: Member[];
|
||||
values?: EnumValue[]; // For enums
|
||||
isAbstract?: boolean;
|
||||
isTemplate?: boolean;
|
||||
templateParams?: string[];
|
||||
}
|
||||
|
||||
export type Type = ClassOrStruct | Enum;
|
||||
|
||||
export interface SpineTypes {
|
||||
[header: string]: Type[];
|
||||
}
|
||||
|
||||
@ -1,81 +0,0 @@
|
||||
#!/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();
|
||||
@ -33,6 +33,306 @@
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_array_float spine_array_float_create() {
|
||||
return (spine_array_float) new (__FILE__, __LINE__) Array<float>();
|
||||
}
|
||||
|
||||
void spine_array_float_dispose(spine_array_float array) {
|
||||
if (!array) return;
|
||||
delete (Array<float>*) array;
|
||||
}
|
||||
|
||||
float spine_array_float_get(spine_array_float array, int index) {
|
||||
if (!array) return 0;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return (*_array)[index];
|
||||
}
|
||||
|
||||
void spine_array_float_set(spine_array_float array, int index, float value) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
(*_array)[index] = value;
|
||||
}
|
||||
|
||||
void spine_array_float_clear(spine_array_float array) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
_array->clear();
|
||||
}
|
||||
|
||||
size_t spine_array_float_get_capacity(spine_array_float array) {
|
||||
if (!array) return 0;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->getCapacity();
|
||||
}
|
||||
|
||||
size_t spine_array_float_size(spine_array_float array) {
|
||||
if (!array) return 0;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->size();
|
||||
}
|
||||
|
||||
void spine_array_float_ensure_capacity(spine_array_float array, size_t newCapacity) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
_array->ensureCapacity(newCapacity);
|
||||
}
|
||||
|
||||
void spine_array_float_add(spine_array_float array, float inValue) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
_array->add(inValue);
|
||||
}
|
||||
|
||||
void spine_array_float_remove_at(spine_array_float array, size_t inIndex) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
_array->removeAt(inIndex);
|
||||
}
|
||||
|
||||
bool spine_array_float_contains(spine_array_float array, float inValue) {
|
||||
if (!array) return false;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->contains(inValue);
|
||||
}
|
||||
|
||||
int spine_array_float_index_of(spine_array_float array, float inValue) {
|
||||
if (!array) return 0;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->indexOf(inValue);
|
||||
}
|
||||
|
||||
float spine_array_float_buffer(spine_array_float array) {
|
||||
if (!array) return 0;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_int spine_array_int_create() {
|
||||
return (spine_array_int) new (__FILE__, __LINE__) Array<int>();
|
||||
}
|
||||
|
||||
void spine_array_int_dispose(spine_array_int array) {
|
||||
if (!array) return;
|
||||
delete (Array<int>*) array;
|
||||
}
|
||||
|
||||
int spine_array_int_get(spine_array_int array, int index) {
|
||||
if (!array) return 0;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return (*_array)[index];
|
||||
}
|
||||
|
||||
void spine_array_int_set(spine_array_int array, int index, int value) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
(*_array)[index] = value;
|
||||
}
|
||||
|
||||
void spine_array_int_clear(spine_array_int array) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
_array->clear();
|
||||
}
|
||||
|
||||
size_t spine_array_int_get_capacity(spine_array_int array) {
|
||||
if (!array) return 0;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->getCapacity();
|
||||
}
|
||||
|
||||
size_t spine_array_int_size(spine_array_int array) {
|
||||
if (!array) return 0;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->size();
|
||||
}
|
||||
|
||||
void spine_array_int_ensure_capacity(spine_array_int array, size_t newCapacity) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
_array->ensureCapacity(newCapacity);
|
||||
}
|
||||
|
||||
void spine_array_int_add(spine_array_int array, int inValue) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
_array->add(inValue);
|
||||
}
|
||||
|
||||
void spine_array_int_remove_at(spine_array_int array, size_t inIndex) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
_array->removeAt(inIndex);
|
||||
}
|
||||
|
||||
bool spine_array_int_contains(spine_array_int array, int inValue) {
|
||||
if (!array) return false;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->contains(inValue);
|
||||
}
|
||||
|
||||
int spine_array_int_index_of(spine_array_int array, int inValue) {
|
||||
if (!array) return 0;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->indexOf(inValue);
|
||||
}
|
||||
|
||||
int spine_array_int_buffer(spine_array_int array) {
|
||||
if (!array) return 0;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_unsigned_short spine_array_unsigned_short_create() {
|
||||
return (spine_array_unsigned_short) new (__FILE__, __LINE__) Array<unsigned short>();
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_dispose(spine_array_unsigned_short array) {
|
||||
if (!array) return;
|
||||
delete (Array<unsigned short>*) array;
|
||||
}
|
||||
|
||||
unsigned short spine_array_unsigned_short_get(spine_array_unsigned_short array, int index) {
|
||||
if (!array) return 0;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return (*_array)[index];
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_set(spine_array_unsigned_short array, int index, unsigned short value) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
(*_array)[index] = value;
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_clear(spine_array_unsigned_short array) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
_array->clear();
|
||||
}
|
||||
|
||||
size_t spine_array_unsigned_short_get_capacity(spine_array_unsigned_short array) {
|
||||
if (!array) return 0;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->getCapacity();
|
||||
}
|
||||
|
||||
size_t spine_array_unsigned_short_size(spine_array_unsigned_short array) {
|
||||
if (!array) return 0;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->size();
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_ensure_capacity(spine_array_unsigned_short array, size_t newCapacity) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
_array->ensureCapacity(newCapacity);
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_add(spine_array_unsigned_short array, unsigned short inValue) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
_array->add(inValue);
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_remove_at(spine_array_unsigned_short array, size_t inIndex) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
_array->removeAt(inIndex);
|
||||
}
|
||||
|
||||
bool spine_array_unsigned_short_contains(spine_array_unsigned_short array, unsigned short inValue) {
|
||||
if (!array) return false;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->contains(inValue);
|
||||
}
|
||||
|
||||
int spine_array_unsigned_short_index_of(spine_array_unsigned_short array, unsigned short inValue) {
|
||||
if (!array) return 0;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->indexOf(inValue);
|
||||
}
|
||||
|
||||
unsigned short spine_array_unsigned_short_buffer(spine_array_unsigned_short array) {
|
||||
if (!array) return 0;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_property_id spine_array_property_id_create() {
|
||||
return (spine_array_property_id) new (__FILE__, __LINE__) Array<PropertyId>();
|
||||
}
|
||||
|
||||
void spine_array_property_id_dispose(spine_array_property_id array) {
|
||||
if (!array) return;
|
||||
delete (Array<PropertyId>*) array;
|
||||
}
|
||||
|
||||
int64_t spine_array_property_id_get(spine_array_property_id array, int index) {
|
||||
if (!array) return 0;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return (*_array)[index];
|
||||
}
|
||||
|
||||
void spine_array_property_id_set(spine_array_property_id array, int index, int64_t value) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
(*_array)[index] = value;
|
||||
}
|
||||
|
||||
void spine_array_property_id_clear(spine_array_property_id array) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
_array->clear();
|
||||
}
|
||||
|
||||
size_t spine_array_property_id_get_capacity(spine_array_property_id array) {
|
||||
if (!array) return 0;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->getCapacity();
|
||||
}
|
||||
|
||||
size_t spine_array_property_id_size(spine_array_property_id array) {
|
||||
if (!array) return 0;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->size();
|
||||
}
|
||||
|
||||
void spine_array_property_id_ensure_capacity(spine_array_property_id array, size_t newCapacity) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
_array->ensureCapacity(newCapacity);
|
||||
}
|
||||
|
||||
void spine_array_property_id_add(spine_array_property_id array, int64_t inValue) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
_array->add(inValue);
|
||||
}
|
||||
|
||||
void spine_array_property_id_remove_at(spine_array_property_id array, size_t inIndex) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
_array->removeAt(inIndex);
|
||||
}
|
||||
|
||||
bool spine_array_property_id_contains(spine_array_property_id array, int64_t inValue) {
|
||||
if (!array) return false;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->contains(inValue);
|
||||
}
|
||||
|
||||
int spine_array_property_id_index_of(spine_array_property_id array, int64_t inValue) {
|
||||
if (!array) return 0;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->indexOf(inValue);
|
||||
}
|
||||
|
||||
int64_t spine_array_property_id_buffer(spine_array_property_id array) {
|
||||
if (!array) return 0;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_animation spine_array_animation_create() {
|
||||
return (spine_array_animation) new (__FILE__, __LINE__) Array<Animation *>();
|
||||
}
|
||||
@ -933,81 +1233,6 @@ spine_event_data spine_array_event_data_buffer(spine_array_event_data array) {
|
||||
return (spine_event_data) _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_float spine_array_float_create() {
|
||||
return (spine_array_float) new (__FILE__, __LINE__) Array<float>();
|
||||
}
|
||||
|
||||
void spine_array_float_dispose(spine_array_float array) {
|
||||
if (!array) return;
|
||||
delete (Array<float>*) array;
|
||||
}
|
||||
|
||||
float spine_array_float_get(spine_array_float array, int index) {
|
||||
if (!array) return 0;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return (*_array)[index];
|
||||
}
|
||||
|
||||
void spine_array_float_set(spine_array_float array, int index, float value) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
(*_array)[index] = value;
|
||||
}
|
||||
|
||||
void spine_array_float_clear(spine_array_float array) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
_array->clear();
|
||||
}
|
||||
|
||||
size_t spine_array_float_get_capacity(spine_array_float array) {
|
||||
if (!array) return 0;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->getCapacity();
|
||||
}
|
||||
|
||||
size_t spine_array_float_size(spine_array_float array) {
|
||||
if (!array) return 0;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->size();
|
||||
}
|
||||
|
||||
void spine_array_float_ensure_capacity(spine_array_float array, size_t newCapacity) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
_array->ensureCapacity(newCapacity);
|
||||
}
|
||||
|
||||
void spine_array_float_add(spine_array_float array, float inValue) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
_array->add(inValue);
|
||||
}
|
||||
|
||||
void spine_array_float_remove_at(spine_array_float array, size_t inIndex) {
|
||||
if (!array) return;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
_array->removeAt(inIndex);
|
||||
}
|
||||
|
||||
bool spine_array_float_contains(spine_array_float array, float inValue) {
|
||||
if (!array) return false;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->contains(inValue);
|
||||
}
|
||||
|
||||
int spine_array_float_index_of(spine_array_float array, float inValue) {
|
||||
if (!array) return 0;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->indexOf(inValue);
|
||||
}
|
||||
|
||||
float *spine_array_float_buffer(spine_array_float array) {
|
||||
if (!array) return nullptr;
|
||||
Array<float> *_array = (Array<float>*) array;
|
||||
return _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_from_property spine_array_from_property_create() {
|
||||
return (spine_array_from_property) new (__FILE__, __LINE__) Array<class FromProperty *>();
|
||||
}
|
||||
@ -1158,81 +1383,6 @@ spine_ik_constraint_data spine_array_ik_constraint_data_buffer(spine_array_ik_co
|
||||
return (spine_ik_constraint_data) _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_int spine_array_int_create() {
|
||||
return (spine_array_int) new (__FILE__, __LINE__) Array<int>();
|
||||
}
|
||||
|
||||
void spine_array_int_dispose(spine_array_int array) {
|
||||
if (!array) return;
|
||||
delete (Array<int>*) array;
|
||||
}
|
||||
|
||||
int spine_array_int_get(spine_array_int array, int index) {
|
||||
if (!array) return 0;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return (*_array)[index];
|
||||
}
|
||||
|
||||
void spine_array_int_set(spine_array_int array, int index, int value) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
(*_array)[index] = value;
|
||||
}
|
||||
|
||||
void spine_array_int_clear(spine_array_int array) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
_array->clear();
|
||||
}
|
||||
|
||||
size_t spine_array_int_get_capacity(spine_array_int array) {
|
||||
if (!array) return 0;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->getCapacity();
|
||||
}
|
||||
|
||||
size_t spine_array_int_size(spine_array_int array) {
|
||||
if (!array) return 0;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->size();
|
||||
}
|
||||
|
||||
void spine_array_int_ensure_capacity(spine_array_int array, size_t newCapacity) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
_array->ensureCapacity(newCapacity);
|
||||
}
|
||||
|
||||
void spine_array_int_add(spine_array_int array, int inValue) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
_array->add(inValue);
|
||||
}
|
||||
|
||||
void spine_array_int_remove_at(spine_array_int array, size_t inIndex) {
|
||||
if (!array) return;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
_array->removeAt(inIndex);
|
||||
}
|
||||
|
||||
bool spine_array_int_contains(spine_array_int array, int inValue) {
|
||||
if (!array) return false;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->contains(inValue);
|
||||
}
|
||||
|
||||
int spine_array_int_index_of(spine_array_int array, int inValue) {
|
||||
if (!array) return 0;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->indexOf(inValue);
|
||||
}
|
||||
|
||||
int *spine_array_int_buffer(spine_array_int array) {
|
||||
if (!array) return nullptr;
|
||||
Array<int> *_array = (Array<int>*) array;
|
||||
return _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_path_constraint_data spine_array_path_constraint_data_create() {
|
||||
return (spine_array_path_constraint_data) new (__FILE__, __LINE__) Array<PathConstraintData *>();
|
||||
}
|
||||
@ -1533,81 +1683,6 @@ spine_polygon spine_array_polygon_buffer(spine_array_polygon array) {
|
||||
return (spine_polygon) _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_property_id spine_array_property_id_create() {
|
||||
return (spine_array_property_id) new (__FILE__, __LINE__) Array<PropertyId>();
|
||||
}
|
||||
|
||||
void spine_array_property_id_dispose(spine_array_property_id array) {
|
||||
if (!array) return;
|
||||
delete (Array<PropertyId>*) array;
|
||||
}
|
||||
|
||||
int64_t spine_array_property_id_get(spine_array_property_id array, int index) {
|
||||
if (!array) return 0;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return (*_array)[index];
|
||||
}
|
||||
|
||||
void spine_array_property_id_set(spine_array_property_id array, int index, int64_t value) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
(*_array)[index] = value;
|
||||
}
|
||||
|
||||
void spine_array_property_id_clear(spine_array_property_id array) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
_array->clear();
|
||||
}
|
||||
|
||||
size_t spine_array_property_id_get_capacity(spine_array_property_id array) {
|
||||
if (!array) return 0;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->getCapacity();
|
||||
}
|
||||
|
||||
size_t spine_array_property_id_size(spine_array_property_id array) {
|
||||
if (!array) return 0;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->size();
|
||||
}
|
||||
|
||||
void spine_array_property_id_ensure_capacity(spine_array_property_id array, size_t newCapacity) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
_array->ensureCapacity(newCapacity);
|
||||
}
|
||||
|
||||
void spine_array_property_id_add(spine_array_property_id array, int64_t inValue) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
_array->add(inValue);
|
||||
}
|
||||
|
||||
void spine_array_property_id_remove_at(spine_array_property_id array, size_t inIndex) {
|
||||
if (!array) return;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
_array->removeAt(inIndex);
|
||||
}
|
||||
|
||||
bool spine_array_property_id_contains(spine_array_property_id array, int64_t inValue) {
|
||||
if (!array) return false;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->contains(inValue);
|
||||
}
|
||||
|
||||
int spine_array_property_id_index_of(spine_array_property_id array, int64_t inValue) {
|
||||
if (!array) return 0;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->indexOf(inValue);
|
||||
}
|
||||
|
||||
int64_t *spine_array_property_id_buffer(spine_array_property_id array) {
|
||||
if (!array) return nullptr;
|
||||
Array<PropertyId> *_array = (Array<PropertyId>*) array;
|
||||
return _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_skin spine_array_skin_create() {
|
||||
return (spine_array_skin) new (__FILE__, __LINE__) Array<Skin *>();
|
||||
}
|
||||
@ -2208,81 +2283,6 @@ spine_transform_constraint_data spine_array_transform_constraint_data_buffer(spi
|
||||
return (spine_transform_constraint_data) _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_unsigned_short spine_array_unsigned_short_create() {
|
||||
return (spine_array_unsigned_short) new (__FILE__, __LINE__) Array<unsigned short>();
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_dispose(spine_array_unsigned_short array) {
|
||||
if (!array) return;
|
||||
delete (Array<unsigned short>*) array;
|
||||
}
|
||||
|
||||
unsigned short spine_array_unsigned_short_get(spine_array_unsigned_short array, int index) {
|
||||
if (!array) return 0;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return (*_array)[index];
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_set(spine_array_unsigned_short array, int index, unsigned short value) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
(*_array)[index] = value;
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_clear(spine_array_unsigned_short array) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
_array->clear();
|
||||
}
|
||||
|
||||
size_t spine_array_unsigned_short_get_capacity(spine_array_unsigned_short array) {
|
||||
if (!array) return 0;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->getCapacity();
|
||||
}
|
||||
|
||||
size_t spine_array_unsigned_short_size(spine_array_unsigned_short array) {
|
||||
if (!array) return 0;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->size();
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_ensure_capacity(spine_array_unsigned_short array, size_t newCapacity) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
_array->ensureCapacity(newCapacity);
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_add(spine_array_unsigned_short array, unsigned short inValue) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
_array->add(inValue);
|
||||
}
|
||||
|
||||
void spine_array_unsigned_short_remove_at(spine_array_unsigned_short array, size_t inIndex) {
|
||||
if (!array) return;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
_array->removeAt(inIndex);
|
||||
}
|
||||
|
||||
bool spine_array_unsigned_short_contains(spine_array_unsigned_short array, unsigned short inValue) {
|
||||
if (!array) return false;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->contains(inValue);
|
||||
}
|
||||
|
||||
int spine_array_unsigned_short_index_of(spine_array_unsigned_short array, unsigned short inValue) {
|
||||
if (!array) return 0;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->indexOf(inValue);
|
||||
}
|
||||
|
||||
unsigned short *spine_array_unsigned_short_buffer(spine_array_unsigned_short array) {
|
||||
if (!array) return nullptr;
|
||||
Array<unsigned short> *_array = (Array<unsigned short>*) array;
|
||||
return _array->buffer();
|
||||
}
|
||||
|
||||
spine_array_update spine_array_update_create() {
|
||||
return (spine_array_update) new (__FILE__, __LINE__) Array<Update *>();
|
||||
}
|
||||
|
||||
@ -37,6 +37,74 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Array<float>
|
||||
SPINE_OPAQUE_TYPE(spine_array_float)
|
||||
|
||||
SPINE_C_EXPORT spine_array_float spine_array_float_create();
|
||||
SPINE_C_EXPORT void spine_array_float_dispose(spine_array_float array);
|
||||
SPINE_C_EXPORT float spine_array_float_get(spine_array_float array, int index);
|
||||
SPINE_C_EXPORT void spine_array_float_set(spine_array_float array, int index, float value);
|
||||
SPINE_C_EXPORT void spine_array_float_clear(spine_array_float array);
|
||||
SPINE_C_EXPORT size_t spine_array_float_get_capacity(spine_array_float array);
|
||||
SPINE_C_EXPORT size_t spine_array_float_size(spine_array_float array);
|
||||
SPINE_C_EXPORT void spine_array_float_ensure_capacity(spine_array_float array, size_t newCapacity);
|
||||
SPINE_C_EXPORT void spine_array_float_add(spine_array_float array, float inValue);
|
||||
SPINE_C_EXPORT void spine_array_float_remove_at(spine_array_float array, size_t inIndex);
|
||||
SPINE_C_EXPORT bool spine_array_float_contains(spine_array_float array, float inValue);
|
||||
SPINE_C_EXPORT int spine_array_float_index_of(spine_array_float array, float inValue);
|
||||
SPINE_C_EXPORT float spine_array_float_buffer(spine_array_float array);
|
||||
|
||||
// Array<int>
|
||||
SPINE_OPAQUE_TYPE(spine_array_int)
|
||||
|
||||
SPINE_C_EXPORT spine_array_int spine_array_int_create();
|
||||
SPINE_C_EXPORT void spine_array_int_dispose(spine_array_int array);
|
||||
SPINE_C_EXPORT int spine_array_int_get(spine_array_int array, int index);
|
||||
SPINE_C_EXPORT void spine_array_int_set(spine_array_int array, int index, int value);
|
||||
SPINE_C_EXPORT void spine_array_int_clear(spine_array_int array);
|
||||
SPINE_C_EXPORT size_t spine_array_int_get_capacity(spine_array_int array);
|
||||
SPINE_C_EXPORT size_t spine_array_int_size(spine_array_int array);
|
||||
SPINE_C_EXPORT void spine_array_int_ensure_capacity(spine_array_int array, size_t newCapacity);
|
||||
SPINE_C_EXPORT void spine_array_int_add(spine_array_int array, int inValue);
|
||||
SPINE_C_EXPORT void spine_array_int_remove_at(spine_array_int array, size_t inIndex);
|
||||
SPINE_C_EXPORT bool spine_array_int_contains(spine_array_int array, int inValue);
|
||||
SPINE_C_EXPORT int spine_array_int_index_of(spine_array_int array, int inValue);
|
||||
SPINE_C_EXPORT int spine_array_int_buffer(spine_array_int array);
|
||||
|
||||
// Array<unsigned short>
|
||||
SPINE_OPAQUE_TYPE(spine_array_unsigned_short)
|
||||
|
||||
SPINE_C_EXPORT spine_array_unsigned_short spine_array_unsigned_short_create();
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_dispose(spine_array_unsigned_short array);
|
||||
SPINE_C_EXPORT unsigned short spine_array_unsigned_short_get(spine_array_unsigned_short array, int index);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_set(spine_array_unsigned_short array, int index, unsigned short value);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_clear(spine_array_unsigned_short array);
|
||||
SPINE_C_EXPORT size_t spine_array_unsigned_short_get_capacity(spine_array_unsigned_short array);
|
||||
SPINE_C_EXPORT size_t spine_array_unsigned_short_size(spine_array_unsigned_short array);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_ensure_capacity(spine_array_unsigned_short array, size_t newCapacity);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_add(spine_array_unsigned_short array, unsigned short inValue);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_remove_at(spine_array_unsigned_short array, size_t inIndex);
|
||||
SPINE_C_EXPORT bool spine_array_unsigned_short_contains(spine_array_unsigned_short array, unsigned short inValue);
|
||||
SPINE_C_EXPORT int spine_array_unsigned_short_index_of(spine_array_unsigned_short array, unsigned short inValue);
|
||||
SPINE_C_EXPORT unsigned short spine_array_unsigned_short_buffer(spine_array_unsigned_short array);
|
||||
|
||||
// Array<PropertyId>
|
||||
SPINE_OPAQUE_TYPE(spine_array_property_id)
|
||||
|
||||
SPINE_C_EXPORT spine_array_property_id spine_array_property_id_create();
|
||||
SPINE_C_EXPORT void spine_array_property_id_dispose(spine_array_property_id array);
|
||||
SPINE_C_EXPORT int64_t spine_array_property_id_get(spine_array_property_id array, int index);
|
||||
SPINE_C_EXPORT void spine_array_property_id_set(spine_array_property_id array, int index, int64_t value);
|
||||
SPINE_C_EXPORT void spine_array_property_id_clear(spine_array_property_id array);
|
||||
SPINE_C_EXPORT size_t spine_array_property_id_get_capacity(spine_array_property_id array);
|
||||
SPINE_C_EXPORT size_t spine_array_property_id_size(spine_array_property_id array);
|
||||
SPINE_C_EXPORT void spine_array_property_id_ensure_capacity(spine_array_property_id array, size_t newCapacity);
|
||||
SPINE_C_EXPORT void spine_array_property_id_add(spine_array_property_id array, int64_t inValue);
|
||||
SPINE_C_EXPORT void spine_array_property_id_remove_at(spine_array_property_id array, size_t inIndex);
|
||||
SPINE_C_EXPORT bool spine_array_property_id_contains(spine_array_property_id array, int64_t inValue);
|
||||
SPINE_C_EXPORT int spine_array_property_id_index_of(spine_array_property_id array, int64_t inValue);
|
||||
SPINE_C_EXPORT int64_t spine_array_property_id_buffer(spine_array_property_id array);
|
||||
|
||||
// Array<Animation *>
|
||||
SPINE_OPAQUE_TYPE(spine_array_animation)
|
||||
|
||||
@ -241,23 +309,6 @@ SPINE_C_EXPORT bool spine_array_event_data_contains(spine_array_event_data array
|
||||
SPINE_C_EXPORT int spine_array_event_data_index_of(spine_array_event_data array, spine_event_data inValue);
|
||||
SPINE_C_EXPORT spine_event_data spine_array_event_data_buffer(spine_array_event_data array);
|
||||
|
||||
// Array<float>
|
||||
SPINE_OPAQUE_TYPE(spine_array_float)
|
||||
|
||||
SPINE_C_EXPORT spine_array_float spine_array_float_create();
|
||||
SPINE_C_EXPORT void spine_array_float_dispose(spine_array_float array);
|
||||
SPINE_C_EXPORT float spine_array_float_get(spine_array_float array, int index);
|
||||
SPINE_C_EXPORT void spine_array_float_set(spine_array_float array, int index, float value);
|
||||
SPINE_C_EXPORT void spine_array_float_clear(spine_array_float array);
|
||||
SPINE_C_EXPORT size_t spine_array_float_get_capacity(spine_array_float array);
|
||||
SPINE_C_EXPORT size_t spine_array_float_size(spine_array_float array);
|
||||
SPINE_C_EXPORT void spine_array_float_ensure_capacity(spine_array_float array, size_t newCapacity);
|
||||
SPINE_C_EXPORT void spine_array_float_add(spine_array_float array, float inValue);
|
||||
SPINE_C_EXPORT void spine_array_float_remove_at(spine_array_float array, size_t inIndex);
|
||||
SPINE_C_EXPORT bool spine_array_float_contains(spine_array_float array, float inValue);
|
||||
SPINE_C_EXPORT int spine_array_float_index_of(spine_array_float array, float inValue);
|
||||
SPINE_C_EXPORT float *spine_array_float_buffer(spine_array_float array);
|
||||
|
||||
// Array<class FromProperty *>
|
||||
SPINE_OPAQUE_TYPE(spine_array_from_property)
|
||||
|
||||
@ -292,23 +343,6 @@ SPINE_C_EXPORT bool spine_array_ik_constraint_data_contains(spine_array_ik_const
|
||||
SPINE_C_EXPORT int spine_array_ik_constraint_data_index_of(spine_array_ik_constraint_data array, spine_ik_constraint_data inValue);
|
||||
SPINE_C_EXPORT spine_ik_constraint_data spine_array_ik_constraint_data_buffer(spine_array_ik_constraint_data array);
|
||||
|
||||
// Array<int>
|
||||
SPINE_OPAQUE_TYPE(spine_array_int)
|
||||
|
||||
SPINE_C_EXPORT spine_array_int spine_array_int_create();
|
||||
SPINE_C_EXPORT void spine_array_int_dispose(spine_array_int array);
|
||||
SPINE_C_EXPORT int spine_array_int_get(spine_array_int array, int index);
|
||||
SPINE_C_EXPORT void spine_array_int_set(spine_array_int array, int index, int value);
|
||||
SPINE_C_EXPORT void spine_array_int_clear(spine_array_int array);
|
||||
SPINE_C_EXPORT size_t spine_array_int_get_capacity(spine_array_int array);
|
||||
SPINE_C_EXPORT size_t spine_array_int_size(spine_array_int array);
|
||||
SPINE_C_EXPORT void spine_array_int_ensure_capacity(spine_array_int array, size_t newCapacity);
|
||||
SPINE_C_EXPORT void spine_array_int_add(spine_array_int array, int inValue);
|
||||
SPINE_C_EXPORT void spine_array_int_remove_at(spine_array_int array, size_t inIndex);
|
||||
SPINE_C_EXPORT bool spine_array_int_contains(spine_array_int array, int inValue);
|
||||
SPINE_C_EXPORT int spine_array_int_index_of(spine_array_int array, int inValue);
|
||||
SPINE_C_EXPORT int *spine_array_int_buffer(spine_array_int array);
|
||||
|
||||
// Array<PathConstraintData *>
|
||||
SPINE_OPAQUE_TYPE(spine_array_path_constraint_data)
|
||||
|
||||
@ -377,23 +411,6 @@ SPINE_C_EXPORT bool spine_array_polygon_contains(spine_array_polygon array, spin
|
||||
SPINE_C_EXPORT int spine_array_polygon_index_of(spine_array_polygon array, spine_polygon inValue);
|
||||
SPINE_C_EXPORT spine_polygon spine_array_polygon_buffer(spine_array_polygon array);
|
||||
|
||||
// Array<PropertyId>
|
||||
SPINE_OPAQUE_TYPE(spine_array_property_id)
|
||||
|
||||
SPINE_C_EXPORT spine_array_property_id spine_array_property_id_create();
|
||||
SPINE_C_EXPORT void spine_array_property_id_dispose(spine_array_property_id array);
|
||||
SPINE_C_EXPORT int64_t spine_array_property_id_get(spine_array_property_id array, int index);
|
||||
SPINE_C_EXPORT void spine_array_property_id_set(spine_array_property_id array, int index, int64_t value);
|
||||
SPINE_C_EXPORT void spine_array_property_id_clear(spine_array_property_id array);
|
||||
SPINE_C_EXPORT size_t spine_array_property_id_get_capacity(spine_array_property_id array);
|
||||
SPINE_C_EXPORT size_t spine_array_property_id_size(spine_array_property_id array);
|
||||
SPINE_C_EXPORT void spine_array_property_id_ensure_capacity(spine_array_property_id array, size_t newCapacity);
|
||||
SPINE_C_EXPORT void spine_array_property_id_add(spine_array_property_id array, int64_t inValue);
|
||||
SPINE_C_EXPORT void spine_array_property_id_remove_at(spine_array_property_id array, size_t inIndex);
|
||||
SPINE_C_EXPORT bool spine_array_property_id_contains(spine_array_property_id array, int64_t inValue);
|
||||
SPINE_C_EXPORT int spine_array_property_id_index_of(spine_array_property_id array, int64_t inValue);
|
||||
SPINE_C_EXPORT int64_t *spine_array_property_id_buffer(spine_array_property_id array);
|
||||
|
||||
// Array<Skin *>
|
||||
SPINE_OPAQUE_TYPE(spine_array_skin)
|
||||
|
||||
@ -530,21 +547,6 @@ SPINE_C_EXPORT bool spine_array_transform_constraint_data_contains(spine_array_t
|
||||
SPINE_C_EXPORT int spine_array_transform_constraint_data_index_of(spine_array_transform_constraint_data array, spine_transform_constraint_data inValue);
|
||||
SPINE_C_EXPORT spine_transform_constraint_data spine_array_transform_constraint_data_buffer(spine_array_transform_constraint_data array);
|
||||
|
||||
// Array<unsigned short>
|
||||
SPINE_OPAQUE_TYPE(spine_array_unsigned_short)
|
||||
|
||||
SPINE_C_EXPORT spine_array_unsigned_short spine_array_unsigned_short_create();
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_dispose(spine_array_unsigned_short array);
|
||||
SPINE_C_EXPORT unsigned short spine_array_unsigned_short_get(spine_array_unsigned_short array, int index);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_set(spine_array_unsigned_short array, int index, unsigned short value);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_clear(spine_array_unsigned_short array);
|
||||
SPINE_C_EXPORT size_t spine_array_unsigned_short_get_capacity(spine_array_unsigned_short array);
|
||||
SPINE_C_EXPORT size_t spine_array_unsigned_short_size(spine_array_unsigned_short array);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_ensure_capacity(spine_array_unsigned_short array, size_t newCapacity);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_add(spine_array_unsigned_short array, unsigned short inValue);
|
||||
SPINE_C_EXPORT void spine_array_unsigned_short_remove_at(spine_array_unsigned_short array, size_t inIndex);
|
||||
SPINE_C_EXPORT unsigned short *spine_array_unsigned_short_buffer(spine_array_unsigned_short array);
|
||||
|
||||
// Array<Update *>
|
||||
SPINE_OPAQUE_TYPE(spine_array_update)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user