The following patch to include/wine/wined3d_types.h
revision 1.8 date: 2005/08/23 09:34:57; author: julliard; state: Exp; lines: +2 -2 Oliver Stieber oliver_stieber@yahoo.co.uk Tidy up d3d9 and finalize passing d3d9 calls to wined3d for now.
@@ -401,7 +401,7 @@ typedef struct _WINED3DADAPTER_IDENTIFIE typedef struct _WINED3DPRESENT_PARAMETERS { UINT *BackBufferWidth; UINT *BackBufferHeight; - D3DFORMAT *BackBufferFormat; + WINED3DFORMAT *BackBufferFormat; UINT *BackBufferCount; D3DMULTISAMPLE_TYPE *MultiSampleType; DWORD *MultiSampleQuality; @@ -409,7 +409,7 @@ typedef struct _WINED3DPRESENT_PARAMETER HWND *hDeviceWindow; BOOL *Windowed; BOOL *EnableAutoDepthStencil; - D3DFORMAT *AutoDepthStencilFormat; + WINED3DFORMAT *AutoDepthStencilFormat; DWORD *Flags; UINT *FullScreen_RefreshRateInHz; UINT *PresentationInterval;
triggers the following warning in IDirect3D8Impl_CreateDevice():
directx.c:670: warning: assignment from incompatible pointer type directx.c:678: warning: assignment from incompatible pointer type
These two lines are
localParameters.BackBufferFormat = &pPresentationParameters->BackBufferFormat; localParameters.AutoDepthStencilFormat = &pPresentationParameters->AutoDepthStencilFormat;
and the two variables have the following types
D3DPRESENT_PARAMETERS* pPresentationParameters (from include/wine/wined3d_types.h
WINED3DPRESENT_PARAMETERS localParameters; (from include/d3d8types.h)
Interestingly, I did not see this on SUSE Linux 9.3, but FreeBSD 4.11 (XFree86) and 5.4 (X.org).
Both D3DFORMAT and WINED3DFORMAT are enums, so indeed assigning one to the other seems a bit strange, if not dangerous. Is the change as such really correct?
Gerald
--- Gerald Pfeifer gerald@pfeifer.com wrote:
The following patch to include/wine/wined3d_types.h
triggers the following warning in IDirect3D8Impl_CreateDevice():
directx.c:670: warning: assignment from incompatible pointer type directx.c:678: warning: assignment from incompatible pointer type
Ok, I'll send in a patch to fix this.
Both D3DFORMAT and WINED3DFORMAT are enums, so indeed assigning one to the other seems a bit strange, if not dangerous. Is the change as such really correct?
The problem is that Microsoft changes what D3DFORMAT are valid between Direct3D releases, DirectX 9 is missing some formats that are in DirectX 8 and DirectX 8 is missing some formats that are in DirectX 9.
To work around this a new enum WINED3DFORMAT was created that includes all the types valid for DirectX 8 as well as those valid for DirectX 9. Because DirectX 8/9's D3DFORMATs are a subset of WINED3DFORMAT DirectX 8/9's D3DFORMAT can be cast to WINED3DFORMAT without any problems.
Texture states are similar to this, except that when DirectX 8 is moved over to using wined3d a switch will be required to send those states that are sampler states in DirectX 9 to wined3d SetSamplerState instead of SetTextureStageState.
Gerald
___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com