X-Git-Url: http://git.tdb.fi/?p=gldbg.git;a=blobdiff_plain;f=source%2Fglwrap.funcs.t;h=17e711b870124d46244a37789995d955384dddf4;hp=eb77b0a7a3e0e5ce15e19101bffcb18ad73e8928;hb=4aba13fc7690cf79e949d9765b371e85e7530207;hpb=03c86c2f632b642aa94f721e326787e91aa69c25 diff --git a/source/glwrap.funcs.t b/source/glwrap.funcs.t index eb77b0a..17e711b 100644 --- a/source/glwrap.funcs.t +++ b/source/glwrap.funcs.t @@ -11,23 +11,33 @@ if ret.ctype!='void': wl(' %s ret;', ret.ctype) wl(' if(!orig)') wl(' orig = glsym("%s");', func.name) -w(' ') -if ret.ctype!='void': - w('ret = ') -wl('orig(%s);', ", ".join([p.name for p in params])) wl(' begin_packet(FUNC_%s);', func.name.upper()) -if ret.ctype!='void': - wl(' write_%s(ret);', ret.io[0].replace(' ', '_')) +head_sent = False for p in params: + if p.direction=="out" and not head_sent: + wl(' send_partial_packet();') + w(' ') + if ret.ctype!='void': + w('ret = ') + wl('orig(%s);', ", ".join([q.name for q in params])) + head_sent = True if p.kind=="value": wl(' write_%s(%s);', p.io[0].replace(' ', '_'), p.name) elif p.kind=="array" and p.io and p.io[0]=="string": - wl(' write_string_array(%s, %s);', p.name, p.csize) + wl(' write_string_array(%s, %s);', p.name, p.csize) elif p.csize: wl(' write_data(%s, %s);', p.name, p.csize) else: wl(' write_pointer(%s);', p.name) +if ret.ctype!='void': + if not head_sent: + wl(' send_partial_packet();') + wl(' ret = orig(%s);', ", ".join([p.name for p in params])) + head_sent = True + wl(' write_%s(ret);', ret.io[0].replace(' ', '_')) wl(' send_packet();') +if not head_sent: + wl(' orig(%s);', ", ".join([p.name for p in params])) if not func.name.startswith("glX"): wl(' check_error();') if ret.ctype!='void':