# New territory border rendering.

Add textured line overlay rendering.
Change terrain height calculations to be triangulation-dependent for
improved accuracy.
Add triangulation-dependent terrain normal function.
Support separate S/T wrap modes for textures.
Rename CVector2D_Maths since it no longer conflicts with simulation
CVector2D.
Coalesce freed chunks in vertex buffers, to avoid excessive
fragmentation.
Add some things to help debug vertex buffer allocation a little.

This was SVN commit r9929.
This commit is contained in:
Ykkrosh
2011-07-30 00:56:45 +00:00
parent 239685d754
commit 8fee3d8ef8
36 changed files with 1084 additions and 143 deletions
+7 -7
View File
@@ -48,14 +48,14 @@ namespace
Noise2D::Noise2D(int f)
{
freq = f;
grads = new CVector2D_Maths*[freq];
grads = new CVector2D*[freq];
for(int i=0; i<freq; i++)
{
grads[i] = new CVector2D_Maths[freq];
grads[i] = new CVector2D[freq];
for(int j=0; j<freq; j++)
{
float a = randFloat() * 2 * (float)M_PI;
grads[i][j] = CVector2D_Maths(cos(a), sin(a));
grads[i][j] = CVector2D(cos(a), sin(a));
}
}
}
@@ -86,10 +86,10 @@ float Noise2D::operator()(float x, float y)
int ix1 = (ix+1) % freq;
int iy1 = (iy+1) % freq;
float s = grads[ix][iy].Dot(CVector2D_Maths(fx, fy));
float t = grads[ix1][iy].Dot(CVector2D_Maths(fx-1, fy));
float u = grads[ix][iy1].Dot(CVector2D_Maths(fx, fy-1));
float v = grads[ix1][iy1].Dot(CVector2D_Maths(fx-1, fy-1));
float s = grads[ix][iy].Dot(CVector2D(fx, fy));
float t = grads[ix1][iy].Dot(CVector2D(fx-1, fy));
float u = grads[ix][iy1].Dot(CVector2D(fx, fy-1));
float v = grads[ix1][iy1].Dot(CVector2D(fx-1, fy-1));
float ex = easeCurve(fx);
float ey = easeCurve(fy);