diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h index 858911f3507..dcda35fb081 100644 --- a/dlls/d3drm/d3drm_private.h +++ b/dlls/d3drm/d3drm_private.h @@ -33,6 +33,19 @@ #include "wine/heap.h" #include "wine/list.h" +struct d3drm_matrix +{ + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; +}; + +static inline struct d3drm_matrix *d3drm_matrix(D3DRMMATRIX4D m) +{ + return (struct d3drm_matrix *)m; +} + struct d3drm_object { LONG ref; @@ -71,7 +84,7 @@ struct d3drm_frame SIZE_T nb_lights; SIZE_T lights_size; IDirect3DRMLight **lights; - D3DRMMATRIX4D transform; + struct d3drm_matrix transform; D3DCOLOR scenebackground; DWORD traversal_options; }; diff --git a/dlls/d3drm/frame.c b/dlls/d3drm/frame.c index 8bed50b57eb..8bcd1f42497 100644 --- a/dlls/d3drm/frame.c +++ b/dlls/d3drm/frame.c @@ -23,11 +23,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3drm); -static D3DRMMATRIX4D identity = { - { 1.0f, 0.0f, 0.0f, 0.0f }, - { 0.0f, 1.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 1.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f, 1.0f } +static const struct d3drm_matrix identity = +{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, }; struct d3drm_frame_array @@ -941,13 +942,14 @@ static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface, D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix) { struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + const struct d3drm_matrix *m = d3drm_matrix(matrix); TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix); switch (type) { case D3DRMCOMBINE_REPLACE: - memcpy(frame->transform, matrix, sizeof(D3DRMMATRIX4D)); + frame->transform = *m; break; case D3DRMCOMBINE_BEFORE: @@ -1415,13 +1417,14 @@ static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix) { struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface); + struct d3drm_matrix *m = d3drm_matrix(matrix); TRACE("iface %p, reference %p, matrix %p.\n", iface, reference, matrix); if (reference) - FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n"); + FIXME("Ignoring reference frame %p.\n", reference); - memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D)); + *m = frame->transform; return D3DRM_OK; } @@ -1429,10 +1432,11 @@ static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface, static HRESULT WINAPI d3drm_frame2_GetTransform(IDirect3DRMFrame2 *iface, D3DRMMATRIX4D matrix) { struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface); + struct d3drm_matrix *m = d3drm_matrix(matrix); TRACE("iface %p, matrix %p.\n", iface, matrix); - memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D)); + *m = frame->transform; return D3DRM_OK; } @@ -2950,7 +2954,7 @@ HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, I d3drm_object_init(&object->obj, classname); - memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D)); + object->transform = identity; if (parent_frame) {