mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
Terrain: remove hard dependency on shiny - can now be compiled without it (fixed function)
This commit is contained in:
parent
c9e349f60f
commit
64c9932597
3 changed files with 13 additions and 0 deletions
|
@ -73,6 +73,7 @@ add_component_dir (translation
|
|||
translation
|
||||
)
|
||||
|
||||
add_definitions(-DTERRAIN_USE_SHADER=1)
|
||||
add_component_dir (terrain
|
||||
quadtreenode chunk world storage material
|
||||
)
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
#if TERRAIN_USE_SHADER
|
||||
#include <extern/shiny/Main/Factory.hpp>
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -64,7 +66,9 @@ namespace Terrain
|
|||
assert(!renderCompositeMap || !displayCompositeMap);
|
||||
if (!mat.isNull())
|
||||
{
|
||||
#if TERRAIN_USE_SHADER
|
||||
sh::Factory::getInstance().destroyMaterialInstance(mat->getName());
|
||||
#endif
|
||||
Ogre::MaterialManager::getSingleton().remove(mat->getName());
|
||||
}
|
||||
|
||||
|
@ -144,6 +148,7 @@ namespace Terrain
|
|||
|
||||
return mat;
|
||||
}
|
||||
#if TERRAIN_USE_SHADER
|
||||
else
|
||||
{
|
||||
sh::MaterialInstance* material = sh::Factory::getInstance().createMaterialInstance (name.str());
|
||||
|
@ -343,6 +348,7 @@ namespace Terrain
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return Ogre::MaterialManager::getSingleton().getByName(name.str());
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,12 @@ namespace Terrain
|
|||
, mMaxY(0)
|
||||
, mMinY(0)
|
||||
{
|
||||
#if TERRAIN_USE_SHADER == 0
|
||||
if (mShaders)
|
||||
std::cerr << "Compiled Terrain without shader support, disabling..." << std::endl;
|
||||
mShaders = false;
|
||||
#endif
|
||||
|
||||
mCompositeMapSceneMgr = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
|
||||
|
||||
/// \todo make composite map size configurable
|
||||
|
|
Loading…
Reference in a new issue