Skip to content
Snippets Groups Projects
Commit 92ee1045 authored by richard's avatar richard
Browse files

merge

parents 41b1b284 8bc4dcc8
No related branches found
No related tags found
No related merge requests found
......@@ -244,23 +244,6 @@ void LLConsole::draw()
}
}
void LLConsole::addLine(const std::string& utf8line)
{
LLWString wline = utf8str_to_wstring(utf8line);
addLine(wline, 0.f, LLColor4(1.f, 1.f, 1.f, 1.f));
}
void LLConsole::addLine(const LLWString& wline)
{
addLine(wline, 0.f, LLColor4(1.f, 1.f, 1.f, 1.f));
}
void LLConsole::addLine(const std::string& utf8line, F32 size, const LLColor4 &color)
{
LLWString wline = utf8str_to_wstring(utf8line);
addLine(wline, size, color);
}
//Generate highlight color segments for this paragraph. Pass in default color of paragraph.
void LLConsole::Paragraph::makeParagraphColorSegments (const LLColor4 &color)
{
......@@ -383,21 +366,43 @@ void LLConsole::Paragraph::updateLines(F32 screen_width, const LLFontGL* font, b
//Pass in the string and the default color for this block of text.
LLConsole::Paragraph::Paragraph (LLWString str, const LLColor4 &color, F32 add_time, const LLFontGL* font, F32 screen_width)
: mParagraphText(str), mAddTime(add_time), mMaxWidth(-1)
: mParagraphText(str), mAddTime(add_time), mMaxWidth(-1)
{
makeParagraphColorSegments(color);
updateLines( screen_width, font );
}
void LLConsole::addLine(const LLWString& wline, F32 size, const LLColor4 &color)
// called once per frame regardless of console visibility
// static
void LLConsole::updateClass()
{
Paragraph paragraph(wline, color, mTimer.getElapsedTimeF32(), mFont, (F32)getRect().getWidth() );
mParagraphs.push_back ( paragraph );
for (instance_iter it = beginInstances(); it != endInstances(); ++it)
{
it->update();
}
}
void LLConsole::update()
{
{
LLMutexLock lock(&mMutex);
while (!mLines.empty())
{
mParagraphs.push_back(
Paragraph( mLines.front(),
LLColor4::white,
mTimer.getElapsedTimeF32(),
mFont,
(F32)getRect().getWidth()));
mLines.pop_front();
}
}
// remove old paragraphs which can't possibly be visible any more. ::draw() will do something similar but more conservative - we do this here because ::draw() isn't guaranteed to ever be called! (i.e. the console isn't visible)
while ((S32)mParagraphs.size() > llmax((S32)0, (S32)(mMaxLines)))
{
mParagraphs.pop_front();
}
while ((S32)mParagraphs.size() > llmax((S32)0, (S32)(mMaxLines)))
{
mParagraphs.pop_front();
}
}
......@@ -40,7 +40,7 @@
class LLSD;
class LLConsole : public LLFixedBuffer, public LLUICtrl
class LLConsole : public LLFixedBuffer, public LLUICtrl, public LLInstanceTracker<LLConsole>
{
public:
typedef enum e_font_size
......@@ -68,6 +68,9 @@ class LLConsole : public LLFixedBuffer, public LLUICtrl
friend class LLUICtrlFactory;
public:
// call once per frame to pull data out of LLFixedBuffer
static void updateClass();
//A paragraph color segment defines the color of text in a line
//of text that was received for console display. It has no
//notion of line wraps, screen position, or the text it contains.
......@@ -139,14 +142,12 @@ class LLConsole : public LLFixedBuffer, public LLUICtrl
// -1 = monospace, 0 means small, font size = 1 means big
void setFontSize(S32 size_index);
void addLine(const std::string& utf8line, F32 size, const LLColor4 &color);
void addLine(const LLWString& wline, F32 size, const LLColor4 &color);
// Overrides
/*virtual*/ void draw();
/*virtual*/ void addLine(const std::string& utf8line);
/*virtual*/ void addLine(const LLWString& line);
private:
void update();
F32 mLinePersistTime; // Age at which to stop drawing.
F32 mFadeTime; // Age at which to start fading
const LLFontGL* mFont;
......
......@@ -2463,6 +2463,8 @@ void LLViewerWindow::updateUI()
{
static std::string last_handle_msg;
LLConsole::updateClass();
// animate layout stacks so we have up to date rect for world view
LLLayoutStack::updateClass();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment