simplify and fix GetPrimaryVideoDriverInfo
This commit is contained in:
@@ -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 != "" )
|
||||||
|
return sPrimaryDeviceName;
|
||||||
|
|
||||||
LOG->Warn("GetPrimaryVideoName9xAnd2k failed; renderer selection may be wrong");
|
LOG->Warn("GetPrimaryVideoName9xAnd2k failed; renderer selection may be wrong");
|
||||||
|
|
||||||
for( int i=0; true; i++ )
|
VideoDriverInfo info;
|
||||||
{
|
if( !GetVideoDriverInfo(0, info) )
|
||||||
if( !GetVideoDriverInfo(i, info) )
|
RageException::Throw( "GetVideoDriverInfo(0) failed");
|
||||||
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)
|
return info.sDescription;
|
||||||
return;
|
|
||||||
|
|
||||||
if( info.sDescription == sPrimaryDeviceName )
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user