ddraw: Link directly to wined3d.
This commit is contained in:
parent
69ea0884ab
commit
8872239088
|
@ -1,6 +1,6 @@
|
|||
MODULE = ddraw.dll
|
||||
IMPORTLIB = ddraw
|
||||
IMPORTS = dxguid uuid ole32 user32 gdi32 advapi32
|
||||
IMPORTS = dxguid uuid wined3d user32 gdi32 advapi32
|
||||
|
||||
C_SRCS = \
|
||||
clipper.c \
|
||||
|
|
|
@ -307,7 +307,7 @@ HRESULT ddraw_clipper_init(IDirectDrawClipperImpl *clipper)
|
|||
{
|
||||
clipper->lpVtbl = &ddraw_clipper_vtbl;
|
||||
clipper->ref = 1;
|
||||
clipper->wineD3DClipper = pWineDirect3DCreateClipper();
|
||||
clipper->wineD3DClipper = WineDirect3DCreateClipper();
|
||||
if (!clipper->wineD3DClipper)
|
||||
{
|
||||
WARN("Failed to create wined3d clipper.\n");
|
||||
|
|
|
@ -3964,12 +3964,6 @@ DirectDrawCreateClipper(DWORD Flags,
|
|||
return CLASS_E_NOAGGREGATION;
|
||||
}
|
||||
|
||||
if (!LoadWineD3D())
|
||||
{
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return DDERR_NODIRECTDRAWSUPPORT;
|
||||
}
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
sizeof(IDirectDrawClipperImpl));
|
||||
if (object == NULL)
|
||||
|
@ -6016,13 +6010,7 @@ HRESULT ddraw_init(IDirectDrawImpl *ddraw, WINED3DDEVTYPE device_type)
|
|||
ddraw->orig_width = GetSystemMetrics(SM_CXSCREEN);
|
||||
ddraw->orig_height = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
if (!LoadWineD3D())
|
||||
{
|
||||
ERR("Failed to load wined3d - broken OpenGL setup?\n");
|
||||
return DDERR_NODIRECTDRAWSUPPORT;
|
||||
}
|
||||
|
||||
ddraw->wineD3D = pWineDirect3DCreate(7, &ddraw->IDirectDraw7_iface);
|
||||
ddraw->wineD3D = WineDirect3DCreate(7, &ddraw->IDirectDraw7_iface);
|
||||
if (!ddraw->wineD3D)
|
||||
{
|
||||
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 */
|
||||
extern WINED3DSURFTYPE DefaultSurfaceType DECLSPEC_HIDDEN;
|
||||
|
||||
extern typeof(WineDirect3DCreateClipper) *pWineDirect3DCreateClipper DECLSPEC_HIDDEN;
|
||||
extern typeof(WineDirect3DCreate) *pWineDirect3DCreate DECLSPEC_HIDDEN;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawSurface implementation structure
|
||||
*****************************************************************************/
|
||||
|
|
|
@ -39,9 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
|
|||
/* The configured default surface */
|
||||
WINED3DSURFTYPE DefaultSurfaceType = SURFACE_UNKNOWN;
|
||||
|
||||
typeof(WineDirect3DCreateClipper) *pWineDirect3DCreateClipper DECLSPEC_HIDDEN;
|
||||
typeof(WineDirect3DCreate) *pWineDirect3DCreate DECLSPEC_HIDDEN;
|
||||
|
||||
/* DDraw list and critical section */
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
|
Loading…
Reference in New Issue