diff --git a/specter/include/specter/Icon.hpp b/specter/include/specter/Icon.hpp index 2bfa42241..ad30b1bd0 100644 --- a/specter/include/specter/Icon.hpp +++ b/specter/include/specter/Icon.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include "specter/View.hpp" @@ -15,9 +16,9 @@ class ViewResources; struct Icon { boo::ObjToken m_tex; - zeus::CVector2f m_uvCoords[4]; + std::array m_uvCoords; Icon() = default; - Icon(boo::ObjToken tex, float rect[4]) : m_tex(std::move(tex)) { + Icon(boo::ObjToken tex, const std::array& rect) : m_tex(std::move(tex)) { m_uvCoords[0][0] = rect[0]; m_uvCoords[0][1] = -rect[3]; @@ -35,11 +36,15 @@ struct Icon { template class IconAtlas { boo::ObjToken m_tex; - Icon m_icons[COLS][ROWS]; + std::array, COLS> m_icons; - Icon MakeIcon(float x, float y) { - float rect[] = {x / float(COLS), y / float(ROWS), x / float(COLS) + 1.f / float(COLS), - y / float(ROWS) + 1.f / float(ROWS)}; + Icon MakeIcon(float x, float y) const { + const std::array rect{ + x / float(COLS), + y / float(ROWS), + x / float(COLS) + 1.f / float(COLS), + y / float(ROWS) + 1.f / float(ROWS), + }; return Icon(m_tex.get(), rect); }