[PATCH 2/5] wined3d: Get rid of the conv_mat macro.

Henri Verbeet hverbeet at codeweavers.com
Tue May 22 11:01:05 CDT 2012


---
 dlls/wined3d/device.c          |   13 +++++--------
 dlls/wined3d/wined3d_private.h |   13 -------------
 2 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a575eec..e1e28d1 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1801,6 +1801,10 @@ HRESULT CDECL wined3d_device_set_transform(struct wined3d_device *device,
 {
     TRACE("device %p, state %s, matrix %p.\n",
             device, debug_d3dtstype(d3dts), matrix);
+    TRACE("%.8e %.8e %.8e %.8e\n", matrix->u.s._11, matrix->u.s._12, matrix->u.s._13, matrix->u.s._14);
+    TRACE("%.8e %.8e %.8e %.8e\n", matrix->u.s._21, matrix->u.s._22, matrix->u.s._23, matrix->u.s._24);
+    TRACE("%.8e %.8e %.8e %.8e\n", matrix->u.s._31, matrix->u.s._32, matrix->u.s._33, matrix->u.s._34);
+    TRACE("%.8e %.8e %.8e %.8e\n", matrix->u.s._41, matrix->u.s._42, matrix->u.s._43, matrix->u.s._44);
 
     /* Handle recording of state blocks. */
     if (device->isRecordingState)
@@ -1823,14 +1827,7 @@ HRESULT CDECL wined3d_device_set_transform(struct wined3d_device *device,
         return WINED3D_OK;
     }
 
-    conv_mat(matrix, &device->stateBlock->state.transforms[d3dts].u.m[0][0]);
-
-    /* ScreenCoord = ProjectionMat * ViewMat * WorldMat * ObjectCoord
-     * where ViewMat = Camera space, WorldMat = world space.
-     *
-     * In OpenGL, camera and world space is combined into GL_MODELVIEW
-     * matrix.  The Projection matrix stay projection matrix. */
-
+    device->stateBlock->state.transforms[d3dts] = *matrix;
     if (d3dts == WINED3D_TS_VIEW)
         device->view_ident = !memcmp(matrix, &identity, sizeof(identity));
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0525471..6e6aecb 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -840,19 +840,6 @@ do {                                                                \
 #define checkGLcall(A) do {} while(0)
 #endif
 
-/* Trace routines / diagnostics */
-/* ---------------------------- */
-
-/* Dump out a matrix and copy it */
-#define conv_mat(mat,gl_mat)                                                                \
-do {                                                                                        \
-    TRACE("%f %f %f %f\n", (mat)->u.s._11, (mat)->u.s._12, (mat)->u.s._13, (mat)->u.s._14); \
-    TRACE("%f %f %f %f\n", (mat)->u.s._21, (mat)->u.s._22, (mat)->u.s._23, (mat)->u.s._24); \
-    TRACE("%f %f %f %f\n", (mat)->u.s._31, (mat)->u.s._32, (mat)->u.s._33, (mat)->u.s._34); \
-    TRACE("%f %f %f %f\n", (mat)->u.s._41, (mat)->u.s._42, (mat)->u.s._43, (mat)->u.s._44); \
-    memcpy(gl_mat, (mat), 16 * sizeof(float));                                              \
-} while (0)
-
 /* Trace vector and strided data information */
 #define TRACE_STRIDED(si, name) do { if (si->use_map & (1 << name)) \
         TRACE( #name " = (data {%#x:%p}, stride %d, format %s, stream %u)\n", \
-- 
1.7.3.4




More information about the wine-patches mailing list