예제 #1
0
void CCommandFuncs::Window ( const char* szParameters )
{
#if 0
    // Make sure no mod is loaded
    if ( !CCore::GetSingleton ().GetModManager ()->IsLoaded () )
    {
        CGameSettings * gameSettings = CCore::GetSingleton ( ).GetGame ( )->GetSettings();
        unsigned int currentMode = gameSettings->GetCurrentVideoMode();

        if ( currentMode == 0 )
        {
            GetVideoModeManager ()->ChangeVideoMode ( VIDEO_MODE_FULLSCREEN );
            g_pCore->GetLocalGUI()->GetMainMenu ()->RefreshPositions();
        }
        else
        {
            // Run "vid 0"
            Vid ( "0" );
        }
    }
    else
    {
        g_pCore->GetConsole ()->Echo ( "window: Please disconnect first" );
    }
#endif
}
예제 #2
0
void CCommandFuncs::Vid(const char* szParameters)
{
#if 0
    // ripped from the renderware sdk
    CGameSettings * gameSettings = CCore::GetSingleton ( ).GetGame ( )->GetSettings();

    if ( strlen(szParameters) == 0 )
    {
        VideoMode           vidModemInfo;
        int                 vidMode, numVidModes, currentVidMode;

        numVidModes = gameSettings->GetNumVideoModes();
        currentVidMode = gameSettings->GetCurrentVideoMode();
        // Add the available video modes to the dialog
        for (vidMode = 0; vidMode < numVidModes; vidMode++)
        {
            gameSettings->GetVideoModeInfo(&vidModemInfo, vidMode);

            SString strMode ( "%d: %lu x %lu x %lu %s %s",
                    vidMode, vidModemInfo.width, vidModemInfo.height,
                    vidModemInfo.depth,
                    vidModemInfo.flags & rwVIDEOMODEEXCLUSIVE ?
                    "(Fullscreen)" : "",
                    currentVidMode == vidMode ? "(Current)" : "" );

            CCore::GetSingleton ().GetConsole ()->Printf ( strMode );
        }
        CCore::GetSingleton ().GetConsole ()->Printf( "* Syntax: vid <mode>" );
    }
    else
    {
        // Make sure no mod is loaded
        if ( !CCore::GetSingleton ().GetModManager ()->IsLoaded () )
        {
            // Grab the device window and what mode to switch to
            int iParameter = atoi ( szParameters );

            // Change the video mode
            GetVideoModeManager ()->ChangeVideoMode ( iParameter );

            // Grab viewport settings
            int iViewportX = CCore::GetSingleton ().GetGraphics()->GetViewportWidth ();
            int iViewportY = CCore::GetSingleton ().GetGraphics()->GetViewportHeight ();

            // Re-create all CGUI windows, for correct absolute sizes that depend on the (new) screen resolution
            CCore::GetSingleton ().GetLocalGUI ()->DestroyWindows ();
            CCore::GetSingleton ().GetGUI ()->SetResolution ( (float) iViewportX, (float) iViewportY );
            CCore::GetSingleton ().GetLocalGUI ()->CreateWindows ();

            // Reload console, serverbrowser and chat settings (removed in DestroyWindows)
            g_pCore->ApplyConsoleSettings ();
            g_pCore->ApplyMenuSettings ();
        }
        else
        {
            g_pCore->GetConsole ()->Echo ( "vid: Please disconnect before changing video mode" );
        }
    }
#endif
}
예제 #3
0
///////////////////////////////////////////////////////////////
//
// CVideoModeManager::LoadCVars
//
// Loads to current
//
///////////////////////////////////////////////////////////////
void CVideoModeManager::LoadCVars ( void )
{
    // Upgrade display_alttab_handler
    bool bAltTabHandlerWasEnabled = CVARS_GET_VALUE < bool > ( "display_alttab_handler" );
    int iFullscreenStyle = CVARS_GET_VALUE < int > ( "display_fullscreen_style" );
    if ( bAltTabHandlerWasEnabled && iFullscreenStyle == 0 )
    {
        CVARS_SET ( "display_alttab_handler", false );
        CVARS_SET ( "display_fullscreen_style", FULLSCREEN_BORDERLESS );
    }

    // Apply override
    if ( GetApplicationSettingInt( "nvhacks", "optimus-force-windowed" ) )
    {
        SetApplicationSettingInt( "nvhacks", "optimus-force-windowed", 0 );
        CVARS_SET ( "display_windowed", true );
    }

    m_iCurrentVideoMode = m_pGameSettings->GetCurrentVideoMode ();
    CVARS_GET ( "display_windowed",             m_bCurrentWindowed );
    CVARS_GET ( "display_fullscreen_style",     m_iCurrentFullscreenStyle );
    CVARS_GET ( "multimon_fullscreen_minimize", m_bCurrentFullScreenMinimize );
}