| Index: ddraw/glRenderer.cpp |
| — | — | @@ -688,7 +688,6 @@ |
| 689 | 689 | {
|
| 690 | 690 | glEnable(GL_TEXTURE_2D);
|
| 691 | 691 | }
|
| 692 | | - if(src) glBindTexture(GL_TEXTURE_2D,src->GetTexture());
|
| 693 | 692 | if((dwFlags & DDBLT_KEYSRC) && (src && src->colorkey[0].enabled) && !(dwFlags & DDBLT_COLORFILL))
|
| 694 | 693 | {
|
| 695 | 694 | SetShader(PROG_CKEY,NULL,true);
|
| — | — | @@ -726,6 +725,8 @@ |
| 727 | 726 | GLint texloc = glGetUniformLocation(shaders[PROG_TEXTURE].prog,"Texture");
|
| 728 | 727 | glUniform1i(texloc,0);
|
| 729 | 728 | }
|
| | 729 | + glActiveTexture(GL_TEXTURE0);
|
| | 730 | + if(src) glBindTexture(GL_TEXTURE_2D,src->GetTexture());
|
| 730 | 731 | GLuint prog = GetProgram()&0xffffffff;
|
| 731 | 732 | GLint viewloc = glGetUniformLocation(prog,"view");
|
| 732 | 733 | glUniform4f(viewloc,0,(GLfloat)dest->fakex,0,(GLfloat)dest->fakey);
|
| — | — | @@ -733,14 +734,11 @@ |
| 734 | 735 | GLint xyloc = glGetAttribLocation(prog,"xy");
|
| 735 | 736 | glEnableVertexAttribArray(xyloc);
|
| 736 | 737 | glVertexAttribPointer(xyloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].x);
|
| 737 | | - if(dwFlags & DDBLT_COLORFILL)
|
| | 738 | + GLint rgbloc = glGetAttribLocation(prog,"rgb");
|
| | 739 | + glEnableVertexAttribArray(rgbloc);
|
| | 740 | + glVertexAttribPointer(rgbloc,3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&bltvertices[0].r);
|
| | 741 | + if(!(dwFlags & DDBLT_COLORFILL))
|
| 738 | 742 | {
|
| 739 | | - GLint rgbloc = glGetAttribLocation(prog,"rgb");
|
| 740 | | - glEnableVertexAttribArray(rgbloc);
|
| 741 | | - glVertexAttribPointer(rgbloc,3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&bltvertices[0].r);
|
| 742 | | - }
|
| 743 | | - else
|
| 744 | | - {
|
| 745 | 743 | GLint stloc = glGetAttribLocation(prog,"st");
|
| 746 | 744 | glEnableVertexAttribArray(stloc);
|
| 747 | 745 | glVertexAttribPointer(stloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].s);
|
| — | — | @@ -929,6 +927,9 @@ |
| 930 | 928 | GLint stloc = glGetAttribLocation(prog,"st");
|
| 931 | 929 | glEnableVertexAttribArray(stloc);
|
| 932 | 930 | glVertexAttribPointer(stloc,2,GL_FLOAT,false,sizeof(BltVertex),&bltvertices[0].s);
|
| | 931 | + GLint rgbloc = glGetAttribLocation(prog,"rgb");
|
| | 932 | + glEnableVertexAttribArray(rgbloc);
|
| | 933 | + glVertexAttribPointer(rgbloc,3,GL_UNSIGNED_BYTE,true,sizeof(BltVertex),&bltvertices[0].r);
|
| 933 | 934 | glDrawRangeElements(GL_TRIANGLE_STRIP,0,3,4,GL_UNSIGNED_SHORT,bltindices);
|
| 934 | 935 | glDisable(GL_TEXTURE_2D);
|
| 935 | 936 | glFlush();
|