mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
fix overloaded sorting checks
This commit is contained in:
parent
2c934140ba
commit
66ac542bce
@ -187,12 +187,12 @@ def subclass(type1, type2):
|
|||||||
return 1
|
return 1
|
||||||
elif (type2 == 0):
|
elif (type2 == 0):
|
||||||
return -1
|
return -1
|
||||||
# If class1 inherits from class2 return 1
|
# If class1 inherits from class2 return -1
|
||||||
elif inheritsFrom(type1, type2):
|
elif inheritsFrom(type1, type2):
|
||||||
return 1
|
|
||||||
# If class2 inherits from class1 return -1
|
|
||||||
elif inheritsFrom(type2, type1):
|
|
||||||
return -1
|
return -1
|
||||||
|
# If class2 inherits from class1 return 1
|
||||||
|
elif inheritsFrom(type2, type1):
|
||||||
|
return 1
|
||||||
else:
|
else:
|
||||||
# This is the dont care case. We must specify a sorting
|
# This is the dont care case. We must specify a sorting
|
||||||
# rule just so it is not arbitrary
|
# rule just so it is not arbitrary
|
||||||
@ -343,7 +343,7 @@ class FFIMethodArgumentTree:
|
|||||||
typeNameList = []
|
typeNameList = []
|
||||||
# Make a copy of the keys so we can sort them in place
|
# Make a copy of the keys so we can sort them in place
|
||||||
sortedKeys = self.tree.keys()
|
sortedKeys = self.tree.keys()
|
||||||
# Sort the keys based on inheritance hierarchy, most generic classes first
|
# Sort the keys based on inheritance hierarchy, most specific classes first
|
||||||
sortedKeys.sort(subclass)
|
sortedKeys.sort(subclass)
|
||||||
# Import everybody we need
|
# Import everybody we need
|
||||||
for i in range(len(sortedKeys)):
|
for i in range(len(sortedKeys)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user