From 346ad5bdaad625dca798354f109eb004e7df7b2a Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Sat, 16 Aug 2014 11:28:53 +1000 Subject: [PATCH] Finished up splash screen implementation. * Added stub methods for non-Windows platforms * Move canvas show to after tools have loaded * Fix a tab --- Engine/source/gui/core/guiCanvas.cpp | 2 +- Engine/source/platformMac/macCocoaPlatform.mm | 5 +++++ Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp | 1 + Templates/Empty/game/main.cs | 9 +++++++++ Templates/Empty/game/main.cs.in | 9 +++++++++ Templates/Empty/game/scripts/gui/startupGui.cs | 6 ------ Templates/Full/game/main.cs | 9 +++++++++ Templates/Full/game/main.cs.in | 9 +++++++++ Templates/Full/game/scripts/gui/startupGui.cs | 6 ------ 9 files changed, 43 insertions(+), 13 deletions(-) diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 1d5166fce..ad5646fe6 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -2716,6 +2716,6 @@ ConsoleMethod( GuiCanvas, hideWindow, void, 2, 2, "" ) return; object->getPlatformWindow()->hide(); - WindowManager->setDisplayWindow(false); + WindowManager->setDisplayWindow(false); object->getPlatformWindow()->setDisplayWindow(false); } \ No newline at end of file diff --git a/Engine/source/platformMac/macCocoaPlatform.mm b/Engine/source/platformMac/macCocoaPlatform.mm index 24b8808e9..286aa44e2 100644 --- a/Engine/source/platformMac/macCocoaPlatform.mm +++ b/Engine/source/platformMac/macCocoaPlatform.mm @@ -70,6 +70,11 @@ bool Platform::displaySplashWindow() return false; } +bool Platform::closeSplashWindow() +{ + return false; +} + #pragma mark ---- File IO ---- //----------------------------------------------------------------------------- bool dPathCopy(const char* source, const char* dest, bool nooverwrite) diff --git a/Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp b/Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp index 770fd0680..39948914b 100644 --- a/Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp +++ b/Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp @@ -93,6 +93,7 @@ void Platform::openFile(const char *path) { } // window bool Platform::displaySplashWindow(String path) { return false; } +bool Platform::closeSplashWindow() { return false; } // font PlatformFont *createPlatformFont(const char *name, U32 size, U32 charset) { return NULL; } diff --git a/Templates/Empty/game/main.cs b/Templates/Empty/game/main.cs index 512c0cc4e..5d26b7fca 100644 --- a/Templates/Empty/game/main.cs +++ b/Templates/Empty/game/main.cs @@ -249,6 +249,15 @@ if ($displayHelp) { else { onStart(); echo("Engine initialized..."); + + if( !$isDedicated ) + { + // As we know at this point that the initial load is complete, + // we can hide any splash screen we have, and show the canvas. + // This keeps things looking nice, instead of having a blank window + closeSplashWindow(); + Canvas.showWindow(); + } // Auto-load on the 360 if( $platform $= "xenon" ) diff --git a/Templates/Empty/game/main.cs.in b/Templates/Empty/game/main.cs.in index db8436e7d..dbabc4a2f 100644 --- a/Templates/Empty/game/main.cs.in +++ b/Templates/Empty/game/main.cs.in @@ -246,6 +246,15 @@ if ($displayHelp) { else { onStart(); echo("Engine initialized..."); + + if( !$isDedicated ) + { + // As we know at this point that the initial load is complete, + // we can hide any splash screen we have, and show the canvas. + // This keeps things looking nice, instead of having a blank window + closeSplashWindow(); + Canvas.showWindow(); + } // Auto-load on the 360 if( $platform $= "xenon" ) diff --git a/Templates/Empty/game/scripts/gui/startupGui.cs b/Templates/Empty/game/scripts/gui/startupGui.cs index d0226a9bf..675daeafa 100644 --- a/Templates/Empty/game/scripts/gui/startupGui.cs +++ b/Templates/Empty/game/scripts/gui/startupGui.cs @@ -29,12 +29,6 @@ function loadStartup() // The index of the current splash screen $StartupIdx = 0; - // As we know at this point that the initial load is complete, - // we can hide any splash screen we have, and show the canvas. - // This keeps things looking nice, instead of having a blank window - closeSplashWindow(); - Canvas.showWindow(); - // A list of the splash screens and logos // to cycle through. Note that they have to // be in consecutive numerical order diff --git a/Templates/Full/game/main.cs b/Templates/Full/game/main.cs index d8fc36dbc..96794899a 100644 --- a/Templates/Full/game/main.cs +++ b/Templates/Full/game/main.cs @@ -249,6 +249,15 @@ if ($displayHelp) { else { onStart(); echo("Engine initialized..."); + + if( !$isDedicated ) + { + // As we know at this point that the initial load is complete, + // we can hide any splash screen we have, and show the canvas. + // This keeps things looking nice, instead of having a blank window + closeSplashWindow(); + Canvas.showWindow(); + } // Auto-load on the 360 if( $platform $= "xenon" ) diff --git a/Templates/Full/game/main.cs.in b/Templates/Full/game/main.cs.in index db8436e7d..dbabc4a2f 100644 --- a/Templates/Full/game/main.cs.in +++ b/Templates/Full/game/main.cs.in @@ -246,6 +246,15 @@ if ($displayHelp) { else { onStart(); echo("Engine initialized..."); + + if( !$isDedicated ) + { + // As we know at this point that the initial load is complete, + // we can hide any splash screen we have, and show the canvas. + // This keeps things looking nice, instead of having a blank window + closeSplashWindow(); + Canvas.showWindow(); + } // Auto-load on the 360 if( $platform $= "xenon" ) diff --git a/Templates/Full/game/scripts/gui/startupGui.cs b/Templates/Full/game/scripts/gui/startupGui.cs index d0226a9bf..675daeafa 100644 --- a/Templates/Full/game/scripts/gui/startupGui.cs +++ b/Templates/Full/game/scripts/gui/startupGui.cs @@ -29,12 +29,6 @@ function loadStartup() // The index of the current splash screen $StartupIdx = 0; - // As we know at this point that the initial load is complete, - // we can hide any splash screen we have, and show the canvas. - // This keeps things looking nice, instead of having a blank window - closeSplashWindow(); - Canvas.showWindow(); - // A list of the splash screens and logos // to cycle through. Note that they have to // be in consecutive numerical order