diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 0c26e0417c..95cd3e1a7f 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -46,6 +46,7 @@ RUNTIME=0 DISTRIBUTOR="" VERSION=None OSXTARGET=None + if "MACOSX_DEPLOYMENT_TARGET" in os.environ: OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"] @@ -337,7 +338,7 @@ if (COMPILER=="MSVC"): LibDirectory(pkg, SDK[pkg] + '/lib') LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum)) LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum)) - if (vnum=="9"): + if (vnum=="9" and "GENERIC_DXERR_LIBRARY" in SDK): LibName(pkg, 'dxerr.lib') else: LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum)) @@ -1338,6 +1339,8 @@ DTOOL_CONFIG=[ ("HAVE_TINYXML", 'UNDEF', 'UNDEF'), ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'), ("PRC_SAVE_DESCRIPTIONS", '1', '1'), + ("_SECURE_SCL", '1', 'UNDEF'), + ("_SECURE_SCL_THROWS", '0', 'UNDEF'), ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'), ] @@ -1453,6 +1456,11 @@ def WriteConfigSettings(): if (RUNTIME): dtool_config["HAVE_P3D_PLUGIN"] = '1' + if ("GENERIC_DXERR_LIBRARY" in SDK): + dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1" + else: + dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF" + conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n" for key in prc_parameters.keys(): if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")): diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index c763c84805..ec85b3caef 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -1257,10 +1257,12 @@ def SdkLocateDirectX(): dir = GetRegistryKey("SOFTWARE\\Wow6432Node\\Microsoft\\DirectX\\Microsoft DirectX SDK (August 2009)", "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 (August 2009)", "InstallPath") if (dir != 0): 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") diff --git a/panda/src/dxgsg9/config_dxgsg9.cxx b/panda/src/dxgsg9/config_dxgsg9.cxx index 7828cd6b1b..d614fa9608 100755 --- a/panda/src/dxgsg9/config_dxgsg9.cxx +++ b/panda/src/dxgsg9/config_dxgsg9.cxx @@ -28,7 +28,7 @@ #include "dconfig.h" -Configure(config_dxgsg9); +DToolConfigure(config_dxgsg9); NotifyCategoryDef(dxgsg9, ":display:gsg"); NotifyCategoryDef(wdxdisplay9, "display"); diff --git a/panda/src/dxgsg9/dxgsg9base.h b/panda/src/dxgsg9/dxgsg9base.h index dbcfc31797..7eeee0eb31 100755 --- a/panda/src/dxgsg9/dxgsg9base.h +++ b/panda/src/dxgsg9/dxgsg9base.h @@ -29,9 +29,21 @@ #define D3D_OVERLOADS // get D3DVECTOR '+' operator, etc from d3dtypes.h //#define D3D_DEBUG_INFO + +#undef Configure #include #include + +#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 #if (D3D_SDK_VERSION & 0xffff) < 32 @@ -40,9 +52,9 @@ #ifndef D3DERRORSTRING #ifdef NDEBUG -#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DXGetErrorString9(HRESULT) << endl // leave out descriptions to shrink release build +#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DX_GET_ERROR_STRING_FUNC(HRESULT) << endl // leave out descriptions to shrink release build #else -#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DXGetErrorString9(HRESULT) << ": " << DXGetErrorDescription9(HRESULT) << endl +#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DX_GET_ERROR_STRING_FUNC(HRESULT) << ": " << DX_GET_ERROR_DESCRIPTION_FUNC(HRESULT) << endl #endif #endif