summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Solid.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-03-27 17:42:26 +0200
committerAki <please@ignore.pl>2022-03-27 17:42:26 +0200
commita12e588079700d55a0b788fea2df7727c2e41f52 (patch)
tree690072569624c73af5043b3619acaab4d298b1fa /Stars45/Solid.cpp
parent72bb517271dad40a440533ad0796a88247011199 (diff)
downloadstarshatter-a12e588079700d55a0b788fea2df7727c2e41f52.zip
starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.gz
starshatter-a12e588079700d55a0b788fea2df7727c2e41f52.tar.bz2
Removed MemDebug from FoundationEx
Diffstat (limited to 'Stars45/Solid.cpp')
-rw-r--r--Stars45/Solid.cpp59
1 files changed, 29 insertions, 30 deletions
diff --git a/Stars45/Solid.cpp b/Stars45/Solid.cpp
index 6ea1430..ff4f610 100644
--- a/Stars45/Solid.cpp
+++ b/Stars45/Solid.cpp
@@ -11,7 +11,6 @@
Classes for rendering solid meshes of polygons
*/
-#include "MemDebug.h"
#include "Solid.h"
#include "Scene.h"
#include "Bitmap.h"
@@ -51,8 +50,8 @@ public:
nverts = s->NumVerts();
ntris = s->NumIndices() / 3;
- locs = new(__FILE__,__LINE__) IcePoint[nverts];
- tris = new(__FILE__,__LINE__) IndexedTriangle[ntris];
+ locs = new IcePoint[nverts];
+ tris = new IndexedTriangle[ntris];
if (locs && tris) {
int i, n = 0;
@@ -548,7 +547,7 @@ Solid::Load(const char* mag_file, double scale)
ClearModel();
// loading our own copy, so we own the model:
- model = new(__FILE__,__LINE__) Model;
+ model = new Model;
own_model = 1;
// now load the model:
@@ -570,7 +569,7 @@ Solid::Load(ModelFile* mod_file, double scale)
ClearModel();
// loading our own copy, so we own the model:
- model = new(__FILE__,__LINE__) Model;
+ model = new Model;
own_model = 1;
// now load the model:
@@ -617,7 +616,7 @@ void
Solid::CreateShadows(int nlights)
{
while (shadows.size() < nlights) {
- shadows.append(new(__FILE__,__LINE__) Shadow(this));
+ shadows.append(new Shadow(this));
}
}
@@ -819,7 +818,7 @@ Model::operator = (const Model& m)
ListIter<Material> m_iter = pmod->materials;
while (++m_iter) {
Material* matl1 = m_iter.value();
- Material* matl2 = new(__FILE__,__LINE__) Material;
+ Material* matl2 = new Material;
CopyMemory(matl2, matl1, sizeof(Material));
matl2->thumbnail = 0;
@@ -830,7 +829,7 @@ Model::operator = (const Model& m)
ListIter<Surface> s_iter = pmod->surfaces;
while (++s_iter) {
Surface* surf1 = s_iter.value();
- Surface* surf2 = new(__FILE__,__LINE__) Surface;
+ Surface* surf2 = new Surface;
surf2->Copy(*surf1, this);
surfaces.append(surf2);
@@ -1043,7 +1042,7 @@ Model::LoadMag5(BYTE* block, int len, double scale)
// read texture list:
for (int i = 0; i < ntex; i++) {
- mtl = new(__FILE__,__LINE__) Material;
+ mtl = new Material;
char tname[32];
if (mtl) {
@@ -1085,15 +1084,15 @@ Model::LoadMag5(BYTE* block, int len, double scale)
nverts = npolys * 4;
- Surface* s = new(__FILE__,__LINE__) Surface;
+ Surface* s = new Surface;
VertexSet* vset = 0;
if (s) {
strcpy_s(s->name, "default");
s->model = this;
- s->vertex_set = new(__FILE__,__LINE__) VertexSet(nverts);
- s->vloc = new(__FILE__,__LINE__) Vec3[nverts];
+ s->vertex_set = new VertexSet(nverts);
+ s->vloc = new Vec3[nverts];
ZeroMemory(s->vertex_set->loc, nverts * sizeof(Vec3));
ZeroMemory(s->vertex_set->diffuse, nverts * sizeof(DWORD));
@@ -1104,7 +1103,7 @@ Model::LoadMag5(BYTE* block, int len, double scale)
ZeroMemory(s->vloc, nverts * sizeof(Vec3));
s->npolys = npolys;
- s->polys = new(__FILE__,__LINE__) Poly[npolys];
+ s->polys = new Poly[npolys];
ZeroMemory(s->polys, sizeof(Poly) * npolys);
surfaces.append(s);
@@ -1274,7 +1273,7 @@ Model::LoadMag5(BYTE* block, int len, double scale)
}
if (!segment) {
- segment = new(__FILE__,__LINE__) Segment;
+ segment = new Segment;
segment->npolys = 1;
segment->polys = &s->polys[n];
@@ -1341,7 +1340,7 @@ Model::LoadMag6(BYTE* block, int len, double scale)
// read texture list:
if (ntex) {
- char* buffer = new(__FILE__,__LINE__) char[ntex];
+ char* buffer = new char[ntex];
char* p = buffer;
Bitmap* bmp = 0;
@@ -1359,7 +1358,7 @@ Model::LoadMag6(BYTE* block, int len, double scale)
for (int i = 0; i < nmtls; i++) {
MaterialMag6 m6;
- Material* mtl = new(__FILE__,__LINE__) Material;
+ Material* mtl = new Material;
loader->fread(&m6, sizeof(m6), 1, fp);
@@ -1415,7 +1414,7 @@ Model::LoadMag6(BYTE* block, int len, double scale)
loader->fread(&namelen, 1, 1, fp);
loader->fread(name, 1, namelen, fp);
- Surface* surface = new(__FILE__,__LINE__) Surface;
+ Surface* surface = new Surface;
surface->model = this;
surface->SetName(name);
surface->CreateVerts(nverts);
@@ -1510,7 +1509,7 @@ Model::LoadMag6(BYTE* block, int len, double scale)
}
if (!segment) {
- segment = new(__FILE__,__LINE__) Segment;
+ segment = new Segment;
segment->npolys = 1;
segment->polys = &polys[n];
@@ -1828,14 +1827,14 @@ Surface::Copy(Surface& s, Model* m)
vertex_set = s.vertex_set->Clone();
if (nhull > 0) {
- vloc = new(__FILE__,__LINE__) Vec3[nhull];
+ vloc = new Vec3[nhull];
CopyMemory(vloc, s.vloc, nhull * sizeof(Vec3));
}
else {
vloc = 0;
}
- polys = new(__FILE__,__LINE__) Poly[npolys];
+ polys = new Poly[npolys];
CopyMemory(polys, s.polys, npolys * sizeof(Poly));
for (int i = 0; i < npolys; i++) {
@@ -1848,7 +1847,7 @@ Surface::Copy(Surface& s, Model* m)
ListIter<Segment> iter = s.segments;
while (++iter) {
Segment* seg1 = iter.value();
- Segment* seg2 = new(__FILE__,__LINE__) Segment;
+ Segment* seg2 = new Segment;
seg2->npolys = seg1->npolys;
seg2->polys = polys + (seg1->polys - s.polys);
@@ -1908,8 +1907,8 @@ void
Surface::CreateVerts(int nverts)
{
if (!vertex_set && !vloc) {
- vertex_set = new(__FILE__,__LINE__) VertexSet(nverts);
- vloc = new(__FILE__,__LINE__) Vec3[nverts];
+ vertex_set = new VertexSet(nverts);
+ vloc = new Vec3[nverts];
}
}
@@ -1918,7 +1917,7 @@ Surface::CreatePolys(int np)
{
if (!polys && !npolys) {
npolys = np;
- polys = new(__FILE__,__LINE__) Poly[npolys];
+ polys = new Poly[npolys];
ZeroMemory(polys, npolys * sizeof(Poly));
}
@@ -1938,7 +1937,7 @@ Surface::AddPolys(int np, int nv)
vertex_set->Resize(newverts, true);
- Poly* pset = new(__FILE__,__LINE__) Poly[newpolys];
+ Poly* pset = new Poly[newpolys];
Poly* pnew = pset + npolys;
CopyMemory(pset, polys, npolys * sizeof(Poly));
@@ -1978,7 +1977,7 @@ Surface::ExplodeMesh()
}
// create target vertex set:
- VertexSet* vset = new(__FILE__,__LINE__) VertexSet(nverts);
+ VertexSet* vset = new VertexSet(nverts);
v = 0;
// explode verts:
@@ -2010,7 +2009,7 @@ Surface::ExplodeMesh()
if (vloc)
delete [] vloc;
- vloc = new(__FILE__,__LINE__) Vec3[nverts];
+ vloc = new Vec3[nverts];
ComputeTangents();
BuildHull();
@@ -2100,7 +2099,7 @@ Surface::OptimizeMesh()
}
// create target vertex set:
- VertexSet* vset = new(__FILE__,__LINE__) VertexSet(used);
+ VertexSet* vset = new VertexSet(used);
int v = 0;
// compress verts:
@@ -2154,7 +2153,7 @@ Surface::OptimizeMesh()
if (vloc)
delete [] vloc;
- vloc = new(__FILE__,__LINE__) Vec3[nverts];
+ vloc = new Vec3[nverts];
ComputeTangents();
BuildHull();
@@ -2400,7 +2399,7 @@ Surface::CalcGradients(Poly& p, Vec3& tangent, Vec3& binormal)
void
Surface::InitializeCollisionHull()
{
- opcode = new(__FILE__,__LINE__) OPCODE_data(this);
+ opcode = new OPCODE_data(this);
}
// +--------------------------------------------------------------------+