mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 07:23:54 +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
|
||||
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!
|
||||
add_definitions (-Wno-ignored-qualifiers)
|
||||
SET(CMAKE_CXX_FLAGS "-Wno-ignored-qualifiers ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION)
|
||||
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 (CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
|
|
|
@ -345,6 +345,8 @@ namespace MWBase
|
|||
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0;
|
||||
///< 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 int canRest() = 0;
|
||||
|
|
|
@ -462,6 +462,10 @@ void CharacterController::update(float duration, Movement &movement)
|
|||
mAnimation->disable("torch");
|
||||
}
|
||||
}
|
||||
else if (cls.getCreatureStats(mPtr).isDead())
|
||||
{
|
||||
MWBase::Environment::get().getWorld()->enableActorCollision(mPtr, false);
|
||||
}
|
||||
|
||||
if(mAnimation && !mSkipAnim)
|
||||
{
|
||||
|
|
|
@ -572,35 +572,36 @@ Ogre::String WeatherManager::nextWeather(const ESM::Region* region) const
|
|||
|
||||
int chance = (rand() % 100) + 1; // 1..100
|
||||
int sum = 0;
|
||||
for (int i = 0; i < 10; ++i)
|
||||
int i = 0;
|
||||
for (; i < 10; ++i)
|
||||
{
|
||||
sum += probability[i];
|
||||
if (chance < sum)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
return "cloudy";
|
||||
case 2:
|
||||
return "foggy";
|
||||
case 3:
|
||||
return "overcast";
|
||||
case 4:
|
||||
return "rain";
|
||||
case 5:
|
||||
return "thunderstorm";
|
||||
case 6:
|
||||
return "ashstorm";
|
||||
case 7:
|
||||
return "blight";
|
||||
case 8:
|
||||
return "snow";
|
||||
case 9:
|
||||
return "blizzard";
|
||||
default: // case 0
|
||||
return "clear";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
return "cloudy";
|
||||
case 2:
|
||||
return "foggy";
|
||||
case 3:
|
||||
return "overcast";
|
||||
case 4:
|
||||
return "rain";
|
||||
case 5:
|
||||
return "thunderstorm";
|
||||
case 6:
|
||||
return "ashstorm";
|
||||
case 7:
|
||||
return "blight";
|
||||
case 8:
|
||||
return "snow";
|
||||
case 9:
|
||||
return "blizzard";
|
||||
default: // case 0
|
||||
return "clear";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1751,4 +1751,18 @@ namespace MWWorld
|
|||
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);
|
||||
///< 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 int canRest();
|
||||
|
|
|
@ -146,6 +146,16 @@ namespace Physic
|
|||
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;
|
||||
|
||||
void disableCollisionBody();
|
||||
void enableCollisionBody();
|
||||
|
||||
//HACK: in Visual Studio 2010 and presumably above, this structures alignment
|
||||
// must be 16, but the built in operator new & delete don't properly
|
||||
// perform this alignment.
|
||||
|
|
Loading…
Reference in a new issue