From d427b8559f45445bbcac60bc2895b411d93ef9b3 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 10 Jun 2009 05:51:21 +0000 Subject: [PATCH] Fixes from Mike Christel to work with the latest Direct X SDK --- makepanda/makepandacore.py | 42 +++++++++++++++++------------- panda/src/movies/webcamVideoDS.cxx | 11 ++++++++ 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 3dff8fbaf7..e149519bb5 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -762,24 +762,30 @@ def SdkLocateDirectX(): if (sys.platform != "win32"): return if (os.path.isdir("sdks/directx8")): SDK["DX8"]="sdks/directx8" if (os.path.isdir("sdks/directx9")): SDK["DX9"]="sdks/directx9" - uninstaller = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; - for subdir in ListRegistryKeys(uninstaller): - if (subdir[0]=="{"): - dir = GetRegistryKey(uninstaller+"\\"+subdir, "InstallLocation") - if (dir != 0): - if ((SDK.has_key("DX8")==0) and - (os.path.isfile(dir+"\\Include\\d3d8.h")) and - (os.path.isfile(dir+"\\Include\\d3dx8.h")) and - (os.path.isfile(dir+"\\Lib\\d3d8.lib")) and - (os.path.isfile(dir+"\\Lib\\d3dx8.lib"))): - SDK["DX8"] = dir.replace("\\", "/").rstrip("/") - if ((SDK.has_key("DX9")==0) 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\\x86\\d3d9.lib")) and - (os.path.isfile(dir+"\\Lib\\x86\\d3dx9.lib"))): - SDK["DX9"] = dir.replace("\\", "/").rstrip("/") + if (SDK.has_key("DX9")==0): + ## 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): + SDK["DX9"] = dir.replace("\\", "/").rstrip("/") + if (SDK.has_key("DX9")==0 or SDK.has_key("DX8")==0): + uninstaller = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; + for subdir in ListRegistryKeys(uninstaller): + if (subdir[0]=="{"): + dir = GetRegistryKey(uninstaller+"\\"+subdir, "InstallLocation") + if (dir != 0): + if ((SDK.has_key("DX8")==0) and + (os.path.isfile(dir+"\\Include\\d3d8.h")) and + (os.path.isfile(dir+"\\Include\\d3dx8.h")) and + (os.path.isfile(dir+"\\Lib\\d3d8.lib")) and + (os.path.isfile(dir+"\\Lib\\d3dx8.lib"))): + SDK["DX8"] = dir.replace("\\", "/").rstrip("/") + if ((SDK.has_key("DX9")==0) 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\\x86\\d3d9.lib")) and + (os.path.isfile(dir+"\\Lib\\x86\\d3dx9.lib"))): + SDK["DX9"] = dir.replace("\\", "/").rstrip("/") if (SDK.has_key("DX9")): SDK["DIRECTCAM"] = SDK["DX9"] diff --git a/panda/src/movies/webcamVideoDS.cxx b/panda/src/movies/webcamVideoDS.cxx index 864346fb01..b865ca11e0 100644 --- a/panda/src/movies/webcamVideoDS.cxx +++ b/panda/src/movies/webcamVideoDS.cxx @@ -60,6 +60,17 @@ #include #include #include + +// NOTE: there is a problem with dxtrans.h missing from newer Microsoft DirectX SDKs (including March 2009) +// See "dxtrans.h missing in Microsoft DirectX SDK" at +// http://social.msdn.microsoft.com/forums/en-US/windowssdk/thread/ed097d2c-3d68-4f48-8448-277eaaf68252/ for example. +// This header file is referenced only by qedit.h and not needed. +// Solution: add this pragma and these 4 defines before the qedit.h inclusion: +#pragma include_alias( "dxtrans.h", "qedit.h" ) +#define __IDxtCompositor_INTERFACE_DEFINED__ +#define __IDxtAlphaSetter_INTERFACE_DEFINED__ +#define __IDxtJpeg_INTERFACE_DEFINED_ +#define __IDxtKey_INTERFACE_DEFINED__ #include #include