- Fixed: APlayerPawn::GiveDefaultInventory() used two different variables
both named item. - Switched ddraw.dll to be delay loaded. With D3D9 now being the default display code, this avoids wasting time loading DDraw if it isn't needed. - Fixed: The Win32 I_FatalError() did not set alreadyThrown, so it could get stuck in an endless fatal error loop. SVN r433 (trunk)
This commit is contained in:
parent
b2b28fa2f5
commit
82cf5d703f
8 changed files with 594 additions and 570 deletions
|
|
@ -73,6 +73,7 @@
|
|||
IMPLEMENT_ABSTRACT_CLASS(BaseWinFB)
|
||||
|
||||
typedef IDirect3D9 *(WINAPI *DIRECT3DCREATE9FUNC)(UINT SDKVersion);
|
||||
typedef HRESULT (WINAPI *DIRECTDRAWCREATEFUNC)(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter);
|
||||
|
||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||
|
||||
|
|
@ -95,6 +96,7 @@ EXTERN_CVAR (Float, Gamma)
|
|||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||
|
||||
static HMODULE D3D9_dll;
|
||||
static HMODULE DDraw_dll;
|
||||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
|
|
@ -154,7 +156,7 @@ bool Win32Video::InitD3D9 ()
|
|||
return false;
|
||||
}
|
||||
|
||||
// Create the IDirect3D object.
|
||||
// Obtain an IDirect3D interface.
|
||||
if ((direct3d_create_9 = (DIRECT3DCREATE9FUNC)GetProcAddress (D3D9_dll, "Direct3DCreate9")) == NULL)
|
||||
{
|
||||
goto closelib;
|
||||
|
|
@ -201,12 +203,25 @@ closelib:
|
|||
|
||||
void Win32Video::InitDDraw ()
|
||||
{
|
||||
DIRECTDRAWCREATEFUNC directdraw_create;
|
||||
LPDIRECTDRAW ddraw1;
|
||||
STARTLOG;
|
||||
|
||||
HRESULT dderr;
|
||||
|
||||
dderr = DirectDrawCreate (NULL, &ddraw1, NULL);
|
||||
// Load the DirectDraw library.
|
||||
if ((DDraw_dll = LoadLibraryA ("ddraw.dll")) == NULL)
|
||||
{
|
||||
I_FatalError ("Could not load ddraw.dll");
|
||||
}
|
||||
|
||||
// Obtain an IDirectDraw interface.
|
||||
if ((directdraw_create = (DIRECTDRAWCREATEFUNC)GetProcAddress (DDraw_dll, "DirectDrawCreate")) == NULL)
|
||||
{
|
||||
I_FatalError ("The system file ddraw.dll is missing the DirectDrawCreate export");
|
||||
}
|
||||
|
||||
dderr = directdraw_create (NULL, &ddraw1, NULL);
|
||||
|
||||
if (FAILED(dderr))
|
||||
I_FatalError ("Could not create DirectDraw object: %08lx", dderr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue