From fee7a36ec7602c2bdaff68ca862da8356afc47ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 30 Jul 2017 17:10:41 -0300 Subject: [PATCH] Console optimization. --HG-- branch : dev --- src/eepp/graphics/console.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/eepp/graphics/console.cpp b/src/eepp/graphics/console.cpp index a7799e0bc..e528740e3 100755 --- a/src/eepp/graphics/console.cpp +++ b/src/eepp/graphics/console.cpp @@ -201,7 +201,11 @@ void Console::draw() { Text& text = mTextCache[Pos]; - text.setStyleConfig( mFontStyleConfig ); + text.setFont( mFontStyleConfig.Font ); + text.setCharacterSize( mFontStyleConfig.CharacterSize ); + text.setStyle( mFontStyleConfig.Style ); + text.setOutlineThickness( mFontStyleConfig.OutlineThickness ); + text.setOutlineColor( mFontStyleConfig.OutlineColor ); text.setFillColor( Color( mFontStyleConfig.FontColor.r, mFontStyleConfig.FontColor.g, mFontStyleConfig.FontColor.b, static_cast(mA) ) ); text.setString( mCmdLog[i] ); text.draw( mFontSize, CurY ); @@ -213,13 +217,21 @@ void Console::draw() { CurY = mTempY + mY + mCurHeight - mFontSize - 1; Text& text = mTextCache[ mTextCache.size() - 1 ]; - text.setStyleConfig( mFontStyleConfig ); + text.setFont( mFontStyleConfig.Font ); + text.setCharacterSize( mFontStyleConfig.CharacterSize ); + text.setStyle( mFontStyleConfig.Style ); + text.setOutlineThickness( mFontStyleConfig.OutlineThickness ); + text.setOutlineColor( mFontStyleConfig.OutlineColor ); text.setFillColor( Color( mFontLineColor.r, mFontLineColor.g, mFontLineColor.b, static_cast(mA) ) ); text.setString( "> " + mTBuf->getBuffer() ); text.draw( mFontSize, CurY ); Text& text2 = mTextCache[ mTextCache.size() - 2 ]; - text2.setStyleConfig( mFontStyleConfig ); + text2.setFont( mFontStyleConfig.Font ); + text2.setCharacterSize( mFontStyleConfig.CharacterSize ); + text2.setStyle( mFontStyleConfig.Style ); + text2.setOutlineThickness( mFontStyleConfig.OutlineThickness ); + text2.setOutlineColor( mFontStyleConfig.OutlineColor ); text2.setFillColor( Color( mFontLineColor.r, mFontLineColor.g, mFontLineColor.b, static_cast(mCurAlpha) ) ); if ( (unsigned int)mTBuf->getCursorPos() == mTBuf->getBuffer().size() ) {