- 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:
Randy Heit 2006-12-29 20:28:23 +00:00
parent b2b28fa2f5
commit 82cf5d703f
8 changed files with 680 additions and 656 deletions

View file

@ -1,4 +1,12 @@
December 29, 2006
- 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.
December 28, 2006 December 28, 2006
- Fixed: The Win32 I_FatalError() did not set alreadyThrown, so it could get
stuck in an endless fatal error loop.
- Fixed: The SDL input code must convert the event.data1 to uppercase. - Fixed: The SDL input code must convert the event.data1 to uppercase.
- Added more resolution options when playing windowed under SDL. - Added more resolution options when playing windowed under SDL.
- Changed SDL mouse handling to be basically identical to the (non-DirectInput) - Changed SDL mouse handling to be basically identical to the (non-DirectInput)

View file

@ -890,7 +890,7 @@ void APlayerPawn::GiveDefaultInventory ()
} }
else else
{ {
AInventory *item = static_cast<AInventory *>(Spawn (ti, 0,0,0, NO_REPLACE)); item = static_cast<AInventory *>(Spawn (ti, 0,0,0, NO_REPLACE));
item->Amount = di->amount; item->Amount = di->amount;
if (item->IsKindOf (RUNTIME_CLASS (AWeapon))) if (item->IsKindOf (RUNTIME_CLASS (AWeapon)))
{ {

View file

@ -520,6 +520,7 @@ void STACK_ARGS I_FatalError (const char *error, ...)
if (!alreadyThrown) // ignore all but the first message -- killough if (!alreadyThrown) // ignore all but the first message -- killough
{ {
alreadyThrown = true;
char errortext[MAX_ERRORTEXT]; char errortext[MAX_ERRORTEXT];
int index; int index;
va_list argptr; va_list argptr;

View file

@ -73,6 +73,7 @@
IMPLEMENT_ABSTRACT_CLASS(BaseWinFB) IMPLEMENT_ABSTRACT_CLASS(BaseWinFB)
typedef IDirect3D9 *(WINAPI *DIRECT3DCREATE9FUNC)(UINT SDKVersion); typedef IDirect3D9 *(WINAPI *DIRECT3DCREATE9FUNC)(UINT SDKVersion);
typedef HRESULT (WINAPI *DIRECTDRAWCREATEFUNC)(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter);
// PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- // PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
@ -95,6 +96,7 @@ EXTERN_CVAR (Float, Gamma)
// PRIVATE DATA DEFINITIONS ------------------------------------------------ // PRIVATE DATA DEFINITIONS ------------------------------------------------
static HMODULE D3D9_dll; static HMODULE D3D9_dll;
static HMODULE DDraw_dll;
// PUBLIC DATA DEFINITIONS ------------------------------------------------- // PUBLIC DATA DEFINITIONS -------------------------------------------------
@ -154,7 +156,7 @@ bool Win32Video::InitD3D9 ()
return false; return false;
} }
// Create the IDirect3D object. // Obtain an IDirect3D interface.
if ((direct3d_create_9 = (DIRECT3DCREATE9FUNC)GetProcAddress (D3D9_dll, "Direct3DCreate9")) == NULL) if ((direct3d_create_9 = (DIRECT3DCREATE9FUNC)GetProcAddress (D3D9_dll, "Direct3DCreate9")) == NULL)
{ {
goto closelib; goto closelib;
@ -201,12 +203,25 @@ closelib:
void Win32Video::InitDDraw () void Win32Video::InitDDraw ()
{ {
DIRECTDRAWCREATEFUNC directdraw_create;
LPDIRECTDRAW ddraw1; LPDIRECTDRAW ddraw1;
STARTLOG; STARTLOG;
HRESULT dderr; 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)) if (FAILED(dderr))
I_FatalError ("Could not create DirectDraw object: %08lx", dderr); I_FatalError ("Could not create DirectDraw object: %08lx", dderr);

File diff suppressed because it is too large Load diff