Index: ddraw/ShaderGen2D.cpp |
— | — | @@ -479,7 +479,7 @@ |
480 | 480 | "",
|
481 | 481 | "",
|
482 | 482 | "",
|
483 | | -"pixel = ivec4(255) - pattern;\n",//0F
|
| 483 | +"pixel = colorsizedest - pattern;\n",//0F
|
484 | 484 | "",//10
|
485 | 485 | "",
|
486 | 486 | "",
|
— | — | @@ -515,7 +515,7 @@ |
516 | 516 | "",//30
|
517 | 517 | "",
|
518 | 518 | "",
|
519 | | -"pixel = ivec4(255) - pixel;\n",// 33 NOTSRCCOPY
|
| 519 | +"pixel = colorsizedest - pixel;\n",// 33 NOTSRCCOPY
|
520 | 520 | "",
|
521 | 521 | "",
|
522 | 522 | "",
|
— | — | @@ -549,7 +549,7 @@ |
550 | 550 | "",
|
551 | 551 | "",
|
552 | 552 | "",
|
553 | | -"pixel = ivec4(255) - dest;\n",//55 DSTINVERT
|
| 553 | +"pixel = colorsizedest - dest;\n",//55 DSTINVERT
|
554 | 554 | "",
|
555 | 555 | "",
|
556 | 556 | "",
|
— | — | @@ -719,7 +719,7 @@ |
720 | 720 | "",
|
721 | 721 | "",
|
722 | 722 | "",
|
723 | | -"pixel = ivec4(255);\n",//FF WHITENESS
|
| 723 | +"pixel = colorsizedest;\n",//FF WHITENESS
|
724 | 724 | };
|
725 | 725 |
|
726 | 726 | DWORD PackROPBits(DWORD rop, DWORD flags)
|
Index: ddraw/ShaderManager.cpp |
— | — | @@ -28,13 +28,6 @@ |
29 | 29 | #include "ShaderGen3D.h"
|
30 | 30 | #include "ShaderGen2D.h"
|
31 | 31 |
|
32 | | -const char frag_Color[] = "\
|
33 | | -#version 110\n\
|
34 | | -void main() \n\
|
35 | | -{ \n\
|
36 | | - gl_FragColor = gl_Color; \n\
|
37 | | -} ";
|
38 | | -
|
39 | 32 | const char frag_Texture[] = "\
|
40 | 33 | #version 110\n\
|
41 | 34 | uniform sampler2D tex0;\n\
|
— | — | @@ -109,7 +102,6 @@ |
110 | 103 | #version 110\n\
|
111 | 104 | uniform vec4 view;\n\
|
112 | 105 | attribute vec2 xy;\n\
|
113 | | -attribute vec3 rgb;\n\
|
114 | 106 | attribute vec2 st;\n\
|
115 | 107 | void main()\n\
|
116 | 108 | {\n\
|
— | — | @@ -121,7 +113,6 @@ |
122 | 114 | vec4(-(view[1] + view[0]) / (view[1] - view[0]),\n\
|
123 | 115 | -(view[2] + view[3]) / (view[2] - view[3]), -1 , 1));\n\
|
124 | 116 | gl_Position = proj * xyzw;\n\
|
125 | | - gl_FrontColor = vec4(rgb,1.0);\n\
|
126 | 117 | gl_TexCoord[0] = vec4(st,0.0,1.0);\n\
|
127 | 118 | } ";
|
128 | 119 |
|
— | — | @@ -131,7 +122,6 @@ |
132 | 123 | const int SHADER_START = __LINE__;
|
133 | 124 | const SHADER shader_template[] =
|
134 | 125 | {
|
135 | | - {0,0, vert_ortho, frag_Color, 0,-1,-1,-1},
|
136 | 126 | {0,0, vert_ortho, frag_Texture, 0,-1,-1,-1},
|
137 | 127 | {0,0, vert_ortho, frag_Pal256, 0,-1,-1,-1},
|
138 | 128 | {0,0, vert_ortho, frag_ColorKey, 0,-1,-1,-1},
|
— | — | @@ -172,7 +162,6 @@ |
173 | 163 | }
|
174 | 164 | ext->glLinkProgram(shaders[i].prog);
|
175 | 165 | shaders[i].pos = ext->glGetAttribLocation(shaders[i].prog,"xy");
|
176 | | - shaders[i].rgb = ext->glGetAttribLocation(shaders[i].prog,"rgb");
|
177 | 166 | shaders[i].texcoord = ext->glGetAttribLocation(shaders[i].prog,"st");
|
178 | 167 | shaders[i].tex0 = ext->glGetUniformLocation(shaders[i].prog,"tex0");
|
179 | 168 | shaders[i].tex1 = ext->glGetUniformLocation(shaders[i].prog,"tex1");
|
Index: ddraw/ShaderManager.h |
— | — | @@ -27,7 +27,6 @@ |
28 | 28 | const char *fsrc;
|
29 | 29 | GLint prog;
|
30 | 30 | GLint pos;
|
31 | | - GLint rgb;
|
32 | 31 | GLint texcoord;
|
33 | 32 | GLint tex0;
|
34 | 33 | GLint tex1;
|
— | — | @@ -38,13 +37,12 @@ |
39 | 38 |
|
40 | 39 | extern const SHADER shader_template[];
|
41 | 40 |
|
42 | | -#define PROG_FILL 0
|
43 | | -#define PROG_TEXTURE 1
|
44 | | -#define PROG_PAL256 2
|
45 | | -#define PROG_CKEY 3
|
46 | | -#define PROG_CKEYMASK 4
|
47 | | -#define PROG_2CKEY 5
|
48 | | -#define PROG_CLIPSTENCIL 6
|
| 41 | +#define PROG_TEXTURE 0
|
| 42 | +#define PROG_PAL256 1
|
| 43 | +#define PROG_CKEY 2
|
| 44 | +#define PROG_CKEYMASK 3
|
| 45 | +#define PROG_2CKEY 4
|
| 46 | +#define PROG_CLIPSTENCIL 5
|
49 | 47 |
|
50 | 48 | struct TEXTURESTAGE;
|
51 | 49 | class ShaderGen3D;
|
Index: ddraw/glDirectDrawClipper.cpp |
— | — | @@ -235,8 +235,6 @@ |
236 | 236 | }
|
237 | 237 | for(int i = 0; i < (4*lpClipList->rdh.nCount); i++)
|
238 | 238 | {
|
239 | | - This->vertices[i].r = 255;
|
240 | | - This->vertices[i].g = This->vertices[i].b = This->vertices[i].a = 0;
|
241 | 239 | This->vertices[i].s = This->vertices[i].t = 0.0f;
|
242 | 240 | }
|
243 | 241 | }
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -1144,10 +1144,10 @@ |
1145 | 1145 | This->bltvertices[2].t = This->bltvertices[3].t = (GLfloat)srcrect.bottom / (GLfloat)ddsdSrc.dwHeight;
|
1146 | 1146 | if(dwFlags & 0x10000000)
|
1147 | 1147 | {
|
1148 | | - This->blttexcoords[1].stencils = This->blttexcoords[3].stencils = This->bltvertices[1].x / (GLfloat)dest->fakex;
|
1149 | | - This->blttexcoords[0].stencils = This->blttexcoords[2].stencils = This->bltvertices[0].x / (GLfloat)dest->fakex;
|
1150 | | - This->blttexcoords[0].stencilt = This->blttexcoords[1].stencilt = This->bltvertices[0].y / (GLfloat)dest->fakey;
|
1151 | | - This->blttexcoords[2].stencilt = This->blttexcoords[3].stencilt = This->bltvertices[2].y / (GLfloat)dest->fakey;
|
| 1148 | + This->bltvertices[1].stencils = This->bltvertices[3].stencils = This->bltvertices[1].x / (GLfloat)dest->fakex;
|
| 1149 | + This->bltvertices[0].stencils = This->bltvertices[2].stencils = This->bltvertices[0].x / (GLfloat)dest->fakex;
|
| 1150 | + This->bltvertices[0].stencilt = This->bltvertices[1].stencilt = This->bltvertices[0].y / (GLfloat)dest->fakey;
|
| 1151 | + This->bltvertices[2].stencilt = This->bltvertices[3].stencilt = This->bltvertices[2].y / (GLfloat)dest->fakey;
|
1152 | 1152 | }
|
1153 | 1153 | if(dest->zbuffer) glClear(GL_DEPTH_BUFFER_BIT);
|
1154 | 1154 | if (dwFlags & DDBLT_COLORFILL) SetColorFillUniform(lpDDBltFx->dwFillColor, dest->texture->colorsizes,
|
— | — | @@ -1176,7 +1176,7 @@ |
1177 | 1177 | TextureManager_SetTexture(This->texman, 3, dest->stencil);
|
1178 | 1178 | This->ext->glUniform1i(shader->shader.uniforms[4],3);
|
1179 | 1179 | This->util->EnableArray(shader->shader.attribs[5],true);
|
1180 | | - This->ext->glVertexAttribPointer(shader->shader.attribs[5], 2, GL_FLOAT, false, sizeof(BltTexcoord), &This->blttexcoords[0].stencils);
|
| 1180 | + This->ext->glVertexAttribPointer(shader->shader.attribs[5], 2, GL_FLOAT, false, sizeof(BltVertex), &This->bltvertices[0].stencils);
|
1181 | 1181 | }
|
1182 | 1182 | if(src)
|
1183 | 1183 | {
|
— | — | @@ -1197,11 +1197,6 @@ |
1198 | 1198 | dest->dirty |= 2;
|
1199 | 1199 | This->util->EnableArray(shader->shader.attribs[0],true);
|
1200 | 1200 | This->ext->glVertexAttribPointer(shader->shader.attribs[0],2,GL_FLOAT,false,sizeof(BltVertex),&This->bltvertices[0].x);
|
1201 | | - if(shader->shader.attribs[1] != -1)
|
1202 | | - {
|
1203 | | - This->util->EnableArray(shader->shader.attribs[1],true);
|
1204 | | - This->ext->glVertexAttribPointer(shader->shader.attribs[1],3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&This->bltvertices[0].r);
|
1205 | | - }
|
1206 | 1201 | if(!(dwFlags & DDBLT_COLORFILL))
|
1207 | 1202 | {
|
1208 | 1203 | This->util->EnableArray(shader->shader.attribs[3],true);
|
— | — | @@ -1452,11 +1447,6 @@ |
1453 | 1448 | This->ext->glVertexAttribPointer(This->shaders->shaders[progtype].pos,2,GL_FLOAT,false,sizeof(BltVertex),&This->bltvertices[0].x);
|
1454 | 1449 | This->util->EnableArray(This->shaders->shaders[progtype].texcoord,true);
|
1455 | 1450 | This->ext->glVertexAttribPointer(This->shaders->shaders[progtype].texcoord,2,GL_FLOAT,false,sizeof(BltVertex),&This->bltvertices[0].s);
|
1456 | | - if(This->shaders->shaders[progtype].rgb != -1)
|
1457 | | - {
|
1458 | | - This->util->EnableArray(This->shaders->shaders[progtype].rgb,true);
|
1459 | | - This->ext->glVertexAttribPointer(This->shaders->shaders[progtype].rgb,3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&This->bltvertices[0].r);
|
1460 | | - }
|
1461 | 1451 | This->util->SetCull(D3DCULL_NONE);
|
1462 | 1452 | This->util->SetPolyMode(D3DFILL_SOLID);
|
1463 | 1453 | This->ext->glDrawRangeElements(GL_TRIANGLE_STRIP,0,3,4,GL_UNSIGNED_SHORT,bltindices);
|
Index: ddraw/glRenderer.h |
— | — | @@ -112,7 +112,6 @@ |
113 | 113 | GLfloat fogend;
|
114 | 114 | GLfloat fogdensity;
|
115 | 115 | BltVertex bltvertices[4];
|
116 | | - BltTexcoord blttexcoords[4];
|
117 | 116 | int oldswap;
|
118 | 117 | TextureManager *texman;
|
119 | 118 | glUtil *util;
|
Index: ddraw/glUtil.h |
— | — | @@ -31,17 +31,11 @@ |
32 | 32 | typedef struct
|
33 | 33 | {
|
34 | 34 | GLfloat x, y;
|
35 | | - GLubyte r, g, b, a;
|
36 | 35 | GLfloat s, t;
|
37 | 36 | GLfloat dests, destt;
|
38 | | - GLfloat padding;
|
| 37 | + GLfloat stencils, stencilt;
|
39 | 38 | } BltVertex;
|
40 | 39 |
|
41 | | -typedef struct
|
42 | | -{
|
43 | | - GLfloat stencils, stencilt;
|
44 | | -} BltTexcoord;
|
45 | | -
|
46 | 40 | class glDirectDrawSurface7;
|
47 | 41 |
|
48 | 42 | class glUtil
|