]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/meshtex/AllocatedMatrix.h
Merge commit 'b017c473e86330d5908858b8add1b16674b0a1a8' into garux-merge
[xonotic/netradiant.git] / contrib / meshtex / AllocatedMatrix.h
index db3850fb9ed0b57981a4b5e0997ff58a3c03af6a..3967d6c85c07c9661c46b000ec9ecb956f427eea 100644 (file)
@@ -38,8 +38,8 @@
 template<typename Element>
 class AllocatedMatrix : public Matrix<Element>
 {
-       std::size_t m_x, m_y;
-       Element* m_data; 
+       //std::size_t m_x, m_y;
+       //Element* m_data;
 public: // public methods
 
    /**
@@ -48,8 +48,11 @@ public: // public methods
     * @param x Matrix x dimension.
     * @param y Matrix y dimension.
     */
-   AllocatedMatrix(std::size_t x, std::size_t y) : m_x(x), m_y(y), m_data(_allocated = new Element[x*y]){}
-//      Matrix(x, y, (_allocated = new Element[x*y])) {}
+   //AllocatedMatrix(std::size_t x, std::size_t y) : m_x(x), m_y(y), m_data(_allocated = new Element[x*y]){} //doesnt work.
+   //AllocatedMatrix(std::size_t x, std::size_t y) : Matrix(x, y, (_allocated = new Element[x*y])) {} //msvc
+   typedef Matrix<Element> matrix_type;
+   AllocatedMatrix(std::size_t x, std::size_t y) : matrix_type(x, y, (_allocated = new Element[x*y])) {}
+
 
    /**
     * Destructor. Deallocates the data array.
@@ -64,4 +67,4 @@ private: // private member vars
    Element *_allocated;
 };
 
-#endif // #if !defined(INCLUDED_ALLOCATEDMATRIX_H)
\ No newline at end of file
+#endif // #if !defined(INCLUDED_ALLOCATEDMATRIX_H)