Several renderer fixes for 3dfx hardware:

- Try to determine which 3dfx card we are using
- Use GL_CLAMP for 3dfx instead, fixes dynamic lights/skyboxes/etc. (GL_CLAMP_TO_EDGE becomes GL_REPEAT on older 3dfx drivers)
- Support for 3dfx gamma control and overbrights restored
- Indexed w/ alpha color is now forced GL_RGBA on Voodoo Graphics (v1)
- attempt at silencing the 3dfx splash
This commit is contained in:
leilei-
2016-05-31 04:34:45 -04:00
parent 601a5ec701
commit ea9bdc0a68
8 changed files with 161 additions and 7 deletions

View File

@@ -29,6 +29,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../renderercommon/tr_common.h"
#include "../qcommon/qcommon.h"
#ifdef _WIN32
// leilei - 3dfx gamma fix
BOOL ( WINAPI * qwglGetDeviceGammaRamp3DFX)( HDC, LPVOID );
BOOL ( WINAPI * qwglSetDeviceGammaRamp3DFX)( HDC, LPVOID );
#endif
/*
=================
GLimp_SetGamma
@@ -86,6 +91,19 @@ void GLimp_SetGamma( unsigned char red[256], unsigned char green[256], unsigned
}
}
// leilei - 3dfx gamma support
#ifdef _WIN32
if ( qwglSetDeviceGammaRamp3DFX )
{
HDC hDC;// = GetDC( hWnd );
hDC = GetDC( GetForegroundWindow() );
qwglSetDeviceGammaRamp3DFX( hDC, table );
ReleaseDC( GetForegroundWindow(), hDC );
}
else
#endif
{
SDL_SetGammaRamp(table[0], table[1], table[2]);
}
}

View File

@@ -845,6 +845,15 @@ success:
// http://bugzilla.icculus.org/show_bug.cgi?id=4316
glConfig.deviceSupportsGamma = SDL_SetGamma( 1.0f, 1.0f, 1.0f ) >= 0;
#ifdef _WIN32
// leilei - 3dfx gamma
if ( qwglSetDeviceGammaRamp3DFX )
{
glConfig.deviceSupportsGamma = 1; // force it
}
#endif
if ( -1 == r_ignorehwgamma->integer)
glConfig.deviceSupportsGamma = 1;