Index: ddraw/ShaderGen2D.cpp |
— | — | @@ -207,41 +207,41 @@ |
208 | 208 | static const char func_readrgbg_nearest[] =
|
209 | 209 | "vec4 readrgbg(sampler2DRect texture)\n\
|
210 | 210 | {\n\
|
211 | | - float x = floor(gl_TexCoord[0].s);\n\
|
212 | | - float y = floor(gl_TexCoord[0].t);\n\
|
213 | | - float x2 = floor(gl_TexCoord[0].s/2.0)*2.0;\n\
|
| 211 | + float x = floor(gl_TexCoord[0].s)+0.5;\n\
|
| 212 | + float y = floor(gl_TexCoord[0].t)+0.5;\n\
|
| 213 | + float x2 = (floor(gl_TexCoord[0].s/2.0)*2.0)+0.5;\n\
|
214 | 214 | return vec4(texture2DRect(texture,vec2(x2,y)).r,texture2DRect(texture,vec2(x,y)).g,texture2DRect(texture,vec2(x2+1.0,y)).r,1.0);\n\
|
215 | 215 | }\n\n";
|
216 | 216 | static const char func_readgrgb_nearest[] =
|
217 | 217 | "vec4 readgrgb(sampler2DRect texture)\n\
|
218 | 218 | {\n\
|
219 | | - float x = floor(gl_TexCoord[0].s);\n\
|
220 | | - float y = floor(gl_TexCoord[0].t);\n\
|
221 | | - float x2 = floor(gl_TexCoord[0].s/2.0)*2.0;\n\
|
| 219 | + float x = floor(gl_TexCoord[0].s)+0.5;\n\
|
| 220 | + float y = floor(gl_TexCoord[0].t)+0.5;\n\
|
| 221 | + float x2 = (floor(gl_TexCoord[0].s/2.0)*2.0)+0.5;\n\
|
222 | 222 | return vec4(texture2DRect(texture,vec2(x2,y)).g,texture2DRect(texture,vec2(x,y)).r,texture2DRect(texture,vec2(x2+1.0,y)).g,1.0);\n\
|
223 | 223 | }\n\n";
|
224 | 224 | static const char func_readuyvy_nearest[] =
|
225 | 225 | "vec4 readuyvy(sampler2DRect texture)\n\
|
226 | 226 | {\n\
|
227 | | - float x = floor(gl_TexCoord[0].s);\n\
|
228 | | - float y = floor(gl_TexCoord[0].t);\n\
|
229 | | - float x2 = floor(gl_TexCoord[0].s/2.0)*2.0;\n\
|
| 227 | + float x = floor(gl_TexCoord[0].s)+0.5;\n\
|
| 228 | + float y = floor(gl_TexCoord[0].t)+0.5;\n\
|
| 229 | + float x2 = (floor(gl_TexCoord[0].s/2.0)*2.0)+0.5;\n\
|
230 | 230 | return vec4(texture2DRect(texture,vec2(x,y)).g,texture2DRect(texture,vec2(x2,y)).r,texture2DRect(texture,vec2(x2+1.0,y)).r,1.0);\n\
|
231 | 231 | }\n\n";
|
232 | 232 | static const char func_readyuyv_nearest[] =
|
233 | 233 | "vec4 readyuyv(sampler2DRect texture)\n\
|
234 | 234 | {\n\
|
235 | | - float x = floor(gl_TexCoord[0].s);\n\
|
236 | | - float y = floor(gl_TexCoord[0].t);\n\
|
237 | | - float x2 = floor(gl_TexCoord[0].s/2.0)*2.0;\n\
|
| 235 | + float x = floor(gl_TexCoord[0].s)+0.5;\n\
|
| 236 | + float y = floor(gl_TexCoord[0].t)+0.5;\n\
|
| 237 | + float x2 = (floor(gl_TexCoord[0].s/2.0)*2.0)+0.5;\n\
|
238 | 238 | return vec4(texture2DRect(texture,vec2(x,y)).r,texture2DRect(texture,vec2(x2,y)).g,texture2DRect(texture,vec2(x2+1.0,y)).g,1.0);\n\
|
239 | 239 | }\n\n";
|
240 | 240 | static const char func_readyvyu_nearest[] =
|
241 | 241 | "vec4 readyvyu(sampler2DRect texture)\n\
|
242 | 242 | {\n\
|
243 | | - float x = floor(gl_TexCoord[0].s);\n\
|
244 | | - float y = floor(gl_TexCoord[0].t);\n\
|
245 | | - float x2 = floor(gl_TexCoord[0].s/2.0)*2.0;\n\
|
| 243 | + float x = floor(gl_TexCoord[0].s)+0.5;\n\
|
| 244 | + float y = floor(gl_TexCoord[0].t)+0.5;\n\
|
| 245 | + float x2 = (floor(gl_TexCoord[0].s/2.0)*2.0)+0.5;\n\
|
246 | 246 | return vec4(texture2DRect(texture,vec2(x,y)).r,texture2DRect(texture,vec2(x2+1.0,y)).g,texture2DRect(texture,vec2(x2,y)).g,1.0);\n\
|
247 | 247 | }\n\n";
|
248 | 248 |
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -2803,6 +2803,7 @@ |
2804 | 2804 | TRACE_EXIT(23,DD_OK);
|
2805 | 2805 | return DD_OK;
|
2806 | 2806 | }
|
| 2807 | + else *lplpDDSurface = NULL;
|
2807 | 2808 | TRACE_EXIT(23,err);
|
2808 | 2809 | return err;
|
2809 | 2810 | }
|
— | — | @@ -3008,6 +3009,7 @@ |
3009 | 3010 | TRACE_EXIT(23, DD_OK);
|
3010 | 3011 | return DD_OK;
|
3011 | 3012 | }
|
| 3013 | + else *lplpDDSurface = NULL;
|
3012 | 3014 | TRACE_EXIT(23,err);
|
3013 | 3015 | return err;
|
3014 | 3016 | }
|
— | — | @@ -3240,6 +3242,7 @@ |
3241 | 3243 | TRACE_EXIT(23, DD_OK);
|
3242 | 3244 | return DD_OK;
|
3243 | 3245 | }
|
| 3246 | + else *lplpDDSurface = NULL;
|
3244 | 3247 | TRACE_EXIT(23,err);
|
3245 | 3248 | return err;
|
3246 | 3249 | }
|