Skip to content

Commit

Permalink
[Ogre2] fix invalid anti-aliasing level warning (gazebosim#470)
Browse files Browse the repository at this point in the history
- Fix a bug where the warning of an invalid anti-aliasing level in Ogre2RenderTarget was not being output
- Set the FSAA level to 0 if the target level is invalid
- Provide a list of valid options in the warning

Signed-off-by: Rhys Mainwaring <[email protected]>
Signed-off-by: William Lew <[email protected]>
  • Loading branch information
srmainwaring authored and WilliamLewww committed Dec 7, 2021
1 parent e5bca45 commit cfbf223
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ogre2/src/Ogre2RenderTarget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,20 @@ void Ogre2RenderTarget::BuildTargetImpl()
{
// output warning but only do it once
static bool ogre2FSAAWarn = false;
if (ogre2FSAAWarn)
if (!ogre2FSAAWarn)
{
std::ostringstream os;
os << "[ ";
for (auto &&level : fsaaLevels)
{
os << level << " ";
}
os << "]";

ignwarn << "Anti-aliasing level of '" << this->antiAliasing << "' "
<< "is not supported. Setting to 0" << std::endl;
<< "is not supported; valid FSAA levels are: " << os.str()
<< ". Setting to 0" << std::endl;
targetFSAA = 0u;
ogre2FSAAWarn = true;
}
}
Expand Down

0 comments on commit cfbf223

Please sign in to comment.