mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 10:49:57 +00:00
Code cleanup: Removed unneeded Ogre namespace
This commit is contained in:
parent
3c934e3e44
commit
bcd2371baa
1 changed files with 28 additions and 28 deletions
|
@ -15,16 +15,16 @@ namespace MWRender
|
|||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
TerrainManager::TerrainManager(Ogre::SceneManager* mgr)
|
||||
TerrainManager::TerrainManager(SceneManager* mgr)
|
||||
{
|
||||
mTerrainGlobals = OGRE_NEW Ogre::TerrainGlobalOptions();
|
||||
mTerrainGlobals = OGRE_NEW TerrainGlobalOptions();
|
||||
|
||||
Ogre::TerrainMaterialGeneratorPtr matGen;
|
||||
TerrainMaterialGeneratorPtr matGen;
|
||||
TerrainMaterialGeneratorB* matGenP = new TerrainMaterialGeneratorB();
|
||||
matGen.bind(matGenP);
|
||||
mTerrainGlobals->setDefaultMaterialGenerator(matGen);
|
||||
|
||||
Ogre::TerrainMaterialGenerator::Profile* const activeProfile =
|
||||
TerrainMaterialGenerator::Profile* const activeProfile =
|
||||
mTerrainGlobals->getDefaultMaterialGenerator()
|
||||
->getActiveProfile();
|
||||
TerrainMaterialGeneratorB::SM2Profile* matProfile =
|
||||
|
@ -54,16 +54,16 @@ namespace MWRender
|
|||
matProfile->setReceiveDynamicShadowsEnabled(false);
|
||||
matProfile->setGlobalColourMapEnabled(true);
|
||||
|
||||
mTerrainGroup = OGRE_NEW Ogre::TerrainGroup(mgr,
|
||||
Ogre::Terrain::ALIGN_X_Z,
|
||||
mTerrainGroup = OGRE_NEW TerrainGroup(mgr,
|
||||
Terrain::ALIGN_X_Z,
|
||||
mLandSize,
|
||||
mWorldSize);
|
||||
|
||||
mTerrainGroup->setOrigin(Ogre::Vector3(mWorldSize/2,
|
||||
mTerrainGroup->setOrigin(Vector3(mWorldSize/2,
|
||||
0,
|
||||
-mWorldSize/2));
|
||||
|
||||
Ogre::Terrain::ImportData& importSettings =
|
||||
Terrain::ImportData& importSettings =
|
||||
mTerrainGroup->getDefaultImportSettings();
|
||||
|
||||
importSettings.inputBias = 0;
|
||||
|
@ -85,14 +85,14 @@ namespace MWRender
|
|||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
void TerrainManager::setDiffuse(const Ogre::ColourValue& diffuse)
|
||||
void TerrainManager::setDiffuse(const ColourValue& diffuse)
|
||||
{
|
||||
mTerrainGlobals->setCompositeMapDiffuse(diffuse);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
void TerrainManager::setAmbient(const Ogre::ColourValue& ambient)
|
||||
void TerrainManager::setAmbient(const ColourValue& ambient)
|
||||
{
|
||||
mTerrainGlobals->setCompositeMapAmbient(ambient);
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ namespace MWRender
|
|||
{
|
||||
for ( int y = 0; y < 2; y++ )
|
||||
{
|
||||
Ogre::Terrain::ImportData terrainData =
|
||||
Terrain::ImportData terrainData =
|
||||
mTerrainGroup->getDefaultImportSettings();
|
||||
|
||||
const int terrainX = cellX * 2 + x;
|
||||
|
@ -120,10 +120,10 @@ namespace MWRender
|
|||
|
||||
//it makes far more sense to reallocate the memory here,
|
||||
//and let Ogre deal with it due to the issues with deleting
|
||||
//it at the wrong time if using threads (Which Ogre::Terrain does)
|
||||
//it at the wrong time if using threads (Which Terrain does)
|
||||
terrainData.inputFloat = OGRE_ALLOC_T(float,
|
||||
mLandSize*mLandSize,
|
||||
Ogre::MEMCATEGORY_GEOMETRY);
|
||||
MEMCATEGORY_GEOMETRY);
|
||||
|
||||
//copy the height data row by row
|
||||
for ( int terrainCopyY = 0; terrainCopyY < mLandSize; terrainCopyY++ )
|
||||
|
@ -150,7 +150,7 @@ namespace MWRender
|
|||
|
||||
mTerrainGroup->loadTerrain(terrainX, terrainY, true);
|
||||
|
||||
Ogre::Terrain* terrain = mTerrainGroup->getTerrain(terrainX, terrainY);
|
||||
Terrain* terrain = mTerrainGroup->getTerrain(terrainX, terrainY);
|
||||
initTerrainBlendMaps(terrain, store,
|
||||
x * numTextures, y * numTextures,
|
||||
numTextures,
|
||||
|
@ -158,7 +158,7 @@ namespace MWRender
|
|||
|
||||
if ( store->land[1][1]->landData->usingColours )
|
||||
{
|
||||
Ogre::TexturePtr vertex = getVertexColours(store,
|
||||
TexturePtr vertex = getVertexColours(store,
|
||||
x*(mLandSize-1),
|
||||
y*(mLandSize-1),
|
||||
mLandSize);
|
||||
|
@ -193,7 +193,7 @@ namespace MWRender
|
|||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
void TerrainManager::initTerrainTextures(Ogre::Terrain::ImportData* terrainData,
|
||||
void TerrainManager::initTerrainTextures(Terrain::ImportData* terrainData,
|
||||
MWWorld::Ptr::CellStore* store,
|
||||
int fromX, int fromY, int size,
|
||||
std::map<uint16_t, int>& indexes)
|
||||
|
@ -257,7 +257,7 @@ namespace MWRender
|
|||
}
|
||||
|
||||
const size_t position = terrainData->layerList.size();
|
||||
terrainData->layerList.push_back(Ogre::Terrain::LayerInstance());
|
||||
terrainData->layerList.push_back(Terrain::LayerInstance());
|
||||
|
||||
terrainData->layerList[position].worldSize = 256;
|
||||
terrainData->layerList[position].textureNames.push_back("textures\\" + texture);
|
||||
|
@ -276,7 +276,7 @@ namespace MWRender
|
|||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
void TerrainManager::initTerrainBlendMaps(Ogre::Terrain* terrain,
|
||||
void TerrainManager::initTerrainBlendMaps(Terrain* terrain,
|
||||
MWWorld::Ptr::CellStore* store,
|
||||
int fromX, int fromY, int size,
|
||||
const std::map<uint16_t, int>& indexes)
|
||||
|
@ -361,7 +361,7 @@ namespace MWRender
|
|||
|
||||
for ( int i = 1; i < terrain->getLayerCount(); i++ )
|
||||
{
|
||||
Ogre::TerrainLayerBlendMap* blend = terrain->getLayerBlendMap(i);
|
||||
TerrainLayerBlendMap* blend = terrain->getLayerBlendMap(i);
|
||||
blend->dirty();
|
||||
blend->update();
|
||||
}
|
||||
|
@ -418,10 +418,10 @@ namespace MWRender
|
|||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
Ogre::TexturePtr TerrainManager::getVertexColours(MWWorld::Ptr::CellStore* store,
|
||||
TexturePtr TerrainManager::getVertexColours(MWWorld::Ptr::CellStore* store,
|
||||
int fromX, int fromY, int size)
|
||||
{
|
||||
Ogre::TextureManager* const texMgr = Ogre::TextureManager::getSingletonPtr();
|
||||
TextureManager* const texMgr = TextureManager::getSingletonPtr();
|
||||
|
||||
const std::string colourTextureName = "VtexColours_" +
|
||||
boost::lexical_cast<std::string>(store->cell->getGridX()) +
|
||||
|
@ -432,22 +432,22 @@ namespace MWRender
|
|||
"_" +
|
||||
boost::lexical_cast<std::string>(fromY);
|
||||
|
||||
Ogre::TexturePtr tex = texMgr->getByName(colourTextureName);
|
||||
TexturePtr tex = texMgr->getByName(colourTextureName);
|
||||
if ( !tex.isNull() )
|
||||
{
|
||||
return tex;
|
||||
}
|
||||
|
||||
tex = texMgr->createManual(colourTextureName,
|
||||
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
|
||||
Ogre::TEX_TYPE_2D, size, size, 0, Ogre::PF_BYTE_BGR);
|
||||
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
|
||||
TEX_TYPE_2D, size, size, 0, PF_BYTE_BGR);
|
||||
|
||||
Ogre::HardwarePixelBufferSharedPtr pixelBuffer = tex->getBuffer();
|
||||
HardwarePixelBufferSharedPtr pixelBuffer = tex->getBuffer();
|
||||
|
||||
pixelBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD);
|
||||
const Ogre::PixelBox& pixelBox = pixelBuffer->getCurrentLock();
|
||||
pixelBuffer->lock(HardwareBuffer::HBL_DISCARD);
|
||||
const PixelBox& pixelBox = pixelBuffer->getCurrentLock();
|
||||
|
||||
Ogre::uint8* pDest = static_cast<Ogre::uint8*>(pixelBox.data);
|
||||
uint8* pDest = static_cast<uint8*>(pixelBox.data);
|
||||
|
||||
const char* const colours = store->land[1][1]->landData->colours;
|
||||
for ( int y = 0; y < size; y++ )
|
||||
|
|
Loading…
Reference in a new issue