Renamed Terrain::Terrain to Terrain::World to make VC happy

actorid
scrawl 12 years ago
parent d3d6dfbde8
commit 839d251cc5

@ -25,7 +25,7 @@
#include <components/esm/loadstat.hpp>
#include <components/settings/settings.hpp>
#include <components/terrain/terrain.hpp>
#include <components/terrain/world.hpp>
#include "../mwworld/esmstore.hpp"
#include "../mwworld/class.hpp"
@ -1020,7 +1020,7 @@ void RenderingManager::enableTerrain(bool enable)
{
Loading::Listener* listener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
Loading::ScopedLoad load(listener);
mTerrain = new Terrain::Terrain(listener, mRendering.getScene(), new MWRender::TerrainStorage(), RV_Terrain,
mTerrain = new Terrain::World(listener, mRendering.getScene(), new MWRender::TerrainStorage(), RV_Terrain,
Settings::Manager::getBool("distant land", "Terrain"),
Settings::Manager::getBool("shader", "Terrain"));
mTerrain->applyMaterials(Settings::Manager::getBool("enabled", "Shadows"),

@ -40,7 +40,7 @@ namespace sh
namespace Terrain
{
class Terrain;
class World;
}
namespace MWRender
@ -234,7 +234,7 @@ private:
OcclusionQuery* mOcclusionQuery;
Terrain::Terrain* mTerrain;
Terrain::World* mTerrain;
MWRender::Water *mWater;

@ -67,7 +67,7 @@ add_component_dir (translation
)
add_component_dir (terrain
quadtreenode chunk terrain storage material
quadtreenode chunk world storage material
)
add_component_dir (loadinglistener

@ -4,7 +4,7 @@
#include <OgreHardwareBufferManager.h>
#include "quadtreenode.hpp"
#include "terrain.hpp"
#include "world.hpp"
#include "storage.hpp"
namespace Terrain

@ -3,7 +3,7 @@
#include <OgreSceneManager.h>
#include <OgreManualObject.h>
#include "terrain.hpp"
#include "world.hpp"
#include "chunk.hpp"
#include "storage.hpp"
@ -132,7 +132,7 @@ namespace
}
}
QuadTreeNode::QuadTreeNode(Terrain* terrain, ChildDirection dir, float size, const Ogre::Vector2 &center, QuadTreeNode* parent)
QuadTreeNode::QuadTreeNode(World* terrain, ChildDirection dir, float size, const Ogre::Vector2 &center, QuadTreeNode* parent)
: mSize(size)
, mCenter(center)
, mParent(parent)

@ -14,7 +14,7 @@ namespace Ogre
namespace Terrain
{
class Terrain;
class World;
class Chunk;
class MaterialGenerator;
@ -48,7 +48,7 @@ namespace Terrain
/// @param size size (in *cell* units!)
/// @param center center (in *cell* units!)
/// @param parent parent node
QuadTreeNode (Terrain* terrain, ChildDirection dir, float size, const Ogre::Vector2& center, QuadTreeNode* parent);
QuadTreeNode (World* terrain, ChildDirection dir, float size, const Ogre::Vector2& center, QuadTreeNode* parent);
~QuadTreeNode();
void setVisible(bool visible);
@ -95,7 +95,7 @@ namespace Terrain
/// Get bounding box in local coordinates
const Ogre::AxisAlignedBox& getBoundingBox();
Terrain* getTerrain() { return mTerrain; }
World* getTerrain() { return mTerrain; }
/// Adjust LODs for the given camera position, possibly splitting up chunks or merging them.
void update (const Ogre::Vector3& cameraPos, Loading::Listener* loadingListener);
@ -148,7 +148,7 @@ namespace Terrain
Chunk* mChunk;
Terrain* mTerrain;
World* mTerrain;
Ogre::TexturePtr mCompositeMap;

@ -1,4 +1,4 @@
#include "terrain.hpp"
#include "world.hpp"
#include <OgreAxisAlignedBox.h>
#include <OgreCamera.h>
@ -52,7 +52,7 @@ namespace
namespace Terrain
{
Terrain::Terrain(Loading::Listener* loadingListener, Ogre::SceneManager* sceneMgr,
World::World(Loading::Listener* loadingListener, Ogre::SceneManager* sceneMgr,
Storage* storage, int visibilityFlags, bool distantLand, bool shaders)
: mStorage(storage)
, mMinBatchSize(1)
@ -65,6 +65,7 @@ namespace Terrain
, mLoadingListener(loadingListener)
{
loadingListener->setLabel("Creating terrain");
loadingListener->indicateProgress();
mCompositeMapSceneMgr = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
@ -98,13 +99,13 @@ namespace Terrain
loadingListener->indicateProgress();
}
Terrain::~Terrain()
World::~World()
{
delete mRootNode;
delete mStorage;
}
void Terrain::buildQuadTree(QuadTreeNode *node)
void World::buildQuadTree(QuadTreeNode *node)
{
float halfSize = node->getSize()/2.f;
@ -151,7 +152,7 @@ namespace Terrain
node->markAsDummy();
}
void Terrain::update(const Ogre::Vector3& cameraPos)
void World::update(const Ogre::Vector3& cameraPos)
{
if (!mVisible)
return;
@ -159,7 +160,7 @@ namespace Terrain
mRootNode->updateIndexBuffers();
}
Ogre::AxisAlignedBox Terrain::getWorldBoundingBox (const Ogre::Vector2& center)
Ogre::AxisAlignedBox World::getWorldBoundingBox (const Ogre::Vector2& center)
{
if (center.x > mBounds.getMaximum().x
|| center.x < mBounds.getMinimum().x
@ -173,7 +174,7 @@ namespace Terrain
return box;
}
Ogre::HardwareVertexBufferSharedPtr Terrain::getVertexBuffer(int numVertsOneSide)
Ogre::HardwareVertexBufferSharedPtr World::getVertexBuffer(int numVertsOneSide)
{
if (mUvBufferMap.find(numVertsOneSide) != mUvBufferMap.end())
{
@ -205,7 +206,7 @@ namespace Terrain
return buffer;
}
Ogre::HardwareIndexBufferSharedPtr Terrain::getIndexBuffer(int flags, size_t& numIndices)
Ogre::HardwareIndexBufferSharedPtr World::getIndexBuffer(int flags, size_t& numIndices)
{
if (mIndexBufferMap.find(flags) != mIndexBufferMap.end())
{
@ -366,31 +367,31 @@ namespace Terrain
return buffer;
}
void Terrain::renderCompositeMap(Ogre::TexturePtr target)
void World::renderCompositeMap(Ogre::TexturePtr target)
{
mCompositeMapRenderTarget->update();
target->getBuffer()->blit(mCompositeMapRenderTexture->getBuffer());
}
void Terrain::clearCompositeMapSceneManager()
void World::clearCompositeMapSceneManager()
{
mCompositeMapSceneMgr->destroyAllManualObjects();
mCompositeMapSceneMgr->clearScene();
}
float Terrain::getHeightAt(const Ogre::Vector3 &worldPos)
float World::getHeightAt(const Ogre::Vector3 &worldPos)
{
return mStorage->getHeightAt(worldPos);
}
void Terrain::applyMaterials(bool shadows, bool splitShadows)
void World::applyMaterials(bool shadows, bool splitShadows)
{
mShadows = shadows;
mSplitShadows = splitShadows;
mRootNode->applyMaterials();
}
void Terrain::setVisible(bool visible)
void World::setVisible(bool visible)
{
if (visible && !mVisible)
mSceneMgr->getRootSceneNode()->addChild(mRootSceneNode);
@ -400,7 +401,7 @@ namespace Terrain
mVisible = visible;
}
bool Terrain::getVisible()
bool World::getVisible()
{
return mVisible;
}

@ -29,7 +29,7 @@ namespace Terrain
* Cracks at LOD transitions are avoided using stitching.
* @note Multiple cameras are not supported yet
*/
class Terrain
class World
{
public:
/// @note takes ownership of \a storage
@ -41,9 +41,9 @@ namespace Terrain
/// This is a temporary option until it can be streamlined.
/// @param shaders Whether to use splatting shader, or multi-pass fixed function splatting. Shader is usually
/// faster so this is just here for compatibility.
Terrain(Loading::Listener* loadingListener, Ogre::SceneManager* sceneMgr,
World(Loading::Listener* loadingListener, Ogre::SceneManager* sceneMgr,
Storage* storage, int visiblityFlags, bool distantLand, bool shaders);
~Terrain();
~World();
void setLoadingListener(Loading::Listener* loadingListener) { mLoadingListener = loadingListener; }
Loading…
Cancel
Save