Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
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
JennaHuntsman
XDG Integration
Commits
f2b02613
Commit
f2b02613
authored
12 years ago
by
tonyasouther
Browse files
Options
Downloads
Patches
Plain Diff
Don't send a materials update to the sim until the previous one has been acknowledged.
parent
a91b231b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/llpanelface.cpp
+85
-8
85 additions, 8 deletions
indra/newview/llpanelface.cpp
indra/newview/llpanelface.h
+14
-1
14 additions, 1 deletion
indra/newview/llpanelface.h
with
99 additions
and
9 deletions
indra/newview/llpanelface.cpp
+
85
−
8
View file @
f2b02613
...
...
@@ -257,7 +257,9 @@ LLPanelFace::LLPanelFace()
:
LLPanel
(),
mMaterialID
(
LLMaterialID
::
null
),
mMaterial
(
LLMaterialPtr
()),
mIsAlpha
(
FALSE
)
mIsAlpha
(
false
),
mUpdateInFlight
(
false
),
mUpdatePending
(
false
)
{
}
...
...
@@ -1140,6 +1142,13 @@ void LLPanelFace::getState()
llinfos
<<
"Requesting material ID "
<<
mMaterialID
.
asString
()
<<
llendl
;
LLMaterialMgr
::
getInstance
()
->
get
(
objectp
->
getRegion
()
->
getRegionID
(),
mMaterialID
,
boost
::
bind
(
&
LLPanelFace
::
onMaterialLoaded
,
this
,
_1
,
_2
));
}
if
(
mUpdatePending
&&
!
mUpdateInFlight
)
{
// One or more updates are pending, and the
// previous one has been acknowledged. Send
// the pending updates.
updateMaterial
();
}
}
// Set variable values for numeric expressions
...
...
@@ -1206,6 +1215,9 @@ void LLPanelFace::refresh()
void
LLPanelFace
::
onMaterialLoaded
(
const
LLMaterialID
&
material_id
,
const
LLMaterialPtr
material
)
{
mMaterial
=
material
;
// We've gotten a materials update, so the sim's ready for another.
mUpdateInFlight
=
false
;
// Alpha
LLCtrlSelectionInterface
*
combobox_alphamode
=
childGetSelectionInterface
(
"combobox alphamode"
);
...
...
@@ -1278,6 +1290,11 @@ void LLPanelFace::onMaterialLoaded(const LLMaterialID& material_id, const LLMate
void
LLPanelFace
::
updateMaterial
()
{
if
(
mUpdateInFlight
)
{
LL_WARNS
(
"Materials"
)
<<
"Attempt to update material while a previous update is pending ignored."
<<
LL_ENDL
;
return
;
}
LLComboBox
*
comboAlphaMode
=
getChild
<
LLComboBox
>
(
"combobox alphamode"
);
LLComboBox
*
comboBumpiness
=
getChild
<
LLComboBox
>
(
"combobox bumpiness"
);
LLComboBox
*
comboShininess
=
getChild
<
LLComboBox
>
(
"combobox shininess"
);
...
...
@@ -1336,6 +1353,10 @@ void LLPanelFace::updateMaterial()
mMaterial
->
setAlphaMaskCutoff
((
U8
)(
getChild
<
LLUICtrl
>
(
"maskcutoff"
)
->
getValue
().
asInteger
()));
llinfos
<<
"Updating material: "
<<
mMaterial
->
asLLSD
()
<<
llendl
;
LLSelectMgr
::
getInstance
()
->
selectionSetMaterial
(
*
mMaterial
);
// We've sent an update. Need to hold off on any more until
// the sim acknowledges this one.
mUpdateInFlight
=
true
;
}
else
{
...
...
@@ -1346,8 +1367,15 @@ void LLPanelFace::updateMaterial()
mMaterial
.
reset
();
mMaterialID
=
LLMaterialID
::
null
;
// Delete existing material entry...
// Hold off any further updates till this one's
// acknowledged.
//mUpdateInFlight = true;
}
}
// We've taken care of the update, so clear the update pending flag.
mUpdatePending
=
false
;
}
//
...
...
@@ -1368,7 +1396,14 @@ void LLPanelFace::onCommitColor(const LLSD& data)
void
LLPanelFace
::
onCommitShinyColor
(
const
LLSD
&
data
)
{
updateMaterial
();
if
(
!
mUpdateInFlight
)
{
updateMaterial
();
}
else
{
mUpdatePending
=
true
;
}
}
void
LLPanelFace
::
onCommitAlpha
(
const
LLSD
&
data
)
...
...
@@ -1531,7 +1566,14 @@ void LLPanelFace::onCommitShiny(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace
*
self
=
(
LLPanelFace
*
)
userdata
;
self
->
sendShiny
();
self
->
updateMaterial
();
if
(
!
self
->
mUpdateInFlight
)
{
self
->
updateMaterial
();
}
else
{
self
->
mUpdatePending
=
true
;
}
}
// static
...
...
@@ -1554,7 +1596,14 @@ void LLPanelFace::onCommitAlphaMode(LLUICtrl* ctrl, void* userdata)
{
LLPanelFace
*
self
=
(
LLPanelFace
*
)
userdata
;
updateAlphaControls
(
ctrl
,
userdata
);
self
->
updateMaterial
();
if
(
!
self
->
mUpdateInFlight
)
{
self
->
updateMaterial
();
}
else
{
self
->
mUpdatePending
=
true
;
}
}
// static
...
...
@@ -1608,25 +1657,53 @@ void LLPanelFace::onSelectTexture(const LLSD& data)
void
LLPanelFace
::
onCommitMaterialTexture
(
const
LLSD
&
data
)
{
updateMaterial
();
if
(
!
mUpdateInFlight
)
{
updateMaterial
();
}
else
{
mUpdatePending
=
true
;
}
}
void
LLPanelFace
::
onCancelMaterialTexture
(
const
LLSD
&
data
)
{
// not sure what to do here other than
updateMaterial
();
if
(
!
mUpdateInFlight
)
{
updateMaterial
();
}
else
{
mUpdatePending
=
true
;
}
}
void
LLPanelFace
::
onSelectMaterialTexture
(
const
LLSD
&
data
)
{
updateMaterial
();
if
(
!
mUpdateInFlight
)
{
updateMaterial
();
}
else
{
mUpdatePending
=
true
;
}
}
//static
void
LLPanelFace
::
onCommitMaterial
(
LLUICtrl
*
ctrl
,
void
*
userdata
)
{
LLPanelFace
*
self
=
(
LLPanelFace
*
)
userdata
;
self
->
updateMaterial
();
if
(
!
self
->
mUpdateInFlight
)
{
self
->
updateMaterial
();
}
else
{
self
->
mUpdatePending
=
true
;
}
}
// static
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llpanelface.h
+
14
−
1
View file @
f2b02613
...
...
@@ -116,7 +116,20 @@ class LLPanelFace : public LLPanel
LLMaterialID
mMaterialID
;
LLMaterialPtr
mMaterial
;
BOOL
mIsAlpha
;
bool
mIsAlpha
;
/* These variables interlock processing of materials updates sent to
* the sim. mUpdateInFlight is set to flag that an update has been
* sent to the sim and not acknowledged yet, and cleared when an
* update is received from the sim. mUpdatePending is set when
* there's an update in flight and another UI change has been made
* that needs to be sent as a materials update, and cleared when the
* update is sent. This prevents the sim from getting spammed with
* update messages when, for example, the user holds down the
* up-arrow on a spinner, and avoids running afoul of its throttle.
*/
bool
mUpdateInFlight
;
bool
mUpdatePending
;
};
#endif
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