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
db154bd7
Commit
db154bd7
authored
3 years ago
by
Kitty Barnett
Browse files
Options
Downloads
Plain Diff
Merge branch 'world/effect-base' into rlva/development
parents
38444462
a0ff6c35
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/llvisualeffect.cpp
+8
-13
8 additions, 13 deletions
indra/newview/llvisualeffect.cpp
indra/newview/llvisualeffect.h
+14
-6
14 additions, 6 deletions
indra/newview/llvisualeffect.h
with
22 additions
and
19 deletions
indra/newview/llvisualeffect.cpp
+
8
−
13
View file @
db154bd7
...
@@ -75,30 +75,25 @@ LLVfxManager::LLVfxManager()
...
@@ -75,30 +75,25 @@ LLVfxManager::LLVfxManager()
bool
LLVfxManager
::
addEffect
(
LLVisualEffect
*
pEffectInst
)
bool
LLVfxManager
::
addEffect
(
LLVisualEffect
*
pEffectInst
)
{
{
if
(
m_Effects
.
end
()
!=
m_Effects
.
find
(
pEffectInst
))
// Effect IDs can be reused across effects but should be unique for all effect instances sharing the same effect code
auto
itEffect
=
std
::
find_if
(
m_Effects
.
begin
(),
m_Effects
.
end
(),
[
pEffectInst
](
const
LLVisualEffect
*
pEffect
)
{
return
pEffect
->
getCode
()
==
pEffectInst
->
getCode
()
&&
pEffect
->
getId
()
==
pEffectInst
->
getId
();
});
llassert
(
m_Effects
.
end
()
==
itEffect
);
if
(
m_Effects
.
end
()
!=
itEffect
)
return
false
;
return
false
;
m_Effects
.
insert
(
pEffectInst
);
m_Effects
.
insert
(
pEffectInst
);
return
true
;
return
true
;
}
}
LLVisualEffect
*
LLVfxManager
::
getEffect
(
const
LLUUID
&
idEffect
)
const
LLVisualEffect
*
LLVfxManager
::
getEffect
(
EVisualEffect
eCode
,
const
LLUUID
&
idEffect
)
const
{
auto
itEffect
=
std
::
find_if
(
m_Effects
.
begin
(),
m_Effects
.
end
(),
[
&
idEffect
](
const
LLVisualEffect
*
pEffect
)
{
return
pEffect
->
getId
()
==
idEffect
;
});
return
(
m_Effects
.
end
()
!=
itEffect
)
?
*
itEffect
:
nullptr
;
}
LLVisualEffect
*
LLVfxManager
::
getEffect
(
EVisualEffect
eCode
)
const
{
{
// NOTE: returns the first found but there could be more
auto
itEffect
=
std
::
find_if
(
m_Effects
.
begin
(),
m_Effects
.
end
(),
[
eCode
,
&
idEffect
](
const
LLVisualEffect
*
pEffect
)
{
return
pEffect
->
getCode
()
==
eCode
&&
pEffect
->
getId
()
==
idEffect
;
});
auto
itEffect
=
std
::
find_if
(
m_Effects
.
begin
(),
m_Effects
.
end
(),
[
eCode
](
const
LLVisualEffect
*
pEffect
)
{
return
pEffect
->
getCode
()
==
eCode
;
});
return
(
m_Effects
.
end
()
!=
itEffect
)
?
*
itEffect
:
nullptr
;
return
(
m_Effects
.
end
()
!=
itEffect
)
?
*
itEffect
:
nullptr
;
}
}
bool
LLVfxManager
::
removeEffect
(
const
LLUUID
&
idEffect
)
bool
LLVfxManager
::
removeEffect
(
EVisualEffect
eCode
,
const
LLUUID
&
idEffect
)
{
{
auto
itEffect
=
std
::
find_if
(
m_Effects
.
begin
(),
m_Effects
.
end
(),
[
&
idEffect
](
const
LLVisualEffect
*
pEffect
)
{
return
pEffect
->
getId
()
==
idEffect
;
});
auto
itEffect
=
std
::
find_if
(
m_Effects
.
begin
(),
m_Effects
.
end
(),
[
eCode
,
&
idEffect
](
const
LLVisualEffect
*
pEffect
)
{
return
pEffect
->
getCode
()
==
eCode
&&
pEffect
->
getId
()
==
idEffect
;
});
if
(
m_Effects
.
end
()
==
itEffect
)
if
(
m_Effects
.
end
()
==
itEffect
)
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llvisualeffect.h
+
14
−
6
View file @
db154bd7
...
@@ -159,12 +159,11 @@ class LLVfxManager : public LLSingleton<LLVfxManager>
...
@@ -159,12 +159,11 @@ class LLVfxManager : public LLSingleton<LLVfxManager>
*/
*/
public
:
public
:
bool
addEffect
(
LLVisualEffect
*
pEffectInst
);
bool
addEffect
(
LLVisualEffect
*
pEffectInst
);
LLVisualEffect
*
getEffect
(
const
LLUUID
&
idEffect
)
const
;
LLVisualEffect
*
getEffect
(
EVisualEffect
eCode
,
const
LLUUID
&
idEffect
)
const
;
template
<
typename
T
>
T
*
getEffect
(
const
LLUUID
&
idEffect
)
const
{
return
dynamic_cast
<
T
*>
(
getEffect
(
idEffect
));
}
template
<
typename
T
>
T
*
getEffect
(
const
LLUUID
&
idEffect
)
const
{
return
dynamic_cast
<
T
*>
(
getEffect
(
T
::
EffectCode
,
idEffect
));
}
LLVisualEffect
*
getEffect
(
EVisualEffect
eCode
)
const
;
bool
hasEffect
(
EVisualEffect
eCode
)
const
;
template
<
typename
T
>
T
*
getEffect
(
EVisualEffect
eCode
)
const
{
return
dynamic_cast
<
T
*>
(
getEffect
(
eCode
));
}
bool
removeEffect
(
EVisualEffect
eCode
,
const
LLUUID
&
idEffect
);
bool
hasEffect
(
EVisualEffect
eCode
)
const
{
return
getEffect
(
eCode
);
}
template
<
typename
T
>
bool
removeEffect
(
const
LLUUID
&
idEffect
)
{
return
removeEffect
(
T
::
EffectCode
,
idEffect
);
}
bool
removeEffect
(
const
LLUUID
&
idEffect
);
void
runEffect
(
EVisualEffect
eCode
,
LLVisualEffectParams
*
pParams
=
nullptr
);
void
runEffect
(
EVisualEffect
eCode
,
LLVisualEffectParams
*
pParams
=
nullptr
);
void
runEffect
(
EVisualEffectType
eType
,
LLVisualEffectParams
*
pParams
=
nullptr
);
void
runEffect
(
EVisualEffectType
eType
,
LLVisualEffectParams
*
pParams
=
nullptr
);
protected
:
protected
:
...
@@ -177,3 +176,12 @@ class LLVfxManager : public LLSingleton<LLVfxManager>
...
@@ -177,3 +176,12 @@ class LLVfxManager : public LLSingleton<LLVfxManager>
};
};
// ============================================================================
// ============================================================================
// Inlined member functions
//
inline
bool
LLVfxManager
::
hasEffect
(
EVisualEffect
eCode
)
const
{
return
m_Effects
.
end
()
!=
std
::
find_if
(
m_Effects
.
begin
(),
m_Effects
.
end
(),
[
eCode
](
const
LLVisualEffect
*
pEffect
)
{
return
pEffect
->
getCode
()
==
eCode
;
});
}
// ============================================================================
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