| Index: ddraw/glRenderer.cpp |
| — | — | @@ -3210,7 +3210,7 @@ |
| 3211 | 3211 | glTexture__FinishCreate(texture);
|
| 3212 | 3212 | }
|
| 3213 | 3213 |
|
| 3214 | | -void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted)
|
| | 3214 | +void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass)
|
| 3215 | 3215 | {
|
| 3216 | 3216 | GLfloat view[4];
|
| 3217 | 3217 | DDSURFACEDESC2 ddsd;
|
| — | — | @@ -3217,7 +3217,7 @@ |
| 3218 | 3218 | DWORD x2, y2;
|
| 3219 | 3219 | x2 = x * This->firstscalex;
|
| 3220 | 3220 | y2 = y * This->firstscaley;
|
| 3221 | | - glUtil_SetActiveTexture(This->util,0);
|
| | 3221 | + glUtil_SetActiveTexture(This->util,8);
|
| 3222 | 3222 | if(!This->backbuffer)
|
| 3223 | 3223 | {
|
| 3224 | 3224 | ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
|
| — | — | @@ -3242,12 +3242,11 @@ |
| 3243 | 3243 | view[3] = (GLfloat)y2;
|
| 3244 | 3244 | glUtil_SetViewport(This->util,0,0,x2,y2);
|
| 3245 | 3245 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
| 3246 | | - glUtil_SetTexture(This->util,0,*texture);
|
| | 3246 | + glUtil_SetTexture(This->util,8,*texture);
|
| 3247 | 3247 | *texture = This->backbuffer;
|
| 3248 | | - if (!paletted && dxglcfg.firstscalefilter == 1)
|
| 3249 | | - glTexture__SetFilter(*texture, 0, GL_LINEAR, GL_LINEAR, This);
|
| 3250 | | - else glTexture__SetFilter(*texture, 0, GL_NEAREST, GL_NEAREST, This);
|
| 3251 | | - if(This->ext->GLEXT_ARB_sampler_objects) glTexture__SetFilter(NULL,0,GL_LINEAR,GL_LINEAR, This);
|
| | 3248 | + if (!paletted && firstpass && (dxglcfg.firstscalefilter == 1))
|
| | 3249 | + glTexture__SetFilter(*texture, 8, GL_LINEAR, GL_LINEAR, This);
|
| | 3250 | + else glTexture__SetFilter(*texture, 8, GL_NEAREST, GL_NEAREST, This);
|
| 3252 | 3251 | This->ext->glUniform4f(This->shaders->shaders[progtype].view,view[0],view[1],view[2],view[3]);
|
| 3253 | 3252 | This->bltvertices[0].s = This->bltvertices[0].t = This->bltvertices[1].t = This->bltvertices[2].s = 1.;
|
| 3254 | 3253 | This->bltvertices[1].s = This->bltvertices[2].t = This->bltvertices[3].s = This->bltvertices[3].t = 0.;
|
| — | — | @@ -3386,25 +3385,20 @@ |
| 3387 | 3386 | glUtil_SetTexture(This->util,9,paltex);
|
| 3388 | 3387 | if(dxglcfg.scalingfilter || (This->firstscalex != 1.0f) || (This->firstscaley != 1.0f))
|
| 3389 | 3388 | {
|
| 3390 | | - glRenderer__DrawBackbuffer(This,&texture,texture->bigwidth,texture->bigheight,progtype,TRUE);
|
| | 3389 | + glRenderer__DrawBackbuffer(This,&texture,texture->bigwidth,texture->bigheight,progtype,TRUE,TRUE);
|
| 3391 | 3390 | ShaderManager_SetShader(This->shaders,PROG_TEXTURE,NULL,0);
|
| 3392 | 3391 | progtype = PROG_TEXTURE;
|
| 3393 | 3392 | glUtil_SetTexture(This->util,8,texture);
|
| 3394 | 3393 | This->ext->glUniform1i(This->shaders->shaders[progtype].tex0,8);
|
| 3395 | 3394 | }
|
| 3396 | | - if(This->ext->GLEXT_ARB_sampler_objects)
|
| 3397 | | - {
|
| 3398 | | - glTexture__SetFilter(NULL, 8, GL_NEAREST, GL_NEAREST, This);
|
| 3399 | | - glTexture__SetFilter(NULL, 9, GL_NEAREST, GL_NEAREST, This);
|
| 3400 | | - }
|
| 3401 | 3395 | }
|
| 3402 | 3396 | else
|
| 3403 | 3397 | {
|
| 3404 | 3398 | if ((This->firstscalex != 1.0f) || (This->firstscaley != 1.0f))
|
| 3405 | 3399 | {
|
| 3406 | | - glRenderer__DrawBackbuffer(This, &texture, texture->bigwidth, texture->bigheight, progtype, FALSE);
|
| | 3400 | + progtype = PROG_TEXTURE;
|
| 3407 | 3401 | ShaderManager_SetShader(This->shaders, PROG_TEXTURE, NULL, 0);
|
| 3408 | | - progtype = PROG_TEXTURE;
|
| | 3402 | + glRenderer__DrawBackbuffer(This, &texture, texture->bigwidth, texture->bigheight, progtype, FALSE, TRUE);
|
| 3409 | 3403 | glUtil_SetTexture(This->util, 8, texture);
|
| 3410 | 3404 | This->ext->glUniform1i(This->shaders->shaders[progtype].tex0, 0);
|
| 3411 | 3405 | }
|
| — | — | @@ -3413,10 +3407,8 @@ |
| 3414 | 3408 | glUtil_SetTexture(This->util,8,texture);
|
| 3415 | 3409 | This->ext->glUniform1i(This->shaders->shaders[progtype].tex0,8);
|
| 3416 | 3410 | }
|
| 3417 | | - if (dxglcfg.scalingfilter && This->ext->GLEXT_ARB_sampler_objects)
|
| 3418 | | - glTexture__SetFilter(NULL, 0, GL_LINEAR, GL_LINEAR, This);
|
| 3419 | | - else if (This->ext->GLEXT_ARB_sampler_objects)
|
| 3420 | | - glTexture__SetFilter(NULL, 0, GL_NEAREST, GL_NEAREST, This);
|
| | 3411 | + if (dxglcfg.scalingfilter) glTexture__SetFilter(texture, 8, GL_LINEAR, GL_LINEAR, This);
|
| | 3412 | + else glTexture__SetFilter(texture, 8, GL_NEAREST, GL_NEAREST, This);
|
| 3421 | 3413 | glUtil_SetViewport(This->util,viewport[0],viewport[1],viewport[2],viewport[3]);
|
| 3422 | 3414 | This->ext->glUniform4f(This->shaders->shaders[progtype].view,view[0],view[1],view[2],view[3]);
|
| 3423 | 3415 | if(This->ddInterface->GetFullscreen())
|
| Index: ddraw/glRenderer.h |
| — | — | @@ -207,7 +207,7 @@ |
| 208 | 208 | void glRenderer__MakeTexture(glRenderer *This, glTexture *texture);
|
| 209 | 209 | void glRenderer__DrawScreen(glRenderer *This, glTexture *texture, glTexture *paltex, GLint vsync, glTexture *previous, BOOL setsync);
|
| 210 | 210 | void glRenderer__DeleteTexture(glRenderer *This, glTexture *texture);
|
| 211 | | -void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted);
|
| | 211 | +void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass);
|
| 212 | 212 | void glRenderer__DrawBackbufferRect(glRenderer *This, glTexture *texture, RECT srcrect, int progtype);
|
| 213 | 213 | void glRenderer__InitD3D(glRenderer *This, int zbuffer, int x, int y);
|
| 214 | 214 | void glRenderer__Clear(glRenderer *This, ClearCommand *cmd);
|
| Index: ddraw/glUtil.cpp |
| — | — | @@ -74,8 +74,8 @@ |
| 75 | 75 | int i;
|
| 76 | 76 | if (glext->GLEXT_ARB_sampler_objects)
|
| 77 | 77 | {
|
| 78 | | - memset(util->samplers, 0, 8 * sizeof(SAMPLER));
|
| 79 | | - for (i = 0; i < 8; i++)
|
| | 78 | + memset(util->samplers, 0, 12 * sizeof(SAMPLER));
|
| | 79 | + for (i = 0; i < 12; i++)
|
| 80 | 80 | {
|
| 81 | 81 | glext->glGenSamplers(1, &util->samplers[i].id);
|
| 82 | 82 | glext->glBindSampler(i, util->samplers[i].id);
|
| — | — | @@ -102,7 +102,7 @@ |
| 103 | 103 | int i;
|
| 104 | 104 | if (This->ext->GLEXT_ARB_sampler_objects)
|
| 105 | 105 | {
|
| 106 | | - for (i = 0; i < 8; i++)
|
| | 106 | + for (i = 0; i < 12; i++)
|
| 107 | 107 | {
|
| 108 | 108 | This->ext->glBindSampler(i, 0);
|
| 109 | 109 | This->ext->glDeleteSamplers(1, &This->samplers[i].id);
|
| Index: ddraw/struct.h |
| — | — | @@ -249,7 +249,7 @@ |
| 250 | 250 | D3DFILLMODE polymode;
|
| 251 | 251 | D3DSHADEMODE shademode;
|
| 252 | 252 | BufferObject *LastBoundBuffer;
|
| 253 | | - SAMPLER samplers[8];
|
| | 253 | + SAMPLER samplers[16];
|
| 254 | 254 | GLint texlevel;
|
| 255 | 255 | GLuint textures[16];
|
| 256 | 256 | } glUtil;
|