forked from mirror/openmw-tes3mp
CG no longer listed in the settings if the plugin isn't loaded.
This commit is contained in:
parent
492e0f2ccf
commit
7604fb51b6
1 changed files with 13 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <OgreRoot.h>
|
||||
#include <OgreRenderSystem.h>
|
||||
#include <OgrePlugin.h>
|
||||
#include <OgreString.h>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
@ -77,6 +78,17 @@ namespace
|
|||
{
|
||||
return (Ogre::Root::getSingleton ().getRenderSystem ()->getName ().find("OpenGL") != std::string::npos) ? "glsl" : "hlsl";
|
||||
}
|
||||
|
||||
bool cgAvailable ()
|
||||
{
|
||||
Ogre::Root::PluginInstanceList list = Ogre::Root::getSingleton ().getInstalledPlugins ();
|
||||
for (Ogre::Root::PluginInstanceList::const_iterator it = list.begin(); it != list.end(); ++it)
|
||||
{
|
||||
if ((*it)->getName() == "Cg Program Manager")
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
namespace MWGui
|
||||
|
@ -428,7 +440,7 @@ namespace MWGui
|
|||
{
|
||||
val = hlslGlsl();
|
||||
}
|
||||
else
|
||||
else if (cgAvailable ())
|
||||
val = "cg";
|
||||
|
||||
static_cast<MyGUI::Button*>(_sender)->setCaption(val);
|
||||
|
|
Loading…
Reference in a new issue