From 439808e259518b7b05955f8ba08f47aedb1dc76e Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 2 Jan 2021 22:04:31 +0100 Subject: [PATCH] Remove glm_cols and glm_rows function calls in favor of built-in GLM functions --- ext/ghoul | 2 +- src/properties/matrix/dmat2property.cpp | 20 +++++++++----------- src/properties/matrix/dmat2x3property.cpp | 20 +++++++++----------- src/properties/matrix/dmat2x4property.cpp | 20 +++++++++----------- src/properties/matrix/dmat3property.cpp | 20 +++++++++----------- src/properties/matrix/dmat3x2property.cpp | 20 +++++++++----------- src/properties/matrix/dmat3x4property.cpp | 20 +++++++++----------- src/properties/matrix/dmat4property.cpp | 20 +++++++++----------- src/properties/matrix/dmat4x2property.cpp | 20 +++++++++----------- src/properties/matrix/dmat4x3property.cpp | 20 +++++++++----------- src/properties/matrix/mat2property.cpp | 20 +++++++++----------- src/properties/matrix/mat2x3property.cpp | 20 +++++++++----------- src/properties/matrix/mat2x4property.cpp | 20 +++++++++----------- src/properties/matrix/mat3property.cpp | 20 +++++++++----------- src/properties/matrix/mat3x2property.cpp | 20 +++++++++----------- src/properties/matrix/mat3x4property.cpp | 20 +++++++++----------- src/properties/matrix/mat4property.cpp | 20 +++++++++----------- src/properties/matrix/mat4x2property.cpp | 20 +++++++++----------- src/properties/matrix/mat4x3property.cpp | 20 +++++++++----------- 19 files changed, 163 insertions(+), 199 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 37757a2e83..1f97e924b3 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 37757a2e83ac423d391c663a32e4efb95b0b2084 +Subproject commit 1f97e924b36bedcf95a7e4e562e23319338ee238 diff --git a/src/properties/matrix/dmat2property.cpp b/src/properties/matrix/dmat2property.cpp index e99d0d3cf0..49c2945347 100644 --- a/src/properties/matrix/dmat2property.cpp +++ b/src/properties/matrix/dmat2property.cpp @@ -36,8 +36,8 @@ glm::dmat2x2 fromLuaConversion(lua_State* state, bool& success) { glm::dmat2x2 result; lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x2::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -63,8 +63,8 @@ glm::dmat2x2 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::dmat2x2 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x2::col_type::length(); ++j) { lua_pushnumber(state, value[i][j]); lua_rawseti(state, -2, number); ++number; @@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat2x2 value) { glm::dmat2x2 fromStringConversion(const std::string& val, bool& success) { glm::dmat2x2 result = glm::dmat2x2(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x2::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::dmat2x2::value_type v; s >> v; @@ -104,8 +102,8 @@ glm::dmat2x2 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::dmat2x2 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x2::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/dmat2x3property.cpp b/src/properties/matrix/dmat2x3property.cpp index 55bafb7c6c..bc2c45bdcc 100644 --- a/src/properties/matrix/dmat2x3property.cpp +++ b/src/properties/matrix/dmat2x3property.cpp @@ -36,8 +36,8 @@ glm::dmat2x3 fromLuaConversion(lua_State* state, bool& success) { glm::dmat2x3 result; lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -63,8 +63,8 @@ glm::dmat2x3 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::dmat2x3 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) { lua_pushnumber(state, value[i][j]); lua_rawseti(state, -2, number); ++number; @@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat2x3 value) { glm::dmat2x3 fromStringConversion(const std::string& val, bool& success) { glm::dmat2x3 result = glm::dmat2x3(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::dmat2x3::value_type v; s >> v; @@ -104,8 +102,8 @@ glm::dmat2x3 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::dmat2x3 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/dmat2x4property.cpp b/src/properties/matrix/dmat2x4property.cpp index 5ccc63ebbc..0134c624e8 100644 --- a/src/properties/matrix/dmat2x4property.cpp +++ b/src/properties/matrix/dmat2x4property.cpp @@ -36,8 +36,8 @@ glm::dmat2x4 fromLuaConversion(lua_State* state, bool& success) { glm::dmat2x4 result; lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x4::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -63,8 +63,8 @@ glm::dmat2x4 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::dmat2x4 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x4::col_type::length(); ++j) { lua_pushnumber(state, value[i][j]); lua_rawseti(state, -2, number); ++number; @@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat2x4 value) { glm::dmat2x4 fromStringConversion(const std::string& val, bool& success) { glm::dmat2x4 result = glm::dmat2x4(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x4::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::dmat2x4::value_type v; s >> v; @@ -104,8 +102,8 @@ glm::dmat2x4 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::dmat2x4 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat2x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x4::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/dmat3property.cpp b/src/properties/matrix/dmat3property.cpp index f7ff215a2a..c3f94f472e 100644 --- a/src/properties/matrix/dmat3property.cpp +++ b/src/properties/matrix/dmat3property.cpp @@ -36,8 +36,8 @@ glm::dmat3x3 fromLuaConversion(lua_State* state, bool& success) { glm::dmat3x3 result; lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -63,8 +63,8 @@ glm::dmat3x3 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::dmat3x3 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) { lua_pushnumber(state, value[i][j]); lua_rawseti(state, -2, number); ++number; @@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat3x3 value) { glm::dmat3x3 fromStringConversion(const std::string& val, bool& success) { glm::dmat3x3 result = glm::dmat3x3(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::dmat3x3::value_type v; s >> v; @@ -104,8 +102,8 @@ glm::dmat3x3 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::dmat3x3 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat2x3::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/dmat3x2property.cpp b/src/properties/matrix/dmat3x2property.cpp index 29edd6bec7..fd58a78776 100644 --- a/src/properties/matrix/dmat3x2property.cpp +++ b/src/properties/matrix/dmat3x2property.cpp @@ -36,8 +36,8 @@ glm::dmat3x2 fromLuaConversion(lua_State* state, bool& success) { glm::dmat3x2 result; lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat3x2::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -63,8 +63,8 @@ glm::dmat3x2 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::dmat3x2 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat3x2::col_type::length(); ++j) { lua_pushnumber(state, value[i][j]); lua_rawseti(state, -2, number); ++number; @@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat3x2 value) { glm::dmat3x2 fromStringConversion(const std::string& val, bool& success) { glm::dmat3x2 result = glm::dmat3x2(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat3x2::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::dmat3x2::value_type v; s >> v; @@ -104,8 +102,8 @@ glm::dmat3x2 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::dmat3x2 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat3x2::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/dmat3x4property.cpp b/src/properties/matrix/dmat3x4property.cpp index 7ce468853a..531a839970 100644 --- a/src/properties/matrix/dmat3x4property.cpp +++ b/src/properties/matrix/dmat3x4property.cpp @@ -36,8 +36,8 @@ glm::dmat3x4 fromLuaConversion(lua_State* state, bool& success) { glm::dmat3x4 result; lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat3x4::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -63,8 +63,8 @@ glm::dmat3x4 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::dmat3x4 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat3x4::col_type::length(); ++j) { lua_pushnumber(state, value[i][j]); lua_rawseti(state, -2, number); ++number; @@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::dmat3x4 value) { glm::dmat3x4 fromStringConversion(const std::string& val, bool& success) { glm::dmat3x4 result = glm::dmat3x4(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat3x4::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::dmat3x4::value_type v; s >> v; @@ -105,8 +103,8 @@ glm::dmat3x4 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::dmat3x4 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat3x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat3x4::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/dmat4property.cpp b/src/properties/matrix/dmat4property.cpp index a2da14e804..6cff54b244 100644 --- a/src/properties/matrix/dmat4property.cpp +++ b/src/properties/matrix/dmat4property.cpp @@ -36,8 +36,8 @@ glm::dmat4x4 fromLuaConversion(lua_State* state, bool& success) { glm::dmat4x4 result; lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x4::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -63,8 +63,8 @@ glm::dmat4x4 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::dmat4x4 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x4::col_type::length(); ++j) { lua_pushnumber(state, value[i][j]); lua_rawseti(state, -2, number); ++number; @@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat4x4 value) { glm::dmat4x4 fromStringConversion(const std::string& val, bool& success) { glm::dmat4x4 result = glm::dmat4x4(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x4::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::dmat4x4::value_type v; s >> v; @@ -104,8 +102,8 @@ glm::dmat4x4 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::dmat4x4 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x4::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/dmat4x2property.cpp b/src/properties/matrix/dmat4x2property.cpp index 50bd58a054..ee1c31e26d 100644 --- a/src/properties/matrix/dmat4x2property.cpp +++ b/src/properties/matrix/dmat4x2property.cpp @@ -36,8 +36,8 @@ glm::dmat4x2 fromLuaConversion(lua_State* state, bool& success) { glm::dmat4x2 result; lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x2::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -63,8 +63,8 @@ glm::dmat4x2 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::dmat4x2 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x2::col_type::length(); ++j) { lua_pushnumber(state, value[i][j]); lua_rawseti(state, -2, number); ++number; @@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat4x2 value) { glm::dmat4x2 fromStringConversion(const std::string& val, bool& success) { glm::dmat4x2 result = glm::dmat4x2(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x2::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::dmat4x2::value_type v; s >> v; @@ -104,8 +102,8 @@ glm::dmat4x2 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::dmat4x2 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x2::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/dmat4x3property.cpp b/src/properties/matrix/dmat4x3property.cpp index 399b3f62fe..fe11fd7118 100644 --- a/src/properties/matrix/dmat4x3property.cpp +++ b/src/properties/matrix/dmat4x3property.cpp @@ -36,8 +36,8 @@ glm::dmat4x3 fromLuaConversion(lua_State* state, bool& success) { glm::dmat4x3 result; lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x3::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -63,8 +63,8 @@ glm::dmat4x3 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::dmat4x3 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x3::col_type::length(); ++j) { lua_pushnumber(state, value[i][j]); lua_rawseti(state, -2, number); ++number; @@ -76,15 +76,13 @@ bool toLuaConversion(lua_State* state, glm::dmat4x3 value) { glm::dmat4x3 fromStringConversion(const std::string& val, bool& success) { glm::dmat4x3 result = glm::dmat4x3(1.0); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x3::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::dmat4x3::value_type v; s >> v; @@ -104,8 +102,8 @@ glm::dmat4x3 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::dmat4x3 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::dmat4x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::dmat4x3::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/mat2property.cpp b/src/properties/matrix/mat2property.cpp index 8a156ef584..be91afeb1e 100644 --- a/src/properties/matrix/mat2property.cpp +++ b/src/properties/matrix/mat2property.cpp @@ -36,8 +36,8 @@ glm::mat2x2 fromLuaConversion(lua_State* state, bool& success) { glm::mat2x2 result = glm::mat2x2(1.f); lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x2::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -65,8 +65,8 @@ glm::mat2x2 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::mat2x2 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x2::col_type::length(); ++j) { lua_pushnumber(state, static_cast(value[i][j])); lua_rawseti(state, -2, number); ++number; @@ -78,15 +78,13 @@ bool toLuaConversion(lua_State* state, glm::mat2x2 value) { glm::mat2x2 fromStringConversion(const std::string& val, bool& success) { glm::mat2x2 result = glm::mat2x2(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x2::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::mat2x2::value_type v; s >> v; @@ -106,8 +104,8 @@ glm::mat2x2 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::mat2x2 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x2::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/mat2x3property.cpp b/src/properties/matrix/mat2x3property.cpp index a31fb30601..0cc150c78c 100644 --- a/src/properties/matrix/mat2x3property.cpp +++ b/src/properties/matrix/mat2x3property.cpp @@ -38,8 +38,8 @@ glm::mat2x3 fromLuaConversion(lua_State* state, bool& success) { glm::mat2x3 result = glm::mat2x3(1.f); lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x3::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -66,8 +66,8 @@ glm::mat2x3 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::mat2x3 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x3::col_type::length(); ++j) { lua_pushnumber(state, static_cast(value[i][j])); lua_rawseti(state, -2, number); ++number; @@ -79,15 +79,13 @@ bool toLuaConversion(lua_State* state, glm::mat2x3 value) { glm::mat2x3 fromStringConversion(const std::string& val, bool& success) { glm::mat2x3 result = glm::mat2x3(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x3::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::mat2x3::value_type v; s >> v; @@ -107,8 +105,8 @@ glm::mat2x3 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::mat2x3 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x3::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/mat2x4property.cpp b/src/properties/matrix/mat2x4property.cpp index b3f4a888eb..1867ed5dd0 100644 --- a/src/properties/matrix/mat2x4property.cpp +++ b/src/properties/matrix/mat2x4property.cpp @@ -36,8 +36,8 @@ glm::mat2x4 fromLuaConversion(lua_State* state, bool& success) { glm::mat2x4 result = glm::mat2x4(1.f); lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x4::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -64,8 +64,8 @@ glm::mat2x4 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::mat2x4 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x4::col_type::length(); ++j) { lua_pushnumber(state, static_cast(value[i][j])); lua_rawseti(state, -2, number); ++number; @@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat2x4 value) { glm::mat2x4 fromStringConversion(const std::string& val, bool& success) { glm::mat2x4 result = glm::mat2x4(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x4::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::mat2x4::value_type v; s >> v; @@ -105,8 +103,8 @@ glm::mat2x4 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::mat2x4 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat2x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat2x4::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/mat3property.cpp b/src/properties/matrix/mat3property.cpp index f7896baf83..79748ebeea 100644 --- a/src/properties/matrix/mat3property.cpp +++ b/src/properties/matrix/mat3property.cpp @@ -36,8 +36,8 @@ glm::mat3x3 fromLuaConversion(lua_State* state, bool& success) { glm::mat3x3 result = glm::mat3x3(1.f); lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x3::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -64,8 +64,8 @@ glm::mat3x3 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::mat3x3 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x3::col_type::length(); ++j) { lua_pushnumber(state, static_cast(value[i][j])); lua_rawseti(state, -2, number); ++number; @@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat3x3 value) { glm::mat3x3 fromStringConversion(const std::string& val, bool& success) { glm::mat3x3 result = glm::mat3x3(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x3::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::mat3x3::value_type v; s >> v; @@ -105,8 +103,8 @@ glm::mat3x3 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::mat3x3 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x3::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/mat3x2property.cpp b/src/properties/matrix/mat3x2property.cpp index 3088c3c794..ce32e1cb97 100644 --- a/src/properties/matrix/mat3x2property.cpp +++ b/src/properties/matrix/mat3x2property.cpp @@ -36,8 +36,8 @@ glm::mat3x2 fromLuaConversion(lua_State* state, bool& success) { glm::mat3x2 result = glm::mat3x2(1.f); lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x2::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -64,8 +64,8 @@ glm::mat3x2 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::mat3x2 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x2::col_type::length(); ++j) { lua_pushnumber(state, static_cast(value[i][j])); lua_rawseti(state, -2, number); ++number; @@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat3x2 value) { glm::mat3x2 fromStringConversion(const std::string& val, bool& success) { glm::mat3x2 result = glm::mat3x2(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x2::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::mat3x2::value_type v; s >> v; @@ -105,8 +103,8 @@ glm::mat3x2 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::mat3x2 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x2::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/mat3x4property.cpp b/src/properties/matrix/mat3x4property.cpp index 6571839d93..9f37aa8f51 100644 --- a/src/properties/matrix/mat3x4property.cpp +++ b/src/properties/matrix/mat3x4property.cpp @@ -36,8 +36,8 @@ glm::mat3x4 fromLuaConversion(lua_State* state, bool& success) { glm::mat3x4 result = glm::mat3x4(1.f); lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x4::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -64,8 +64,8 @@ glm::mat3x4 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::mat3x4 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x4::col_type::length(); ++j) { lua_pushnumber(state, static_cast(value[i][j])); lua_rawseti(state, -2, number); ++number; @@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat3x4 value) { glm::mat3x4 fromStringConversion(const std::string& val, bool& success) { glm::mat3x4 result = glm::mat3x4(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x4::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::mat3x4::value_type v; s >> v; @@ -105,8 +103,8 @@ glm::mat3x4 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::mat3x4 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat3x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat3x4::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/mat4property.cpp b/src/properties/matrix/mat4property.cpp index 1c9ca7a1b9..8be8cc6ef7 100644 --- a/src/properties/matrix/mat4property.cpp +++ b/src/properties/matrix/mat4property.cpp @@ -38,8 +38,8 @@ glm::mat4x4 fromLuaConversion(lua_State* state, bool& success) { glm::mat4x4 result = glm::mat4x4(1.f); lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x4::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -66,8 +66,8 @@ glm::mat4x4 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::mat4x4 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x4::col_type::length(); ++j) { lua_pushnumber(state, static_cast(value[i][j])); lua_rawseti(state, -2, number); ++number; @@ -79,15 +79,13 @@ bool toLuaConversion(lua_State* state, glm::mat4x4 value) { glm::mat4x4 fromStringConversion(const std::string& val, bool& success) { glm::mat4x4 result = glm::mat4x4(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x4::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::mat4x4::value_type v; s >> v; @@ -107,8 +105,8 @@ glm::mat4x4 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::mat4x4 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x4::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x4::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/mat4x2property.cpp b/src/properties/matrix/mat4x2property.cpp index d2b0b97ed2..1b10566d22 100644 --- a/src/properties/matrix/mat4x2property.cpp +++ b/src/properties/matrix/mat4x2property.cpp @@ -36,8 +36,8 @@ glm::mat4x2 fromLuaConversion(lua_State* state, bool& success) { glm::mat4x2 result = glm::mat4x2(1.f); lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x2::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -64,8 +64,8 @@ glm::mat4x2 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::mat4x2 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x2::col_type::length(); ++j) { lua_pushnumber(state, static_cast(value[i][j])); lua_rawseti(state, -2, number); ++number; @@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat4x2 value) { glm::mat4x2 fromStringConversion(const std::string& val, bool& success) { glm::mat4x2 result = glm::mat4x2(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x2::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::mat4x2::value_type v; s >> v; @@ -105,8 +103,8 @@ glm::mat4x2 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::mat4x2 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x2::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x2::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } } diff --git a/src/properties/matrix/mat4x3property.cpp b/src/properties/matrix/mat4x3property.cpp index f86d9e0c7d..667d63011f 100644 --- a/src/properties/matrix/mat4x3property.cpp +++ b/src/properties/matrix/mat4x3property.cpp @@ -36,8 +36,8 @@ glm::mat4x3 fromLuaConversion(lua_State* state, bool& success) { glm::mat4x3 result = glm::mat4x3(1.f); lua_pushnil(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x3::col_type::length(); ++j) { int hasNext = lua_next(state, -2); if (hasNext != 1) { success = false; @@ -64,8 +64,8 @@ glm::mat4x3 fromLuaConversion(lua_State* state, bool& success) { bool toLuaConversion(lua_State* state, glm::mat4x3 value) { lua_newtable(state); int number = 1; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x3::col_type::length(); ++j) { lua_pushnumber(state, static_cast(value[i][j])); lua_rawseti(state, -2, number); ++number; @@ -77,15 +77,13 @@ bool toLuaConversion(lua_State* state, glm::mat4x3 value) { glm::mat4x3 fromStringConversion(const std::string& val, bool& success) { glm::mat4x3 result = glm::mat4x3(1.f); std::vector tokens = ghoul::tokenizeString(val, ','); - if (tokens.size() != - (ghoul::glm_rows::value * ghoul::glm_cols::value)) - { + if (tokens.size() != ghoul::glm_components::value) { success = false; return result; } int number = 0; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x3::col_type::length(); ++j) { std::stringstream s(tokens[number]); glm::mat4x3::value_type v; s >> v; @@ -105,8 +103,8 @@ glm::mat4x3 fromStringConversion(const std::string& val, bool& success) { bool toStringConversion(std::string& outValue, glm::mat4x3 inValue) { outValue = "["; - for (glm::length_t i = 0; i < ghoul::glm_cols::value; ++i) { - for (glm::length_t j = 0; j < ghoul::glm_rows::value; ++j) { + for (glm::length_t i = 0; i < glm::mat4x3::row_type::length(); ++i) { + for (glm::length_t j = 0; j < glm::mat4x3::col_type::length(); ++j) { outValue += std::to_string(inValue[i][j]) + ","; } }