Update parsers to use more real C data.

This commit is contained in:
2025-06-23 22:23:18 -05:00
parent 22af9d1507
commit 24eab84f4f
17 changed files with 85 additions and 57 deletions

View File

@ -91,14 +91,17 @@ with open(headerFile, 'w') as f:
def findProp(name, expectedType=''):
for prop in properties.findall('property'):
if prop.get('name') == name:
if len(expectedType) > 0 and prop.get('type') != expectedType:
continue
if len(expectedType) > 0:
if 'type' in prop.attrib and prop.get('type') != expectedType:
continue
if 'propertytype' in prop.attrib and prop.get('propertytype') != expectedType:
continue
return prop.get('value', '')
return None
f.write(f" {{\n")
propSolid = findProp('solid', 'int')
propSolid = findProp('solidType', 'tileSolidType')
if propSolid is not None:
f.write(f" .solidType = {propSolid},\n")