(namespace, data)
| 537 | |
| 538 | |
| 539 | def outputfntables(namespace, data): |
| 540 | lastclass = '' |
| 541 | lastmethod = '' |
| 542 | for method in data['methods']: |
| 543 | if (len(method) > 0): |
| 544 | returntype = method['returntype'] |
| 545 | if(returntype == 'class CSteamID'): |
| 546 | returntype = 'uint64' |
| 547 | methodname = method['methodname'] |
| 548 | if(methodname == lastmethod): |
| 549 | methodname = methodname + repr(count) |
| 550 | count = count + 1 |
| 551 | else: |
| 552 | count = 0 |
| 553 | lastmethod = method['methodname'] |
| 554 | |
| 555 | classname = method['classname'] |
| 556 | |
| 557 | if(namespace != getnamespace(classname)): |
| 558 | continue |
| 559 | |
| 560 | classname = getclasswithoutnamespace(classname) |
| 561 | if(classname != lastclass): |
| 562 | if(lastclass != ''): |
| 563 | print("};\n"); |
| 564 | |
| 565 | fntablename = method['classname'].replace('vr::', 'VR::').replace('::', '_') + '_FnTable' |
| 566 | print("struct " + fntablename + "\n{") |
| 567 | lastclass = classname |
| 568 | |
| 569 | sys.stdout.write ('\t'+ ctype(returntype) + ' (OPENVR_FNTABLE_CALLTYPE *' + methodname + ')') |
| 570 | |
| 571 | paramlist = [] |
| 572 | if('params' in method): |
| 573 | for param in method['params']: |
| 574 | paramlist.append(ctype(param['paramtype']) + ' ' + param['paramname']) |
| 575 | |
| 576 | print('('+", ".join(paramlist)+");") |
| 577 | |
| 578 | print("};\n"); |
| 579 | |
| 580 | def outputfntabledecls(namespace, data): |
| 581 | lastclass = '' |
nothing calls this directly
no test coverage detected