1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

Merge remote-tracking branch 'zini/master' into physics

This commit is contained in:
Chris Robinson 2013-08-20 04:42:28 -07:00
commit 0e56b2facb
6 changed files with 15 additions and 19 deletions

View file

@ -248,6 +248,9 @@ namespace MWGui
delete mCharGen;
mCharGen = new CharacterCreation();
mGuiModes.clear();
mHud->unsetSelectedWeapon();
mHud->unsetSelectedSpell();
unsetForceHide(GW_ALL);
}
else
allow(GW_ALL);

View file

@ -145,7 +145,6 @@ RenderingManager::RenderingManager(OEngine::Render::OgreRenderer& _rend, const b
sh::Factory::getInstance ().setGlobalSetting ("fog", "true");
sh::Factory::getInstance ().setGlobalSetting ("num_lights", Settings::Manager::getString ("num lights", "Objects"));
sh::Factory::getInstance ().setGlobalSetting ("terrain_num_lights", Settings::Manager::getString ("num lights", "Terrain"));
sh::Factory::getInstance ().setGlobalSetting ("simple_water", Settings::Manager::getBool("shader", "Water") ? "false" : "true");
sh::Factory::getInstance ().setGlobalSetting ("render_refraction", "false");
@ -1003,7 +1002,8 @@ void RenderingManager::resetCamera()
float RenderingManager::getTerrainHeightAt(Ogre::Vector3 worldPos)
{
assert(mTerrain);
if (!mTerrain || !mTerrain->getVisible())
return -std::numeric_limits<float>::max();
return mTerrain->getHeightAt(worldPos);
}

View file

@ -240,12 +240,13 @@ namespace MWWorld
// Rebuild player
setupPlayer();
MWWorld::Ptr player = mPlayer->getPlayer();
renderPlayer();
mRendering->resetCamera();
// removes NpcStats, ContainerStore etc
player.getRefData().setCustomData(NULL);
renderPlayer();
mRendering->resetCamera();
// make sure to do this so that local scripts from items that were in the players inventory are removed
mLocalScripts.clear();
@ -1026,13 +1027,10 @@ namespace MWWorld
return;
}
if (ptr.getCell()->isExterior())
{
float terrainHeight = mRendering->getTerrainHeightAt(pos);
float terrainHeight = mRendering->getTerrainHeightAt(pos);
if (pos.z < terrainHeight)
pos.z = terrainHeight;
}
if (pos.z < terrainHeight)
pos.z = terrainHeight;
ptr.getRefData().getPosition().pos[2] = pos.z + 20; // place slightly above. will snap down to ground with code below

View file

@ -46,12 +46,12 @@ namespace
// Algorithm described by Hanan Samet - 'Neighbour Finding in Quadtrees'
// http://www.cs.umd.edu/~hjs/pubs/SametPRIP81.pdf
Terrain::QuadTreeNode* searchNeighbourRecursive (Terrain::QuadTreeNode* currentNode, Terrain::Direction dir)
QuadTreeNode* searchNeighbourRecursive (QuadTreeNode* currentNode, Direction dir)
{
if (!currentNode->getParent())
return NULL; // Arrived at root node, the root node does not have neighbours
Terrain::QuadTreeNode* nextNode;
QuadTreeNode* nextNode;
if (adjacent(currentNode->getDirection(), dir))
nextNode = searchNeighbourRecursive(currentNode->getParent(), dir);
else

View file

@ -14,6 +14,8 @@ namespace Terrain
/// We keep storage of terrain data abstract here since we need different implementations for game and editor
class Storage
{
public:
virtual ~Storage() {}
private:
virtual ESM::Land* getLand (int cellX, int cellY) = 0;
virtual const ESM::LandTexture* getLandTexture(int index, short plugin) = 0;

View file

@ -200,13 +200,6 @@
@shPassthroughFragmentInputs
shUniform(float4, lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour)
@shForeach(@shGlobalSettingString(terrain_num_lights))
shUniform(float4, lightPosObjSpace@shIterator) @shAutoConstant(lightPosObjSpace@shIterator, light_position, @shIterator)
shUniform(float4, lightAttenuation@shIterator) @shAutoConstant(lightAttenuation@shIterator, light_attenuation, @shIterator)
shUniform(float4, lightDiffuse@shIterator) @shAutoConstant(lightDiffuse@shIterator, light_diffuse_colour, @shIterator)
@shEndForeach
#if SHADOWS
shSampler2D(shadowMap0)
shUniform(float2, invShadowmapSize0) @shAutoConstant(invShadowmapSize0, inverse_texture_size, @shPropertyString(shadowtexture_offset))