- preparing to rewrite the landscape gen phase

git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@116 ea6a568a-9f4f-0410-981a-c910a81bb256
This commit is contained in:
nkorslund 2009-05-18 11:32:26 +00:00
parent 401bd35e02
commit c18a1ebd05
7 changed files with 321 additions and 152 deletions

View file

@ -14,7 +14,6 @@ public:
Ogre::MovableObject(),
mWidth(width),
mUseSkirts(skirts),
mBuilt(false),
mDepth(depth),
mVertexes(0),
mIndices(0),
@ -74,14 +73,10 @@ public:
if ( g_heightMap->isMorphingEnabled() )
calculateDeltaValues();
mBuilt = true;
}
~TerrainMesh()
{
if ( !mBuilt ) return;
//deleting null values is fine iirc
delete mIndices;
@ -97,8 +92,6 @@ public:
}
# endif
mBuilt = false;
assert(node);
node->detachAllObjects();
@ -323,17 +316,24 @@ private:
std::vector<int> ti;
/*
ti.resize((size+2)*(size+2), -1);
for ( int y = 0; y < size+2; ++y ){
for ( int x = 0; x < size+2; ++x ){
ti[(y)*(size+2)+(x)] = tref.at((y+yoff)*(indexSize)+(x+xoff));
}
}
*/
ti.resize(size*size, -1);
for ( int y = 0; y < size; ++y ){
for ( int x = 0; x < size; ++x ){
ti[y*size+x] = tref.at((1+y+yoff)*(indexSize)+(1+x+xoff));
}
}
mMaterial = g_materialGen->getAlphaMat
(ti,size,
1, 1.0f/size,
1.0f/size,
mQuadData->getUsedResourcesRef());
}
@ -712,9 +712,6 @@ else pDeltas[( y)*vw+ x] = v;
const int mWidth;
const bool mUseSkirts;
///true if the land has been built
bool mBuilt;
int mDepth;
Ogre::MaterialPtr mMaterial;