This commit is contained in:
Chris Danford
2005-11-10 20:00:01 +00:00
parent 6446d21eb2
commit 20b5c41f76
+80 -57
View File
@@ -404,8 +404,8 @@ static void CheckSettings()
struct VideoCardDefaults struct VideoCardDefaults
{ {
const char *szDriverRegex; CString sDriverRegex;
const char *szVideoRenderers; CString sVideoRenderers;
int iWidth; int iWidth;
int iHeight; int iHeight;
int iDisplayColor; int iDisplayColor;
@@ -413,65 +413,89 @@ struct VideoCardDefaults
int iMovieColor; int iMovieColor;
int iTextureSize; int iTextureSize;
bool bSmoothLines; bool bSmoothLines;
VideoCardDefaults() {}
VideoCardDefaults(
CString sDriverRegex_,
CString sVideoRenderers_,
int iWidth_,
int iHeight_,
int iDisplayColor_,
int iTextureColor_,
int iMovieColor_,
int iTextureSize_,
bool bSmoothLines_
)
{
sDriverRegex = sDriverRegex_;
sVideoRenderers = sVideoRenderers_;
iWidth = iWidth_;
iHeight = iHeight_;
iDisplayColor = iDisplayColor_;
iTextureColor = iTextureColor_;
iMovieColor = iMovieColor_;
iTextureSize = iTextureSize_;
bSmoothLines = bSmoothLines_;
}
} const g_VideoCardDefaults[] = } const g_VideoCardDefaults[] =
{ {
{ VideoCardDefaults(
"Xbox", "Xbox",
"d3d,opengl", "d3d,opengl",
600,400, 600,400,
32,32,32, 32,32,32,
2048, 2048,
true true
}, ),
{ VideoCardDefaults(
"Voodoo *5", "Voodoo *5",
"d3d,opengl", // received 3 reports of opengl crashing. -Chris "d3d,opengl", // received 3 reports of opengl crashing. -Chris
640,480, 640,480,
32,32,32, 32,32,32,
2048, 2048,
true // accelerated true // accelerated
}, ),
{ VideoCardDefaults(
"Voodoo|3dfx", /* all other Voodoos: some drivers don't identify which one */ "Voodoo|3dfx", /* all other Voodoos: some drivers don't identify which one */
"d3d,opengl", "d3d,opengl",
640,480, 640,480,
16,16,16, 16,16,16,
256, 256,
false // broken, causes black screen false // broken, causes black screen
}, ),
{ VideoCardDefaults(
"Radeon.* 7|Wonder 7500|ArcadeVGA", // Radeon 7xxx, RADEON Mobility 7500 "Radeon.* 7|Wonder 7500|ArcadeVGA", // Radeon 7xxx, RADEON Mobility 7500
"d3d,opengl", // movie texture performance is terrible in OpenGL, but fine in D3D. "d3d,opengl", // movie texture performance is terrible in OpenGL, but fine in D3D.
640,480, 640,480,
16,16,16, 16,16,16,
2048, 2048,
true // accelerated true // accelerated
}, ),
{ VideoCardDefaults(
"GeForce|Radeon|Wonder 9|Quadro", "GeForce|Radeon|Wonder 9|Quadro",
"opengl,d3d", "opengl,d3d",
640,480, 640,480,
32,32,32, // 32 bit textures are faster to load 32,32,32, // 32 bit textures are faster to load
2048, 2048,
true // hardware accelerated true // hardware accelerated
}, ),
{ VideoCardDefaults(
"TNT|Vanta|M64", "TNT|Vanta|M64",
"opengl,d3d", "opengl,d3d",
640,480, 640,480,
16,16,16, // Athlon 1.2+TNT demonstration w/ movies: 70fps w/ 32bit textures, 86fps w/ 16bit textures 16,16,16, // Athlon 1.2+TNT demonstration w/ movies: 70fps w/ 32bit textures, 86fps w/ 16bit textures
2048, 2048,
true // hardware accelerated true // hardware accelerated
}, ),
{ VideoCardDefaults(
"G200|G250|G400", "G200|G250|G400",
"d3d,opengl", "d3d,opengl",
640,480, 640,480,
16,16,16, 16,16,16,
2048, 2048,
false // broken, causes black screen false // broken, causes black screen
}, ),
{ VideoCardDefaults(
"Savage", "Savage",
"d3d", "d3d",
// OpenGL is unusable on my Savage IV with even the latest drivers. // OpenGL is unusable on my Savage IV with even the latest drivers.
@@ -481,8 +505,8 @@ struct VideoCardDefaults
16,16,16, 16,16,16,
2048, 2048,
false false
}, ),
{ VideoCardDefaults(
"XPERT@PLAY|IIC|RAGE PRO|RAGE LT PRO", // Rage Pro chip, Rage IIC chip "XPERT@PLAY|IIC|RAGE PRO|RAGE LT PRO", // Rage Pro chip, Rage IIC chip
"d3d", "d3d",
// OpenGL is not hardware accelerated, despite the fact that the // OpenGL is not hardware accelerated, despite the fact that the
@@ -493,25 +517,25 @@ struct VideoCardDefaults
16,16,16, 16,16,16,
256, 256,
false false
}, ),
{ VideoCardDefaults(
"RAGE MOBILITY-M1", "RAGE MOBILITY-M1",
"d3d,opengl", // Vertex alpha is broken in OpenGL, but not D3D. -Chris "d3d,opengl", // Vertex alpha is broken in OpenGL, but not D3D. -Chris
400,300, // lower resolution for 60fps 400,300, // lower resolution for 60fps
16,16,16, 16,16,16,
256, 256,
false false
}, ),
{ VideoCardDefaults(
"Mobility M3", // ATI Rage Mobility 128 (AKA "M3") "Mobility M3", // ATI Rage Mobility 128 (AKA "M3")
"d3d,opengl", // bad movie texture performance in opengl "d3d,opengl", // bad movie texture performance in opengl
640,480, 640,480,
16,16,16, 16,16,16,
1024, 1024,
false false
}, ),
#if 0 #if 0
{ VideoCardDefaults(
/* success report: /* success report:
* Video driver: IntelR 82845G/GL/GE/PE/GV Graphics Controller [Intel Corporation] * Video driver: IntelR 82845G/GL/GE/PE/GV Graphics Controller [Intel Corporation]
* 6.14.10.3865, 7-1-2004 [pci\ven_8086&dev_2562] */ * 6.14.10.3865, 7-1-2004 [pci\ven_8086&dev_2562] */
@@ -522,33 +546,33 @@ struct VideoCardDefaults
16,16,16, 16,16,16,
1024, 1024,
true true
}, ),
#endif #endif
{ VideoCardDefaults(
"Intel.*82810|Intel.*82815", "Intel.*82810|Intel.*82815",
"opengl,d3d",// OpenGL is 50%+ faster than D3D w/ latest Intel drivers. -Chris "opengl,d3d",// OpenGL is 50%+ faster than D3D w/ latest Intel drivers. -Chris
512,384, // lower resolution for 60fps 512,384, // lower resolution for 60fps
16,16,16, 16,16,16,
512, 512,
false false
}, ),
{ VideoCardDefaults(
"Intel*Extreme Graphics", "Intel*Extreme Graphics",
"d3d", // OpenGL blue screens w/ XP drivers from 6-21-2002 "d3d", // OpenGL blue screens w/ XP drivers from 6-21-2002
640,480, 640,480,
16,16,16, // slow at 32bpp 16,16,16, // slow at 32bpp
1024, 1024,
false false
}, ),
{ VideoCardDefaults(
"Intel.*", /* fallback: all unknown Intel cards to D3D, since Intel is notoriously bad at OpenGL */ "Intel.*", /* fallback: all unknown Intel cards to D3D, since Intel is notoriously bad at OpenGL */
"d3d,opengl", "d3d,opengl",
640,480, 640,480,
16,16,16, 16,16,16,
1024, 1024,
false false
}, ),
{ VideoCardDefaults(
// Cards that have problems with OpenGL: // Cards that have problems with OpenGL:
// ASSERT fail somewhere in RageDisplay_OpenGL "Trident Video Accelerator CyberBlade" // ASSERT fail somewhere in RageDisplay_OpenGL "Trident Video Accelerator CyberBlade"
// bug 764499: ASSERT fail after glDeleteTextures for "SiS 650_651_740" // bug 764499: ASSERT fail after glDeleteTextures for "SiS 650_651_740"
@@ -560,8 +584,8 @@ struct VideoCardDefaults
16,16,16, 16,16,16,
2048, 2048,
false false
}, ),
{ VideoCardDefaults(
/* Unconfirmed texture problems on this; let's try D3D, since it's a VIA/S3 /* Unconfirmed texture problems on this; let's try D3D, since it's a VIA/S3
* chipset. */ * chipset. */
"VIA/S3G KM400/KN400", "VIA/S3G KM400/KN400",
@@ -570,16 +594,16 @@ struct VideoCardDefaults
16,16,16, 16,16,16,
2048, 2048,
false false
}, ),
{ VideoCardDefaults(
"OpenGL", // This matches all drivers in Mac and Linux. -Chris "OpenGL", // This matches all drivers in Mac and Linux. -Chris
"opengl", "opengl",
640,480, 640,480,
16,16,16, 16,16,16,
2048, 2048,
true // Right now, they've got to have NVidia or ATi Cards anyway.. true // Right now, they've got to have NVidia or ATi Cards anyway..
}, ),
{ VideoCardDefaults(
// Default graphics settings used for all cards that don't match above. // Default graphics settings used for all cards that don't match above.
// This must be the very last entry! // This must be the very last entry!
"", "",
@@ -588,7 +612,7 @@ struct VideoCardDefaults
16,16,16, 16,16,16,
2048, 2048,
false // AA is slow on some cards, so let's selectively enable HW accelerated cards. false // AA is slow on some cards, so let's selectively enable HW accelerated cards.
}, ),
}; };
@@ -610,24 +634,23 @@ static void CheckVideoDefaultSettings()
LOG->Trace( "Last seen video driver: " + PREFSMAN->m_sLastSeenVideoDriver.Get() ); LOG->Trace( "Last seen video driver: " + PREFSMAN->m_sLastSeenVideoDriver.Get() );
const VideoCardDefaults* pDefaults = NULL; VideoCardDefaults defaults;
for( unsigned i=0; i<ARRAYSIZE(g_VideoCardDefaults); i++ ) for( unsigned i=0; i<ARRAYSIZE(g_VideoCardDefaults); i++ )
{ {
pDefaults = &g_VideoCardDefaults[i]; defaults = g_VideoCardDefaults[i];
CString sDriverRegex = pDefaults->szDriverRegex; CString sDriverRegex = defaults.sDriverRegex;
Regex regex( sDriverRegex ); Regex regex( sDriverRegex );
if( regex.Compare(sVideoDriver) ) if( regex.Compare(sVideoDriver) )
{ {
LOG->Trace( "Card matches '%s'.", sDriverRegex.size()? sDriverRegex.c_str():"(unknown card)" ); LOG->Trace( "Card matches '%s'.", sDriverRegex.size()? sDriverRegex.c_str():"(unknown card)" );
break; goto found_defaults;
} }
} }
ASSERT( 0 ); // we must have matched at least one above
ASSERT( pDefaults ); // we must have matched at least one found_defaults:
CString sVideoRenderers = pDefaults->szVideoRenderers;
bool SetDefaultVideoParams=false; bool SetDefaultVideoParams=false;
if( PREFSMAN->m_sVideoRenderers.Get() == "" ) if( PREFSMAN->m_sVideoRenderers.Get() == "" )
@@ -643,22 +666,22 @@ static void CheckVideoDefaultSettings()
if( SetDefaultVideoParams ) if( SetDefaultVideoParams )
{ {
PREFSMAN->m_sVideoRenderers.Set( sVideoRenderers ); PREFSMAN->m_sVideoRenderers.Set( defaults.sVideoRenderers );
PREFSMAN->m_iDisplayWidth.Set( pDefaults->iWidth ); PREFSMAN->m_iDisplayWidth.Set( defaults.iWidth );
PREFSMAN->m_iDisplayHeight.Set( pDefaults->iHeight ); PREFSMAN->m_iDisplayHeight.Set( defaults.iHeight );
PREFSMAN->m_iDisplayColorDepth.Set( pDefaults->iDisplayColor ); PREFSMAN->m_iDisplayColorDepth.Set( defaults.iDisplayColor );
PREFSMAN->m_iTextureColorDepth.Set( pDefaults->iTextureColor ); PREFSMAN->m_iTextureColorDepth.Set( defaults.iTextureColor );
PREFSMAN->m_iMovieColorDepth.Set( pDefaults->iMovieColor ); PREFSMAN->m_iMovieColorDepth.Set( defaults.iMovieColor );
PREFSMAN->m_iMaxTextureResolution.Set( pDefaults->iTextureSize ); PREFSMAN->m_iMaxTextureResolution.Set( defaults.iTextureSize );
PREFSMAN->m_bSmoothLines.Set( pDefaults->bSmoothLines ); PREFSMAN->m_bSmoothLines.Set( defaults.bSmoothLines );
// Update last seen video card // Update last seen video card
PREFSMAN->m_sLastSeenVideoDriver.Set( GetVideoDriverName() ); PREFSMAN->m_sLastSeenVideoDriver.Set( GetVideoDriverName() );
} }
else if( PREFSMAN->m_sVideoRenderers.Get().CompareNoCase(sVideoRenderers) ) else if( PREFSMAN->m_sVideoRenderers.Get().CompareNoCase(defaults.sVideoRenderers) )
{ {
LOG->Warn("Video renderer list has been changed from '%s' to '%s'", LOG->Warn("Video renderer list has been changed from '%s' to '%s'",
sVideoRenderers.c_str(), PREFSMAN->m_sVideoRenderers.Get().c_str() ); defaults.sVideoRenderers.c_str(), PREFSMAN->m_sVideoRenderers.Get().c_str() );
return; return;
} }