diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e82bb8..8a1569d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,8 +28,8 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_SUPPRESS_REGENERATION true) -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") +##set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") +## set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") #-------------------------------------------------------------------- # Set sources @@ -75,7 +75,7 @@ add_library(Lina::VG ALIAS ${PROJECT_NAME}) target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/include) target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_MAJOR=1) target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_MINOR=6) -target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_PATCH=7) +target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_PATCH=8) #-------------------------------------------------------------------- # Subdirectories & linking diff --git a/include/LinaVG/Core/Common.hpp b/include/LinaVG/Core/Common.hpp index 83b90b7..f36c878 100644 --- a/include/LinaVG/Core/Common.hpp +++ b/include/LinaVG/Core/Common.hpp @@ -33,6 +33,9 @@ SOFTWARE. #include #include #include +#include +#include +#include #include "Vectors.hpp" namespace LinaVG @@ -198,7 +201,7 @@ namespace LinaVG inline void shrink(int size) { - _ASSERT(size <= m_size); + assert(size <= m_size); m_size = size; } @@ -235,8 +238,8 @@ namespace LinaVG inline T* erase(const T* it) { - _ASSERT(it >= m_data && it < m_data + m_size); - const ptrdiff_t off = it - m_data; + assert(it >= m_data && it < m_data + m_size); + const std::ptrdiff_t off = it - m_data; std::memmove(m_data + off, m_data + off + 1, ((size_t)m_size - (size_t)off - 1) * sizeof(T)); m_size--; return m_data + off; @@ -254,13 +257,13 @@ namespace LinaVG inline T& operator[](int i) { - _ASSERT(i >= 0 && i < m_capacity); + assert(i >= 0 && i < m_capacity); return m_data[i]; } inline const T& operator[](int i) const { - _ASSERT(i >= 0 && i < m_capacity); + assert(i >= 0 && i < m_capacity); return m_data[i]; } @@ -289,7 +292,7 @@ namespace LinaVG inline void swap(int start, int end) { - _ASSERT(start > -1 && start < m_size && end > -1 && end < m_size); + assert(start > -1 && start < m_size && end > -1 && end < m_size); T temp = m_data[start]; m_data[start] = m_data[end]; m_data[end] = temp; @@ -842,9 +845,9 @@ namespace LinaVG BackendHandle clipSizeX = 0; BackendHandle clipSizeY = 0; - bool IsClipDifferent(BackendHandle clipPosX, BackendHandle clipPosY, BackendHandle clipSizeX, BackendHandle clipSizeY) + bool IsClipDifferent(BackendHandle cpx, BackendHandle cpy, BackendHandle csx, BackendHandle csy) { - return (this->clipPosX != clipPosX || this->clipPosY != clipPosY || this->clipSizeX != clipSizeX || this->clipSizeY != clipSizeY); + return (this->clipPosX != cpx || this->clipPosY != cpy || this->clipSizeX != csx || this->clipSizeY != csy); } inline void Clear() diff --git a/src/Core/Math.cpp b/src/Core/Math.cpp index 31e5d13..75c678a 100644 --- a/src/Core/Math.cpp +++ b/src/Core/Math.cpp @@ -28,6 +28,7 @@ SOFTWARE. #include "LinaVG/Core/Math.hpp" #include +#include namespace LinaVG { @@ -55,22 +56,22 @@ namespace LinaVG float Math::GetAngleFromCenter(const Vec2& center, const Vec2& point) { - return LVG_RAD2DEG * (std::atan2(point.y - center.y, point.x - center.x)); + return LVG_RAD2DEG * (atan2(point.y - center.y, point.x - center.x)); } float Math::GetAngleBetween(const Vec2& p1, const Vec2& p2) { - return LVG_RAD2DEG * (std::atan2(p2.y, p2.x) - atan2(p1.y, p1.x)); + return LVG_RAD2DEG * (atan2(p2.y, p2.x) - atan2(p1.y, p1.x)); } float Math::GetAngleBetweenDirs(const Vec2& dir1, const Vec2& dir2) { - return LVG_RAD2DEG * std::atan2f(dir1.x * dir2.y - dir1.y * dir2.x, dir1.x * dir2.x + dir1.y * dir2.y); + return LVG_RAD2DEG * atan2f(dir1.x * dir2.y - dir1.y * dir2.x, dir1.x * dir2.x + dir1.y * dir2.y); } float Math::GetAngleBetweenShort(const Vec2& p1, const Vec2& p2) { - float ang = LVG_RAD2DEG * (std::atan2(p2.y, p2.x) - atan2(p1.y, p1.x)); + float ang = LVG_RAD2DEG * (atan2(p2.y, p2.x) - atan2(p1.y, p1.x)); if (ang > 180.0f) ang = 360.0f - ang; @@ -165,8 +166,8 @@ namespace LinaVG // Parallel if (det == 0.0f) return p10; - - _ASSERT(det != 0.0f); + + assert(det != 0.0f); float x = (b2 * c1 - b1 * c2) / det; float y = (a1 * c2 - a2 * c1) / det; diff --git a/src/Core/Renderer.cpp b/src/Core/Renderer.cpp index f4c3dbd..ff36018 100644 --- a/src/Core/Renderer.cpp +++ b/src/Core/Renderer.cpp @@ -35,6 +35,7 @@ SOFTWARE. #include "LinaVG/Core/Text.hpp" #include "LinaVG/Utility/Utility.hpp" #include +#include namespace LinaVG { @@ -102,7 +103,7 @@ namespace LinaVG { Internal::InitThreadedData(); - _ASSERT(Backend::BaseBackend::Get() != nullptr); + assert(Backend::BaseBackend::Get() != nullptr); if (!Backend::BaseBackend::Get()->Initialize()) {