|
From: <axl...@us...> - 2010-11-13 21:40:58
|
Revision: 763
http://hgengine.svn.sourceforge.net/hgengine/?rev=763&view=rev
Author: axlecrusher
Date: 2010-11-13 21:40:52 +0000 (Sat, 13 Nov 2010)
Log Message:
-----------
go back to just using the stack
Modified Paths:
--------------
Mercury2/src/MercuryVertex.cpp
Mercury2/src/MercuryVertex.h
Modified: Mercury2/src/MercuryVertex.cpp
===================================================================
--- Mercury2/src/MercuryVertex.cpp 2010-11-13 21:40:17 UTC (rev 762)
+++ Mercury2/src/MercuryVertex.cpp 2010-11-13 21:40:52 UTC (rev 763)
@@ -1,28 +1,28 @@
#include <MercuryVertex.h>
#include <MercuryUtil.h>
#include <MercuryMath.h>
-
+/*
float* MercuryVertex::GetFloatMem()
{
if (m_memory==NULL)
{
m_memory = new MercuryMemory< FloatRow >(1024);
}
-// return new FloatRow;
- return (float*)m_memory->Allocate();
+ return new FloatRow;
+// return (float*)m_memory->Allocate();
}
-
+*/
MercuryVertex::MercuryVertex()
- :m_xyzw(NULL)
+// :m_xyzw(NULL)
{
- m_xyzw = GetFloatMem();
+// m_xyzw = GetFloatMem();
m_xyzw[0] = m_xyzw[1] = m_xyzw[2] = m_xyzw[3] = 0;
}
MercuryVertex::MercuryVertex( float ix, float iy, float iz, float iw )
- :m_xyzw(NULL)
+// :m_xyzw(NULL)
{
- m_xyzw = GetFloatMem();
+// m_xyzw = GetFloatMem();
m_xyzw[0] = ix;
m_xyzw[1] = iy;
m_xyzw[2] = iz;
@@ -30,46 +30,47 @@
}
MercuryVertex::MercuryVertex( const float* in3f, float f )
- :m_xyzw(NULL)
+// :m_xyzw(NULL)
{
- m_xyzw = GetFloatMem();
+// m_xyzw = GetFloatMem();
for (unsigned int i = 0; i < 3; ++i)
(*this)[i] = in3f[i];
m_xyzw[3] = f;
}
MercuryVertex::MercuryVertex( const float* in4f )
- :m_xyzw(NULL)
+// :m_xyzw(NULL)
{
- m_xyzw = GetFloatMem();
+// m_xyzw = GetFloatMem();
for (unsigned int i = 0; i < 4; ++i)
(*this)[i] = in4f[i];
}
MercuryVertex::MercuryVertex( const MercuryVertex& v)
- :m_xyzw(NULL)
+// :m_xyzw(NULL)
{
- m_xyzw = GetFloatMem();
+// m_xyzw = GetFloatMem();
for (unsigned int i = 0; i < 4; ++i)
(*this)[i] = v[i];
}
MercuryVertex::MercuryVertex( const MercuryVertex& v, float w)
- :m_xyzw(NULL)
+// :m_xyzw(NULL)
{
- m_xyzw = GetFloatMem();
+// m_xyzw = GetFloatMem();
for (unsigned int i = 0; i < 3; ++i)
(*this)[i] = v[i];
m_xyzw[3] = w;
}
-
+/*
MercuryVertex::~MercuryVertex()
{
- if (m_xyzw!=NULL)
- m_memory->Free((FloatRow*)m_xyzw);
- m_xyzw = NULL;
+// if (m_xyzw!=NULL)
+// delete m_xyzw;
+// m_memory->Free((FloatRow*)m_xyzw);
+// m_xyzw = NULL;
}
-
+*/
void MercuryVertex::NormalizeSelf()
{
float imag = 1.0f/Length();
@@ -170,7 +171,7 @@
return MercuryVertex(x,y,z);
}
-MercuryMemory< FloatRow >* MercuryVertex::m_memory = NULL;
+//MercuryMemory< FloatRow >* MercuryVertex::m_memory = NULL;
/****************************************************************************
* Copyright (C) 2009 by Joshua Allen *
Modified: Mercury2/src/MercuryVertex.h
===================================================================
--- Mercury2/src/MercuryVertex.h 2010-11-13 21:40:17 UTC (rev 762)
+++ Mercury2/src/MercuryVertex.h 2010-11-13 21:40:52 UTC (rev 763)
@@ -21,7 +21,7 @@
MercuryVertex( const float* in4f );
MercuryVertex( const MercuryVertex& v);
MercuryVertex( const MercuryVertex& v, float w);
- virtual ~MercuryVertex();
+// virtual ~MercuryVertex();
///Direct conversion to float*
__inline__ operator float* () { return m_xyzw; }
@@ -96,11 +96,11 @@
static MercuryVertex CreateFromString(const MString& s);
// float m_xyzw[3];
-// FloatRow m_xyzw;
private:
- float* m_xyzw;
- static MercuryMemory< FloatRow >* m_memory;
- static float* GetFloatMem();
+ FloatRow m_xyzw;
+// float* m_xyzw;
+// static MercuryMemory< FloatRow >* m_memory;
+// static float* GetFloatMem();
};
typedef MercuryVertex MercuryVector;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|