X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglprint.funcs.t;h=111748e91e3f546c9e189bd70f74971d5f5134a6;hb=HEAD;hp=db626c0539efecdb4a3530fb2b88f79625198a04;hpb=3c32a221de1435ae7af8d96182560e8b28f1a4c0;p=gldbg.git diff --git a/source/glprint.funcs.t b/source/glprint.funcs.t index db626c0..111748e 100644 --- a/source/glprint.funcs.t +++ b/source/glprint.funcs.t @@ -1,4 +1,3 @@ -# $Id$ w('static void print_%s(void *user_data', func.name) if ret.ctype!="void": w(', %s ret', ret.ctype) @@ -9,17 +8,22 @@ wl('{') wl(' GlPrintData *gpd = (GlPrintData *)user_data;') w(' snprintf(gpd->buffer, gpd->bufsize, "%s(', func.name) first = True +pname = None for p in params: if not first: w(', ') + if p.name=="pname": + pname = p if p.kind=="value": - w('%s', p.io[1]) - elif p.kind=="reference": - if p.io: - w('{%s}', p.io[1]) + if pname and p.name=="param" and p.base_ctype=="GLint": + w('%%s') + elif p.type=="TextureComponentCount": + w('%%s') else: - w('', p.type) - elif p.kind=="array": + w('%s', p.io[1]) + elif p.kind=="reference" and not p.io: + w('', p.type) + else: w('%%s') first = False w(')') @@ -29,21 +33,27 @@ w('"') for p in params+[ret]: if p.ctype!="void": 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:])) + if pname and p.name=="param" and p.base_ctype=="GLint": + w(', print_parameter(%s, %s)', pname.name, p.name) + elif p.type=="TextureComponentCount": + w(', print_internal_format(%s)', p.name) + elif len(p.io)>=3 and p.io[2]: + if p.io[2][0]=='(': + w(', %s%s', p.io[2], p.name) + else: + w(', %s(%s, "%s")', p.io[2], p.name, p.type) else: w(', %s', p.name) - elif p.kind=="reference": - if p.io: - 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: - w(', print_array("%s", %s, sizeof(%s), %s)', p.io[1], p.name, p.base_ctype, p.csize) + elif p.kind=="reference" and not p.io: + w(', %s', p.name) + elif 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) + elif len(p.io)>=3 and p.io[2]: + w(', print_array_described(%s, "%s", %s, sizeof(%s), %s)', p.io[2], p.type, p.name, p.base_ctype, p.csize) + else: + w(', print_array("%s", %s, sizeof(%s), %s)', p.io[1], p.name, p.base_ctype, p.csize) wl(');') wl('}') :static void init_print(GlDecoder *dec)