Moved Array2D to it's own file.

This commit is contained in:
David Williams
2014-08-21 21:38:19 +02:00
parent 46358adfbc
commit 20815b6083
3 changed files with 63 additions and 30 deletions

View File

@ -25,40 +25,12 @@ freely, subject to the following restrictions:
#include "PolyVoxCore/Array.h"
#include "PolyVoxCore/Impl/Array2D.h"
#include <QtTest>
using namespace PolyVox;
template <typename ElementType>
class Array2D
{
public:
Array2D(uint32_t width, uint32_t height)
:m_uWidth(width)
,m_uHeight(height)
,m_pData(0)
{
m_pData = new ElementType[m_uWidth * m_uHeight];
}
~Array2D()
{
delete[] m_pData;
}
ElementType& operator()(uint32_t x, uint32_t y)
{
return m_pData[y * m_uWidth + x];
}
private:
uint32_t m_uWidth;
uint32_t m_uHeight;
ElementType* m_pData;
};
void TestArray::testCArraySpeed()
{
const int width = 128;