Stefan Dösinger : ddraw: Update the wined3d matrix if a current matrix handle is modified.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Jul 6 12:59:09 CDT 2007
Module: wine
Branch: master
Commit: f7597dee15307cb46e53d297f7a461c20b058328
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f7597dee15307cb46e53d297f7a461c20b058328
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Sun Jul 1 23:28:21 2007 +0200
ddraw: Update the wined3d matrix if a current matrix handle is modified.
---
dlls/ddraw/ddraw_private.h | 1 +
dlls/ddraw/device.c | 19 +++++++++++++++++++
dlls/ddraw/executebuffer.c | 6 ++++++
3 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index ee194a1..2f35643 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -348,6 +348,7 @@ struct IDirect3DDeviceImpl
/* Handle management */
struct HandleEntry *Handles;
DWORD numHandles;
+ D3DMATRIXHANDLE world, proj, view;
};
/* Vtables in various versions */
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 5c21bf9..d0cfcdf 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -1406,6 +1406,25 @@ IDirect3DDeviceImpl_1_SetMatrix(IDirect3DDevice *iface,
*((D3DMATRIX *) This->Handles[D3DMatHandle - 1].ptr) = *D3DMatrix;
+ if(This->world == D3DMatHandle)
+ {
+ IWineD3DDevice_SetTransform(This->wineD3DDevice,
+ WINED3DTS_WORLDMATRIX(0),
+ (WINED3DMATRIX *) D3DMatrix);
+ }
+ if(This->view == D3DMatHandle)
+ {
+ IWineD3DDevice_SetTransform(This->wineD3DDevice,
+ WINED3DTS_VIEW,
+ (WINED3DMATRIX *) D3DMatrix);
+ }
+ if(This->proj == D3DMatHandle)
+ {
+ IWineD3DDevice_SetTransform(This->wineD3DDevice,
+ WINED3DTS_PROJECTION,
+ (WINED3DMATRIX *) D3DMatrix);
+ }
+
LeaveCriticalSection(&ddraw_cs);
return D3D_OK;
}
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c
index ff0bbdb..c44a37e 100644
--- a/dlls/ddraw/executebuffer.c
+++ b/dlls/ddraw/executebuffer.c
@@ -227,6 +227,12 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
} else if(lpDevice->Handles[ci->u2.dwArg[0] - 1].type != DDrawHandle_Matrix) {
ERR("Handle %d is not a matrix handle\n", ci->u2.dwArg[0]);
} else {
+ if(ci->u1.drstRenderStateType == D3DTRANSFORMSTATE_WORLD)
+ lpDevice->world = ci->u2.dwArg[0];
+ if(ci->u1.drstRenderStateType == D3DTRANSFORMSTATE_VIEW)
+ lpDevice->view = ci->u2.dwArg[0];
+ if(ci->u1.drstRenderStateType == D3DTRANSFORMSTATE_PROJECTION)
+ lpDevice->proj = ci->u2.dwArg[0];
IDirect3DDevice7_SetTransform(ICOM_INTERFACE(lpDevice, IDirect3DDevice7),
ci->u1.drstRenderStateType, (LPD3DMATRIX) lpDevice->Handles[ci->u2.dwArg[0] - 1].ptr);
}
More information about the wine-cvs
mailing list