From 0b0f3d2f8ed2d22f35b13b4d9402b871a9098dfe Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 13 Jan 2020 16:00:31 +0100 Subject: [PATCH] dxgsg9: drop support for old dxerr9.lib (part of #433) This drops support for the *really* old DX SDKs. We still support the June 2010 SDK. --- makepanda/makepanda.py | 13 ++--------- makepanda/makepandacore.py | 44 ----------------------------------- panda/src/dxgsg9/dxgsg9base.h | 16 ++----------- 3 files changed, 4 insertions(+), 69 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 911392b2b7..455d2b31fb 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -145,7 +145,7 @@ def usage(problem): print("") print(" --nothing (disable every third-party lib)") print(" --everything (enable every third-party lib)") - print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)") + print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009)") print(" --windows-sdk=X (specify Windows SDK version, eg. 7.1, 8.1 or 10. Default is 8.1)") print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2. Default is 14)") print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)") @@ -547,10 +547,7 @@ if (COMPILER == "MSVC"): LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum)) LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum)) - if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK: - LibName(pkg, 'dxerr.lib') - else: - LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum)) + LibName(pkg, 'dxerr.lib') #LibName(pkg, 'ddraw.lib') LibName(pkg, 'dxguid.lib') @@ -2340,12 +2337,6 @@ def WriteConfigSettings(): ## if GetTarget() == 'windows' and GetTargetArch() == 'x64': ## dtool_config["SIMPLE_THREADS"] = 'UNDEF' - - if ("GENERIC_DXERR_LIBRARY" in SDK): - dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1" - else: - dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF" - if (PkgSkip("SPEEDTREE")==0): speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF" speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF" diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index a5c14d1d7d..3a7a79de8c 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -1927,43 +1927,31 @@ def SdkLocateDirectX( strMode = 'default' ): if (dir != 0): print("Using DirectX SDK June 2010") SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - SDK["GENERIC_DXERR_LIBRARY"] = 1; if ("DX9" not in SDK): dir = GetRegistryKey("SOFTWARE\\Microsoft\\DirectX\\Microsoft DirectX SDK (June 2010)", "InstallPath") if (dir != 0): print("Using DirectX SDK June 2010") SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - SDK["GENERIC_DXERR_LIBRARY"] = 1; if ("DX9" not in SDK): dir = "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)" if os.path.isdir(dir): print("Using DirectX SDK June 2010") SDK["DX9"] = dir - SDK["GENERIC_DXERR_LIBRARY"] = 1 if ("DX9" not in SDK): dir = "C:/Program Files/Microsoft DirectX SDK (June 2010)" if os.path.isdir(dir): print("Using DirectX SDK June 2010") SDK["DX9"] = dir - SDK["GENERIC_DXERR_LIBRARY"] = 1 if ("DX9" not in SDK): dir = GetRegistryKey("SOFTWARE\\Wow6432Node\\Microsoft\\DirectX\\Microsoft DirectX SDK (August 2009)", "InstallPath") if (dir != 0): print("Using DirectX SDK Aug 2009") SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - SDK["GENERIC_DXERR_LIBRARY"] = 1; if ("DX9" not in SDK): dir = GetRegistryKey("SOFTWARE\\Microsoft\\DirectX\\Microsoft DirectX SDK (August 2009)", "InstallPath") if (dir != 0): print("Using DirectX SDK Aug 2009") SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - SDK["GENERIC_DXERR_LIBRARY"] = 1; - if ("DX9" not in SDK): - ## Try to locate the key within the "new" March 2009 location in the registry (yecch): - dir = GetRegistryKey("SOFTWARE\\Microsoft\\DirectX\\Microsoft DirectX SDK (March 2009)", "InstallPath") - if (dir != 0): - print("Using DirectX SDK March 2009") - SDK["DX9"] = dir.replace("\\", "/").rstrip("/") archStr = GetTargetArch() if ("DX9" not in SDK): uninstaller = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" @@ -1986,22 +1974,18 @@ def SdkLocateDirectX( strMode = 'default' ): dir = GetRegistryKey("SOFTWARE\\Wow6432Node\\Microsoft\\DirectX\\Microsoft DirectX SDK (June 2010)", "InstallPath") if (dir != 0): SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - SDK["GENERIC_DXERR_LIBRARY"] = 1; if ("DX9" not in SDK): dir = GetRegistryKey("SOFTWARE\\Microsoft\\DirectX\\Microsoft DirectX SDK (June 2010)", "InstallPath") if (dir != 0): SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - SDK["GENERIC_DXERR_LIBRARY"] = 1; if ("DX9" not in SDK): dir = "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)" if os.path.isdir(dir): SDK["DX9"] = dir - SDK["GENERIC_DXERR_LIBRARY"] = 1 if ("DX9" not in SDK): dir = "C:/Program Files/Microsoft DirectX SDK (June 2010)" if os.path.isdir(dir): SDK["DX9"] = dir - SDK["GENERIC_DXERR_LIBRARY"] = 1 if ("DX9" not in SDK): exit("Couldn't find DirectX June2010 SDK") else: @@ -2012,41 +1996,13 @@ def SdkLocateDirectX( strMode = 'default' ): if (dir != 0): print("Found DirectX SDK Aug 2009") SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - SDK["GENERIC_DXERR_LIBRARY"] = 1; if ("DX9" not in SDK): dir = GetRegistryKey("SOFTWARE\\Microsoft\\DirectX\\Microsoft DirectX SDK (August 2009)", "InstallPath") if (dir != 0): print("Found DirectX SDK Aug 2009") SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - SDK["GENERIC_DXERR_LIBRARY"] = 1; if ("DX9" not in SDK): exit("Couldn't find DirectX Aug 2009 SDK") - elif strMode == 'mar2009': - if ("DX9" not in SDK): - ## Try to locate the key within the "new" March 2009 location in the registry (yecch): - dir = GetRegistryKey("SOFTWARE\\Microsoft\\DirectX\\Microsoft DirectX SDK (March 2009)", "InstallPath") - if (dir != 0): - print("Found DirectX SDK March 2009") - SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - if ("DX9" not in SDK): - exit("Couldn't find DirectX March 2009 SDK") - elif strMode == 'aug2006': - archStr = GetTargetArch() - if ("DX9" not in SDK): - uninstaller = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" - for subdir in ListRegistryKeys(uninstaller): - if (subdir[0]=="{"): - dir = GetRegistryKey(uninstaller+"\\"+subdir, "InstallLocation") - if (dir != 0): - if (("DX9" not in SDK) and - (os.path.isfile(dir+"\\Include\\d3d9.h")) and - (os.path.isfile(dir+"\\Include\\d3dx9.h")) and - (os.path.isfile(dir+"\\Include\\dxsdkver.h")) and - (os.path.isfile(dir+"\\Lib\\" + archStr + "\\d3d9.lib")) and - (os.path.isfile(dir+"\\Lib\\" + archStr + "\\d3dx9.lib"))): - SDK["DX9"] = dir.replace("\\", "/").rstrip("/") - if ("DX9" not in SDK): - exit("Couldn't find a DirectX Aug 2006 SDK") if ("DX9" in SDK): SDK["DIRECTCAM"] = SDK["DX9"] diff --git a/panda/src/dxgsg9/dxgsg9base.h b/panda/src/dxgsg9/dxgsg9base.h index 430876dff5..6782c4b2c7 100644 --- a/panda/src/dxgsg9/dxgsg9base.h +++ b/panda/src/dxgsg9/dxgsg9base.h @@ -34,19 +34,7 @@ #undef Configure #include #include - -// This symbol is defined (or not defined) in Config.pp. #define -// USE_GENERIC_DXERR_LIBRARY 1 - -#ifdef USE_GENERIC_DXERR_LIBRARY #include -#define DX_GET_ERROR_STRING_FUNC DXGetErrorString -#define DX_GET_ERROR_DESCRIPTION_FUNC DXGetErrorDescription -#else -#include -#define DX_GET_ERROR_STRING_FUNC DXGetErrorString9 -#define DX_GET_ERROR_DESCRIPTION_FUNC DXGetErrorDescription9 -#endif #undef WIN32_LEAN_AND_MEAN @@ -56,9 +44,9 @@ #ifndef D3DERRORSTRING #ifdef NDEBUG -#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DX_GET_ERROR_STRING_FUNC(HRESULT) << std::endl // leave out descriptions to shrink release build +#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DXGetErrorString(HRESULT) << std::endl // leave out descriptions to shrink release build #else -#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DX_GET_ERROR_STRING_FUNC(HRESULT) << ": " << DX_GET_ERROR_DESCRIPTION_FUNC(HRESULT) << std::endl +#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DXGetErrorString(HRESULT) << ": " << DXGetErrorDescription(HRESULT) << std::endl #endif #endif