2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Graphics cleanup for old graphics card tunables.

c.f. H'uru commits:

>    commit e4e718e243
>    Author: Adam Johnson <AdamJohnso@gmail.com>
>    Date:   Fri Feb 1 17:19:50 2013 -0500
>
>        Bypass ATI Generic fudging with Radeon HD cards

>    commit bbae6a76d7
>    Author: Adam Johnson <AdamJohnso@gmail.com>
>    Date:   Sat Nov 30 20:02:08 2013 -0500
>
>        We don't support 3dfx cards...
>
>        Come on, man... They made some good cards, but they went out of business
>        in 1999! Ain't nobody got time fo' dat.

>    commit a30a326d17
>    Author: Adam Johnson <AdamJohnso@gmail.com>
>    Date:   Sat Nov 30 20:06:19 2013 -0500
>
>        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.

>    commit 544abef39e
>    Author: Adam Johnson <AdamJohnso@gmail.com>
>    Date:   Sat Nov 30 20:41:56 2013 -0500
>
>        Wow, those cards are old...
>
>        Remove detection for cards that are don't support at LEAST DirectX 8.
>        There's no way they would even be able to get past Direct3DCreate9, so we
>        shouldn't need to worry about them... I hope.

>    commit 9070d70e50
>    Author: Branan Purvine-Riley <branan@gmail.com>
>    Date:   Sat Jul 27 14:50:20 2013 -0700
>
>        Lots of cleanups to hsG3DeviceDelector

>    commit ac23835384
>    Author: Branan Purvine-Riley <branan@gmail.com>
>    Date:   Sat Jul 27 15:09:24 2013 -0700
>
>        Get rid of obsolete readers/writes for device info

>    commit fc67738ee8
>    Author: Branan Purvine-Riley <branan@gmail.com>
>    Date:   Sat Jul 27 15:50:10 2013 -0700
>
>        Remove some obviously obsolete caps

>    commit 60c544e1ff
>    Author: Adam Johnson <AdamJohnso@gmail.com>
>    Date:   Fri Nov 29 23:42:20 2013 -0500
>
>        Don't lazy-load D3D9.dll
>
>        We already link against it, so that's just a waste of time. Also, cleanup
>        some unneeded ddraw includes. Remember that in Direct3D9, all devices can
>        render in windowed mode.

(cherry picked from commit 95ab8161f0)
This commit is contained in:
rarified
2021-11-17 09:22:40 -07:00
parent 2160831221
commit 916bf4f87f
14 changed files with 88 additions and 1840 deletions

View File

@ -2129,78 +2129,6 @@ void plClient::IAddRenderRequest(plRenderRequest* req)
}
}
hsG3DDeviceModeRecord plClient::ILoadDevMode(const char* devModeFile)
{
hsStatusMessage("Load DevMode client\n");
HWND hWnd = fWindowHndl;
hsUNIXStream stream;
hsBool gottaCreate = false;
// If DevModeFind is specified, use the old method
// if ((GetGameFlags() & kDevModeFind))
// FindAndSaveDevMode(hWnd, devModeFile);
// Otherwise, use the new method
hsG3DDeviceModeRecord dmr;
if (stream.Open(devModeFile, "rb"))
{
/// It's there, but is the device record valid?
hsG3DDeviceRecord selRec;
hsG3DDeviceMode selMode;
selRec.Read(&stream);
if( selRec.IsInvalid() )
{
hsStatusMessage( "WARNING: Old DeviceRecord found on file. Setting defaults..." );
gottaCreate = true;
}
else
{
/// Read the rest in
selMode.Read(&stream);
UInt16 performance = stream.ReadSwap16();
if( performance < 25 )
plBitmap::SetGlobalLevelChopCount( 2 );
else if( performance < 75 )
plBitmap::SetGlobalLevelChopCount( 1 );
else
plBitmap::SetGlobalLevelChopCount( 0 );
}
stream.Close();
dmr = hsG3DDeviceModeRecord(selRec, selMode);
}
else
gottaCreate = true;
if( gottaCreate )
{
hsG3DDeviceSelector devSel;
devSel.Enumerate(hWnd);
devSel.RemoveUnusableDevModes(true);
if (!devSel.GetDefault(&dmr))
{
//hsAssert(0, "plGame::LoadDevMode - No acceptable hardware found");
hsMessageBox("No suitable rendering devices found.","realMYST",hsMessageBoxNormal);
return dmr;
}
if (stream.Open(devModeFile, "wb"))
{
dmr.GetDevice()->Write(&stream);
dmr.GetMode()->Write(&stream);
stream.WriteSwap16((UInt16)(0*100));
stream.Close();
}
}
return dmr;
}
void plClient::ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool Windowed, int NumAASamples, int MaxAnisotropicSamples, hsBool VSync)
{
if(!fPipeline) return;
@ -2296,9 +2224,6 @@ void plClient::IDetectAudioVideoSettings()
hsBool pixelshaders = rec->GetCap(hsG3DDeviceSelector::kCapsPixelShader);
int psMajor = 0, psMinor = 0;
rec->GetPixelShaderVersion(psMajor, psMinor);
hsBool refDevice = false;
if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DRefDev)
refDevice = true;
plPipeline::fDefaultPipeParams.ColorDepth = hsG3DDeviceSelector::kDefaultDepth;
#if defined(HS_DEBUGGING) || defined(DEBUG)
@ -2325,17 +2250,10 @@ void plClient::IDetectAudioVideoSettings()
plPipeline::fDefaultPipeParams.Shadows = 1;
// enable planar reflections if pixelshaders are available
if(pixelshaders && !refDevice)
{
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
if(psMajor >= 2 && !refDevice)
if(psMajor >= 2)
{
plPipeline::fDefaultPipeParams.AntiAliasingAmount = rec->GetMaxAnisotropicSamples() ? 2 : 0;
plPipeline::fDefaultPipeParams.AnisotropicLevel = mode->GetNumFSAATypes() ? 2 : 0;
@ -2346,26 +2264,10 @@ void plClient::IDetectAudioVideoSettings()
plPipeline::fDefaultPipeParams.AnisotropicLevel = 0;
}
if(refDevice)
{
plPipeline::fDefaultPipeParams.TextureQuality = 0;
plPipeline::fDefaultPipeParams.VideoQuality = 0;
}
else
{
plPipeline::fDefaultPipeParams.TextureQuality = psMajor >= 2 ? 2 : 1;
plPipeline::fDefaultPipeParams.VideoQuality = pixelshaders ? 2 : 1;
}
plPipeline::fDefaultPipeParams.TextureQuality = psMajor >= 2 ? 2 : 1;
plPipeline::fDefaultPipeParams.VideoQuality = pixelshaders ? 2 : 1;
plPipeline::fDefaultPipeParams.VSync = false;
// card specific overrides
if(strstr(rec->GetDriverDesc(), "FX 5200"))
{
plPipeline::fDefaultPipeParams.AntiAliasingAmount = 0;
}
int val = 0;
hsStream *stream = nil;
hsUNIXStream s;

View File

@ -135,8 +135,6 @@ protected:
pfGameGUIMgr *fGameGUIMgr;
virtual hsG3DDeviceModeRecord ILoadDevMode(const char* devModeFile);
hsBool IUpdate();
hsBool IDraw();
hsBool IDrawProgress();