@@ -145,7 +145,7 @@ void CChat::LoadCVars(void)
145
145
//
146
146
// Draw
147
147
//
148
- void CChat::Draw (bool bUseCacheTexture)
148
+ void CChat::Draw (bool bUseCacheTexture, bool bAllowOutline )
149
149
{
150
150
// Are we visible?
151
151
if (!m_bVisible)
@@ -159,9 +159,12 @@ void CChat::Draw(bool bUseCacheTexture)
159
159
UpdateGUI ();
160
160
}
161
161
162
+ bool bUsingOutline = m_bTextBlackOutline && bAllowOutline && bUseCacheTexture;
163
+ DrawInputLine (bUsingOutline);
164
+
162
165
// Get drawList for the chat box text
163
166
SDrawList drawList;
164
- GetDrawList (drawList);
167
+ GetDrawList (drawList, bUsingOutline );
165
168
166
169
// Calc some size info
167
170
CVector2D chatTopLeft (drawList.renderBounds .fX1 , drawList.renderBounds .fY1 );
@@ -212,6 +215,7 @@ void CChat::Draw(bool bUseCacheTexture)
212
215
// If we can't get a rendertarget for some reason, just render the text directly to the screen
213
216
if (!m_pCacheTexture)
214
217
{
218
+ drawList.bOutline = false ; // Outline too slow without cache texture
215
219
DrawDrawList (drawList, chatTopLeft);
216
220
return ;
217
221
}
@@ -270,15 +274,14 @@ void CChat::DrawDrawList(const SDrawList& drawList, const CVector2D& topLeftOffs
270
274
//
271
275
// Get list of text lines to draw
272
276
//
273
- void CChat::GetDrawList (SDrawList& outDrawList)
277
+ void CChat::GetDrawList (SDrawList& outDrawList, bool bUsingOutline )
274
278
{
275
279
float fLineDifference = CChat::GetFontHeight (m_vecScale.fY );
276
280
CVector2D vecPosition (m_vecBackgroundPosition.fX + (5 .0f * m_vecScale.fX ), m_vecBackgroundPosition.fY + m_vecBackgroundSize.fY - (fLineDifference * 1 .25f ));
277
281
float fMaxLineWidth = m_vecBackgroundSize.fX - (10 .0f * m_vecScale.fX );
278
282
unsigned long ulTime = GetTickCount32 ();
279
283
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;
282
285
283
286
if (m_Color.A * m_fBackgroundAlpha > 0 .f )
284
287
{
@@ -304,7 +307,7 @@ void CChat::GetDrawList(SDrawList& outDrawList)
304
307
305
308
outDrawList.renderBounds = RenderBounds;
306
309
outDrawList.bShadow = bShadow;
307
- outDrawList.bOutline = m_bTextBlackOutline ;
310
+ outDrawList.bOutline = bUsingOutline ;
308
311
309
312
// Smooth scroll
310
313
int iLineScroll;
@@ -351,7 +354,13 @@ void CChat::GetDrawList(SDrawList& outDrawList)
351
354
if (uiLine == m_uiMostRecentLine) // Went through all lines?
352
355
break ;
353
356
}
357
+ }
354
358
359
+ //
360
+ // CChat::DrawInputLine
361
+ //
362
+ void CChat::DrawInputLine (bool bUsingOutline)
363
+ {
355
364
if (m_InputColor.A * m_fInputBackgroundAlpha > 0 .f )
356
365
{
357
366
if (m_pInput)
@@ -366,8 +375,10 @@ void CChat::GetDrawList(SDrawList& outDrawList)
366
375
367
376
if (m_bInputVisible)
368
377
{
378
+ float fLineDifference = CChat::GetFontHeight (m_vecScale.fY );
379
+ bool bInputShadow = (m_InputColor.A * m_fInputBackgroundAlpha == 0 .f ) && !bUsingOutline;
369
380
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 );
371
382
}
372
383
}
373
384
0 commit comments