diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-07 19:08:08 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:55 +0200 |
commit | 12fffa7df0685ef6d23ffe888a06695ae490df81 (patch) | |
tree | ffdc24e482b7d4610bdec6f1ebb8ccc0800c5ee5 /src/engine/graphics/string_matrix.cpp | |
parent | a9a4381398098107d1b359a19338e91651605de8 (diff) |
refactor: make vector2 data int32_t
Diffstat (limited to 'src/engine/graphics/string_matrix.cpp')
-rw-r--r-- | src/engine/graphics/string_matrix.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/engine/graphics/string_matrix.cpp b/src/engine/graphics/string_matrix.cpp index b1db334..26d48df 100644 --- a/src/engine/graphics/string_matrix.cpp +++ b/src/engine/graphics/string_matrix.cpp @@ -22,12 +22,18 @@ void StringMatrix::fill(std::string_view element) std::string_view StringMatrix::get(const Vector2 &pos) const { - return _matrix[pos.get_y()][pos.get_x()]; + auto x = static_cast<std::size_t>(pos.get_x()); + auto y = static_cast<std::size_t>(pos.get_y()); + + return _matrix[y][x]; } void StringMatrix::set(const Vector2 &pos, std::string_view element) { - _matrix[pos.get_y()][pos.get_x()] = element; + auto x = static_cast<std::size_t>(pos.get_x()); + auto y = static_cast<std::size_t>(pos.get_y()); + + _matrix[y][x] = element; } uint32_t StringMatrix::rows() const |