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

@ -54,6 +54,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsConfig.h"
#include "hsWindows.h"
#include <functional>
#include <memory>
#include <ddraw.h>
#include <d3d9.h>
@ -61,7 +64,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsDXTDirectXCodec.h"
#include "plMipmap.h"
#include "hsCodecManager.h"
#include "../plPipeline/hsGDDrawDllLoad.h"
namespace {
typedef HRESULT(WINAPI * DIRECTDRAWCREATEEX)( GUID*, VOID**, REFIID, IUnknown* );
@ -138,26 +140,20 @@ hsBool hsDXTDirectXCodec::IInitialize()
{
fFlags |= kInitialized;
// if( hsGDDrawDllLoad::GetDDrawDll() == nil )
// return false;
DIRECTDRAWCREATEEX DirectDrawCreateEx = 0;
DIRECTDRAWCREATEEX DirectDrawCreateEx = nil;
// Initialize DirectDraw
HRESULT hr;
DirectDrawCreateEx = (DIRECTDRAWCREATEEX)GetProcAddress( hsGDDrawDllLoad::GetD3DDll(), "DirectDrawCreateEx" );
if( DirectDrawCreateEx == nil )
std::unique_ptr<HINSTANCE__, std::function<BOOL(HMODULE)>> ddraw(LoadLibraryA("ddraw.dll"), FreeLibrary);
DirectDrawCreateEx = (DIRECTDRAWCREATEEX)GetProcAddress(ddraw.get(), "DirectDrawCreateEx");
if (!DirectDrawCreateEx)
return false;
/// Using EMULATIONONLY here usually fails--using NULL forces the
/// use of the standard display driver, which DOES work.
if (FAILED(hr = DirectDrawCreateEx((GUID FAR *)NULL/*DDCREATE_EMULATIONONLY*/, (VOID**)&fDirectDraw, IID_IDirectDraw7, NULL)))
if (FAILED(DirectDrawCreateEx((GUID FAR *)NULL/*DDCREATE_EMULATIONONLY*/, (VOID**)&fDirectDraw, IID_IDirectDraw7, NULL)))
return false;
if (FAILED(hr = fDirectDraw->SetCooperativeLevel(NULL, DDSCL_NORMAL)))
return false;
return true;
return SUCCEEDED(fDirectDraw->SetCooperativeLevel(NULL, DDSCL_NORMAL));
}
//// CreateCompressedMipmap ///////////////////////////////////////////////////