Module: wine Branch: master Commit: ba519be60f06ac0ed937b84dc058a74de9d23611 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ba519be60f06ac0ed937b84dc0...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Mar 4 12:19:56 2010 +0100
wined3d: Split TEXT shader comments into separate lines.
Based on a patch by Christian Costa.
---
dlls/wined3d/shader.c | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 2dc9522..307cadf 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1231,7 +1231,27 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe fe->shader_read_comment(&ptr, &comment, &comment_size); if (comment) { - TRACE("// %s\n", debugstr_an(comment, comment_size)); + if (comment_size > 4 && *(const DWORD *)comment == WINEMAKEFOURCC('T', 'E', 'X', 'T')) + { + const char *end = comment + comment_size; + const char *ptr = comment + 4; + const char *line = ptr; + + TRACE("// TEXT\n"); + while (ptr != end) + { + if (*ptr == '\n') + { + UINT len = ptr - line; + if (len && *(ptr - 1) == '\r') --len; + TRACE("// %s\n", debugstr_an(line, len)); + line = ++ptr; + } + else ++ptr; + } + if (line != ptr) TRACE("// %s\n", debugstr_an(line, ptr - line)); + } + else TRACE("// %s\n", debugstr_an(comment, comment_size)); continue; }