Commit 952dfe30 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Translate before scaling for rhw as well in transform_projection().

parent 8e0cb60b
...@@ -3905,10 +3905,6 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock ...@@ -3905,10 +3905,6 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock
glOrtho(x, x + w, y + h, y, 0.0, -1.0); glOrtho(x, x + w, y + h, y, 0.0, -1.0);
checkGLcall("glOrtho"); checkGLcall("glOrtho");
/* Window Coord 0 is the middle of the first pixel, so translate by 1/2 pixels */
glTranslatef(63.0f / 128.0f, 63.0f / 128.0f, 0.0f);
checkGLcall("glTranslatef(63.0f / 128.0f, 63.0f / 128.0f, 0.0f)");
/* D3D texture coordinates are flipped compared to OpenGL ones, so /* D3D texture coordinates are flipped compared to OpenGL ones, so
* render everything upside down when rendering offscreen. */ * render everything upside down when rendering offscreen. */
if (context->render_offscreen) if (context->render_offscreen)
...@@ -3916,7 +3912,13 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock ...@@ -3916,7 +3912,13 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock
glScalef(1.0f, -1.0f, 1.0f); glScalef(1.0f, -1.0f, 1.0f);
checkGLcall("glScalef"); checkGLcall("glScalef");
} }
} else {
/* Window Coord 0 is the middle of the first pixel, so translate by 1/2 pixels */
glTranslatef(63.0f / 128.0f, 63.0f / 128.0f, 0.0f);
checkGLcall("glTranslatef(63.0f / 128.0f, -63.0f / 128.0f, 0.0f)");
}
else
{
/* The rule is that the window coordinate 0 does not correspond to the /* The rule is that the window coordinate 0 does not correspond to the
beginning of the first pixel, but the center of the first pixel. beginning of the first pixel, but the center of the first pixel.
As a consequence if you want to correctly draw one line exactly from As a consequence if you want to correctly draw one line exactly from
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment