mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-11 09:38:44 +08:00
- Ported extract-spine-cpp-types.js to TypeScript in type-extractor.ts - Improved type interfaces with discriminated unions for better type safety - Added proper isConst tracking for const-qualified methods - Fixed exclusions to check method.isConst instead of return type - Removed special type mappings (utf8, spine_void) - primitives pass through unchanged - Made toCTypeName strict with proper error handling - Documented all conversion functions with examples - Excluded SpineObject from extraction (matches JS behavior) - Removed original JS extractor as it's now replaced by TypeScript version The TypeScript extractor produces identical output (107 files, 164 types) while providing better type information including isConst for methods and consistent isStatic fields. Co-Authored-By: Claude <noreply@anthropic.com>
26 lines
631 B
C
26 lines
631 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <spine-c.h>
|
|
|
|
int main() {
|
|
printf("Testing spine-c-new...\n");
|
|
|
|
// Test version functions
|
|
printf("Spine version: %d.%d\n", spine_major_version(), spine_minor_version());
|
|
|
|
// Test debug extension
|
|
spine_enable_debug_extension(1);
|
|
|
|
// Test loading an atlas (will fail but tests the API)
|
|
spine_atlas atlas = spine_atlas_load("test.atlas");
|
|
if (!atlas) {
|
|
printf("Failed to load atlas (expected)\n");
|
|
} else {
|
|
spine_atlas_dispose(atlas);
|
|
}
|
|
|
|
// Report any memory leaks
|
|
spine_report_leaks();
|
|
|
|
return 0;
|
|
} |