From cb26d59d2667ffa69b42aeb5b8c3c214c5eab61e Mon Sep 17 00:00:00 2001 From: "H. Verbeet" Date: Mon, 15 Jan 2007 19:30:41 +0100 Subject: [PATCH] 05/49: wined3d: Only add line numbers for new lines in shader_addline(). --- dlls/wined3d/baseshader.c | 13 +++++++++++-- dlls/wined3d/pixelshader.c | 1 + dlls/wined3d/vertexshader.c | 1 + dlls/wined3d/wined3d_private.h | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index 5e58721a2b0..bd4887847d8 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -57,9 +57,18 @@ int shader_addline( return -1; } + if (buffer->newline) { + TRACE("GL HW (%u, %u) : %s", buffer->lineNo + 1, buffer->bsize, base); + buffer->newline = FALSE; + } else { + TRACE(base); + } + buffer->bsize += rc; - buffer->lineNo++; - TRACE("GL HW (%u, %u) : %s", buffer->lineNo, buffer->bsize, base); + if (buffer->buffer[buffer->bsize-1] == '\n') { + buffer->lineNo++; + buffer->newline = TRUE; + } return 0; } diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index 862d56aaba5..ce69e0bad11 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -832,6 +832,7 @@ inline static VOID IWineD3DPixelShaderImpl_GenerateShader( #endif buffer.bsize = 0; buffer.lineNo = 0; + buffer.newline = TRUE; if (This->baseShader.shader_mode == SHADER_GLSL) { diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c index f68a2fbd6ad..cd2d4729a3f 100644 --- a/dlls/wined3d/vertexshader.c +++ b/dlls/wined3d/vertexshader.c @@ -715,6 +715,7 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader( #endif buffer.bsize = 0; buffer.lineNo = 0; + buffer.newline = TRUE; if (This->baseShader.shader_mode == SHADER_GLSL) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 3611f8713d2..3ff6b26ab5c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1491,6 +1491,7 @@ typedef struct SHADER_BUFFER { char* buffer; unsigned int bsize; unsigned int lineNo; + BOOL newline; } SHADER_BUFFER; /* Undocumented opcode controls */