Compatibility with DX SDK August 2009 that shouldn't break older SDKs. SECURE_SCL settings restored in makepanda.

This commit is contained in:
gogg 2010-02-04 04:27:35 +00:00
parent aae5068ad3
commit fbbc5bb9e6
4 changed files with 26 additions and 4 deletions

View File

@ -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_")):

View File

@ -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")

View File

@ -28,7 +28,7 @@
#include "dconfig.h"
Configure(config_dxgsg9);
DToolConfigure(config_dxgsg9);
NotifyCategoryDef(dxgsg9, ":display:gsg");
NotifyCategoryDef(wdxdisplay9, "display");

View File

@ -29,9 +29,21 @@
#define D3D_OVERLOADS // get D3DVECTOR '+' operator, etc from d3dtypes.h
//#define D3D_DEBUG_INFO
#undef Configure
#include <d3d9.h>
#include <d3dx9.h>
#ifdef USE_GENERIC_DXERR_LIBRARY
#include <dxerr.h>
#define DX_GET_ERROR_STRING_FUNC DXGetErrorString
#define DX_GET_ERROR_DESCRIPTION_FUNC DXGetErrorDescription
#else
#include <dxerr9.h>
#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