Ejemplo n.º 1
0
void CDX8Disp::LoadSettings(char *reg_path, int flags)
{
   	if(m_dx8_initialised_ok == false)
	{
		return;
	}

	DWORD adapter, aatype;

	if(reg_get_dword(reg_path, "D3D8_Adapter", &adapter) == false)
	{
		UpdateAdapterList();
		return;
	}

	UpdateAdapterList(adapter);

	// Getting mode options is a bit more complicated
	char mode_string[1024];
	bool result = false;
	unsigned int width, height;
	int cdepth;

	char *reg_name = "Videocard";

	if(reg_get_sz(reg_path, reg_name, mode_string, 1024))
		if(sscanf(mode_string, "D3D8-(%dx%d)x%d bit", &width, &height, &cdepth)  == 3) 
			result = true;

	// No mode found, show user choice and return
	if(result == false)
	{
		UpdateResList();
		return;
	}

	// Show user choice and set if next setting is already set
	UpdateResList(width, height, cdepth);

	if(reg_get_dword(reg_path, "D3D8_AAType", &aatype) == false)
	{
		// No setting found, show user choice and return
		UpdateAntialiasList();
		return;
	}

	UpdateAntialiasList(aatype);
}
Ejemplo n.º 2
0
/**
 * Determines the current settings in the registry and selects them in the list if avaliable
 *
 * @param char *reg_path - Registry path to obtain info from
 */
void CDX5Disp::LoadSettings()
{	
	char videocard_string[MAX_PATH];

	// Lets get those video card settings
	if(reg_get_sz(LauncherSettings::get_reg_path(), "VideocardFs2open", videocard_string, MAX_PATH) == false)
	{
		return;
	}

	int count = 0;
	for(int i = 0; i < NUM_DX5_MODES; i++)
	{
		if(strcmp(videocard_string, dx5_modes[i].text_desc) == 0)
		{
			m_res_list.SetCurSel(count);
			return;
		}

		count++;
	}

	m_res_list.SetCurSel(0);
}