Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
92ee1045
Commit
92ee1045
authored
15 years ago
by
richard
Browse files
Options
Downloads
Plain Diff
merge
parents
41b1b284
8bc4dcc8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/llui/llconsole.cpp
+31
-26
31 additions, 26 deletions
indra/llui/llconsole.cpp
indra/llui/llconsole.h
+6
-5
6 additions, 5 deletions
indra/llui/llconsole.h
indra/newview/llviewerwindow.cpp
+2
-0
2 additions, 0 deletions
indra/newview/llviewerwindow.cpp
with
39 additions
and
31 deletions
indra/llui/llconsole.cpp
+
31
−
26
View file @
92ee1045
...
...
@@ -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
();
}
}
This diff is collapsed.
Click to expand it.
indra/llui/llconsole.h
+
6
−
5
View file @
92ee1045
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llviewerwindow.cpp
+
2
−
0
View file @
92ee1045
...
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment