Never refuse to run due to a missing LoadingWindow; just log an error and fall back...
authorMarc Cannon <vyhdycokio@gmail.com>
Fri, 28 Dec 2012 23:56:41 +0000 (23:56 +0000)
committerMarc Cannon <vyhdycokio@gmail.com>
Sun, 30 Dec 2012 02:20:33 +0000 (02:20 +0000)
src/StepMania.cpp
src/arch/LoadingWindow/LoadingWindow.cpp

index cc862f3..6bf117e 100755 (executable)
@@ -1100,13 +1100,11 @@ int main(int argc, char* argv[])
        LUA                     = new LuaManager;
        GAMESTATE       = new GameState;
 
-       /* This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow. */
+       /* This requires PREFSMAN, for g_bShowLoadingWindow. */
        LoadingWindow *loading_window = LoadingWindow::Create();
-       if( loading_window == NULL )
-               RageException::Throw( "Couldn't open any loading windows." );
 
-       srand( time(NULL) );    // seed number generator        
-       
+       srand( time(NULL) );    // seed number generator
+
        /* Do this early, so we have debugging output if anything else fails.  LOG and
         * Dialog must be set up first.  It shouldn't take long, but it might take a
         * little time; do this after the LoadingWindow is shown, since we don't want
index c4cedc4..2e8c034 100755 (executable)
@@ -1,5 +1,6 @@
 #include "global.h"\r
 #include "LoadingWindow.h"\r
+#include "LoadingWindow_Null.h" // fallback\r
 #include "Preference.h"\r
 #include "RageLog.h"\r
 #include "arch/arch_default.h"\r
@@ -15,11 +16,6 @@ LoadingWindow *LoadingWindow::Create()
        if( !g_bShowLoadingWindow )\r
                return new LoadingWindow_Null;\r
 \r
-#if defined(UNIX) && !defined(HAVE_GTK)\r
-       return new LoadingWindow_Null;\r
-#endif\r
-\r
-       /* don't load Null by default. */\r
        const CString drivers = "xbox,win32,cocoa,gtk,sdl";\r
        vector<CString> DriversToTry;\r
        split( drivers, ",", DriversToTry, true );\r
@@ -47,9 +43,13 @@ LoadingWindow *LoadingWindow::Create()
        }\r
 \r
        if( ret )\r
+       {\r
                LOG->Info( "Loading window: %s", Driver.c_str() );\r
+               return ret;\r
+       }\r
 \r
-       return ret;\r
+       LOG->Warn( "Couldn't open any loading windows." );\r
+       return new LoadingWindow_Null;\r
 }\r
 \r
 /*\r