From 82cf5d703f35be7df5c2a953f9f907f1e4dee8ae Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 29 Dec 2006 20:28:23 +0000 Subject: [PATCH] - 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) --- docs/rh-log.txt | 30 +- src/g_game.cpp | 2 +- src/g_level.cpp | 36 +- src/m_options.cpp | 2 +- src/p_user.cpp | 2 +- src/win32/i_system.cpp | 1 + src/win32/win32video.cpp | 19 +- zdoom.vcproj | 1244 +++++++++++++++++++------------------- 8 files changed, 680 insertions(+), 656 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index d2838c2b0..c02531079 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,14 +1,22 @@ -December 28, 2006 -- Fixed: The SDL input code must convert the event.data1 to uppercase. -- 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 +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 +- 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. +- 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. - Fixed: The VC++ project was not set up to redefine RM using del in wadsrc/Makefile, nor did it use the makefile for cleaning. diff --git a/src/g_game.cpp b/src/g_game.cpp index 7b094bc56..800c36bde 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -843,7 +843,7 @@ void G_Ticker () } if (ToggleFullscreen) - { + { static char toggle_fullscreen[] = "toggle fullscreen"; ToggleFullscreen = false; AddCommandString (toggle_fullscreen); diff --git a/src/g_level.cpp b/src/g_level.cpp index c7254c608..9a9408e89 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -137,25 +137,25 @@ TArray wadlevelinfos; // MAPINFO is parsed slightly differently when the map name is just a number. static bool HexenHack; - + static char unnamed[] = "Unnamed"; -static level_info_t TheDefaultLevelInfo = -{ - "", // mapname - 0, // levelnum - "", // pname, - "", // nextmap - "", // secretmap - "SKY1", // skypic1 - 0, // cluster - 0, // partime - 0, // sucktime - 0, // flags - NULL, // music - unnamed, // level_name - "COLORMAP", // fadetable - +8, // WallVertLight - -8 // WallHorizLight +static level_info_t TheDefaultLevelInfo = +{ + "", // mapname + 0, // levelnum + "", // pname, + "", // nextmap + "", // secretmap + "SKY1", // skypic1 + 0, // cluster + 0, // partime + 0, // sucktime + 0, // flags + NULL, // music + unnamed, // level_name + "COLORMAP", // fadetable + +8, // WallVertLight + -8 // WallHorizLight }; static cluster_info_t TheDefaultClusterInfo = { 0 }; diff --git a/src/m_options.cpp b/src/m_options.cpp index 307b50fd6..877b7bf3f 100644 --- a/src/m_options.cpp +++ b/src/m_options.cpp @@ -2761,7 +2761,7 @@ CCMD (menu_mididevice) #endif static void MakeSoundChanges (void) -{ +{ static char snd_reset[] = "snd_reset"; AddCommandString (snd_reset); } diff --git a/src/p_user.cpp b/src/p_user.cpp index c1b98a1ff..7d6d7b7cc 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -890,7 +890,7 @@ void APlayerPawn::GiveDefaultInventory () } else { - AInventory *item = static_cast(Spawn (ti, 0,0,0, NO_REPLACE)); + item = static_cast(Spawn (ti, 0,0,0, NO_REPLACE)); item->Amount = di->amount; if (item->IsKindOf (RUNTIME_CLASS (AWeapon))) { diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 8b043d719..0f9ee7335 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -520,6 +520,7 @@ void STACK_ARGS I_FatalError (const char *error, ...) if (!alreadyThrown) // ignore all but the first message -- killough { + alreadyThrown = true; char errortext[MAX_ERRORTEXT]; int index; va_list argptr; diff --git a/src/win32/win32video.cpp b/src/win32/win32video.cpp index 5a0dd53ff..e383f8a32 100644 --- a/src/win32/win32video.cpp +++ b/src/win32/win32video.cpp @@ -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); diff --git a/zdoom.vcproj b/zdoom.vcproj index a7c0a9ec0..c30c6483d 100644 --- a/zdoom.vcproj +++ b/zdoom.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -2717,14 +2725,6 @@ GeneratePreprocessedFile="0" /> - - - @@ -2747,7 +2747,7 @@ /> - - - @@ -4814,6 +4804,16 @@ Outputs="$(IntDir)/$(InputName).obj" /> + + + @@ -4838,16 +4838,6 @@ Outputs="$(IntDir)/$(InputName).obj" /> - - - @@ -4858,6 +4848,16 @@ Outputs="$(IntDir)/$(InputName).obj" /> + + + @@ -4882,16 +4882,6 @@ Outputs="$(IntDir)\$(InputName).obj" /> - - - @@ -4902,6 +4892,16 @@ Outputs="$(IntDir)\$(InputName).obj" /> + + + @@ -4926,16 +4926,6 @@ Outputs="$(IntDir)\$(InputName).obj" /> - - - @@ -4946,6 +4936,16 @@ Outputs="$(IntDir)\$(InputName).obj" /> + + + @@ -4970,16 +4970,6 @@ Outputs="$(IntDir)\$(InputName).obj" /> - - - @@ -4990,6 +4980,16 @@ Outputs="$(IntDir)\$(InputName).obj" /> + + + @@ -5069,7 +5069,7 @@ /> + + + @@ -5408,14 +5416,6 @@ Outputs="$(IntDir)\$(InputName).obj" /> - - - - - - @@ -5650,6 +5642,14 @@ GeneratePreprocessedFile="0" /> + + + @@ -5671,7 +5671,7 @@ /> + + + @@ -9156,14 +9164,6 @@ AdditionalIncludeDirectories="src\win32;$(NoInherit)" /> - - - @@ -9338,7 +9338,7 @@ />