mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 11:53:53 +00:00
Merge remote-tracking branch 'origin/master' into mergetool
This commit is contained in:
commit
9392e426c0
7 changed files with 45 additions and 2 deletions
|
@ -291,6 +291,10 @@ namespace MWMechanics
|
|||
return;
|
||||
}
|
||||
|
||||
// no combat for totally static creatures (they have no movement or attack animations anyway)
|
||||
if (!actor1.getClass().isMobile(actor1))
|
||||
return;
|
||||
|
||||
bool aggressive;
|
||||
|
||||
if (againstPlayer)
|
||||
|
|
|
@ -390,7 +390,8 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|||
}
|
||||
else
|
||||
{
|
||||
movemask = MWRender::Animation::BlendMask_LowerBody;
|
||||
if (weap != sWeaponTypeListEnd)
|
||||
movemask = MWRender::Animation::BlendMask_LowerBody;
|
||||
movementAnimName.erase(swimpos, 4);
|
||||
if(!mAnimation->hasAnimation(movementAnimName))
|
||||
movementAnimName.clear();
|
||||
|
@ -467,10 +468,14 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|||
mIdleState = idle;
|
||||
|
||||
std::string idle;
|
||||
MWRender::Animation::AnimPriority idlePriority (Priority_Default);
|
||||
// Only play "idleswim" or "idlesneak" if they exist. Otherwise, fallback to
|
||||
// "idle"+weapon or "idle".
|
||||
if(mIdleState == CharState_IdleSwim && mAnimation->hasAnimation("idleswim"))
|
||||
{
|
||||
idle = "idleswim";
|
||||
idlePriority = Priority_SwimIdle;
|
||||
}
|
||||
else if(mIdleState == CharState_IdleSneak && mAnimation->hasAnimation("idlesneak"))
|
||||
idle = "idlesneak";
|
||||
else if(mIdleState != CharState_None)
|
||||
|
@ -487,7 +492,7 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|||
mAnimation->disable(mCurrentIdle);
|
||||
mCurrentIdle = idle;
|
||||
if(!mCurrentIdle.empty())
|
||||
mAnimation->play(mCurrentIdle, Priority_Default, MWRender::Animation::BlendMask_All, false,
|
||||
mAnimation->play(mCurrentIdle, idlePriority, MWRender::Animation::BlendMask_All, false,
|
||||
1.0f, "start", "stop", 0.0f, ~0ul, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ class CreatureStats;
|
|||
enum Priority {
|
||||
Priority_Default,
|
||||
Priority_WeaponLowerBody,
|
||||
Priority_SwimIdle,
|
||||
Priority_Jump,
|
||||
Priority_Movement,
|
||||
Priority_Hit,
|
||||
|
|
|
@ -717,6 +717,13 @@ public:
|
|||
mAlpha = alpha;
|
||||
}
|
||||
|
||||
virtual void setDefaults(osg::StateSet* stateset)
|
||||
{
|
||||
// need to create a deep copy of StateAttributes we will modify
|
||||
osg::Material* mat = static_cast<osg::Material*>(stateset->getAttribute(osg::StateAttribute::MATERIAL));
|
||||
stateset->setAttribute(osg::clone(mat, osg::CopyOp::DEEP_COPY_ALL), osg::StateAttribute::ON);
|
||||
}
|
||||
|
||||
virtual void apply(osg::StateSet* stateset, osg::NodeVisitor* nv)
|
||||
{
|
||||
osg::Material* mat = static_cast<osg::Material*>(stateset->getAttribute(osg::StateAttribute::MATERIAL));
|
||||
|
|
|
@ -353,6 +353,13 @@ AlphaController::AlphaController(const AlphaController ©, const osg::CopyOp
|
|||
{
|
||||
}
|
||||
|
||||
void AlphaController::setDefaults(osg::StateSet *stateset)
|
||||
{
|
||||
// need to create a deep copy of StateAttributes we will modify
|
||||
osg::Material* mat = static_cast<osg::Material*>(stateset->getAttribute(osg::StateAttribute::MATERIAL));
|
||||
stateset->setAttribute(osg::clone(mat, osg::CopyOp::DEEP_COPY_ALL), osg::StateAttribute::ON);
|
||||
}
|
||||
|
||||
void AlphaController::apply(osg::StateSet *stateset, osg::NodeVisitor *nv)
|
||||
{
|
||||
if (hasInput())
|
||||
|
@ -380,6 +387,13 @@ MaterialColorController::MaterialColorController(const MaterialColorController &
|
|||
{
|
||||
}
|
||||
|
||||
void MaterialColorController::setDefaults(osg::StateSet *stateset)
|
||||
{
|
||||
// need to create a deep copy of StateAttributes we will modify
|
||||
osg::Material* mat = static_cast<osg::Material*>(stateset->getAttribute(osg::StateAttribute::MATERIAL));
|
||||
stateset->setAttribute(osg::clone(mat, osg::CopyOp::DEEP_COPY_ALL), osg::StateAttribute::ON);
|
||||
}
|
||||
|
||||
void MaterialColorController::apply(osg::StateSet *stateset, osg::NodeVisitor *nv)
|
||||
{
|
||||
if (hasInput())
|
||||
|
|
|
@ -189,6 +189,8 @@ namespace NifOsg
|
|||
AlphaController();
|
||||
AlphaController(const AlphaController& copy, const osg::CopyOp& copyop);
|
||||
|
||||
virtual void setDefaults(osg::StateSet* stateset);
|
||||
|
||||
virtual void apply(osg::StateSet* stateset, osg::NodeVisitor* nv);
|
||||
|
||||
META_Object(NifOsg, AlphaController)
|
||||
|
@ -206,6 +208,8 @@ namespace NifOsg
|
|||
|
||||
META_Object(NifOsg, MaterialColorController)
|
||||
|
||||
virtual void setDefaults(osg::StateSet* stateset);
|
||||
|
||||
virtual void apply(osg::StateSet* stateset, osg::NodeVisitor* nv);
|
||||
};
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <osgDB/Registry>
|
||||
#include <osg/GLExtensions>
|
||||
#include <osg/Version>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
|
@ -118,10 +119,17 @@ namespace Resource
|
|||
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
|
||||
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
|
||||
{
|
||||
#if OSG_MIN_VERSION_REQUIRED(3,3,3)
|
||||
osg::GLExtensions* exts = osg::GLExtensions::Get(0, false);
|
||||
if (exts && !exts->isTextureCompressionS3TCSupported
|
||||
// This one works too. Should it be included in isTextureCompressionS3TCSupported()? Submitted as a patch to OSG.
|
||||
&& !osg::isGLExtensionSupported(0, "GL_S3_s3tc"))
|
||||
#else
|
||||
osg::Texture::Extensions* exts = osg::Texture::getExtensions(0, false);
|
||||
if (exts && !exts->isTextureCompressionS3TCSupported()
|
||||
// This one works too. Should it be included in isTextureCompressionS3TCSupported()? Submitted as a patch to OSG.
|
||||
&& !osg::isGLExtensionSupported(0, "GL_S3_s3tc"))
|
||||
#endif
|
||||
{
|
||||
std::cerr << "Error loading " << filename << ": no S3TC texture compression support installed" << std::endl;
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue