Indentation tweaks and code cleanup

This commit is contained in:
Jacob Essex 2012-03-04 11:46:33 +00:00
parent 941a22034f
commit eca91d17bb

View file

@ -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,6 +48,9 @@ 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,
@ -62,8 +62,7 @@ namespace MWRender
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,14 +153,10 @@ namespace MWRender
numTextures, numTextures,
indexes); indexes);
// disable or enable global colour map (depends on available vertex colours)
if ( store->land[1][1]->landData->usingColours )
mActiveProfile->setGlobalColourMapEnabled(true);
else
mActiveProfile->setGlobalColourMapEnabled(false);
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);
TexturePtr vertex = getVertexColours(store, TexturePtr vertex = getVertexColours(store,
x*(mLandSize-1), x*(mLandSize-1),
y*(mLandSize-1), y*(mLandSize-1),
@ -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);
}
} }
} }
} }