mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-01 06:17:58 +03:00
Imported Upstream version 0.26.0
This commit is contained in:
commit
9a2b6c69b6
1398 changed files with 212217 additions and 0 deletions
41
extern/shiny/Platforms/Ogre/OgreTextureUnitState.cpp
vendored
Normal file
41
extern/shiny/Platforms/Ogre/OgreTextureUnitState.cpp
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
#include "OgreTextureUnitState.hpp"
|
||||
|
||||
#include "OgrePass.hpp"
|
||||
#include "OgrePlatform.hpp"
|
||||
#include "OgreMaterialSerializer.hpp"
|
||||
|
||||
namespace sh
|
||||
{
|
||||
OgreTextureUnitState::OgreTextureUnitState (OgrePass* parent, const std::string& name)
|
||||
: TextureUnitState()
|
||||
{
|
||||
mTextureUnitState = parent->getOgrePass()->createTextureUnitState("");
|
||||
mTextureUnitState->setName(name);
|
||||
}
|
||||
|
||||
bool OgreTextureUnitState::setPropertyOverride (const std::string &name, PropertyValuePtr& value, PropertySetGet* context)
|
||||
{
|
||||
OgreMaterialSerializer& s = OgrePlatform::getSerializer();
|
||||
|
||||
if (name == "texture_alias")
|
||||
{
|
||||
// texture alias in this library refers to something else than in ogre
|
||||
// delegate up
|
||||
return TextureUnitState::setPropertyOverride (name, value, context);
|
||||
}
|
||||
else if (name == "direct_texture")
|
||||
{
|
||||
setTextureName (retrieveValue<StringValue>(value, context).get());
|
||||
return true;
|
||||
}
|
||||
else if (name == "create_in_ffp")
|
||||
return true; // handled elsewhere
|
||||
|
||||
return s.setTextureUnitProperty (name, retrieveValue<StringValue>(value, context).get(), mTextureUnitState);
|
||||
}
|
||||
|
||||
void OgreTextureUnitState::setTextureName (const std::string& textureName)
|
||||
{
|
||||
mTextureUnitState->setTextureName(textureName);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue