From b45f6fbbed3534e0c0c79f4fd783e5169809e414 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 29 Oct 2018 17:50:22 -0600 Subject: [PATCH] dxgsg9: Remove DirectX 9.1 "detection" code This method of checking for pnhpast.dll was actually for DirectX 8.1 (see a16fe56c7) and its presence in the DX9 code is largely due to the copy-and-paste nature of how the DX9 GSG was created from the DX8 code. --- panda/src/dxgsg9/dxgsg9base.h | 1 - panda/src/dxgsg9/wdxGraphicsPipe9.cxx | 24 ++---------------------- panda/src/dxgsg9/wdxGraphicsPipe9.h | 1 - panda/src/dxgsg9/wdxGraphicsWindow9.cxx | 3 +-- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/panda/src/dxgsg9/dxgsg9base.h b/panda/src/dxgsg9/dxgsg9base.h index b0e2b9dfef..430876dff5 100644 --- a/panda/src/dxgsg9/dxgsg9base.h +++ b/panda/src/dxgsg9/dxgsg9base.h @@ -211,7 +211,6 @@ struct DXScreenData { bool _is_tnl_device; bool _can_use_hw_vertex_shaders; bool _can_use_pixel_shaders; - bool _is_dx9_1; UINT _supported_screen_depths_mask; UINT _supported_tex_formats_mask; bool _supports_rgba16f_texture_format; diff --git a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx index 6c85c6652f..ce8d33165f 100644 --- a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx @@ -193,30 +193,10 @@ init() { } // Create a Direct3D object. + __d3d9 = (*_Direct3DCreate9)(D3D_SDK_VERSION); - // these were taken from the 8.0 and 8.1 d3d8.h SDK headers - __is_dx9_1 = false; - -#define D3D_SDK_VERSION_9_0 D3D_SDK_VERSION -#define D3D_SDK_VERSION_9_1 D3D_SDK_VERSION - - // are we using 9.0 or 9.1? - WIN32_FIND_DATA TempFindData; - HANDLE hFind; - char tmppath[_MAX_PATH + 128]; - GetSystemDirectory(tmppath, MAX_PATH); - strcat(tmppath, "\\dpnhpast.dll"); - hFind = FindFirstFile (tmppath, &TempFindData); - if (hFind != INVALID_HANDLE_VALUE) { - FindClose(hFind); -// ??? This was from DX8 __is_dx9_1 = true; - __d3d9 = (*_Direct3DCreate9)(D3D_SDK_VERSION_9_1); - } else { - __is_dx9_1 = false; - __d3d9 = (*_Direct3DCreate9)(D3D_SDK_VERSION_9_0); - } if (__d3d9 == nullptr) { - wdxdisplay9_cat.error() << "Direct3DCreate9(9." << (__is_dx9_1 ? "1" : "0") << ") failed!, error = " << GetLastError() << endl; + wdxdisplay9_cat.error() << "Direct3DCreate9 failed!, error = " << GetLastError() << endl; // release_gsg(); goto error; } diff --git a/panda/src/dxgsg9/wdxGraphicsPipe9.h b/panda/src/dxgsg9/wdxGraphicsPipe9.h index 2d9eea18b0..ff25433e79 100644 --- a/panda/src/dxgsg9/wdxGraphicsPipe9.h +++ b/panda/src/dxgsg9/wdxGraphicsPipe9.h @@ -93,7 +93,6 @@ private: typedef pvector CardIDs; CardIDs _card_ids; - bool __is_dx9_1; public: static TypeHandle get_class_type() { diff --git a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx index 3207c81189..07a265a97c 100644 --- a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx @@ -878,7 +878,7 @@ choose_device() { LARGE_INTEGER *DrvVer = &adapter_info.DriverVersion; wdxdisplay9_cat.info() - << "D3D9." << (dxpipe->__is_dx9_1 ?"1":"0") << " Adapter[" << i << "]: " << adapter_info.Description + << "D3D9 Adapter[" << i << "]: " << adapter_info.Description << ", Driver: " << adapter_info.Driver << ", DriverVersion: (" << HIWORD(DrvVer->HighPart) << "." << LOWORD(DrvVer->HighPart) << "." << HIWORD(DrvVer->LowPart) << "." << LOWORD(DrvVer->LowPart) @@ -979,7 +979,6 @@ consider_device(wdxGraphicsPipe9 *dxpipe, DXDeviceInfo *device_info) { nassertr(_dxgsg != nullptr, false); _wcontext._d3d9 = _d3d9; - _wcontext._is_dx9_1 = dxpipe->__is_dx9_1; _wcontext._card_id = device_info->cardID; // could this change by end? bool bWantStencil = (_fb_properties.get_stencil_bits() > 0);