From cfbf22349fbb08a34de91637cc7097ab8fcee3a1 Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Fri, 15 Oct 2021 01:23:54 +0100 Subject: [PATCH] [Ogre2] fix invalid anti-aliasing level warning (#470) - 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 Signed-off-by: William Lew --- ogre2/src/Ogre2RenderTarget.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ogre2/src/Ogre2RenderTarget.cc b/ogre2/src/Ogre2RenderTarget.cc index 7e8ff390b..4034ee3c7 100644 --- a/ogre2/src/Ogre2RenderTarget.cc +++ b/ogre2/src/Ogre2RenderTarget.cc @@ -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; } }