move "video driver database" to text file
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
[VideoCards]
|
||||||
|
NumEntries=3
|
||||||
|
|
||||||
|
[0000]
|
||||||
|
DriverRegex=Voodoo3
|
||||||
|
Renderers=d3d
|
||||||
|
Width=640
|
||||||
|
Height=480
|
||||||
|
DisplayColor=16
|
||||||
|
TextureColor=16
|
||||||
|
|
||||||
|
[0001]
|
||||||
|
DriverRegex=GeForce|Radeon
|
||||||
|
Renderers=opengl,d3d
|
||||||
|
Width=640
|
||||||
|
Height=480
|
||||||
|
DisplayColor=32
|
||||||
|
TextureColor=32
|
||||||
|
|
||||||
|
// Default graphics settings used for all cards that don't match above.
|
||||||
|
// This must be the very last entry!
|
||||||
|
[0002]
|
||||||
|
DriverRegex=
|
||||||
|
Renderers=opengl,d3d
|
||||||
|
Width=640
|
||||||
|
Height=480
|
||||||
|
DisplayColor=16
|
||||||
|
TextureColor=16
|
||||||
@@ -63,7 +63,7 @@ PrefsManager::PrefsManager()
|
|||||||
m_fJudgeWindowGreatSeconds = 0.090f;
|
m_fJudgeWindowGreatSeconds = 0.090f;
|
||||||
m_fJudgeWindowGoodSeconds = 0.135f;
|
m_fJudgeWindowGoodSeconds = 0.135f;
|
||||||
m_fJudgeWindowBooSeconds = 0.180f;
|
m_fJudgeWindowBooSeconds = 0.180f;
|
||||||
m_fJudgeWindowOKSeconds = 0.140f;
|
m_fJudgeWindowOKSeconds = 0.250f; // allow enough time to take foot off and put back on
|
||||||
m_fLifeDifficultyScale = 1.0f;
|
m_fLifeDifficultyScale = 1.0f;
|
||||||
m_iMovieDecodeMS = 2;
|
m_iMovieDecodeMS = 2;
|
||||||
m_bUseBGIfNoBanner = false;
|
m_bUseBGIfNoBanner = false;
|
||||||
@@ -112,7 +112,7 @@ PrefsManager::PrefsManager()
|
|||||||
m_bHiddenSongs = false;
|
m_bHiddenSongs = false;
|
||||||
m_bVsync = true;
|
m_bVsync = true;
|
||||||
|
|
||||||
m_sRenderer = "";
|
m_sVideoRenderers = "";
|
||||||
m_sSoundDrivers = DEFAULT_SOUND_DRIVER_LIST;
|
m_sSoundDrivers = DEFAULT_SOUND_DRIVER_LIST;
|
||||||
m_fSoundVolume = DEFAULT_SOUND_VOLUME;
|
m_fSoundVolume = DEFAULT_SOUND_VOLUME;
|
||||||
/* This is experimental: let's see if preloading helps people's skipping.
|
/* This is experimental: let's see if preloading helps people's skipping.
|
||||||
@@ -178,7 +178,8 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
|
|||||||
ini.GetValueB( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
|
ini.GetValueB( "Options", "DelayedScreenLoad", m_bDelayedScreenLoad );
|
||||||
ini.GetValueI( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections );
|
ini.GetValueI( "Options", "MusicWheelUsesSections", (int&)m_MusicWheelUsesSections );
|
||||||
ini.GetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed );
|
ini.GetValueI( "Options", "MusicWheelSwitchSpeed", m_iMusicWheelSwitchSpeed );
|
||||||
ini.GetValue ( "Options", "Renderer", m_sRenderer );
|
ini.GetValue ( "Options", "VideoRenderers", m_sVideoRenderers );
|
||||||
|
ini.GetValue ( "Options", "LastSeenVideoDriver", m_sLastSeenVideoDriver );
|
||||||
ini.GetValue ( "Options", "SoundDrivers", m_sSoundDrivers );
|
ini.GetValue ( "Options", "SoundDrivers", m_sSoundDrivers );
|
||||||
ini.GetValueB( "Options", "EasterEggs", m_bEasterEggs );
|
ini.GetValueB( "Options", "EasterEggs", m_bEasterEggs );
|
||||||
ini.GetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming );
|
ini.GetValueB( "Options", "MarvelousTiming", m_bMarvelousTiming );
|
||||||
@@ -306,8 +307,8 @@ void PrefsManager::SaveGlobalPrefsToDisk()
|
|||||||
ini.SetValue ( "Options", "SoundDrivers", m_sSoundDrivers );
|
ini.SetValue ( "Options", "SoundDrivers", m_sSoundDrivers );
|
||||||
if(m_fSoundVolume != DEFAULT_SOUND_VOLUME)
|
if(m_fSoundVolume != DEFAULT_SOUND_VOLUME)
|
||||||
ini.SetValueF( "Options", "SoundVolume", m_fSoundVolume );
|
ini.SetValueF( "Options", "SoundVolume", m_fSoundVolume );
|
||||||
if(m_sRenderer != "")
|
if(m_sVideoRenderers != "")
|
||||||
ini.SetValue ( "Options", "Renderer", m_sRenderer );
|
ini.SetValue ( "Options", "Renderer", m_sVideoRenderers );
|
||||||
|
|
||||||
|
|
||||||
ini.SetValue( "Options", "AdditionalSongFolders", join(",", m_asAdditionalSongFolders) );
|
ini.SetValue( "Options", "AdditionalSongFolders", join(",", m_asAdditionalSongFolders) );
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ public:
|
|||||||
CStringArray m_asAdditionalSongFolders;
|
CStringArray m_asAdditionalSongFolders;
|
||||||
CString m_DWIPath;
|
CString m_DWIPath;
|
||||||
|
|
||||||
CString m_sRenderer;
|
CString m_sVideoRenderers;
|
||||||
|
CString m_sLastSeenVideoDriver;
|
||||||
CString m_sSoundDrivers;
|
CString m_sSoundDrivers;
|
||||||
float m_fSoundVolume;
|
float m_fSoundVolume;
|
||||||
bool m_bSoundPreloadAll;
|
bool m_bSoundPreloadAll;
|
||||||
|
|||||||
+62
-54
@@ -293,80 +293,88 @@ RageDisplay *CreateDisplay()
|
|||||||
* #2 is the only case that's actually a bug.
|
* #2 is the only case that's actually a bug.
|
||||||
*
|
*
|
||||||
* Actually, right now we're falling back. I'm not sure which behavior is better.
|
* Actually, right now we're falling back. I'm not sure which behavior is better.
|
||||||
*
|
|
||||||
* This should probably be exported into an INI.
|
|
||||||
*/
|
*/
|
||||||
bool NeedsD3D = false;
|
|
||||||
if( PREFSMAN->m_sRenderer != "" )
|
// Video card changed since last run
|
||||||
|
CString sVideoDriver = GetPrimaryVideoDriverName();
|
||||||
|
if( PREFSMAN->m_sLastSeenVideoDriver != sVideoDriver )
|
||||||
{
|
{
|
||||||
LOG->Warn("Forcing renderer: %s", PREFSMAN->m_sRenderer.c_str() );
|
// Apply default graphic settings for this card
|
||||||
if( !PREFSMAN->m_sRenderer.CompareNoCase("opengl") )
|
IniFile ini;
|
||||||
NeedsD3D = false;
|
ini.SetPath( "Data/VideoCards.ini" );
|
||||||
else if( !PREFSMAN->m_sRenderer.CompareNoCase("d3d") )
|
ini.ReadFile();
|
||||||
NeedsD3D = true;
|
|
||||||
else
|
int iNumEntries = 0;
|
||||||
RageException::Throw("Unknown Renderer value: %s", PREFSMAN->m_sRenderer.c_str() );
|
ini.GetValueI( "VideoCards", "NumEntries", iNumEntries );
|
||||||
|
for( int i=0; i<iNumEntries; i++ )
|
||||||
|
{
|
||||||
|
CString sKey = ssprintf("%04d",i);
|
||||||
|
|
||||||
|
CString sDriverRegex;
|
||||||
|
ini.GetValue( sKey, "DriverRegex", sDriverRegex );
|
||||||
|
Regex regex( sDriverRegex );
|
||||||
|
if( !regex.Compare(sVideoDriver) )
|
||||||
|
continue; // skip
|
||||||
|
|
||||||
|
LOG->Trace( "Using default graphics settings for '%s'.", sDriverRegex.c_str() );
|
||||||
|
|
||||||
|
ini.GetValue( sKey, "Renderers", PREFSMAN->m_sVideoRenderers );
|
||||||
|
ini.GetValueI( sKey, "Width", PREFSMAN->m_iDisplayWidth );
|
||||||
|
ini.GetValueI( sKey, "Height", PREFSMAN->m_iDisplayHeight );
|
||||||
|
ini.GetValueI( sKey, "DisplayColor", PREFSMAN->m_iDisplayColorDepth );
|
||||||
|
ini.GetValueI( sKey, "TextureColor", PREFSMAN->m_iTextureColorDepth );
|
||||||
|
|
||||||
|
// Update last seen video card
|
||||||
|
PREFSMAN->m_sLastSeenVideoDriver = GetPrimaryVideoDriverName();
|
||||||
|
|
||||||
|
break; // stop looking
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( CardRequiresD3D() )
|
CString error = "There was an error while initializing your video card.\n\n"
|
||||||
NeedsD3D = true;
|
" PLEASE DO NOT FILE THIS ERROR AS A BUG!\n\n"
|
||||||
|
"Video Driver: "+sVideoDriver+"\n\n";
|
||||||
|
|
||||||
CString error = "There was an error while initializing your video card.\n\n";
|
CStringArray asRenderers;
|
||||||
if( PREFSMAN->m_sRenderer != "" )
|
split( PREFSMAN->m_sVideoRenderers, ",", asRenderers, true );
|
||||||
error = "(WARNING: Renderer was forced)\n\n";
|
for( int i=0; i<asRenderers.size(); i++ )
|
||||||
|
|
||||||
error += " PLEASE DO NOT FILE THIS ERROR AS A BUG!\n\n";
|
|
||||||
|
|
||||||
if( NeedsD3D )
|
|
||||||
{
|
{
|
||||||
/* We require D3D. Try to start it. */
|
CString sRenderer = asRenderers[i];
|
||||||
error += "Your display adapter, \"" + GetPrimaryVideoDriverName() + "\", requires Direct3D 8 (or "
|
|
||||||
"higher), but ";
|
|
||||||
|
|
||||||
try {
|
|
||||||
return CreateDisplay_D3D();
|
|
||||||
} catch(RageException_D3DNotInstalled e) {
|
|
||||||
error +=
|
|
||||||
"it is not installed. You can download it from:\n" +
|
|
||||||
D3DURL;
|
|
||||||
} catch(RageException_D3DNoAcceleration e) {
|
|
||||||
error +=
|
|
||||||
"your system is reporting that hardware acceleration is not available. "
|
|
||||||
"You can download an updated driver from your card's manufacturer.";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* This card is listed as having problems in OpenGL, so don't try it; it'll
|
|
||||||
* just generate bug reports. */
|
|
||||||
RageException::Throw( error );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if( sRenderer.CompareNoCase("opengl")==0 )
|
||||||
|
{
|
||||||
/* Try to create an OpenGL renderer. This should always succeed. (Actually,
|
/* Try to create an OpenGL renderer. This should always succeed. (Actually,
|
||||||
* SDL may throw, but that only happens with broken driver installations, and
|
* SDL may throw, but that only happens with broken driver installations, and
|
||||||
* we probably don't want to fall back on D3D in that case anyway.) */
|
* we probably don't want to fall back on D3D in that case anyway.) */
|
||||||
|
error += "Initializing OpenGL...\n";
|
||||||
|
|
||||||
RageDisplay *ret = CreateDisplay_OGL();
|
RageDisplay *ret = CreateDisplay_OGL();
|
||||||
|
|
||||||
if( PREFSMAN->m_bAllowUnacceleratedRenderer || !ret->IsSoftwareRenderer() )
|
if( PREFSMAN->m_bAllowUnacceleratedRenderer || !ret->IsSoftwareRenderer() )
|
||||||
return ret;
|
return ret;
|
||||||
|
else
|
||||||
/* OpenGL is unaccelerated. Try D3D. */
|
{
|
||||||
|
error += "Your system is reporting that OpenGL hardware acceleration is not available. "
|
||||||
|
"Please obtain an updated driver from your video card manufacturer.";
|
||||||
delete ret;
|
delete ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if( sRenderer.CompareNoCase("d3d")==0 )
|
||||||
|
{
|
||||||
|
error += "Initializing Direct3D...\n";
|
||||||
try {
|
try {
|
||||||
return CreateDisplay_D3D();
|
return CreateDisplay_D3D();
|
||||||
} catch(RageException_D3DNotInstalled e) {
|
} catch(RageException_D3DNotInstalled e) {
|
||||||
/* Eek. We don't know if we need newer drivers, D3D8 or both. */
|
error += "DirectX 8.1 or greater is not installed. You can download it from:\n"+D3DURL;
|
||||||
error +=
|
|
||||||
"OpenGL hardware acceleration is not available on your system, and "
|
|
||||||
"Direct3D 8 (or higher) is not installed. You can download it from:\n" +
|
|
||||||
D3DURL + "\n\n"
|
|
||||||
"You may also need updated drivers from your card's manufacturer.";
|
|
||||||
} catch(RageException_D3DNoAcceleration e) {
|
} catch(RageException_D3DNoAcceleration e) {
|
||||||
error +=
|
error += "Your system is reporting that Direct3D hardware acceleration is not available. "
|
||||||
"Neither OpenGL nor Direct3D hardware acceleration is available on your "
|
"Please obtain an updated driver from your video card manufacturer.";
|
||||||
"system. Please install the latest video drivers from your graphics "
|
|
||||||
"card vendor.";
|
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
RageException::Throw("Unknown video renderer value: %s", sRenderer.c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
RageException::Throw( error );
|
RageException::Throw( error );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user