Exemple #1
0
void CChat::Output(const char* szText, bool bColorCoded)
{
    CChatLine*  pLine = NULL;
    const char* szRemainingText = szText;
    CColor      color = m_TextColor;

    // Allow smooth scroll when text is added if game FX Quality is not low
    CGameSettings* gameSettings = CCore::GetSingleton().GetGame()->GetSettings();
    if (gameSettings->GetFXQuality() > 0)
        m_fSmoothScroll -= 1.0f;

    do
    {
        m_uiMostRecentLine = (m_uiMostRecentLine == 0 ? CHAT_MAX_LINES - 1 : m_uiMostRecentLine - 1);
        pLine = &m_Lines[m_uiMostRecentLine];
        szRemainingText = pLine->Format(szRemainingText, (m_vecBackgroundSize.fX - (10.0f * m_vecScale.fX)), color, bColorCoded);
        pLine->SetActive(true);
        pLine->UpdateCreationTime();
    } while (szRemainingText);
}
////////////////////////////////////////////////////////////////
//
// CRenderItemManager::GetDxStatus
//
//
//
////////////////////////////////////////////////////////////////
void CRenderItemManager::GetDxStatus ( SDxStatus& outStatus )
{
    outStatus.testMode = m_TestMode;

    // Copy hardware settings
    outStatus.videoCard.strName = m_strVideoCardName;
    outStatus.videoCard.iInstalledMemoryKB = m_iVideoCardMemoryKBTotal;
    outStatus.videoCard.strPSVersion = m_strVideoCardPSVersion;
    outStatus.videoCard.depthBufferFormat = m_depthBufferFormat;
    outStatus.videoCard.iMaxAnisotropy = g_pDeviceState->AdapterState.MaxAnisotropicSetting;
    outStatus.videoCard.iNumSimultaneousRTs = g_pDeviceState->DeviceCaps.NumSimultaneousRTs;

    // State
    outStatus.state.iNumShadersUsingReadableDepthBuffer = m_ShadersUsingDepthBuffer.size();

    // Memory usage
    outStatus.videoMemoryKB.iFreeForMTA = m_iMemoryKBFreeForMTA;
    outStatus.videoMemoryKB.iUsedByFonts = m_iFontMemoryKBUsed;
    outStatus.videoMemoryKB.iUsedByTextures = m_iTextureMemoryKBUsed;
    outStatus.videoMemoryKB.iUsedByRenderTargets = m_iRenderTargetMemoryKBUsed;

    // Option settings
    CGameSettings* gameSettings = CCore::GetSingleton ().GetGame ()->GetSettings ();
    outStatus.settings.bWindowed = GetVideoModeManager()->IsDisplayModeWindowed();
    outStatus.settings.iFullScreenStyle = GetVideoModeManager()->GetFullScreenStyle();
    outStatus.settings.iFXQuality = gameSettings->GetFXQuality(); ;
    outStatus.settings.iDrawDistance = ( gameSettings->GetDrawDistance () - 0.925f ) / 0.8749f * 100;
    outStatus.settings.iAntiAliasing = gameSettings->GetAntiAliasing() - 1;
    outStatus.settings.bVolumetricShadows = false;
    outStatus.settings.bAllowScreenUpload = true;
    outStatus.settings.iStreamingMemory = 0;
    outStatus.settings.bGrassEffect = false;
    outStatus.settings.bHeatHaze = false;
    outStatus.settings.iAnisotropicFiltering = 0;
    outStatus.settings.aspectRatio = gameSettings->GetAspectRatio ();
    outStatus.settings.bHUDMatchAspectRatio = true;
    outStatus.settings.fFieldOfView = 70;
    outStatus.settings.bHighDetailVehicles = false;

    CVARS_GET ( "streaming_memory",     outStatus.settings.iStreamingMemory );
    CVARS_GET ( "volumetric_shadows",   outStatus.settings.bVolumetricShadows );
    CVARS_GET ( "allow_screen_upload",  outStatus.settings.bAllowScreenUpload );
    CVARS_GET ( "grass",                outStatus.settings.bGrassEffect );
    CVARS_GET ( "heat_haze",            outStatus.settings.bHeatHaze );
    CVARS_GET ( "anisotropic",          outStatus.settings.iAnisotropicFiltering );
    CVARS_GET ( "hud_match_aspect_ratio", outStatus.settings.bHUDMatchAspectRatio );
    CVARS_GET ( "fov",                  outStatus.settings.fFieldOfView );
    CVARS_GET ( "high_detail_vehicles", outStatus.settings.bHighDetailVehicles );

    if ( outStatus.settings.iFXQuality == 0 )
    {
        // These are always off with low fx quality
        outStatus.settings.bVolumetricShadows = false;
        outStatus.settings.bGrassEffect = false;
    }

    // Display color depth
    D3DFORMAT BackBufferFormat = g_pDeviceState->CreationState.PresentationParameters.BackBufferFormat;
    if ( BackBufferFormat >= D3DFMT_R5G6B5 && BackBufferFormat < D3DFMT_A8R3G3B2 )
        outStatus.settings.b32BitColor = 0;
    else
        outStatus.settings.b32BitColor = 1;

    // Modify if using test mode
    if ( m_TestMode == DX_TEST_MODE_NO_MEM )
        outStatus.videoMemoryKB.iFreeForMTA = 0;

    if ( m_TestMode == DX_TEST_MODE_LOW_MEM )
        outStatus.videoMemoryKB.iFreeForMTA = 1;

    if ( m_TestMode == DX_TEST_MODE_NO_SHADER )
        outStatus.videoCard.strPSVersion = "0";
}