ddraw: Update the wined3d matrix if a current matrix handle is modified.
This commit is contained in:
parent
9928a4c4fd
commit
f7597dee15
@ -348,6 +348,7 @@ struct IDirect3DDeviceImpl
|
|||||||
/* Handle management */
|
/* Handle management */
|
||||||
struct HandleEntry *Handles;
|
struct HandleEntry *Handles;
|
||||||
DWORD numHandles;
|
DWORD numHandles;
|
||||||
|
D3DMATRIXHANDLE world, proj, view;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Vtables in various versions */
|
/* Vtables in various versions */
|
||||||
|
@ -1406,6 +1406,25 @@ IDirect3DDeviceImpl_1_SetMatrix(IDirect3DDevice *iface,
|
|||||||
|
|
||||||
*((D3DMATRIX *) This->Handles[D3DMatHandle - 1].ptr) = *D3DMatrix;
|
*((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);
|
LeaveCriticalSection(&ddraw_cs);
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
@ -227,6 +227,12 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
|
|||||||
} else if(lpDevice->Handles[ci->u2.dwArg[0] - 1].type != DDrawHandle_Matrix) {
|
} 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]);
|
ERR("Handle %d is not a matrix handle\n", ci->u2.dwArg[0]);
|
||||||
} else {
|
} 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),
|
IDirect3DDevice7_SetTransform(ICOM_INTERFACE(lpDevice, IDirect3DDevice7),
|
||||||
ci->u1.drstRenderStateType, (LPD3DMATRIX) lpDevice->Handles[ci->u2.dwArg[0] - 1].ptr);
|
ci->u1.drstRenderStateType, (LPD3DMATRIX) lpDevice->Handles[ci->u2.dwArg[0] - 1].ptr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user