Fixes from Mike Christel to work with the latest Direct X SDK

This commit is contained in:
rdb 2009-06-10 05:51:21 +00:00
parent eaa2b052cb
commit d427b8559f
2 changed files with 35 additions and 18 deletions

View File

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

View File

@ -60,6 +60,17 @@
#include <wchar.h>
#include <string.h>
#include <windows.h>
// 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 <qedit.h>
#include <atlbase.h>