Index: ddraw/glRenderer.cpp |
— | — | @@ -3395,7 +3395,8 @@ |
3396 | 3396 | else if (usedest)
|
3397 | 3397 | {
|
3398 | 3398 | ShaderManager_SetShader(This->shaders, PROG_TEXTURE, NULL, 0);
|
3399 | | - glRenderer__DrawBackbufferRect(This, cmd->dest, destrect, destrect2, PROG_TEXTURE);
|
| 3399 | + if(!(cmd->flags & 0x80000000))
|
| 3400 | + (This, cmd->dest, destrect, destrect2, PROG_TEXTURE);
|
3400 | 3401 | This->bltvertices[1].dests = This->bltvertices[3].dests = 0.0f;
|
3401 | 3402 | This->bltvertices[0].dests = This->bltvertices[2].dests = (GLfloat)(destrect.right - destrect.left) / (GLfloat)This->backbuffer->levels[0].ddsd.dwWidth;
|
3402 | 3403 | This->bltvertices[0].destt = This->bltvertices[1].destt = 1.0f;
|
— | — | @@ -3404,15 +3405,19 @@ |
3405 | 3406 | ShaderManager_SetShader(This->shaders, shaderid, NULL, 1);
|
3406 | 3407 | GenShader2D *shader = (GenShader2D*)This->shaders->gen3d->current_genshader;
|
3407 | 3408 | glUtil_BlendEnable(This->util, FALSE);
|
3408 | | - do
|
| 3409 | + if (cmd->flags & 0x80000000) glUtil_SetFBO(This->util, NULL);
|
| 3410 | + else
|
3409 | 3411 | {
|
3410 | | - if (glUtil_SetFBOSurface(This->util, cmd->dest, NULL, cmd->destlevel, 0, TRUE) == GL_FRAMEBUFFER_COMPLETE) break;
|
3411 | | - if (!cmd->dest->internalformats[1]) break;
|
3412 | | - glTexture__Repair(cmd->dest, TRUE);
|
3413 | | - glUtil_SetFBO(This->util, NULL);
|
3414 | | - cmd->dest->levels[cmd->destlevel].fbo.fbcolor = NULL;
|
3415 | | - cmd->dest->levels[cmd->destlevel].fbo.fbz = NULL;
|
3416 | | - } while (1);
|
| 3412 | + do
|
| 3413 | + {
|
| 3414 | + if (glUtil_SetFBOSurface(This->util, cmd->dest, NULL, cmd->destlevel, 0, TRUE) == GL_FRAMEBUFFER_COMPLETE) break;
|
| 3415 | + if (!cmd->dest->internalformats[1]) break;
|
| 3416 | + glTexture__Repair(cmd->dest, TRUE);
|
| 3417 | + glUtil_SetFBO(This->util, NULL);
|
| 3418 | + cmd->dest->levels[cmd->destlevel].fbo.fbcolor = NULL;
|
| 3419 | + cmd->dest->levels[cmd->destlevel].fbo.fbz = NULL;
|
| 3420 | + } while (1);
|
| 3421 | + }
|
3417 | 3422 | glUtil_SetViewport(This->util,0,0,cmd->dest->bigwidth,cmd->dest->bigheight);
|
3418 | 3423 | glUtil_DepthTest(This->util, FALSE);
|
3419 | 3424 | DDSURFACEDESC2 ddsdSrc;
|
— | — | @@ -3435,8 +3440,16 @@ |
3436 | 3441 | else srcrect = cmd->srcrect;
|
3437 | 3442 | This->bltvertices[1].x = This->bltvertices[3].x = (GLfloat)destrect.left;
|
3438 | 3443 | This->bltvertices[0].x = This->bltvertices[2].x = (GLfloat)destrect.right;
|
3439 | | - This->bltvertices[0].y = This->bltvertices[1].y = (GLfloat)ddsd.dwHeight - (GLfloat)destrect.top;
|
3440 | | - This->bltvertices[2].y = This->bltvertices[3].y = (GLfloat)ddsd.dwHeight - (GLfloat)destrect.bottom;
|
| 3444 | + if (cmd->flags & 0x80000000)
|
| 3445 | + {
|
| 3446 | + This->bltvertices[0].y = This->bltvertices[1].y = (GLfloat)ddsd.dwHeight;
|
| 3447 | + This->bltvertices[2].y = This->bltvertices[3].y = (GLfloat)ddsd.dwHeight;
|
| 3448 | + }
|
| 3449 | + else
|
| 3450 | + {
|
| 3451 | + This->bltvertices[0].y = This->bltvertices[1].y = (GLfloat)ddsd.dwHeight - (GLfloat)destrect.top;
|
| 3452 | + This->bltvertices[2].y = This->bltvertices[3].y = (GLfloat)ddsd.dwHeight - (GLfloat)destrect.bottom;
|
| 3453 | + }
|
3441 | 3454 | if (cmd->src && (cmd->src->target == GL_TEXTURE_RECTANGLE))
|
3442 | 3455 | {
|
3443 | 3456 | This->bltvertices[1].s = This->bltvertices[3].s = (GLfloat)srcrect.left;
|
— | — | @@ -3515,7 +3528,8 @@ |
3516 | 3529 | }
|
3517 | 3530 | if (usedest && (shader->shader.uniforms[2] != -1))
|
3518 | 3531 | {
|
3519 | | - glUtil_SetTexture(This->util, 9, This->backbuffer);
|
| 3532 | + if(cmd->flags & 0x80000000) glUtil_SetTexture(This->util, 9, cmd->dest);
|
| 3533 | + else glUtil_SetTexture(This->util, 9, This->backbuffer);
|
3520 | 3534 | This->ext->glUniform1i(shader->shader.uniforms[2], 9);
|
3521 | 3535 | }
|
3522 | 3536 | if (usepattern && (shader->shader.uniforms[3] != -1))
|
— | — | @@ -4133,24 +4147,25 @@ |
4134 | 4148 | This->ext->glDrawRangeElements(GL_TRIANGLE_STRIP,0,3,4,GL_UNSIGNED_SHORT,bltindices);
|
4135 | 4149 | if (This->overlays)
|
4136 | 4150 | {
|
| 4151 | + ZeroMemory(&bltcmd, sizeof(BltCommand));
|
4137 | 4152 | for (i = 0; i < overlaycount; i++)
|
4138 | 4153 | {
|
4139 | 4154 | if (This->overlays[i].enabled)
|
4140 | 4155 | {
|
4141 | 4156 | bltcmd.flags = 0x80000000;
|
4142 | | - if (overlays[i].flags & DDOVER_DDFX)
|
| 4157 | + if (This->overlays[i].flags & DDOVER_DDFX)
|
4143 | 4158 | {
|
4144 | | - if (overlays[i].flags & DDOVER_KEYDEST) bltcmd.flags |= DDBLT_KEYDEST;
|
4145 | | - if (overlays[i].flags & DDOVER_KEYDESTOVERRIDE)
|
| 4159 | + if (This->overlays[i].flags & DDOVER_KEYDEST) bltcmd.flags |= DDBLT_KEYDEST;
|
| 4160 | + if (This->overlays[i].flags & DDOVER_KEYDESTOVERRIDE)
|
4146 | 4161 | {
|
4147 | 4162 | bltcmd.flags |= DDBLT_KEYDESTOVERRIDE;
|
4148 | | - bltcmd.destkey = overlays[i].fx.dckDestColorkey;
|
| 4163 | + bltcmd.destkey = This->overlays[i].fx.dckDestColorkey;
|
4149 | 4164 | }
|
4150 | | - if (overlays[i].flags & DDOVER_KEYSRC) bltcmd.flags |= DDBLT_KEYSRC;
|
4151 | | - if (overlays[i].flags & DDOVER_KEYSRCOVERRIDE)
|
| 4165 | + if (This->overlays[i].flags & DDOVER_KEYSRC) bltcmd.flags |= DDBLT_KEYSRC;
|
| 4166 | + if (This->overlays[i].flags & DDOVER_KEYSRCOVERRIDE)
|
4152 | 4167 | {
|
4153 | 4168 | bltcmd.flags |= DDBLT_KEYSRCOVERRIDE;
|
4154 | | - bltcmd.srckey = overlays[i].fx.dckSrcColorkey;
|
| 4169 | + bltcmd.srckey = This->overlays[i].fx.dckSrcColorkey;
|
4155 | 4170 | }
|
4156 | 4171 | }
|
4157 | 4172 | bltcmd.src = This->overlays[i].texture;
|
— | — | @@ -4159,7 +4174,7 @@ |
4160 | 4175 | bltcmd.dest = primary;
|
4161 | 4176 | bltcmd.destlevel = 0;
|
4162 | 4177 | bltcmd.destrect = This->overlays[i].destrect;
|
4163 | | - //FIXME: Finish Blt
|
| 4178 | + glRenderer__Blt(This, &bltcmd);
|
4164 | 4179 | }
|
4165 | 4180 | }
|
4166 | 4181 | }
|