@@ -145,7 +145,7 @@ void CChat::LoadCVars(void)
145145//
146146// Draw
147147//
148- void CChat::Draw (bool bUseCacheTexture)
148+ void CChat::Draw (bool bUseCacheTexture, bool bAllowOutline )
149149{
150150 // Are we visible?
151151 if (!m_bVisible)
@@ -159,9 +159,12 @@ void CChat::Draw(bool bUseCacheTexture)
159159 UpdateGUI ();
160160 }
161161
162+ bool bUsingOutline = m_bTextBlackOutline && bAllowOutline && bUseCacheTexture;
163+ DrawInputLine (bUsingOutline);
164+
162165 // Get drawList for the chat box text
163166 SDrawList drawList;
164- GetDrawList (drawList);
167+ GetDrawList (drawList, bUsingOutline );
165168
166169 // Calc some size info
167170 CVector2D chatTopLeft (drawList.renderBounds .fX1 , drawList.renderBounds .fY1 );
@@ -212,6 +215,7 @@ void CChat::Draw(bool bUseCacheTexture)
212215 // If we can't get a rendertarget for some reason, just render the text directly to the screen
213216 if (!m_pCacheTexture)
214217 {
218+ drawList.bOutline = false ; // Outline too slow without cache texture
215219 DrawDrawList (drawList, chatTopLeft);
216220 return ;
217221 }
@@ -270,15 +274,14 @@ void CChat::DrawDrawList(const SDrawList& drawList, const CVector2D& topLeftOffs
270274//
271275// Get list of text lines to draw
272276//
273- void CChat::GetDrawList (SDrawList& outDrawList)
277+ void CChat::GetDrawList (SDrawList& outDrawList, bool bUsingOutline )
274278{
275279 float fLineDifference = CChat::GetFontHeight (m_vecScale.fY );
276280 CVector2D vecPosition (m_vecBackgroundPosition.fX + (5 .0f * m_vecScale.fX ), m_vecBackgroundPosition.fY + m_vecBackgroundSize.fY - (fLineDifference * 1 .25f ));
277281 float fMaxLineWidth = m_vecBackgroundSize.fX - (10 .0f * m_vecScale.fX );
278282 unsigned long ulTime = GetTickCount32 ();
279283 float fRcpChatLineFadeOut = 1 .0f / m_ulChatLineFadeOut;
280- bool bShadow = (m_Color.A * m_fBackgroundAlpha == 0 .f ) && !m_bTextBlackOutline;
281- bool bInputShadow = (m_InputColor.A * m_fInputBackgroundAlpha == 0 .f ) && !m_bTextBlackOutline;
284+ bool bShadow = (m_Color.A * m_fBackgroundAlpha == 0 .f ) && !bUsingOutline;
282285
283286 if (m_Color.A * m_fBackgroundAlpha > 0 .f )
284287 {
@@ -304,7 +307,7 @@ void CChat::GetDrawList(SDrawList& outDrawList)
304307
305308 outDrawList.renderBounds = RenderBounds;
306309 outDrawList.bShadow = bShadow;
307- outDrawList.bOutline = m_bTextBlackOutline ;
310+ outDrawList.bOutline = bUsingOutline ;
308311
309312 // Smooth scroll
310313 int iLineScroll;
@@ -351,7 +354,13 @@ void CChat::GetDrawList(SDrawList& outDrawList)
351354 if (uiLine == m_uiMostRecentLine) // Went through all lines?
352355 break ;
353356 }
357+ }
354358
359+ //
360+ // CChat::DrawInputLine
361+ //
362+ void CChat::DrawInputLine (bool bUsingOutline)
363+ {
355364 if (m_InputColor.A * m_fInputBackgroundAlpha > 0 .f )
356365 {
357366 if (m_pInput)
@@ -366,8 +375,10 @@ void CChat::GetDrawList(SDrawList& outDrawList)
366375
367376 if (m_bInputVisible)
368377 {
378+ float fLineDifference = CChat::GetFontHeight (m_vecScale.fY );
379+ bool bInputShadow = (m_InputColor.A * m_fInputBackgroundAlpha == 0 .f ) && !bUsingOutline;
369380 CVector2D vecPosition (m_vecInputPosition.fX + (5 .0f * m_vecScale.fX ), m_vecInputPosition.fY + (fLineDifference * 0 .125f ));
370- m_InputLine.Draw (vecPosition, 255 , bInputShadow, m_bTextBlackOutline );
381+ m_InputLine.Draw (vecPosition, 255 , bInputShadow, bUsingOutline );
371382 }
372383}
373384
0 commit comments