ddraw: Update the wined3d matrix if a current matrix handle is modified.

This commit is contained in:
Stefan Dösinger 2007-07-01 23:28:21 +02:00 committed by Alexandre Julliard
parent 9928a4c4fd
commit f7597dee15
3 changed files with 26 additions and 0 deletions

View file

@ -348,6 +348,7 @@ struct IDirect3DDeviceImpl
/* Handle management */
struct HandleEntry *Handles;
DWORD numHandles;
D3DMATRIXHANDLE world, proj, view;
};
/* Vtables in various versions */

View file

@ -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;
}

View file

@ -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);
}