mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-29 06:13:22 +00:00
# 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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user