mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-07 13:20:25 +00:00
Indentation tweaks and code cleanup
This commit is contained in:
parent
941a22034f
commit
eca91d17bb
@ -27,17 +27,14 @@ namespace MWRender
|
|||||||
TerrainMaterialGenerator::Profile* const activeProfile =
|
TerrainMaterialGenerator::Profile* const activeProfile =
|
||||||
mTerrainGlobals->getDefaultMaterialGenerator()
|
mTerrainGlobals->getDefaultMaterialGenerator()
|
||||||
->getActiveProfile();
|
->getActiveProfile();
|
||||||
mActiveProfile =
|
mActiveProfile = static_cast<TerrainMaterialGeneratorB::SM2Profile*>(activeProfile);
|
||||||
static_cast<TerrainMaterialGeneratorB::SM2Profile*>(activeProfile);
|
|
||||||
|
|
||||||
//The pixel error should be as high as possible without it being noticed
|
//The pixel error should be as high as possible without it being noticed
|
||||||
//as it governs how fast mesh quality decreases.
|
//as it governs how fast mesh quality decreases.
|
||||||
mTerrainGlobals->setMaxPixelError(8);
|
mTerrainGlobals->setMaxPixelError(8);
|
||||||
|
|
||||||
mTerrainGlobals->setLayerBlendMapSize(32);
|
mTerrainGlobals->setLayerBlendMapSize(32);
|
||||||
mTerrainGlobals->setLightMapSize(256);
|
mTerrainGlobals->setDefaultGlobalColourMapSize(65);
|
||||||
mTerrainGlobals->setCompositeMapSize(256);
|
|
||||||
mTerrainGlobals->setDefaultGlobalColourMapSize(256);
|
|
||||||
|
|
||||||
//10 (default) didn't seem to be quite enough
|
//10 (default) didn't seem to be quite enough
|
||||||
mTerrainGlobals->setSkirtSize(128);
|
mTerrainGlobals->setSkirtSize(128);
|
||||||
@ -51,19 +48,21 @@ namespace MWRender
|
|||||||
mActiveProfile->setLayerNormalMappingEnabled(false);
|
mActiveProfile->setLayerNormalMappingEnabled(false);
|
||||||
mActiveProfile->setLayerParallaxMappingEnabled(false);
|
mActiveProfile->setLayerParallaxMappingEnabled(false);
|
||||||
mActiveProfile->setReceiveDynamicShadowsEnabled(false);
|
mActiveProfile->setReceiveDynamicShadowsEnabled(false);
|
||||||
|
|
||||||
|
//composite maps lead to a drastic reduction in loading time so are
|
||||||
|
//disabled
|
||||||
mActiveProfile->setCompositeMapEnabled(false);
|
mActiveProfile->setCompositeMapEnabled(false);
|
||||||
|
|
||||||
mTerrainGroup = OGRE_NEW TerrainGroup(mgr,
|
mTerrainGroup = OGRE_NEW TerrainGroup(mgr,
|
||||||
Terrain::ALIGN_X_Z,
|
Terrain::ALIGN_X_Z,
|
||||||
mLandSize,
|
mLandSize,
|
||||||
mWorldSize);
|
mWorldSize);
|
||||||
|
|
||||||
mTerrainGroup->setOrigin(Vector3(mWorldSize/2,
|
mTerrainGroup->setOrigin(Vector3(mWorldSize/2,
|
||||||
0,
|
0,
|
||||||
-mWorldSize/2));
|
-mWorldSize/2));
|
||||||
|
|
||||||
Terrain::ImportData& importSettings =
|
Terrain::ImportData& importSettings = mTerrainGroup->getDefaultImportSettings();
|
||||||
mTerrainGroup->getDefaultImportSettings();
|
|
||||||
|
|
||||||
importSettings.inputBias = 0;
|
importSettings.inputBias = 0;
|
||||||
importSettings.terrainSize = mLandSize;
|
importSettings.terrainSize = mLandSize;
|
||||||
@ -103,7 +102,6 @@ namespace MWRender
|
|||||||
const int cellX = store->cell->getGridX();
|
const int cellX = store->cell->getGridX();
|
||||||
const int cellY = store->cell->getGridY();
|
const int cellY = store->cell->getGridY();
|
||||||
|
|
||||||
|
|
||||||
//split the cell terrain into four segments
|
//split the cell terrain into four segments
|
||||||
const int numTextures = ESM::Land::LAND_TEXTURE_SIZE/2;
|
const int numTextures = ESM::Land::LAND_TEXTURE_SIZE/2;
|
||||||
|
|
||||||
@ -155,18 +153,14 @@ namespace MWRender
|
|||||||
numTextures,
|
numTextures,
|
||||||
indexes);
|
indexes);
|
||||||
|
|
||||||
// disable or enable global colour map (depends on available vertex colours)
|
|
||||||
if ( store->land[1][1]->landData->usingColours )
|
if ( store->land[1][1]->landData->usingColours )
|
||||||
|
{
|
||||||
|
// disable or enable global colour map (depends on available vertex colours)
|
||||||
mActiveProfile->setGlobalColourMapEnabled(true);
|
mActiveProfile->setGlobalColourMapEnabled(true);
|
||||||
else
|
|
||||||
mActiveProfile->setGlobalColourMapEnabled(false);
|
|
||||||
|
|
||||||
if ( store->land[1][1]->landData->usingColours )
|
|
||||||
{
|
|
||||||
TexturePtr vertex = getVertexColours(store,
|
TexturePtr vertex = getVertexColours(store,
|
||||||
x*(mLandSize-1),
|
x*(mLandSize-1),
|
||||||
y*(mLandSize-1),
|
y*(mLandSize-1),
|
||||||
mLandSize);
|
mLandSize);
|
||||||
|
|
||||||
//this is a hack to get around the fact that Ogre seems to
|
//this is a hack to get around the fact that Ogre seems to
|
||||||
//corrupt the global colour map leading to rendering errors
|
//corrupt the global colour map leading to rendering errors
|
||||||
@ -175,6 +169,10 @@ namespace MWRender
|
|||||||
//mat = terrain->_getCompositeMapMaterial();
|
//mat = terrain->_getCompositeMapMaterial();
|
||||||
//mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName( vertex->getName() );
|
//mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName( vertex->getName() );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mActiveProfile->setGlobalColourMapEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user