Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -871,7 +871,7 @@ |
872 | 872 | for(i = 0; i < ddsd.dwBackBufferCount; i++)
|
873 | 873 | {
|
874 | 874 | tmp = tmp->GetBackbuffer();
|
875 | | - textures[i+1] = tmp->GetTexture();
|
| 875 | + textures[i+1] = tmp->texture;
|
876 | 876 | }
|
877 | 877 | glTexture *tmptex = textures[0];
|
878 | 878 | memmove(textures,&textures[1],ddsd.dwBackBufferCount*sizeof(GLuint));
|
Index: ddraw/glDirectDrawSurface.h |
— | — | @@ -111,9 +111,6 @@ |
112 | 112 | ULONG WINAPI AddRefColor();
|
113 | 113 | ULONG WINAPI ReleaseColor();
|
114 | 114 | //void SetFilter(int level, GLint mag, GLint min, glExtensions *ext, glUtil *util);
|
115 | | - glTexture *GetTexture(){
|
116 | | - return texture;
|
117 | | - }
|
118 | 115 | void Restore2();
|
119 | 116 | HRESULT Flip2(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags);
|
120 | 117 | HRESULT AddAttachedSurface2(LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface, IUnknown *iface);
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -1407,6 +1407,7 @@ |
1408 | 1408 | srcrect.bottom = ddsdSrc.dwHeight;
|
1409 | 1409 | }
|
1410 | 1410 | else srcrect = *lpSrcRect;
|
| 1411 | + if (dest->texture->levels[dest->miplevel].dirty & 1) glTexture__Upload(dest->texture, dest->miplevel);
|
1411 | 1412 | This->bltvertices[1].x = This->bltvertices[3].x = (GLfloat)destrect.left * ((GLfloat)dest->fakex/(GLfloat)ddsd.dwWidth);
|
1412 | 1413 | This->bltvertices[0].x = This->bltvertices[2].x = (GLfloat)destrect.right * ((GLfloat)dest->fakex/(GLfloat)ddsd.dwWidth);
|
1413 | 1414 | This->bltvertices[0].y = This->bltvertices[1].y = (GLfloat)dest->fakey-((GLfloat)destrect.top * ((GLfloat)dest->fakey/(GLfloat)ddsd.dwHeight));
|
— | — | @@ -1478,7 +1479,7 @@ |
1479 | 1480 | }
|
1480 | 1481 | if(src)
|
1481 | 1482 | {
|
1482 | | - glUtil_SetTexture(This->util,0,src->GetTexture());
|
| 1483 | + glUtil_SetTexture(This->util,0,src->texture);
|
1483 | 1484 | if(This->ext->GLEXT_ARB_sampler_objects)
|
1484 | 1485 | {
|
1485 | 1486 | if((dxglcfg.scalingfilter == 0) || (This->ddInterface->GetBPP() == 8))
|
— | — | @@ -1492,11 +1493,10 @@ |
1493 | 1494 | src->texture->colorsizes[2], src->texture->colorsizes[3]);
|
1494 | 1495 | if(dest) This->ext->glUniform4i(shader->shader.uniforms[11], dest->texture->colorsizes[0], dest->texture->colorsizes[1],
|
1495 | 1496 | dest->texture->colorsizes[2], dest->texture->colorsizes[3]);
|
1496 | | - if (dest->texture->levels[dest->miplevel].dirty & 1) glTexture__Upload(dest->texture, dest->miplevel);
|
1497 | 1497 | dest->texture->levels[dest->miplevel].dirty |= 2;
|
1498 | 1498 | glUtil_EnableArray(This->util, shader->shader.attribs[0], TRUE);
|
1499 | 1499 | This->ext->glVertexAttribPointer(shader->shader.attribs[0],2,GL_FLOAT,GL_FALSE,sizeof(BltVertex),&This->bltvertices[0].x);
|
1500 | | - if(!(dwFlags & DDBLT_COLORFILL))
|
| 1500 | + if((!(dwFlags & DDBLT_COLORFILL)) && (shader->shader.attribs[3] != -1))
|
1501 | 1501 | {
|
1502 | 1502 | glUtil_EnableArray(This->util, shader->shader.attribs[3], TRUE);
|
1503 | 1503 | This->ext->glVertexAttribPointer(shader->shader.attribs[3],2,GL_FLOAT,GL_FALSE,sizeof(BltVertex),&This->bltvertices[0].s);
|
Index: ddraw/glUtil.cpp |
— | — | @@ -637,6 +637,7 @@ |
638 | 638 | {
|
639 | 639 | glUtil_SetActiveTexture(This, level);
|
640 | 640 | glBindTexture(GL_TEXTURE_2D, texname);
|
| 641 | + This->textures[level] = texname;
|
641 | 642 | }
|
642 | 643 | }
|
643 | 644 |
|