Пример #1
0
void CLocalGUI::Restore ( void )
{
    CGUI* pGUI = CCore::GetSingleton ().GetGUI ();

    if ( pGUI )
    {
        // Restore the GUI
        pGUI->Restore ();
    }
    else
    {
        WriteDebugEvent ( "WARNING: CLocalGUI::Restore() called, but CLocalGUI::CreateObjects() isn't!" );
    }
}
Пример #2
0
void CLocalGUI::Restore ( void )
{
    CGUI* pGUI = CCore::GetSingleton ().GetGUI ();

    if ( pGUI )
    {
        CFilePathTranslator     FileTranslator;
        string                  WorkingDirectory;
        char                    szCurDir [ 1024 ];

        // We must change the current directory here!
        // This is necessary because if we don't, CLocalGUI will try to load
        // files from the wrong path!

        // Set the current directory.
        FileTranslator.SetCurrentWorkingDirectory ( "MTA" );
        FileTranslator.GetCurrentWorkingDirectory ( WorkingDirectory );
        GetCurrentDirectory ( sizeof ( szCurDir ), szCurDir );
        SetCurrentDirectory ( WorkingDirectory.c_str ( ) );

        // Restore the GUI
        pGUI->Restore ();

	    // Restore our renderer.
        if ( m_pRendererLibrary )
        {
	        m_pRendererLibrary->OnRestoreDevice ( );
        }
        else
        {
            WriteDebugEvent ( "WARNING: CLocalGUI::Restore() called, but CLocalGUI::CreateObjects() isn't!" );
        }

        // Restore the current directory to default.
        SetCurrentDirectory ( szCurDir );
    }
    else
    {
        WriteDebugEvent ( "WARNING: CLocalGUI::Restore() called, but CLocalGUI::CreateObjects() isn't!" );
    }
}