ddraw: Implement FPU mode fixup in d3d7 device.
As documented in DirectX7 SDK, d3d7 devices set FPU mode (control word) on every call and restore it back to original state before returning, if created in DDSCL_FPUPRESERVE cooperative mode. This allows games to work with FPU in a possibly incompatible mode and avoid resetting it all the time.
This commit is contained in:
parent
a850cafe6d
commit
cb5e06c944
|
@ -524,8 +524,6 @@ IDirectDrawImpl_SetCooperativeLevel(IDirectDraw7 *iface,
|
|||
WARN("(%p) Unhandled flag DDSCL_ALLOWMODEX, harmless\n", This);
|
||||
if(cooplevel & DDSCL_FPUSETUP)
|
||||
WARN("(%p) Unhandled flag DDSCL_FPUSETUP, harmless\n", This);
|
||||
if(cooplevel & DDSCL_FPUPRESERVE)
|
||||
WARN("(%p) Unhandled flag DDSCL_FPUPRESERVE, harmless\n", This);
|
||||
|
||||
/* Store the cooperative_level */
|
||||
This->cooperative_level |= cooplevel;
|
||||
|
|
|
@ -358,7 +358,8 @@ struct IDirect3DDeviceImpl
|
|||
};
|
||||
|
||||
/* Vtables in various versions */
|
||||
const IDirect3DDevice7Vtbl IDirect3DDevice7_Vtbl;
|
||||
const IDirect3DDevice7Vtbl IDirect3DDevice7_FPUSetup_Vtbl;
|
||||
const IDirect3DDevice7Vtbl IDirect3DDevice7_FPUPreserve_Vtbl;
|
||||
const IDirect3DDevice3Vtbl IDirect3DDevice3_Vtbl;
|
||||
const IDirect3DDevice2Vtbl IDirect3DDevice2_Vtbl;
|
||||
const IDirect3DDeviceVtbl IDirect3DDevice1_Vtbl;
|
||||
|
|
1209
dlls/ddraw/device.c
1209
dlls/ddraw/device.c
File diff suppressed because it is too large
Load Diff
|
@ -805,7 +805,11 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
|
|||
return DDERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
ICOM_INIT_INTERFACE(object, IDirect3DDevice7, IDirect3DDevice7_Vtbl);
|
||||
if (This->cooperative_level & DDSCL_FPUPRESERVE)
|
||||
ICOM_INIT_INTERFACE(object, IDirect3DDevice7, IDirect3DDevice7_FPUPreserve_Vtbl);
|
||||
else
|
||||
ICOM_INIT_INTERFACE(object, IDirect3DDevice7, IDirect3DDevice7_FPUSetup_Vtbl);
|
||||
|
||||
ICOM_INIT_INTERFACE(object, IDirect3DDevice3, IDirect3DDevice3_Vtbl);
|
||||
ICOM_INIT_INTERFACE(object, IDirect3DDevice2, IDirect3DDevice2_Vtbl);
|
||||
ICOM_INIT_INTERFACE(object, IDirect3DDevice, IDirect3DDevice1_Vtbl);
|
||||
|
|
Loading…
Reference in New Issue