Merge pull request #578 from Azaezel/alpha40/dedicatedGFXnullouts

dedicated gfx device suppression
This commit is contained in:
Brian Roberts 2021-09-19 01:57:22 -05:00 committed by GitHub
commit 2fe767f2cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 12 deletions

View file

@ -290,7 +290,7 @@ GFXAdapter *GFXInit::getBestAdapterChoice()
{ {
S32 adapterIdx = dAtoi(adapterDevice.c_str()); S32 adapterIdx = dAtoi(adapterDevice.c_str());
if (adapterIdx == -1) if (adapterIdx == -1)
adapter = chooseAdapter(adapterType, outputDevice.c_str()); adapter = chooseAdapter(NullDevice, outputDevice.c_str());
else else
adapter = chooseAdapter(adapterType, adapterIdx); adapter = chooseAdapter(adapterType, adapterIdx);
} }

View file

@ -258,17 +258,19 @@ bool GuiCanvas::onAdd()
// Make sure we're able to render. // Make sure we're able to render.
newDevice->setAllowRender( true ); newDevice->setAllowRender( true );
if(mDisplayWindow) // NULL device returns a nullptr for getPlatformWindow
PlatformWindow* window = getPlatformWindow();
if (mDisplayWindow && window)
{ {
getPlatformWindow()->show(); window->show();
WindowManager->setDisplayWindow(true); WindowManager->setDisplayWindow(true);
getPlatformWindow()->setDisplayWindow(true); window->setDisplayWindow(true);
} }
else else if (window)
{ {
getPlatformWindow()->hide(); window->hide();
WindowManager->setDisplayWindow(false); WindowManager->setDisplayWindow(false);
getPlatformWindow()->setDisplayWindow(false); window->setDisplayWindow(false);
} }
// Propagate add to parents. // Propagate add to parents.

View file

@ -1,10 +1,6 @@
$Core::windowIcon = "data/icon.png"; $Core::windowIcon = "data/icon.png";
$Core::splashWindowImage = "data/splash.png"; $Core::splashWindowImage = "data/splash.png";
// Display a splash window immediately to improve app responsiveness before
// engine is initialized and main window created.
displaySplashWindow($Core::splashWindowImage);
// Console does something. // Console does something.
setLogMode(6); setLogMode(6);
@ -20,6 +16,13 @@ ModuleDatabase.setModuleExtension("module");
ModuleDatabase.scanModules( "core", false ); ModuleDatabase.scanModules( "core", false );
ModuleDatabase.LoadExplicit( "CoreModule" ); ModuleDatabase.LoadExplicit( "CoreModule" );
// Display a splash window immediately to improve app responsiveness before
// engine is initialized and main window created.
if ($Server::Dedicated == false)
displaySplashWindow($Core::splashWindowImage);
else
$Video::forceDisplayAdapter = -1;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Load any gameplay modules // Load any gameplay modules
ModuleDatabase.scanModules( "data", false ); ModuleDatabase.scanModules( "data", false );
@ -42,6 +45,7 @@ else
} }
} }
closeSplashWindow(); if ($Server::Dedicated == false)
closeSplashWindow();
echo("Engine initialized..."); echo("Engine initialized...");