mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 03:09:13 +00:00
Lots of cleanups to hsG3DeviceDelector
This commit is contained in:
@ -2070,78 +2070,6 @@ void plClient::IAddRenderRequest(plRenderRequest* req)
|
||||
}
|
||||
}
|
||||
|
||||
hsG3DDeviceModeRecord plClient::ILoadDevMode(const char* devModeFile)
|
||||
{
|
||||
hsStatusMessage("Load DevMode client\n");
|
||||
HWND hWnd = fWindowHndl;
|
||||
|
||||
hsUNIXStream stream;
|
||||
bool 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_t performance = stream.ReadLE16();
|
||||
|
||||
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.WriteLE16((uint16_t)(0*100));
|
||||
stream.Close();
|
||||
}
|
||||
|
||||
}
|
||||
return dmr;
|
||||
}
|
||||
|
||||
void plClient::ResetDisplayDevice(int Width, int Height, int ColorDepth, bool Windowed, int NumAASamples, int MaxAnisotropicSamples, bool VSync)
|
||||
{
|
||||
if(!fPipeline) return;
|
||||
|
@ -135,8 +135,6 @@ protected:
|
||||
|
||||
pfGameGUIMgr *fGameGUIMgr;
|
||||
|
||||
virtual hsG3DDeviceModeRecord ILoadDevMode(const char* devModeFile);
|
||||
|
||||
bool IUpdate();
|
||||
bool IDraw();
|
||||
bool IDrawProgress();
|
||||
|
Reference in New Issue
Block a user