Optimization du renderer.
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user