Added detection of buggy Voodoo3 drivers, then found a hack that fixes the problems. Sigh...

This commit is contained in:
Chris Danford
2003-02-20 10:41:43 +00:00
parent 6796e39be7
commit 32cdbed7bf
6 changed files with 126 additions and 34 deletions
+3
View File
@@ -256,6 +256,9 @@ If you experience any visual errors, please visit your video card manufacturer's
web site and download the latest Direct3D 8.1 drivers. Below is a list of known
issues that are thought to be video card driver bugs:<br>
<br>
* <a name="Voodoo3">Voodoo 3</a><br>
Blah<br>
<br>
* S3 Savage family cards (e.g. Diamond Stealth)<br>
Symptom: The right edge of some graphics appears &quot;cut off&quot;.<br>
Explanation: Drivers do not properly handle textures &gt;= 512x512, resulting in
+7 -3
View File
@@ -143,9 +143,13 @@ void Actor::BeginDraw() // set the world matrix and calculate actor properties
DISPLAY->Translate( m_temp.pos.x, m_temp.pos.y, m_temp.pos.z );
DISPLAY->Scale( m_temp.scale.x, m_temp.scale.y, m_temp.scale.z );
if( m_temp.rotation.x != 0 ) DISPLAY->RotateX( m_temp.rotation.x );
if( m_temp.rotation.y != 0 ) DISPLAY->RotateY( m_temp.rotation.y );
if( m_temp.rotation.z != 0 ) DISPLAY->RotateZ( m_temp.rotation.z );
if( m_temp.rotation.x != 0 )
DISPLAY->RotateX( m_temp.rotation.x );
if( m_temp.rotation.y != 0 )
DISPLAY->RotateY( m_temp.rotation.y );
if( m_temp.rotation.z != 0 )
DISPLAY->RotateZ( m_temp.rotation.z );
}
void Actor::EndDraw()
+4
View File
@@ -284,6 +284,8 @@ void Player::DrawPrimitives()
DISPLAY->LookAt(Eye, At, Up);
}
else
DISPLAY->PushMatrix();
m_GrayArrowRow.Draw();
m_NoteField.Draw();
@@ -294,6 +296,8 @@ void Player::DrawPrimitives()
DISPLAY->ExitPerspective();
DISPLAY->PopMatrix();
}
else
DISPLAY->PopMatrix();
m_Judgment.Draw();
+4 -1
View File
@@ -780,7 +780,10 @@ void RageDisplay::RotateY( float r )
void RageDisplay::RotateZ( float r )
{
glRotatef(r* 180/PI, 0, 0, 1);
// HACK: Rotation about (0,0,1) seems to be broken in many Voodoo3 drivers,
// but only while using orthographic projections. Strange...
// Adding a tiny X component fixes the problem. -Chris
glRotatef(r* 180/PI, 0.00001f, 0, 1);
}
void RageDisplay::smPostMultMatrixf( const RageMatrix &f )
+1 -1
View File
@@ -27,7 +27,7 @@ DSound::DSound()
HRESULT hr;
// Initialize COM
if( hr = CoInitialize( NULL ) )
if( FAILED( hr = CoInitialize( NULL ) ) )
RageException::ThrowNonfatal(hr_ssprintf(hr, "CoInitialize"));
// Create IDirectSound using the primary sound device
+107 -29
View File
@@ -2,56 +2,134 @@
#include "DebugInfoHunt.h"
#include "RageLog.h"
#include "RageUtil.h"
#include "../../archutils/Win32/GotoURL.h"
void PrintDebugInfoWin9x()
struct VideoDriverInfo
{
CString sProvider;
CString sDescription;
CString sVersion;
CString sDate;
CString sDeviceID;
};
CString GetRegValue( HKEY hKey, CString sName )
{
char szBuffer[MAX_PATH];
DWORD nSize = sizeof(szBuffer)-1;
if( RegQueryValueEx(hKey, sName, NULL, NULL, (LPBYTE)szBuffer, &nSize) == ERROR_SUCCESS )
return szBuffer;
else
return "";
}
bool GetDebugInfoWin9x( VideoDriverInfo& infoOut )
{
HKEY hkey;
if (RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\Class\\Display\\0000", &hkey) != ERROR_SUCCESS)
return;
return false;
char szBuffer[MAX_PATH];
DWORD nSize;
#define GETSZ2(a) nSize = sizeof(szBuffer)-1; if( RegQueryValueEx(hkey, a, NULL, NULL, (LPBYTE)szBuffer, &nSize) == ERROR_SUCCESS ) LOG->Info("%-15s:\t%s", a, szBuffer);
LOG->Info("Video Driver Information (win9x):");
GETSZ2("DriverDate");
GETSZ2("DriverDesc");
GETSZ2("MatchingDeviceId");
GETSZ2("ProviderName");
GETSZ2("Ver");
infoOut.sDate = GetRegValue( hkey, "DriverDate");
infoOut.sDescription = GetRegValue( hkey, "DriverDesc");
infoOut.sDeviceID = GetRegValue( hkey, "MatchingDeviceId");
infoOut.sProvider = GetRegValue( hkey, "ProviderName");
infoOut.sVersion = GetRegValue( hkey, "Ver");
RegCloseKey(hkey);
return true;
}
void PrintDebugInfoWinNT()
bool GetDebugInfoWinNT( VideoDriverInfo& infoOut )
{
HKEY hkey;
if (RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}\\0000", &hkey) != ERROR_SUCCESS)
return;
return false;
char szBuffer[MAX_PATH];
DWORD nSize;
#define GETSZ2(a) nSize = sizeof(szBuffer)-1; if( RegQueryValueEx(hkey, a, NULL, NULL, (LPBYTE)szBuffer, &nSize) == ERROR_SUCCESS ) LOG->Info("%-15s:\t%s", a, szBuffer);
LOG->Info("Video Driver Information (winnt):");
GETSZ2("DriverDate");
GETSZ2("DriverDesc");
GETSZ2("DriverVersion");
GETSZ2("InfSection");
GETSZ2("ProviderName");
GETSZ2("MatchingDeviceId");
infoOut.sDate = GetRegValue( hkey, "DriverDate");
infoOut.sDescription = GetRegValue( hkey, "DriverDesc");
infoOut.sDeviceID = GetRegValue( hkey, "MatchingDeviceId");
infoOut.sProvider = GetRegValue( hkey, "ProviderName");
infoOut.sVersion = GetRegValue( hkey, "DriverVersion");
RegCloseKey(hkey);
return true;
}
void HandleKnownTerribleDriver( VideoDriverInfo info )
{
struct ProblemAndBookmark
{
char szProblemProvider[1024];
char szProblemDescription[1024];
char szReadMeBookmark[64];
};
ProblemAndBookmark ENTRIES[] =
{
// Hacked around the bug in the V3 driver. -Chris
// {"3dfx Interactive, Inc. (Optimized by Amigamerlin)", "Voodoo3 PCI", "Voodoo3"},
{"blah", "blah", "Voodoo3"},
};
const int NUM_ENTRIES = sizeof(ENTRIES) / sizeof(ENTRIES[0]);
for( int i=0; i<NUM_ENTRIES; i++ )
{
if( info.sProvider == ENTRIES[i].szProblemProvider &&
info.sDescription == ENTRIES[i].szProblemDescription )
{
CString sQuestion = ssprintf(
"Video Driver Information:\n\n"
"Provider: %s\n"
"Description: %s\n"
"Version: %s\n"
"Date: %s\n"
"DeviceID: %s\n"
"\n"
"This video driver is known to have bugs that make StepMania unplayable.\n"
"Click OK to see information on where to find a newer driver.\n"
"Click Cancel to dismiss this warning and continue playing.",
info.sProvider.GetString(),
info.sDescription.GetString(),
info.sVersion.GetString(),
info.sDate.GetString(),
info.sDeviceID.GetString() );
if( IDOK == MessageBox(NULL, sQuestion, "Known problem driver", MB_ICONHAND|MB_OKCANCEL) )
{
char szBuffer[MAX_PATH];
GetCurrentDirectory( MAX_PATH, szBuffer );
GotoURL( ssprintf("%s/README-FIRST.html#%s", szBuffer, ENTRIES[i].szReadMeBookmark) );
exit(1); // Is there a better way to clean up? -Chris
}
else
return;
}
}
}
static void GetDisplayDriverDebugInfo()
{
PrintDebugInfoWin9x(); // will print nothing if not 9x
PrintDebugInfoWinNT(); // will print nothing if not NT
VideoDriverInfo info;
if( GetDebugInfoWin9x(info) )
goto got_debug_info;
if( GetDebugInfoWinNT(info) )
goto got_debug_info;
LOG->Warn( "Failed to get video card driver info." );
return;
got_debug_info:
LOG->Info("Video Driver Information:");
LOG->Info("%-15s:\t%s", "Provider", info.sProvider.GetString());
LOG->Info("%-15s:\t%s", "Description", info.sDescription.GetString());
LOG->Info("%-15s:\t%s", "Version", info.sVersion.GetString());
LOG->Info("%-15s:\t%s", "Date", info.sDate.GetString());
LOG->Info("%-15s:\t%s", "DeviceID", info.sDeviceID.GetString());
HandleKnownTerribleDriver( info );
}
static CString wo_ssprintf( MMRESULT err, const char *fmt, ...)