diff options
author | Aki <please@ignore.pl> | 2022-03-27 17:42:26 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-03-27 17:42:26 +0200 |
commit | a12e588079700d55a0b788fea2df7727c2e41f52 (patch) | |
tree | 690072569624c73af5043b3619acaab4d298b1fa /Stars45/Terrain.cpp | |
parent | 72bb517271dad40a440533ad0796a88247011199 (diff) | |
download | starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.zip starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.gz starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.bz2 |
Removed MemDebug from FoundationEx
Diffstat (limited to 'Stars45/Terrain.cpp')
-rw-r--r-- | Stars45/Terrain.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/Stars45/Terrain.cpp b/Stars45/Terrain.cpp index 2cbdf3b..4d0a5f9 100644 --- a/Stars45/Terrain.cpp +++ b/Stars45/Terrain.cpp @@ -10,7 +10,6 @@ ======== */ -#include "MemDebug.h" #include "Terrain.h" #include "TerrainApron.h" #include "TerrainClouds.h" @@ -58,7 +57,7 @@ aprons(0), clouds(0), terrain_normals(0) ListIter<TerrainLayer> iter = region->GetLayers(); while (++iter) { TerrainLayer* orig = iter.value(); - TerrainLayer* copy = new(__FILE__,__LINE__) TerrainLayer; + TerrainLayer* copy = new TerrainLayer; *copy = *orig; layers.append(copy); } @@ -158,9 +157,9 @@ Terrain::BuildTerrain() double offset = -subdivisions/2; if (water_texture) { - water = new(__FILE__,__LINE__) Water*[6]; + water = new Water*[6]; for (i = 0; i < 6; i++) { - water[i] = new(__FILE__,__LINE__) Water(); + water[i] = new Water(); int n = (1<<i) + 1; water[i]->Init(n, (float) (scale*patch_size), 90.0f); } @@ -182,10 +181,10 @@ Terrain::BuildTerrain() loader->LoadTexture(layer->detail_name, layer->detail_texture); } - patches = new(__FILE__,__LINE__) TerrainPatch*[subdivisions*subdivisions]; + patches = new TerrainPatch*[subdivisions*subdivisions]; if (water_texture) - water_patches = new(__FILE__,__LINE__) TerrainPatch*[subdivisions*subdivisions]; + water_patches = new TerrainPatch*[subdivisions*subdivisions]; for (i = 0; i < subdivisions; i++) { for (j = 0; j < subdivisions; j++) { @@ -195,10 +194,10 @@ Terrain::BuildTerrain() Point p2((j1 + offset+1)*dx, mtnscale, (i + offset+1)*dz); int index = i*subdivisions+j; - patches[index] = new(__FILE__,__LINE__) TerrainPatch(this, &terrain_patch, rect, p1, p2); + patches[index] = new TerrainPatch(this, &terrain_patch, rect, p1, p2); if (water_texture && patches[index]->MinHeight() < 3) - water_patches[index] = new(__FILE__,__LINE__) TerrainPatch(this, rect, p1, p2, 30); + water_patches[index] = new TerrainPatch(this, rect, p1, p2, 30); else if (water_patches != 0) water_patches[index] = 0; @@ -211,7 +210,7 @@ Terrain::BuildTerrain() offset = -3.0/2; double xoffset = offset + 1.0/16.0; - aprons = new(__FILE__,__LINE__) TerrainApron*[8]; + aprons = new TerrainApron*[8]; for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { @@ -221,7 +220,7 @@ Terrain::BuildTerrain() Point p1((j1 + xoffset )*dx, 0, (i + offset )*dz); Point p2((j1 + xoffset+1)*dx, mtnscale, (i + offset+1)*dz); - aprons[a++] = new(__FILE__,__LINE__) TerrainApron(this, &terrain_apron, rect, p1, p2); + aprons[a++] = new TerrainApron(this, &terrain_apron, rect, p1, p2); } } } @@ -235,12 +234,12 @@ Terrain::BuildTerrain() if (state == Weather::MODERATE_CLOUDS) nclouds *= 2; - clouds = new(__FILE__,__LINE__) TerrainClouds*[nclouds]; + clouds = new TerrainClouds*[nclouds]; a = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { - clouds[a] = new(__FILE__,__LINE__) TerrainClouds(this, 0); + clouds[a] = new TerrainClouds(this, 0); double xloc = (j-1) * 75000 + (rand()/32768.0 - 0.5) * 50000; double yloc = (i-1) * 75000 + (rand()/32768.0 - 0.5) * 50000; @@ -255,7 +254,7 @@ Terrain::BuildTerrain() for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { - clouds[a] = new(__FILE__,__LINE__) TerrainClouds(this, 1); + clouds[a] = new TerrainClouds(this, 1); double xloc = (j-1) * 75000 + (rand()/32768.0 - 0.5) * 50000; double yloc = (i-1) * 75000 + (rand()/32768.0 - 0.5) * 50000; @@ -283,11 +282,11 @@ Terrain::BuildNormals() int w = terrain_patch.Width(); int h = terrain_patch.Height(); Color* pix = terrain_patch.HiPixels(); - BYTE* alt = new(__FILE__,__LINE__) BYTE[h*w]; + BYTE* alt = new BYTE[h*w]; int nverts = w * h; double scale = region->MountainScale() / (region->LateralScale() * 2.0); - terrain_normals = new(__FILE__,__LINE__) Vec3B[nverts]; + terrain_normals = new Vec3B[nverts]; ZeroMemory(terrain_normals, sizeof(Vec3B) * nverts); |