mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
[dart] Check C++ class name, not C type name in RTTI based instantiation, as that's what RTTI gives us as className.
This commit is contained in:
parent
0e0a12b4a5
commit
244abfb65a
@ -1336,8 +1336,10 @@ ${declaration} {`;
|
|||||||
lines.push(`switch (className) {`);
|
lines.push(`switch (className) {`);
|
||||||
|
|
||||||
for (const subclass of concreteSubclasses) {
|
for (const subclass of concreteSubclasses) {
|
||||||
|
const cppClass = this.classMap.get(subclass);
|
||||||
|
if (!cppClass) throw Error(`Class ${subclass} not found in class map`);
|
||||||
const dartSubclass = this.toDartTypeName(subclass);
|
const dartSubclass = this.toDartTypeName(subclass);
|
||||||
lines.push(` case '${subclass}':`);
|
lines.push(` case '${cppClass.cppType.name}':`);
|
||||||
lines.push(` return ${dartSubclass}.fromPointer(${resultVar}.cast());`);
|
lines.push(` return ${dartSubclass}.fromPointer(${resultVar}.cast());`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -91,6 +91,17 @@ void main() async {
|
|||||||
final boundsInJump = drawable.skeleton.bounds;
|
final boundsInJump = drawable.skeleton.bounds;
|
||||||
print(' Bounds during jump: $boundsInJump');
|
print(' Bounds during jump: $boundsInJump');
|
||||||
|
|
||||||
|
// Test constraint RTTI
|
||||||
|
print('\nTesting constraint RTTI:');
|
||||||
|
|
||||||
|
// IK Constraints
|
||||||
|
print(' Constraints:');
|
||||||
|
for (final constraint in drawable.skeleton.constraints) {
|
||||||
|
final data = constraint?.data;
|
||||||
|
print(' Constraint type: ${constraint?.rtti.className}');
|
||||||
|
print(' Constraint data type: ${constraint?.data?.rtti.className}');
|
||||||
|
}
|
||||||
|
|
||||||
// Check manager state before cleanup
|
// Check manager state before cleanup
|
||||||
print('\nBefore cleanup:');
|
print('\nBefore cleanup:');
|
||||||
AnimationStateEventManager.instance.debugPrint();
|
AnimationStateEventManager.instance.debugPrint();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user