Index: ddraw/glRenderer.cpp |
— | — | @@ -982,7 +982,8 @@ |
983 | 983 | wndbusy = false;
|
984 | 984 | GLfloat color[4];
|
985 | 985 | dwordto4float(dwColor,color);
|
986 | | - SetFBO(target->texture,target->GetZBuffer()->texture,target->GetZBuffer()->hasstencil);
|
| 986 | + if(target->zbuffer) SetFBO(target->texture,target->GetZBuffer()->texture,target->GetZBuffer()->hasstencil);
|
| 987 | + else SetFBO(target->texture,0,false);
|
987 | 988 | int clearbits = 0;
|
988 | 989 | if(D3DCLEAR_TARGET)
|
989 | 990 | {
|
— | — | @@ -1037,8 +1038,11 @@ |
1038 | 1039 | if(transformed)
|
1039 | 1040 | {
|
1040 | 1041 | GLint xyzwloc = glGetAttribLocation(prog,"rhw");
|
1041 | | - glEnableVertexAttribArray(xyzwloc);
|
1042 | | - glVertexAttribPointer(xyzwloc,4,GL_FLOAT,false,vertices[1].stride,vertices[1].data);
|
| 1042 | + if(xyzwloc != -1)
|
| 1043 | + {
|
| 1044 | + glEnableVertexAttribArray(xyzwloc);
|
| 1045 | + glVertexAttribPointer(xyzwloc,4,GL_FLOAT,false,vertices[1].stride,vertices[1].data);
|
| 1046 | + }
|
1043 | 1047 | }
|
1044 | 1048 | for(i = 0; i < 5; i++)
|
1045 | 1049 | {
|
— | — | @@ -1150,7 +1154,8 @@ |
1151 | 1155 | }
|
1152 | 1156 | }
|
1153 | 1157 | }
|
1154 | | - SetFBO(device->glDDS7->texture,device->glDDS7->zbuffer->texture,device->glDDS7->zbuffer->hasstencil);
|
| 1158 | + if(device->glDDS7->zbuffer) SetFBO(device->glDDS7->texture,device->glDDS7->zbuffer->texture,device->glDDS7->zbuffer->hasstencil);
|
| 1159 | + else SetFBO(device->glDDS7->texture,0,false);
|
1155 | 1160 | glViewport(device->viewport.dwX,device->viewport.dwY,device->viewport.dwWidth,device->viewport.dwHeight);
|
1156 | 1161 | if(indices) glDrawRangeElements(mode,0,indexcount,count,GL_UNSIGNED_SHORT,indices);
|
1157 | 1162 | else glDrawArrays(mode,0,count);
|
Index: ddraw/shadergen.cpp |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | _GENSHADER shader;
|
39 | 39 | __int64 id;
|
40 | 40 | __int64 texids[8];
|
| 41 | + int texcoords[8];
|
41 | 42 | };
|
42 | 43 | GenShader genshaders[256];
|
43 | 44 | static __int64 current_shader = 0;
|
— | — | @@ -145,8 +146,11 @@ |
146 | 147 | {
|
147 | 148 | if(!memcmp(genshaders[i].texids,texstate,8*sizeof(__int64)))
|
148 | 149 | {
|
149 | | - shaderindex = i;
|
150 | | - break;
|
| 150 | + if(!memcmp(genshaders[i].texcoords,texcoords,8*sizeof(int)))
|
| 151 | + {
|
| 152 | + shaderindex = i;
|
| 153 | + break;
|
| 154 | + }
|
151 | 155 | }
|
152 | 156 | }
|
153 | 157 | }
|
— | — | @@ -171,6 +175,7 @@ |
172 | 176 | }
|
173 | 177 | genshaders[shaderindex].id = id;
|
174 | 178 | memcpy(genshaders[shaderindex].texids,texstate,8*sizeof(__int64));
|
| 179 | + memcpy(genshaders[shaderindex].texcoords,texcoords,8*sizeof(int));
|
175 | 180 | glUseProgram(genshaders[shaderindex].shader.prog);
|
176 | 181 | current_prog = genshaders[shaderindex].shader.prog;
|
177 | 182 | }
|