simplify and fix GetPrimaryVideoDriverInfo

This commit is contained in:
Glenn Maynard
2003-05-28 18:36:44 +00:00
parent 5c830994fb
commit ce2958ef83
2 changed files with 10 additions and 15 deletions
@@ -88,24 +88,19 @@ CString GetPrimaryVideoName9xAnd2k()
return sPrimaryDeviceName; return sPrimaryDeviceName;
} }
void GetPrimaryVideoDriverInfo(VideoDriverInfo &info) CString GetPrimaryVideoDriverInfo()
{ {
const CString sPrimaryDeviceName = GetPrimaryVideoName9xAnd2k(); const CString sPrimaryDeviceName = GetPrimaryVideoName9xAnd2k();
if( sPrimaryDeviceName == "" ) if( sPrimaryDeviceName != "" )
LOG->Warn("GetPrimaryVideoName9xAnd2k failed; renderer selection may be wrong"); return sPrimaryDeviceName;
for( int i=0; true; i++ ) LOG->Warn("GetPrimaryVideoName9xAnd2k failed; renderer selection may be wrong");
{
if( !GetVideoDriverInfo(i, info) )
RageException::Throw( "Got video name \"%s\" but wasn't enumerated among %i devices",
sPrimaryDeviceName.c_str(), i );
if( sPrimaryDeviceName == "" ) // failed to get primary display name (NT4) VideoDriverInfo info;
return; if( !GetVideoDriverInfo(0, info) )
RageException::Throw( "GetVideoDriverInfo(0) failed");
if( info.sDescription == sPrimaryDeviceName ) return info.sDescription;
return;
}
} }
/* Get info for the given card number. Return false if that card doesn't exist. */ /* Get info for the given card number. Return false if that card doesn't exist. */
@@ -12,6 +12,6 @@ struct VideoDriverInfo
CString GetPrimaryVideoName9xAnd2k(); CString GetPrimaryVideoName9xAnd2k();
bool GetVideoDriverInfo(int cardno, VideoDriverInfo &info); bool GetVideoDriverInfo(int cardno, VideoDriverInfo &info);
void GetPrimaryVideoDriverInfo(VideoDriverInfo &info); CString GetPrimaryVideoDriverInfo();
#endif #endif