mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 17:15:34 +00:00
Merge branch 'master' of https://github.com/zinnschlag/openmw
This commit is contained in:
commit
f29e30d21d
8 changed files with 65 additions and 29 deletions
|
@ -321,15 +321,15 @@ endif()
|
||||||
|
|
||||||
# Compiler settings
|
# Compiler settings
|
||||||
if (CMAKE_COMPILER_IS_GNUCC)
|
if (CMAKE_COMPILER_IS_GNUCC)
|
||||||
add_definitions (-Wall -Wextra -Wno-unused-parameter -Wno-reorder -std=c++98 -pedantic -Wno-long-long)
|
SET(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-reorder -std=c++98 -pedantic -Wno-long-long ${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
# Silence warnings in OGRE headers. Remove once OGRE got fixed!
|
# Silence warnings in OGRE headers. Remove once OGRE got fixed!
|
||||||
add_definitions (-Wno-ignored-qualifiers)
|
SET(CMAKE_CXX_FLAGS "-Wno-ignored-qualifiers ${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||||
OUTPUT_VARIABLE GCC_VERSION)
|
OUTPUT_VARIABLE GCC_VERSION)
|
||||||
if ("${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6)
|
if ("${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6)
|
||||||
add_definitions (-Wno-unused-but-set-parameter)
|
SET(CMAKE_CXX_FLAGS "-Wno-unused-but-set-parameter ${CMAKE_CXX_FLAGS}")
|
||||||
endif("${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6)
|
endif("${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6)
|
||||||
endif (CMAKE_COMPILER_IS_GNUCC)
|
endif (CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
|
||||||
|
|
|
@ -345,6 +345,8 @@ namespace MWBase
|
||||||
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0;
|
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0;
|
||||||
///< get all items in active cells owned by this Npc
|
///< get all items in active cells owned by this Npc
|
||||||
|
|
||||||
|
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable) = 0;
|
||||||
|
|
||||||
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering) = 0;
|
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering) = 0;
|
||||||
|
|
||||||
virtual int canRest() = 0;
|
virtual int canRest() = 0;
|
||||||
|
|
|
@ -462,6 +462,10 @@ void CharacterController::update(float duration, Movement &movement)
|
||||||
mAnimation->disable("torch");
|
mAnimation->disable("torch");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (cls.getCreatureStats(mPtr).isDead())
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWorld()->enableActorCollision(mPtr, false);
|
||||||
|
}
|
||||||
|
|
||||||
if(mAnimation && !mSkipAnim)
|
if(mAnimation && !mSkipAnim)
|
||||||
{
|
{
|
||||||
|
|
|
@ -572,35 +572,36 @@ Ogre::String WeatherManager::nextWeather(const ESM::Region* region) const
|
||||||
|
|
||||||
int chance = (rand() % 100) + 1; // 1..100
|
int chance = (rand() % 100) + 1; // 1..100
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for (int i = 0; i < 10; ++i)
|
int i = 0;
|
||||||
|
for (; i < 10; ++i)
|
||||||
{
|
{
|
||||||
sum += probability[i];
|
sum += probability[i];
|
||||||
if (chance < sum)
|
if (chance < sum)
|
||||||
{
|
break;
|
||||||
switch (i)
|
}
|
||||||
{
|
|
||||||
case 1:
|
switch (i)
|
||||||
return "cloudy";
|
{
|
||||||
case 2:
|
case 1:
|
||||||
return "foggy";
|
return "cloudy";
|
||||||
case 3:
|
case 2:
|
||||||
return "overcast";
|
return "foggy";
|
||||||
case 4:
|
case 3:
|
||||||
return "rain";
|
return "overcast";
|
||||||
case 5:
|
case 4:
|
||||||
return "thunderstorm";
|
return "rain";
|
||||||
case 6:
|
case 5:
|
||||||
return "ashstorm";
|
return "thunderstorm";
|
||||||
case 7:
|
case 6:
|
||||||
return "blight";
|
return "ashstorm";
|
||||||
case 8:
|
case 7:
|
||||||
return "snow";
|
return "blight";
|
||||||
case 9:
|
case 8:
|
||||||
return "blizzard";
|
return "snow";
|
||||||
default: // case 0
|
case 9:
|
||||||
return "clear";
|
return "blizzard";
|
||||||
}
|
default: // case 0
|
||||||
}
|
return "clear";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1751,4 +1751,18 @@ namespace MWWorld
|
||||||
out.push_back(searchPtrViaHandle(*it));
|
out.push_back(searchPtrViaHandle(*it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void World::enableActorCollision(const MWWorld::Ptr& actor, bool enable)
|
||||||
|
{
|
||||||
|
OEngine::Physic::PhysicActor *physicActor = mPhysEngine->getCharacter(actor.getRefData().getHandle());
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
{
|
||||||
|
physicActor->enableCollisionBody();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
physicActor->disableCollisionBody();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -394,6 +394,8 @@ namespace MWWorld
|
||||||
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out);
|
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out);
|
||||||
///< get all items in active cells owned by this Npc
|
///< get all items in active cells owned by this Npc
|
||||||
|
|
||||||
|
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable);
|
||||||
|
|
||||||
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering);
|
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering);
|
||||||
|
|
||||||
virtual int canRest();
|
virtual int canRest();
|
||||||
|
|
|
@ -146,6 +146,16 @@ namespace Physic
|
||||||
return collisionMode && onGround;
|
return collisionMode && onGround;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PhysicActor::disableCollisionBody()
|
||||||
|
{
|
||||||
|
mEngine->dynamicsWorld->removeRigidBody(mBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PhysicActor::enableCollisionBody()
|
||||||
|
{
|
||||||
|
mEngine->dynamicsWorld->addRigidBody(mBody);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,9 @@ namespace Physic
|
||||||
|
|
||||||
bool getOnGround() const;
|
bool getOnGround() const;
|
||||||
|
|
||||||
|
void disableCollisionBody();
|
||||||
|
void enableCollisionBody();
|
||||||
|
|
||||||
//HACK: in Visual Studio 2010 and presumably above, this structures alignment
|
//HACK: in Visual Studio 2010 and presumably above, this structures alignment
|
||||||
// must be 16, but the built in operator new & delete don't properly
|
// must be 16, but the built in operator new & delete don't properly
|
||||||
// perform this alignment.
|
// perform this alignment.
|
||||||
|
|
Loading…
Reference in a new issue