DXGL r457 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r456‎ | r457 | r458 >
Date:23:58, 4 July 2014
Author:admin
Status:new
Tags:
Comment:
Fix DDBLT_COLORFILL
Modified paths:
  • /ddraw/ShaderGen2D.cpp (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/ShaderGen2D.cpp
@@ -172,7 +172,7 @@
173173
174174 // Operations
175175 static const char op_src[] = "pixel = ivec4(texture2D(srctex,gl_TexCoord[0].st)*255.0);\n";
176 -static const char op_color[] = "pixel = ivec4(gl_FragColor*255.0);\n";
 176+static const char op_color[] = "pixel = ivec4(gl_Color*255.0);\n";
177177 static const char op_dest[] = "dest = ivec4(texture2D(desttex,gl_TexCoord[1].st)*255.0);\n";
178178 static const char op_pattern[] = "pattern = ivec4(texture2D(patterntex,gl_TexCoord[2].st)*255.0);\n";
179179 static const char op_destout[] = "gl_FragColor = vec4(pixel)/255.0;\n";
Index: ddraw/glRenderer.cpp
@@ -926,7 +926,7 @@
927927 LONG sizes[6];
928928 This->ddInterface->GetSizes(sizes);
929929 DWORD shaderid;
930 - if (lpDDBltFx) shaderid = PackROPBits(lpDDBltFx->dwROP, dwFlags);
 930+ if ((lpDDBltFx) && (dwFlags & DDBLT_ROP)) shaderid = PackROPBits(lpDDBltFx->dwROP, dwFlags);
931931 else shaderid = dwFlags & 0xF2FAADFF;
932932 This->shaders->SetShader(shaderid, NULL, NULL, 1);
933933 GenShader2D *shader = &This->shaders->gen2d->genshaders2D[This->shaders->gen3d->current_genshader];
@@ -1056,7 +1056,7 @@
10571057 if(shader->shader.attribs[1] != -1)
10581058 {
10591059 This->util->EnableArray(shader->shader.attribs[1],true);
1060 - This->ext->glVertexAttribPointer(shader->shader.attribs[0],3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&This->bltvertices[0].r);
 1060+ This->ext->glVertexAttribPointer(shader->shader.attribs[1],3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&This->bltvertices[0].r);
10611061 }
10621062 if(!(dwFlags & DDBLT_COLORFILL))
10631063 {