diff --git a/src/lol/math/array2d.h b/src/lol/math/array2d.h index 9a7454aa..4a7f10fe 100644 --- a/src/lol/math/array2d.h +++ b/src/lol/math/array2d.h @@ -36,7 +36,8 @@ template { public: - typedef typename Array::Element Element; + typedef Array Super; + typedef typename Super::Element Element; inline Array2D() : m_size(0, 0) @@ -141,9 +142,9 @@ public: /* Resize the array. * FIXME: data gets scrambled; should we care? */ - inline void SetSize(ivec2 size) + inline void SetSize(ivec2 size, Element e = Element()) { - this->Resize(size.x * size.y); + this->Resize(size.x * size.y, e); m_size = size; } @@ -152,6 +153,12 @@ public: return m_size; } +public: + inline Element *Data() { return Super::Data(); } + inline Element const *Data() const { return Super::Data(); } + inline int Count() const { return Super::Count(); } + inline int Bytes() const { return Super::Bytes(); } + private: ivec2 m_size; };