Browse Source

We only support DirectX 9...

If you have less than 11MB VRAM or need to use the ref implementation,
then you are using a dinosaur and have no business even attempting to play
this game.
Adam Johnson 11 years ago
parent
commit
a30a326d17
  1. 25
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 3
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp
  3. 28
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp
  4. 12
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h

25
Sources/Plasma/Apps/plClient/plClient.cpp

@ -2237,9 +2237,6 @@ void plClient::IDetectAudioVideoSettings()
bool pixelshaders = rec->GetCap(hsG3DDeviceSelector::kCapsPixelShader); bool pixelshaders = rec->GetCap(hsG3DDeviceSelector::kCapsPixelShader);
int psMajor = 0, psMinor = 0; int psMajor = 0, psMinor = 0;
rec->GetPixelShaderVersion(psMajor, psMinor); rec->GetPixelShaderVersion(psMajor, psMinor);
bool refDevice = false;
if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DRefDev)
refDevice = true;
plPipeline::fDefaultPipeParams.ColorDepth = hsG3DDeviceSelector::kDefaultDepth; plPipeline::fDefaultPipeParams.ColorDepth = hsG3DDeviceSelector::kDefaultDepth;
#if defined(HS_DEBUGGING) || defined(DEBUG) #if defined(HS_DEBUGGING) || defined(DEBUG)
@ -2266,17 +2263,10 @@ void plClient::IDetectAudioVideoSettings()
plPipeline::fDefaultPipeParams.Shadows = 1; plPipeline::fDefaultPipeParams.Shadows = 1;
// enable planar reflections if pixelshaders are available // enable planar reflections if pixelshaders are available
if(pixelshaders && !refDevice)
{
plPipeline::fDefaultPipeParams.PlanarReflections = 1; plPipeline::fDefaultPipeParams.PlanarReflections = 1;
}
else
{
plPipeline::fDefaultPipeParams.PlanarReflections = 0;
}
// enable 2x antialiasing and anisotropic to 2 samples if pixelshader version is greater that 2.0 // enable 2x antialiasing and anisotropic to 2 samples if pixelshader version is greater that 2.0
if(psMajor >= 2 && !refDevice) if(psMajor >= 2)
{ {
plPipeline::fDefaultPipeParams.AntiAliasingAmount = rec->GetMaxAnisotropicSamples() ? 2 : 0; plPipeline::fDefaultPipeParams.AntiAliasingAmount = rec->GetMaxAnisotropicSamples() ? 2 : 0;
plPipeline::fDefaultPipeParams.AnisotropicLevel = mode->GetNumFSAATypes() ? 2 : 0; plPipeline::fDefaultPipeParams.AnisotropicLevel = mode->GetNumFSAATypes() ? 2 : 0;
@ -2287,17 +2277,8 @@ void plClient::IDetectAudioVideoSettings()
plPipeline::fDefaultPipeParams.AnisotropicLevel = 0; plPipeline::fDefaultPipeParams.AnisotropicLevel = 0;
} }
if(refDevice) plPipeline::fDefaultPipeParams.TextureQuality = psMajor >= 2 ? 2 : 1;
{ plPipeline::fDefaultPipeParams.VideoQuality = pixelshaders ? 2 : 1;
plPipeline::fDefaultPipeParams.TextureQuality = 0;
plPipeline::fDefaultPipeParams.VideoQuality = 0;
}
else
{
plPipeline::fDefaultPipeParams.TextureQuality = psMajor >= 2 ? 2 : 1;
plPipeline::fDefaultPipeParams.VideoQuality = pixelshaders ? 2 : 1;
}
plPipeline::fDefaultPipeParams.VSync = false; plPipeline::fDefaultPipeParams.VSync = false;
// card specific overrides // card specific overrides

3
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp

