X-Git-Url: http://git.tdb.fi/?p=gldbg.git;a=blobdiff_plain;f=source%2Fglprint.funcs.t;h=d98f6e72102389bd6cac9a78a5fb79af8fdde7da;hp=9c62ee0b2de2b2d0fd67954c60b1436c1a3240f0;hb=0205804a10fe3beb01ed0135fde052d13b045570;hpb=49f8063ce156a50d4b3b8c77a1508a21ea2bfe90 diff --git a/source/glprint.funcs.t b/source/glprint.funcs.t index 9c62ee0..d98f6e7 100644 --- a/source/glprint.funcs.t +++ b/source/glprint.funcs.t @@ -13,9 +13,14 @@ for p in params: if not first: w(', ') if p.kind=="value": - w("%s", p.io[1]) - else: - w("%%p") + w('%s', p.io[1]) + elif p.kind=="reference": + if p.io: + w('{%s}', p.io[1]) + else: + w('', p.type) + elif p.kind=="array": + w('%%s') first = False w(')') if ret.ctype!="void": @@ -23,11 +28,27 @@ if ret.ctype!="void": w('"') for p in params+[ret]: if p.ctype!="void": - if p.io and len(p.io)>=3 and p.io[2]: - f = p.io[2].split(':') - w(', %s(%s)', f[0], ", ".join(eval(x) for x in f[1:])) - else: - w(', %s', p.name) + if p.kind=="value": + if len(p.io)>=3 and p.io[2]: + f = p.io[2].split(':') + w(', %s(%s)', f[0], ", ".join(eval(x) for x in f[1:])) + else: + w(', %s', p.name) + elif p.kind=="reference": + if p.io: + w(', *%s', p.name) + else: + w(', %s', p.name) + elif p.kind=="array": + if not p.csize: + w(', print_data(%s, 0)', p.name) + elif p.base_ctype=="GLvoid" or p.base_ctype=="void": + w(', print_data(%s, %s)', p.name, p.csize) + else: + f = p.io[1] + if len(p.io)>=3 and p.io[2]: + f = "%x" + w(', print_array("%s", %s, sizeof(%s), %s)', f, p.name, p.base_ctype, p.csize) wl(');') wl('}') :static void init_print(GlDecoder *dec)