ddraw: Link directly to wined3d.
This commit is contained in:
parent
69ea0884ab
commit
8872239088
|
@ -1,6 +1,6 @@
|
||||||
MODULE = ddraw.dll
|
MODULE = ddraw.dll
|
||||||
IMPORTLIB = ddraw
|
IMPORTLIB = ddraw
|
||||||
IMPORTS = dxguid uuid ole32 user32 gdi32 advapi32
|
IMPORTS = dxguid uuid wined3d user32 gdi32 advapi32
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
clipper.c \
|
clipper.c \
|
||||||
|
|
|
@ -307,7 +307,7 @@ HRESULT ddraw_clipper_init(IDirectDrawClipperImpl *clipper)
|
||||||
{
|
{
|
||||||
clipper->lpVtbl = &ddraw_clipper_vtbl;
|
clipper->lpVtbl = &ddraw_clipper_vtbl;
|
||||||
clipper->ref = 1;
|
clipper->ref = 1;
|
||||||
clipper->wineD3DClipper = pWineDirect3DCreateClipper();
|
clipper->wineD3DClipper = WineDirect3DCreateClipper();
|
||||||
if (!clipper->wineD3DClipper)
|
if (!clipper->wineD3DClipper)
|
||||||
{
|
{
|
||||||
WARN("Failed to create wined3d clipper.\n");
|
WARN("Failed to create wined3d clipper.\n");
|
||||||
|
|
|
@ -3964,12 +3964,6 @@ DirectDrawCreateClipper(DWORD Flags,
|
||||||
return CLASS_E_NOAGGREGATION;
|
return CLASS_E_NOAGGREGATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LoadWineD3D())
|
|
||||||
{
|
|
||||||
LeaveCriticalSection(&ddraw_cs);
|
|
||||||
return DDERR_NODIRECTDRAWSUPPORT;
|
|
||||||
}
|
|
||||||
|
|
||||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||||
sizeof(IDirectDrawClipperImpl));
|
sizeof(IDirectDrawClipperImpl));
|
||||||
if (object == NULL)
|
if (object == NULL)
|
||||||
|
@ -6016,13 +6010,7 @@ HRESULT ddraw_init(IDirectDrawImpl *ddraw, WINED3DDEVTYPE device_type)
|
||||||
ddraw->orig_width = GetSystemMetrics(SM_CXSCREEN);
|
ddraw->orig_width = GetSystemMetrics(SM_CXSCREEN);
|
||||||
ddraw->orig_height = GetSystemMetrics(SM_CYSCREEN);
|
ddraw->orig_height = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
|
||||||
if (!LoadWineD3D())
|
ddraw->wineD3D = WineDirect3DCreate(7, &ddraw->IDirectDraw7_iface);
|
||||||
{
|
|
||||||
ERR("Failed to load wined3d - broken OpenGL setup?\n");
|
|
||||||
return DDERR_NODIRECTDRAWSUPPORT;
|
|
||||||
}
|
|
||||||
|
|
||||||
ddraw->wineD3D = pWineDirect3DCreate(7, &ddraw->IDirectDraw7_iface);
|
|
||||||
if (!ddraw->wineD3D)
|
if (!ddraw->wineD3D)
|
||||||
{
|
{
|
||||||
WARN("Failed to create a wined3d object.\n");
|
WARN("Failed to create a wined3d object.\n");
|
||||||
|
|
|
@ -187,10 +187,6 @@ IWineD3DVertexDeclaration *ddraw_find_decl(IDirectDrawImpl *This, DWORD fvf) DEC
|
||||||
/* The default surface type */
|
/* The default surface type */
|
||||||
extern WINED3DSURFTYPE DefaultSurfaceType DECLSPEC_HIDDEN;
|
extern WINED3DSURFTYPE DefaultSurfaceType DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
extern typeof(WineDirect3DCreateClipper) *pWineDirect3DCreateClipper DECLSPEC_HIDDEN;
|
|
||||||
extern typeof(WineDirect3DCreate) *pWineDirect3DCreate DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* IDirectDrawSurface implementation structure
|
* IDirectDrawSurface implementation structure
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
|
@ -39,9 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
|
||||||
/* The configured default surface */
|
/* The configured default surface */
|
||||||
WINED3DSURFTYPE DefaultSurfaceType = SURFACE_UNKNOWN;
|
WINED3DSURFTYPE DefaultSurfaceType = SURFACE_UNKNOWN;
|
||||||
|
|
||||||
typeof(WineDirect3DCreateClipper) *pWineDirect3DCreateClipper DECLSPEC_HIDDEN;
|
|
||||||
typeof(WineDirect3DCreate) *pWineDirect3DCreate DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
/* DDraw list and critical section */
|
/* DDraw list and critical section */
|
||||||
static struct list global_ddraw_list = LIST_INIT(global_ddraw_list);
|
static struct list global_ddraw_list = LIST_INIT(global_ddraw_list);
|
||||||
|
|
||||||
|
@ -170,31 +167,6 @@ void *ddraw_get_object(struct ddraw_handle_table *t, DWORD handle, enum ddraw_ha
|
||||||
return entry->object;
|
return entry->object;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Helper Function for DDRAW_Create and DirectDrawCreateClipper for
|
|
||||||
* lazy loading of the Wine D3D driver.
|
|
||||||
*
|
|
||||||
* Returns
|
|
||||||
* TRUE on success
|
|
||||||
* FALSE on failure.
|
|
||||||
*/
|
|
||||||
|
|
||||||
BOOL LoadWineD3D(void)
|
|
||||||
{
|
|
||||||
static HMODULE hWineD3D = (HMODULE) -1;
|
|
||||||
if (hWineD3D == (HMODULE) -1)
|
|
||||||
{
|
|
||||||
hWineD3D = LoadLibraryA("wined3d");
|
|
||||||
if (hWineD3D)
|
|
||||||
{
|
|
||||||
pWineDirect3DCreate = (typeof(WineDirect3DCreate) *)GetProcAddress(hWineD3D, "WineDirect3DCreate");
|
|
||||||
pWineDirect3DCreateClipper = (typeof(WineDirect3DCreateClipper) *) GetProcAddress(hWineD3D, "WineDirect3DCreateClipper");
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return hWineD3D != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Helper function for DirectDrawCreate and friends
|
* Helper function for DirectDrawCreate and friends
|
||||||
|
|
Loading…
Reference in New Issue