Index: ddraw/glRenderer.cpp |
— | — | @@ -707,11 +707,11 @@ |
708 | 708 | tmp_cmd.BltVertex_STORAGE.vertex[1].dests =
|
709 | 709 | tmp_cmd.BltVertex_STORAGE.vertex[3].dests = 0.0f;
|
710 | 710 | tmp_cmd.BltVertex_STORAGE.vertex[0].dests =
|
711 | | - tmp_cmd.BltVertex_STORAGE.vertex[2].dests = (GLfloat)(r1.right - r1.left) / (GLfloat)This->backbuffer->levels[0].ddsd.dwWidth;
|
| 711 | + tmp_cmd.BltVertex_STORAGE.vertex[2].dests = (GLfloat)(r1.right - r1.left) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwWidth;
|
712 | 712 | tmp_cmd.BltVertex_STORAGE.vertex[0].destt =
|
713 | 713 | tmp_cmd.BltVertex_STORAGE.vertex[1].destt = 1.0f;
|
714 | 714 | tmp_cmd.BltVertex_STORAGE.vertex[2].destt =
|
715 | | - tmp_cmd.BltVertex_STORAGE.vertex[3].destt = 1.0f - ((GLfloat)(r1.bottom - r1.top) / (GLfloat)This->backbuffer->levels[0].ddsd.dwHeight);
|
| 715 | + tmp_cmd.BltVertex_STORAGE.vertex[3].destt = 1.0f - ((GLfloat)(r1.bottom - r1.top) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwHeight);
|
716 | 716 | }
|
717 | 717 | if (cmd->Blt.cmd.flags & 0x10000000)
|
718 | 718 | {
|
— | — | @@ -786,10 +786,10 @@ |
787 | 787 | r1.bottom = cmd->Blt.cmd.dest->levels[0].ddsd.dwHeight;
|
788 | 788 | }
|
789 | 789 | // Check backbuffer size and resize
|
790 | | - if((This->backbuffer->levels[0].ddsd.dwWidth < r1.right) ||
|
791 | | - (This->backbuffer->levels[0].ddsd.dwHeight < r1.bottom))
|
| 790 | + if((This->backbuffers[0]->levels[0].ddsd.dwWidth < r1.right) ||
|
| 791 | + (This->backbuffers[0]->levels[0].ddsd.dwHeight < r1.bottom))
|
792 | 792 | {
|
793 | | - DDSURFACEDESC2 newdesc = This->backbuffer->levels[0].ddsd;
|
| 793 | + DDSURFACEDESC2 newdesc = This->backbuffers[0]->levels[0].ddsd;
|
794 | 794 | if (newdesc.dwWidth < r1.right) newdesc.dwWidth = r1.right;
|
795 | 795 | if (newdesc.dwHeight < r1.bottom) newdesc.dwHeight = r1.bottom;
|
796 | 796 | tmp_cmd.SetTextureSurfaceDesc.opcode = OP_SETTEXTURESURFACEDESC;
|
— | — | @@ -804,7 +804,7 @@ |
805 | 805 | tmp_cmd.Blt.cmd.destrect = r1;
|
806 | 806 | tmp_cmd.Blt.cmd.srcrect = cmd->Blt.cmd.destrect;
|
807 | 807 | tmp_cmd.Blt.cmd.src = cmd->Blt.cmd.dest;
|
808 | | - tmp_cmd.Blt.cmd.dest = This->backbuffer;
|
| 808 | + tmp_cmd.Blt.cmd.dest = This->backbuffers[0];
|
809 | 809 | tmp_cmd.Blt.cmd.srclevel = cmd->Blt.cmd.destlevel;
|
810 | 810 | tmp_cmd.Blt.cmd.destlevel = 0;
|
811 | 811 | glRenderer_AddCommand(This, &tmp_cmd, TRUE, FALSE);
|
— | — | @@ -828,7 +828,7 @@ |
829 | 829 | i++;
|
830 | 830 | usetexture = TRUE;
|
831 | 831 | tmp_cmd.SetTexture.texstage[i].stage = 9;
|
832 | | - tmp_cmd.SetTexture.texstage[i].texture = This->backbuffer;
|
| 832 | + tmp_cmd.SetTexture.texstage[i].texture = This->backbuffers[0];
|
833 | 833 | }
|
834 | 834 | // Set Pattern texture (Unit 10)
|
835 | 835 | if (usepattern)
|
— | — | @@ -1003,11 +1003,11 @@ |
1004 | 1004 | tmp_cmd.BltVertex_STORAGE.vertex[1].dests =
|
1005 | 1005 | tmp_cmd.BltVertex_STORAGE.vertex[3].dests = 0.0f;
|
1006 | 1006 | tmp_cmd.BltVertex_STORAGE.vertex[0].dests =
|
1007 | | - tmp_cmd.BltVertex_STORAGE.vertex[2].dests = (GLfloat)(r1.right - r1.left) / (GLfloat)This->backbuffer->levels[0].ddsd.dwWidth;
|
| 1007 | + tmp_cmd.BltVertex_STORAGE.vertex[2].dests = (GLfloat)(r1.right - r1.left) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwWidth;
|
1008 | 1008 | tmp_cmd.BltVertex_STORAGE.vertex[0].destt =
|
1009 | 1009 | tmp_cmd.BltVertex_STORAGE.vertex[1].destt = 1.0f;
|
1010 | 1010 | tmp_cmd.BltVertex_STORAGE.vertex[2].destt =
|
1011 | | - tmp_cmd.BltVertex_STORAGE.vertex[3].destt = 1.0f - ((GLfloat)(r1.bottom - r1.top) / (GLfloat)This->backbuffer->levels[0].ddsd.dwHeight);
|
| 1011 | + tmp_cmd.BltVertex_STORAGE.vertex[3].destt = 1.0f - ((GLfloat)(r1.bottom - r1.top) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwHeight);
|
1012 | 1012 | }
|
1013 | 1013 | if (cmd->Blt.cmd.flags & 0x10000000)
|
1014 | 1014 | {
|
— | — | @@ -1138,10 +1138,10 @@ |
1139 | 1139 | (cmd->DrawScreen.texture->bigheight != (view[3]-view[2]))))
|
1140 | 1140 | {
|
1141 | 1141 | // Check backbuffer size and resize
|
1142 | | - if ((This->backbuffer->levels[0].ddsd.dwWidth < cmd->DrawScreen.texture->bigwidth) ||
|
1143 | | - (This->backbuffer->levels[0].ddsd.dwHeight < cmd->DrawScreen.texture->bigheight))
|
| 1142 | + if ((This->backbuffers[0]->levels[0].ddsd.dwWidth < cmd->DrawScreen.texture->bigwidth) ||
|
| 1143 | + (This->backbuffers[0]->levels[0].ddsd.dwHeight < cmd->DrawScreen.texture->bigheight))
|
1144 | 1144 | {
|
1145 | | - DDSURFACEDESC2 newdesc = This->backbuffer->levels[0].ddsd;
|
| 1145 | + DDSURFACEDESC2 newdesc = This->backbuffers[0]->levels[0].ddsd;
|
1146 | 1146 | if (newdesc.dwWidth < cmd->DrawScreen.texture->bigwidth)
|
1147 | 1147 | newdesc.dwWidth = cmd->DrawScreen.texture->bigwidth;
|
1148 | 1148 | if (newdesc.dwHeight < cmd->DrawScreen.texture->bigheight)
|
— | — | @@ -1181,11 +1181,11 @@ |
1182 | 1182 | sizeof(BltVertex), &vertex->s, TRUE, sizeof(MIN_STORAGE_CMD));
|
1183 | 1183 | glRenderer_AddCommand(This, &tmp_cmd, TRUE, FALSE);
|
1184 | 1184 | // Set render target to backbuffer
|
1185 | | - if ((This->state.target.target != This->backbuffer) || (This->state.target.target != 0))
|
| 1185 | + if ((This->state.target.target != This->backbuffers[0]) || (This->state.target.target != 0))
|
1186 | 1186 | {
|
1187 | 1187 | tmp_cmd.SetRenderTarget.opcode = OP_SETRENDERTARGET;
|
1188 | 1188 | tmp_cmd.SetRenderTarget.size = sizeof(SetRenderTargetCmd) - 8;
|
1189 | | - tmp_cmd.SetRenderTarget.target.target = This->backbuffer;
|
| 1189 | + tmp_cmd.SetRenderTarget.target.target = This->backbuffers[0];
|
1190 | 1190 | tmp_cmd.SetRenderTarget.target.level = 0;
|
1191 | 1191 | tmp_cmd.SetRenderTarget.target.zbuffer = NULL;
|
1192 | 1192 | tmp_cmd.SetRenderTarget.target.zlevel = 0;
|
— | — | @@ -1193,8 +1193,8 @@ |
1194 | 1194 | glRenderer_AddCommand(This, &tmp_cmd, TRUE, FALSE);
|
1195 | 1195 | }
|
1196 | 1196 | // Set viewport to backbuffer
|
1197 | | - r2.right = This->backbuffer->levels[0].ddsd.dwWidth;
|
1198 | | - r2.bottom = This->backbuffer->levels[0].ddsd.dwHeight;
|
| 1197 | + r2.right = This->backbuffers[0]->levels[0].ddsd.dwWidth;
|
| 1198 | + r2.bottom = This->backbuffers[0]->levels[0].ddsd.dwHeight;
|
1199 | 1199 | if (This->state.viewport.x || This->state.viewport.y ||
|
1200 | 1200 | (This->state.viewport.width != r2.right) || (This->state.viewport.hieght != r2.bottom))
|
1201 | 1201 | {
|
— | — | @@ -1241,7 +1241,7 @@ |
1242 | 1242 | tmp_cmd.SetTexture.opcode = OP_SETTEXTURE;
|
1243 | 1243 | tmp_cmd.SetTexture.size = sizeof(SetTextureCmd) + sizeof(DWORD) + sizeof(glTexture*);
|
1244 | 1244 | tmp_cmd.SetTexture.texstage[0].stage = 8;
|
1245 | | - tmp_cmd.SetTexture.texstage[0].texture = This->backbuffer;
|
| 1245 | + tmp_cmd.SetTexture.texstage[0].texture = This->backbuffers[0];
|
1246 | 1246 | tmp_cmd.SetTexture.count = 1;
|
1247 | 1247 | glRenderer_AddCommand(This, &tmp_cmd, TRUE, FALSE);
|
1248 | 1248 | }
|
— | — | @@ -1358,9 +1358,9 @@ |
1359 | 1359 | (cmd->DrawScreen.texture->bigheight != (view[3] - view[2]))))
|
1360 | 1360 | {
|
1361 | 1361 | This->bltvertices[0].s = This->bltvertices[2].s =
|
1362 | | - (GLfloat)cmd->DrawScreen.texture->bigwidth / (GLfloat)This->backbuffer->bigwidth;
|
| 1362 | + (GLfloat)cmd->DrawScreen.texture->bigwidth / (GLfloat)This->backbuffers[0]->bigwidth;
|
1363 | 1363 | This->bltvertices[0].t = This->bltvertices[1].t =
|
1364 | | - (GLfloat)cmd->DrawScreen.texture->bigheight / (GLfloat)This->backbuffer->bigheight;
|
| 1364 | + (GLfloat)cmd->DrawScreen.texture->bigheight / (GLfloat)This->backbuffers[0]->bigheight;
|
1365 | 1365 | This->bltvertices[1].s = This->bltvertices[2].t = This->bltvertices[3].s = This->bltvertices[3].t = 0.0f;
|
1366 | 1366 | }
|
1367 | 1367 | else
|
— | — | @@ -1675,7 +1675,7 @@ |
1676 | 1676 | This->fogstart = 0.0f;
|
1677 | 1677 | This->fogend = 1.0f;
|
1678 | 1678 | This->fogdensity = 1.0f;
|
1679 | | - This->backbuffer = NULL;
|
| 1679 | + ZeroMemory(&This->backbuffers, 16 * sizeof(glTexture*));
|
1680 | 1680 | This->hDC = NULL;
|
1681 | 1681 | This->hRC = NULL;
|
1682 | 1682 | This->pbo = NULL;
|
— | — | @@ -2817,6 +2817,7 @@ |
2818 | 2818 | */
|
2819 | 2819 | DWORD glRenderer__Entry(glRenderer *This)
|
2820 | 2820 | {
|
| 2821 | + int i;
|
2821 | 2822 | EnterCriticalSection(&This->cs);
|
2822 | 2823 | glRenderer__InitGL(This,(int)This->inputs[0],(int)This->inputs[1],(int)This->inputs[2],
|
2823 | 2824 | (int)This->inputs[3],(unsigned int)This->inputs[4],(HWND)This->inputs[5],
|
— | — | @@ -2843,10 +2844,13 @@ |
2844 | 2845 | BufferObject_Release(This->pbo);
|
2845 | 2846 | This->pbo = NULL;
|
2846 | 2847 | }
|
2847 | | - if(This->backbuffer)
|
| 2848 | + for (i = 0; i < 16; i++)
|
2848 | 2849 | {
|
2849 | | - glTexture_Release(This->backbuffer, TRUE);
|
2850 | | - This->backbuffer = NULL;
|
| 2850 | + if (This->backbuffers[i])
|
| 2851 | + {
|
| 2852 | + glTexture_Release(This->backbuffers[i], TRUE);
|
| 2853 | + This->backbuffers[i] = NULL;
|
| 2854 | + }
|
2851 | 2855 | }
|
2852 | 2856 | //glRenderer__DeleteCommandBuffer(&This->cmd1);
|
2853 | 2857 | //glRenderer__DeleteCommandBuffer(&This->cmd2);
|
— | — | @@ -3396,11 +3400,11 @@ |
3397 | 3401 | {
|
3398 | 3402 | ShaderManager_SetShader(This->shaders, PROG_TEXTURE, NULL, 0);
|
3399 | 3403 | if(!(cmd->flags & 0x80000000))
|
3400 | | - glRenderer__DrawBackbufferRect(This, cmd->dest, destrect, destrect2, PROG_TEXTURE);
|
| 3404 | + glRenderer__DrawBackbufferRect(This, cmd->dest, destrect, destrect2, PROG_TEXTURE, 0);
|
3401 | 3405 | This->bltvertices[1].dests = This->bltvertices[3].dests = 0.0f;
|
3402 | | - This->bltvertices[0].dests = This->bltvertices[2].dests = (GLfloat)(destrect.right - destrect.left) / (GLfloat)This->backbuffer->levels[0].ddsd.dwWidth;
|
| 3406 | + This->bltvertices[0].dests = This->bltvertices[2].dests = (GLfloat)(destrect.right - destrect.left) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwWidth;
|
3403 | 3407 | This->bltvertices[0].destt = This->bltvertices[1].destt = 1.0f;
|
3404 | | - This->bltvertices[2].destt = This->bltvertices[3].destt = 1.0f - ((GLfloat)(destrect.bottom - destrect.top) / (GLfloat)This->backbuffer->levels[0].ddsd.dwHeight);
|
| 3408 | + This->bltvertices[2].destt = This->bltvertices[3].destt = 1.0f - ((GLfloat)(destrect.bottom - destrect.top) / (GLfloat)This->backbuffers[0]->levels[0].ddsd.dwHeight);
|
3405 | 3409 | }
|
3406 | 3410 | ShaderManager_SetShader(This->shaders, shaderid, NULL, 1);
|
3407 | 3411 | GenShader2D *shader = (GenShader2D*)This->shaders->gen3d->current_genshader;
|
— | — | @@ -3529,7 +3533,7 @@ |
3530 | 3534 | if (usedest && (shader->shader.uniforms[2] != -1))
|
3531 | 3535 | {
|
3532 | 3536 | if(cmd->flags & 0x80000000) glUtil_SetTexture(This->util, 9, cmd->dest);
|
3533 | | - else glUtil_SetTexture(This->util, 9, This->backbuffer);
|
| 3537 | + else glUtil_SetTexture(This->util, 9, This->backbuffers[0]);
|
3534 | 3538 | This->ext->glUniform1i(shader->shader.uniforms[2], 9);
|
3535 | 3539 | }
|
3536 | 3540 | if (usepattern && (shader->shader.uniforms[3] != -1))
|
— | — | @@ -3611,7 +3615,7 @@ |
3612 | 3616 | glTexture__FinishCreate(texture);
|
3613 | 3617 | }
|
3614 | 3618 |
|
3615 | | -void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass)
|
| 3619 | +void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass, int index)
|
3616 | 3620 | {
|
3617 | 3621 | GLfloat view[4];
|
3618 | 3622 | DDSURFACEDESC2 ddsd;
|
— | — | @@ -3619,7 +3623,7 @@ |
3620 | 3624 | x2 = (DWORD)((float)x * This->postsizex);
|
3621 | 3625 | y2 = (DWORD)((float)y * This->postsizey);
|
3622 | 3626 | glUtil_SetActiveTexture(This->util,8);
|
3623 | | - if(!This->backbuffer)
|
| 3627 | + if(!This->backbuffers[index])
|
3624 | 3628 | {
|
3625 | 3629 | ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
|
3626 | 3630 | memcpy(&ddsd, &ddsdbackbuffer, sizeof(DDSURFACEDESC2));
|
— | — | @@ -3626,9 +3630,9 @@ |
3627 | 3631 | ddsd.dwWidth = x2;
|
3628 | 3632 | ddsd.lPitch = x2 * 4;
|
3629 | 3633 | ddsd.dwHeight = y2;
|
3630 | | - glTexture_Create(&ddsd, &This->backbuffer, This, x2, y2, FALSE, TRUE, 0);
|
| 3634 | + glTexture_Create(&ddsd, &This->backbuffers[index], This, x2, y2, FALSE, TRUE, 0);
|
3631 | 3635 | }
|
3632 | | - if((This->backbuffer->levels[0].ddsd.dwWidth != x2) || (This->backbuffer->levels[0].ddsd.dwHeight != y2))
|
| 3636 | + if((This->backbuffers[index]->levels[0].ddsd.dwWidth != x2) || (This->backbuffers[index]->levels[0].ddsd.dwHeight != y2))
|
3633 | 3637 | {
|
3634 | 3638 | ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
|
3635 | 3639 | ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
— | — | @@ -3635,9 +3639,9 @@ |
3636 | 3640 | ddsd.dwWidth = x2;
|
3637 | 3641 | ddsd.dwHeight = y2;
|
3638 | 3642 | ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT;
|
3639 | | - glTexture__SetSurfaceDesc(This->backbuffer, &ddsd);
|
| 3643 | + glTexture__SetSurfaceDesc(This->backbuffers[index], &ddsd);
|
3640 | 3644 | }
|
3641 | | - glUtil_SetFBOTextures(This->util,&This->fbo,This->backbuffer,NULL,0,0,FALSE);
|
| 3645 | + glUtil_SetFBOTextures(This->util,&This->fbo,This->backbuffers[index],NULL,0,0,FALSE);
|
3642 | 3646 | view[0] = view[2] = 0;
|
3643 | 3647 | view[1] = (GLfloat)x2;
|
3644 | 3648 | view[3] = (GLfloat)y2;
|
— | — | @@ -3644,7 +3648,7 @@ |
3645 | 3649 | glUtil_SetViewport(This->util,0,0,x2,y2);
|
3646 | 3650 | glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
3647 | 3651 | glUtil_SetTexture(This->util,8,*texture);
|
3648 | | - *texture = This->backbuffer;
|
| 3652 | + *texture = This->backbuffers[index];
|
3649 | 3653 | if (!paletted && firstpass && (dxglcfg.postfilter == 1))
|
3650 | 3654 | glTexture__SetFilter(*texture, 8, GL_LINEAR, GL_LINEAR, This);
|
3651 | 3655 | else glTexture__SetFilter(*texture, 8, GL_NEAREST, GL_NEAREST, This);
|
— | — | @@ -3665,7 +3669,7 @@ |
3666 | 3670 | glUtil_SetFBO(This->util, NULL);
|
3667 | 3671 | }
|
3668 | 3672 |
|
3669 | | -void glRenderer__DrawBackbufferRect(glRenderer *This, glTexture *texture, RECT srcrect, RECT destrect, int progtype)
|
| 3673 | +void glRenderer__DrawBackbufferRect(glRenderer *This, glTexture *texture, RECT srcrect, RECT destrect, int progtype, int index)
|
3670 | 3674 | {
|
3671 | 3675 | GLfloat view[4];
|
3672 | 3676 | DDSURFACEDESC2 ddsd;
|
— | — | @@ -3673,8 +3677,9 @@ |
3674 | 3678 | int x2 = destrect.right;
|
3675 | 3679 | int y1 = destrect.top;
|
3676 | 3680 | int y2 = destrect.bottom;
|
| 3681 | + if (index > 15) return;
|
3677 | 3682 | glUtil_SetActiveTexture(This->util, 0);
|
3678 | | - if (!This->backbuffer)
|
| 3683 | + if (!This->backbuffers[index])
|
3679 | 3684 | {
|
3680 | 3685 | ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
|
3681 | 3686 | memcpy(&ddsd, &ddsdbackbuffer, sizeof(DDSURFACEDESC2));
|
— | — | @@ -3681,27 +3686,27 @@ |
3682 | 3687 | ddsd.dwWidth = x2;
|
3683 | 3688 | ddsd.lPitch = x2 * 4;
|
3684 | 3689 | ddsd.dwHeight = y2;
|
3685 | | - glTexture_Create(&ddsd, &This->backbuffer, This, x2, y2, FALSE, TRUE, 0);
|
| 3690 | + glTexture_Create(&ddsd, &This->backbuffers[index], This, x2, y2, FALSE, TRUE, 0);
|
3686 | 3691 | }
|
3687 | | - if ((This->backbuffer->levels[0].ddsd.dwWidth < x2) || (This->backbuffer->levels[0].ddsd.dwHeight < y2))
|
| 3692 | + if ((This->backbuffers[index]->levels[0].ddsd.dwWidth < x2) || (This->backbuffers[index]->levels[0].ddsd.dwHeight < y2))
|
3688 | 3693 | {
|
3689 | | - if (This->backbuffer->levels[0].ddsd.dwWidth > x2) x2 = This->backbuffer->levels[0].ddsd.dwWidth;
|
3690 | | - if (This->backbuffer->levels[0].ddsd.dwHeight > y2) y2 = This->backbuffer->levels[0].ddsd.dwHeight;
|
| 3694 | + if (This->backbuffers[index]->levels[0].ddsd.dwWidth > x2) x2 = This->backbuffers[index]->levels[0].ddsd.dwWidth;
|
| 3695 | + if (This->backbuffers[index]->levels[0].ddsd.dwHeight > y2) y2 = This->backbuffers[index]->levels[0].ddsd.dwHeight;
|
3691 | 3696 | ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
|
3692 | 3697 | ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
3693 | 3698 | ddsd.dwWidth = x2;
|
3694 | 3699 | ddsd.dwHeight = y2;
|
3695 | 3700 | ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT;
|
3696 | | - glTexture__SetSurfaceDesc(This->backbuffer, &ddsd);
|
| 3701 | + glTexture__SetSurfaceDesc(This->backbuffers[index], &ddsd);
|
3697 | 3702 | x2 = destrect.right;
|
3698 | 3703 | y2 = destrect.bottom;
|
3699 | 3704 | }
|
3700 | | - glUtil_SetFBOTextures(This->util, &This->fbo, This->backbuffer, NULL, 0, 0, FALSE);
|
| 3705 | + glUtil_SetFBOTextures(This->util, &This->fbo, This->backbuffers[index], NULL, 0, 0, FALSE);
|
3701 | 3706 | view[0] = view[2] = 0;
|
3702 | | - view[1] = (GLfloat)This->backbuffer->levels[0].ddsd.dwWidth;
|
3703 | | - view[3] = (GLfloat)This->backbuffer->levels[0].ddsd.dwHeight;
|
3704 | | - glUtil_SetViewport(This->util, 0, 0, This->backbuffer->levels[0].ddsd.dwWidth, This->backbuffer->levels[0].ddsd.dwHeight);
|
3705 | | - glUtil_SetScissor(This->util, TRUE, 0, 0, This->backbuffer->levels[0].ddsd.dwWidth, This->backbuffer->levels[0].ddsd.dwHeight);
|
| 3707 | + view[1] = (GLfloat)This->backbuffers[index]->levels[0].ddsd.dwWidth;
|
| 3708 | + view[3] = (GLfloat)This->backbuffers[index]->levels[0].ddsd.dwHeight;
|
| 3709 | + glUtil_SetViewport(This->util, 0, 0, This->backbuffers[index]->levels[0].ddsd.dwWidth, This->backbuffers[index]->levels[0].ddsd.dwHeight);
|
| 3710 | + glUtil_SetScissor(This->util, TRUE, 0, 0, This->backbuffers[index]->levels[0].ddsd.dwWidth, This->backbuffers[index]->levels[0].ddsd.dwHeight);
|
3706 | 3711 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
3707 | 3712 | glUtil_SetScissor(This->util, FALSE, 0, 0, 0, 0);
|
3708 | 3713 | glUtil_SetTexture(This->util, 8, texture);
|
— | — | @@ -4080,7 +4085,7 @@ |
4081 | 4086 | glUtil_SetTexture(This->util,9,paltex);
|
4082 | 4087 | if(dxglcfg.scalingfilter || (This->postsizex != 1.0f) || (This->postsizey != 1.0f))
|
4083 | 4088 | {
|
4084 | | - glRenderer__DrawBackbuffer(This,&texture,texture->bigwidth,texture->bigheight,progtype,TRUE,TRUE);
|
| 4089 | + glRenderer__DrawBackbuffer(This,&texture,texture->bigwidth,texture->bigheight,progtype,TRUE,TRUE,0);
|
4085 | 4090 | ShaderManager_SetShader(This->shaders,PROG_TEXTURE,NULL,0);
|
4086 | 4091 | progtype = PROG_TEXTURE;
|
4087 | 4092 | glUtil_SetTexture(This->util,8,texture);
|
— | — | @@ -4093,7 +4098,7 @@ |
4094 | 4099 | {
|
4095 | 4100 | progtype = PROG_TEXTURE;
|
4096 | 4101 | ShaderManager_SetShader(This->shaders, PROG_TEXTURE, NULL, 0);
|
4097 | | - glRenderer__DrawBackbuffer(This, &texture, texture->bigwidth, texture->bigheight, progtype, FALSE, TRUE);
|
| 4102 | + glRenderer__DrawBackbuffer(This, &texture, texture->bigwidth, texture->bigheight, progtype, FALSE, TRUE, 0);
|
4098 | 4103 | glUtil_SetTexture(This->util, 8, texture);
|
4099 | 4104 | This->ext->glUniform1i(This->shaders->shaders[progtype].tex0, 0);
|
4100 | 4105 | }
|
Index: ddraw/glRenderer.h |
— | — | @@ -136,7 +136,7 @@ |
137 | 137 | HANDLE start;
|
138 | 138 | unsigned int frequency;
|
139 | 139 | DXGLTimer timer;
|
140 | | - glTexture *backbuffer;
|
| 140 | + glTexture *backbuffers[16];
|
141 | 141 | DWORD fogcolor;
|
142 | 142 | GLfloat fogstart;
|
143 | 143 | GLfloat fogend;
|
— | — | @@ -210,8 +210,8 @@ |
211 | 211 | void glRenderer__MakeTexture(glRenderer *This, glTexture *texture);
|
212 | 212 | void glRenderer__DrawScreen(glRenderer *This, glTexture *texture, glTexture *paltex, GLint vsync, glTexture *previous, BOOL setsync, BOOL settime, OVERLAY *overlays, int overlaycount);
|
213 | 213 | void glRenderer__DeleteTexture(glRenderer *This, glTexture *texture);
|
214 | | -void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass);
|
215 | | -void glRenderer__DrawBackbufferRect(glRenderer *This, glTexture *texture, RECT srcrect, RECT destrect, int progtype);
|
| 214 | +void glRenderer__DrawBackbuffer(glRenderer *This, glTexture **texture, int x, int y, int progtype, BOOL paletted, BOOL firstpass, int index);
|
| 215 | +void glRenderer__DrawBackbufferRect(glRenderer *This, glTexture *texture, RECT srcrect, RECT destrect, int progtype, int index);
|
216 | 216 | void glRenderer__InitD3D(glRenderer *This, int zbuffer, int x, int y);
|
217 | 217 | void glRenderer__Clear(glRenderer *This, ClearCommand *cmd);
|
218 | 218 | void glRenderer__UpdateFVF(glRenderer *This, DWORD fvf);
|
Index: dxglcfg/tests.cpp |
— | — | @@ -244,7 +244,7 @@ |
245 | 245 | if (d3d7)
|
246 | 246 | {
|
247 | 247 | d3d7->Release();
|
248 | | - d3d7dev = NULL;
|
| 248 | + d3d7 = NULL;
|
249 | 249 | }
|
250 | 250 | if(ddsrender)
|
251 | 251 | {
|