@ -100,9 +100,6 @@ HRESULT hsGDirect3DTnLEnumerate::SelectFromDevMode(const hsG3DDeviceRecord* devR
if( !colorDepth ) if( !colorDepth )
enumFlags |= D3DENUM_CANWINDOW; enumFlags |= D3DENUM_CANWINDOW;
enumFlags |= D3DENUM_TNLHAL; enumFlags |= D3DENUM_TNLHAL;
#ifdef HS_ALLOW_D3D_REF_DRIVER
enumFlags |= D3DENUM_REFERENCERAST;
#endif
D3DEnum_SelectDefaultDriver(enumFlags); D3DEnum_SelectDefaultDriver(enumFlags);

28
Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp

@ -574,23 +574,11 @@ void hsG3DDeviceSelector::RemoveUnusableDevModes(bool bTough)
// Remove software Direct3D devices // Remove software Direct3D devices
if ((fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DHALDev) && if ((fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DHALDev) &&
(fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DTnLHalDev) (fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DTnLHalDev))
#ifdef HS_ALLOW_D3D_REF_DRIVER
&& (fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DRefDev)
#endif
)
{ {
plDemoDebugFile::Write( " Removing software Direct3D device. Description", (char *)fRecords[ i ].GetDriverDesc() ); plDemoDebugFile::Write( " Removing software Direct3D device. Description", (char *)fRecords[ i ].GetDriverDesc() );
fRecords[i].SetDiscarded(true); fRecords[i].SetDiscarded(true);
} }
// Remove Direct3D devices with less than 11 megs of RAM
else if (bTough && ( totalMem = IAdjustDirectXMemory( fRecords[i].GetMemoryBytes() ) ) < 11*1024*1024 )
{
plString log = plString::Format(" Removing Direct3D device with < 11MB RAM. Device RAM (in kB): %d (Description: %s)",
totalMem / 1024, fRecords[ i ].GetDriverDesc() );
plDemoDebugFile::Write( log.c_str() );
fRecords[i].SetDiscarded(true);
}
else else
{ {
if( fRecords[i].GetG3DDeviceType() == hsG3DDeviceSelector::kDevTypeDirect3DTnL ) if( fRecords[i].GetG3DDeviceType() == hsG3DDeviceSelector::kDevTypeDirect3DTnL )
@ -663,10 +651,6 @@ void hsG3DDeviceSelector::Enumerate(hsWinRef winRef)
#endif #endif
/// Now try our devices /// Now try our devices
#ifdef HS_SELECT_DX7
ITryDirect3D(winRef);
#endif // HS_SELECT_DX7
ITryDirect3DTnL(winRef); ITryDirect3DTnL(winRef);
// ITryOpenGL(winRef); // ITryOpenGL(winRef);
@ -1478,16 +1462,6 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record,
hsAssert( false, "Trying to fudge D3D device but D3D support isn't in this EXE!" ); hsAssert( false, "Trying to fudge D3D device but D3D support isn't in this EXE!" );
} }
} }
#ifdef HS_SELECT_DX7
else if( record.GetG3DDeviceType() == kDevTypeDirect3D )
{
if( !IGetD3D7CardInfo( record, driverInfo, deviceInfo, &vendorID, &deviceID, &szDriver, &szDesc ) )
{
// {} to make VC6 happy in release build
hsAssert( false, "Trying to fudge D3D7 device but D3D7 support isn't in this EXE!" );
}
}
#endif // HS_SELECT_DX7
else else
{ {
hsAssert( false, "IFudgeDirectXDevice got a device type that support wasn't compiled for!" ); hsAssert( false, "IFudgeDirectXDevice got a device type that support wasn't compiled for!" );

12
Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h

@ -69,9 +69,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define DYNAHEADER 1 #define DYNAHEADER 1
#endif // HS_BUILD_FOR_WIN32 #endif // HS_BUILD_FOR_WIN32
/// #define the following to allow selection of the D3D reference driver
#define HS_ALLOW_D3D_REF_DRIVER 1
class hsStream; class hsStream;
struct D3DEnum_DeviceInfo; struct D3DEnum_DeviceInfo;
@ -384,21 +381,12 @@ protected:
void ITryDirect3DTnL(hsWinRef winRef); void ITryDirect3DTnL(hsWinRef winRef);
bool IInitDirect3D( void ); bool IInitDirect3D( void );
#ifdef HS_SELECT_DX7
void ITryDirect3DDevice(D3DEnum_DeviceInfo* devInfo, hsG3DDeviceRecord& srcDevRec);
void ITryDirect3DDriver(D3DEnum_DriverInfo* drivInfo);
void ITryDirect3D(hsWinRef winRef);
#endif // HS_SELECT_DX7
void IFudgeDirectXDevice( hsG3DDeviceRecord &record, void IFudgeDirectXDevice( hsG3DDeviceRecord &record,
D3DEnum_DriverInfo *driverInfo, D3DEnum_DeviceInfo *deviceInfo ); D3DEnum_DriverInfo *driverInfo, D3DEnum_DeviceInfo *deviceInfo );
uint32_t IAdjustDirectXMemory( uint32_t cardMem ); uint32_t IAdjustDirectXMemory( uint32_t cardMem );
bool IGetD3DCardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo, bool IGetD3DCardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo,
uint32_t *vendorID, uint32_t *deviceID, char **driverString, char **descString ); uint32_t *vendorID, uint32_t *deviceID, char **driverString, char **descString );
#ifdef HS_SELECT_DX7
bool IGetD3D7CardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo,
uint32_t *vendorID, uint32_t *deviceID, char **driverString, char **descString );
#endif // HS_SELECT_DX7
void ITryOpenGL( hsWinRef winRef ); void ITryOpenGL( hsWinRef winRef );
void IGetExtOpenGLInfo( hsG3DDeviceRecord &devRec ); void IGetExtOpenGLInfo( hsG3DDeviceRecord &devRec );

Loading…
Cancel
Save