From 78ec5a079e17e1b5dc2e5c673ffe15143bd100af Mon Sep 17 00:00:00 2001 From: omigamedev Date: Sat, 7 Oct 2017 13:35:53 +0100 Subject: [PATCH] implement selection mask with lasso tool --- .gitmodules | 3 + android/CMakeLists.txt | 6 ++ data/layout.xml | 2 +- engine.xcodeproj/project.pbxproj | 42 ++++++++ engine/app_shaders.cpp | 22 +++- engine/canvas.cpp | 29 +++++- engine/canvas.h | 3 + engine/canvas_modes.cpp | 169 ++++++++++++++++++++++++------- engine/canvas_modes.h | 1 + engine/node_canvas.cpp | 13 +++ engine/node_image.cpp | 2 +- engine/node_image.h | 1 + engine/node_panel_brush.cpp | 1 + engine/node_stroke_preview.cpp | 2 +- engine/shader.h | 1 + libs/poly2tri | 1 + 16 files changed, 249 insertions(+), 49 deletions(-) create mode 160000 libs/poly2tri diff --git a/.gitmodules b/.gitmodules index e26413f..712ff4f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,6 @@ [submodule "libs/jpeg"] path = libs/jpeg url = https://github.com/richgel999/jpeg-compressor.git +[submodule "libs/poly2tri"] + path = libs/poly2tri + url = https://github.com/greenm01/poly2tri diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index 4a5e92b..d29613b 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -26,6 +26,11 @@ add_library( ../libs/tinyxml2/tinyxml2.cpp ../libs/jpeg/jpgd.cpp ../libs/jpeg/jpge.cpp + ../libs/poly2tri/poly2tri/common/shapes.cc + ../libs/poly2tri/poly2tri/sweep/advancing_front.cc + ../libs/poly2tri/poly2tri/sweep/cdt.cc + ../libs/poly2tri/poly2tri/sweep/sweep_context.cc + ../libs/poly2tri/poly2tri/sweep/sweep.cc src/main/cpp/main.cpp ../engine/pch.cpp ../engine/util.cpp @@ -84,6 +89,7 @@ target_include_directories(native-lib PRIVATE ../libs/stb ../libs/jpeg ../libs/curl-android-ios/prebuilt-with-ssl/android/include + ../libs/poly2tri/poly2tri ) # add lib dependencies diff --git a/data/layout.xml b/data/layout.xml index 5b7e1cf..d1c72e5 100644 --- a/data/layout.xml +++ b/data/layout.xml @@ -521,7 +521,7 @@