- 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,14 +1,22 @@
December 28, 2006 December 29, 2006
- Fixed: The SDL input code must convert the event.data1 to uppercase. - Fixed: APlayerPawn::GiveDefaultInventory() used two different variables
- Added more resolution options when playing windowed under SDL. both named item.
- Changed SDL mouse handling to be basically identical to the (non-DirectInput) - Switched ddraw.dll to be delay loaded. With D3D9 now being the default
Win32 code. The mouse is polled periodically and constantly warped to the display code, this avoids wasting time loading DDraw if it isn't needed.
center of the window. Despite what the SDL docs specify, SDL_WM_GrabInput()
is apparently no longer a reliable means of obtaining continuous relative December 28, 2006
mouse motion events. - Fixed: The Win32 I_FatalError() did not set alreadyThrown, so it could get
- Fixed: The non-Windows implementation of I_FindClose() did not check for -1 stuck in an endless fatal error loop.
handles. - Fixed: The SDL input code must convert the event.data1 to uppercase.
- Fixed all the warnings from GCC 4.2, including a handful that were present in - Added more resolution options when playing windowed under SDL.
- Changed SDL mouse handling to be basically identical to the (non-DirectInput)
Win32 code. The mouse is polled periodically and constantly warped to the
center of the window. Despite what the SDL docs specify, SDL_WM_GrabInput()
is apparently no longer a reliable means of obtaining continuous relative
mouse motion events.
- Fixed: The non-Windows implementation of I_FindClose() did not check for -1
handles.
- Fixed all the warnings from GCC 4.2, including a handful that were present in
older GCCs. older GCCs.
- Fixed: The VC++ project was not set up to redefine RM using del in - Fixed: The VC++ project was not set up to redefine RM using del in
wadsrc/Makefile, nor did it use the makefile for cleaning. wadsrc/Makefile, nor did it use the makefile for cleaning.

View file

@ -843,7 +843,7 @@ void G_Ticker ()
} }
if (ToggleFullscreen) if (ToggleFullscreen)
{ {
static char toggle_fullscreen[] = "toggle fullscreen"; static char toggle_fullscreen[] = "toggle fullscreen";
ToggleFullscreen = false; ToggleFullscreen = false;
AddCommandString (toggle_fullscreen); AddCommandString (toggle_fullscreen);

View file

@ -137,25 +137,25 @@ TArray<level_info_t> wadlevelinfos;
// MAPINFO is parsed slightly differently when the map name is just a number. // MAPINFO is parsed slightly differently when the map name is just a number.
static bool HexenHack; static bool HexenHack;
static char unnamed[] = "Unnamed"; static char unnamed[] = "Unnamed";
static level_info_t TheDefaultLevelInfo = static level_info_t TheDefaultLevelInfo =
{ {
"", // mapname "", // mapname
0, // levelnum 0, // levelnum
"", // pname, "", // pname,
"", // nextmap "", // nextmap
"", // secretmap "", // secretmap
"SKY1", // skypic1 "SKY1", // skypic1
0, // cluster 0, // cluster
0, // partime 0, // partime
0, // sucktime 0, // sucktime
0, // flags 0, // flags
NULL, // music NULL, // music
unnamed, // level_name unnamed, // level_name
"COLORMAP", // fadetable "COLORMAP", // fadetable
+8, // WallVertLight +8, // WallVertLight
-8 // WallHorizLight -8 // WallHorizLight
}; };
static cluster_info_t TheDefaultClusterInfo = { 0 }; static cluster_info_t TheDefaultClusterInfo = { 0 };

View file

@ -2761,7 +2761,7 @@ CCMD (menu_mididevice)
#endif #endif
static void MakeSoundChanges (void) static void MakeSoundChanges (void)
{ {
static char snd_reset[] = "snd_reset"; static char snd_reset[] = "snd_reset";
AddCommandString (snd_reset); AddCommandString (snd_reset);
} }

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