Module: wine
Branch: master
Commit: 2c0edb94e3da37a736b73f1a647bd3c9863f2608
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2c0edb94e3da37a736b73f1a6…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Wed Dec 30 19:33:43 2009 +0100
wined3d: Fix WINED3DRS_DEPTHBIAS handling.
---
dlls/wined3d/state.c | 30 ++++++++++++++++++++++--------
1 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 1c29dbf..8078118 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1666,19 +1666,33 @@ static void state_scissor(DWORD state, IWineD3DStateBlockImpl *stateblock, struc
}
}
+/* The Direct3D depth bias is specified in normalized depth coordinates. In
+ * OpenGL the bias is specified in units of "the smallest value that is
+ * guaranteed to produce a resolvable offset for a given implementation". To
+ * convert from D3D to GL we need to divide the D3D depth bias by that value.
+ * There's no practical way to retrieve that value from a given GL
+ * implementation, but the D3D application has essentially the same problem,
+ * which makes a guess of 1e-6f seem reasonable here. Note that
+ * SLOPESCALEDEPTHBIAS is a scaling factor for the depth slope, and doesn't
+ * need to be scaled. */
static void state_depthbias(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
- union {
- DWORD d;
- float f;
- } tmpvalue;
+ if (stateblock->renderState[WINED3DRS_SLOPESCALEDEPTHBIAS]
+ || stateblock->renderState[WINED3DRS_DEPTHBIAS])
+ {
+ union
+ {
+ DWORD d;
+ float f;
+ } scale_bias, const_bias;
+
+ scale_bias.d = stateblock->renderState[WINED3DRS_SLOPESCALEDEPTHBIAS];
+ const_bias.d = stateblock->renderState[WINED3DRS_DEPTHBIAS];
- if(stateblock->renderState[WINED3DRS_SLOPESCALEDEPTHBIAS] ||
- stateblock->renderState[WINED3DRS_DEPTHBIAS]) {
- tmpvalue.d = stateblock->renderState[WINED3DRS_SLOPESCALEDEPTHBIAS];
glEnable(GL_POLYGON_OFFSET_FILL);
checkGLcall("glEnable(GL_POLYGON_OFFSET_FILL)");
- glPolygonOffset(tmpvalue.f, *((float*)&stateblock->renderState[WINED3DRS_DEPTHBIAS]));
+
+ glPolygonOffset(scale_bias.f, const_bias.f * 1e6f);
checkGLcall("glPolygonOffset(...)");
} else {
glDisable(GL_POLYGON_OFFSET_FILL);
Module: wine
Branch: master
Commit: 57a47b0833f7be226be8ed8d0407a250e6a02cc7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=57a47b0833f7be226be8ed8d0…
Author: Andrew Eikum <aeikum(a)codeweavers.com>
Date: Wed Dec 30 11:43:05 2009 -0600
hlink: String target reference is actually moniker target's display name.
The original implementation treated the string target in IHlink as a
separate entity from the moniker target. In reality, the string target
is just the moniker target's display name and setting one reference also
sets the other.
---
dlls/hlink/hlink_main.c | 43 ++---------------
dlls/hlink/link.c | 65 +++++++++++++++++++-------
dlls/hlink/tests/hlink.c | 114 +++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 165 insertions(+), 57 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=57a47b0833f7be226be8e…