From 12fffa7df0685ef6d23ffe888a06695ae490df81 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 7 Mar 2022 19:08:08 +0100 Subject: refactor: make vector2 data int32_t --- src/engine/graphics/string_matrix.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/engine/graphics') 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(pos.get_x()); + auto y = static_cast(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(pos.get_x()); + auto y = static_cast(pos.get_y()); + + _matrix[y][x] = element; } uint32_t StringMatrix::rows() const -- cgit v1.2.3-18-g5258