Optimization du renderer.

This commit is contained in:
MarcEricMartel
2021-12-03 11:49:59 -05:00
parent 033f69465c
commit ecddc82e7b
13 changed files with 158 additions and 117 deletions

View File

@@ -12,6 +12,7 @@ class Array2d {
void Set(int x, int y, T type);
T Get(int x, int y) const;
T Remove(int x, int y);
void Reset(T type);
@@ -41,6 +42,13 @@ void Array2d<T>::Set(int x, int y, T type) { m_array[To1dIndex(x, y)] = type; }
template <class T>
T Array2d<T>::Get(int x, int y) const { return m_array[To1dIndex(x, y)]; }
template <class T>
T Array2d<T>::Remove(int x, int y) {
T thing = std::move(m_array[To1dIndex(x, y)]);
m_array[To1dIndex(x, y)] = nullptr;
return thing;
}
template <class T>
void Array2d<T>::Reset(T type) {
for (int i = 0; i < m_x * m_y; ++i)