(struct)
| 96 | namespace = 'vr' |
| 97 | |
| 98 | def OutputStructFields(struct): |
| 99 | |
| 100 | # recursively add base class fields first |
| 101 | basename = getclasswithoutnamespace(struct['struct']) |
| 102 | if basename in structparents: |
| 103 | parentname = structparents[basename] |
| 104 | i = structindices[parentname]; |
| 105 | OutputStructFields(data['structs'][i]) |
| 106 | |
| 107 | for enumvalue in struct['fields']: |
| 108 | fieldtype = enumvalue['fieldtype'] |
| 109 | otype = striparraysuffix(fieldtype) |
| 110 | lastchar = fieldtype[len(fieldtype) - 1] |
| 111 | if(lastchar == ']'): |
| 112 | #print('\t//fixed '+otype+' '+enumvalue['fieldname']+ fieldtype[fieldtype.find('['):]+';') |
| 113 | dims = map(int, fieldtype[fieldtype.find('[')+1:-1].split('][')) |
| 114 | size = reduce(operator.mul, dims, 1) |
| 115 | utype = unmanagedtype(otype) |
| 116 | print('\t'+('char ' if(otype=='char') else ctype(otype)+' ')+enumvalue['fieldname']+ fieldtype[fieldtype.find('['):]+'; //'+otype+fieldtype[fieldtype.find('['):]) |
| 117 | else: |
| 118 | if(lastchar == '*'): |
| 119 | print('\t'+ctype(fieldtype)+' '+enumvalue['fieldname']+';'+' // '+fieldtype) |
| 120 | else: |
| 121 | print('\t'+ctype(otype)+' '+enumvalue['fieldname']+';') |
| 122 | |
| 123 | ######## |
| 124 | # Output constants into OpenVR class |
no test coverage detected