Compare commits

..

4 Commits

3 changed files with 15 additions and 0 deletions

View File

@ -771,6 +771,14 @@ void CEnumerateDevices::WriteSelectedDeviceToRegistry()
SetZBufferBitdepth(dev.d3dDevice.iZBufferBitDepth); SetZBufferBitdepth(dev.d3dDevice.iZBufferBitDepth);
} }
void CEnumerateDevices::LoadSelectedDeviceFromRegistry()
{
char str_title[2048] = { '\0' };
GetRegString(strD3D_TITLE, str_title, sizeof(str_title), "");
SelectDevice(str_title);
}
// //
// Global variables. // Global variables.

View File

@ -150,8 +150,10 @@ public:
return Devices[iSelectedDevice]; return Devices[iSelectedDevice];
} }
void LoadSelectedDeviceFromRegistry();
void WriteSelectedDeviceToRegistry(); void WriteSelectedDeviceToRegistry();
int GetSelectedDeviceIndex() const { return iSelectedDevice; }
void SelectDevice(char* str); void SelectDevice(char* str);
void GetTitle(int i, char* str) const; void GetTitle(int i, char* str) const;

View File

@ -274,6 +274,11 @@ void CConfigureWnd::InitializeCardSelection()
ListBox_AddString(m_hwndList, str); ListBox_AddString(m_hwndList, str);
} }
penumdevDevices->LoadSelectedDeviceFromRegistry();
int selectedDevice = penumdevDevices->GetSelectedDeviceIndex();
if (selectedDevice >= 0 && selectedDevice < iMaxDevices)
penumdevDevices->GetTitle(penumdevDevices->GetSelectedDeviceIndex(), str);
// Attempt to select a string. // Attempt to select a string.
ListBox_SelectString(m_hwndList, 0, str); ListBox_SelectString(m_hwndList, 0, str);