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.
This commit is contained in:
Sam Edwards 2018-10-29 17:50:22 -06:00
parent ad3b145951
commit b45f6fbbed
4 changed files with 3 additions and 26 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -93,7 +93,6 @@ private:
typedef pvector<CardID> CardIDs;
CardIDs _card_ids;
bool __is_dx9_1;
public:
static TypeHandle get_class_type() {

View File

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