From c4c3670c3f7b6dbefbbe479fa083a659c7b54e05 Mon Sep 17 00:00:00 2001 From: Matt Sullivan Date: Sun, 16 Aug 2020 18:20:11 -0700 Subject: [PATCH] Moving wasm to separate repo --- .gitignore | 6 +- rive/Doxyfile => Doxyfile | 0 rive/build.sh => build.sh | 0 build/_premake5.lua | 172 +++++++++ {rive/build => build}/premake5.lua | 0 dev/test.sh | 22 +- dev/test/premake5.lua | 6 +- .../animation/animation.hpp | 0 .../animation/cubic_interpolator.hpp | 0 .../animation/keyed_object.hpp | 0 .../animation/keyed_property.hpp | 0 .../animation/keyframe.hpp | 0 .../animation/keyframe_color.hpp | 0 .../animation/keyframe_double.hpp | 0 .../animation/keyframe_draw_order.hpp | 0 .../animation/keyframe_draw_order_value.hpp | 0 .../animation/linear_animation.hpp | 0 .../animation/linear_animation_instance.hpp | 0 {rive/include => include}/animation/loop.hpp | 0 {rive/include => include}/artboard.hpp | 0 {rive/include => include}/backboard.hpp | 0 {rive/include => include}/bones/bone.hpp | 0 {rive/include => include}/bones/root_bone.hpp | 0 .../bones/skeletal_component.hpp | 0 {rive/include => include}/component.hpp | 0 {rive/include => include}/component_dirt.hpp | 0 .../container_component.hpp | 0 {rive/include => include}/core.hpp | 0 .../core/binary_reader.hpp | 0 .../core/field_types/core_bool_type.hpp | 0 .../core/field_types/core_color_type.hpp | 0 .../core/field_types/core_double_type.hpp | 0 .../core/field_types/core_string_type.hpp | 0 .../core/field_types/core_uint_type.hpp | 0 {rive/include => include}/core/reader.h | 0 {rive/include => include}/core_context.hpp | 0 .../include => include}/dependency_sorter.hpp | 0 {rive/include => include}/drawable.hpp | 0 {rive/include => include}/file.hpp | 0 .../generated/animation/animation_base.hpp | 0 .../animation/cubic_interpolator_base.hpp | 0 .../generated/animation/keyed_object_base.hpp | 0 .../animation/keyed_property_base.hpp | 0 .../generated/animation/keyframe_base.hpp | 0 .../animation/keyframe_color_base.hpp | 0 .../animation/keyframe_double_base.hpp | 0 .../animation/keyframe_draw_order_base.hpp | 0 .../keyframe_draw_order_value_base.hpp | 0 .../animation/linear_animation_base.hpp | 0 .../generated/artboard_base.hpp | 0 .../generated/backboard_base.hpp | 0 .../generated/bones/bone_base.hpp | 0 .../generated/bones/root_bone_base.hpp | 0 .../bones/skeletal_component_base.hpp | 0 .../generated/component_base.hpp | 0 .../generated/container_component_base.hpp | 0 .../generated/core_registry.hpp | 0 .../generated/drawable_base.hpp | 0 .../generated/node_base.hpp | 0 .../generated/shapes/clipping_shape_base.hpp | 0 .../shapes/cubic_asymmetric_vertex_base.hpp | 0 .../shapes/cubic_detached_vertex_base.hpp | 0 .../shapes/cubic_mirrored_vertex_base.hpp | 0 .../generated/shapes/cubic_vertex_base.hpp | 0 .../generated/shapes/ellipse_base.hpp | 0 .../generated/shapes/paint/fill_base.hpp | 0 .../shapes/paint/gradient_stop_base.hpp | 0 .../shapes/paint/linear_gradient_base.hpp | 0 .../shapes/paint/radial_gradient_base.hpp | 0 .../shapes/paint/shape_paint_base.hpp | 0 .../shapes/paint/solid_color_base.hpp | 0 .../generated/shapes/paint/stroke_base.hpp | 0 .../generated/shapes/parametric_path_base.hpp | 0 .../generated/shapes/path_base.hpp | 0 .../generated/shapes/path_composer_base.hpp | 0 .../generated/shapes/path_vertex_base.hpp | 0 .../generated/shapes/points_path_base.hpp | 0 .../generated/shapes/rectangle_base.hpp | 0 .../generated/shapes/shape_base.hpp | 0 .../generated/shapes/straight_vertex_base.hpp | 0 .../generated/shapes/triangle_base.hpp | 0 .../generated/transform_component_base.hpp | 0 {rive/include => include}/layout.hpp | 0 {rive/include => include}/math/aabb.hpp | 0 .../math/circle_constant.hpp | 0 {rive/include => include}/math/color.hpp | 0 {rive/include => include}/math/mat2d.hpp | 0 .../math/transform_components.hpp | 0 {rive/include => include}/math/vec2d.hpp | 0 {rive/include => include}/node.hpp | 0 {rive/include => include}/renderer.hpp | 0 {rive/include => include}/runtime_header.hpp | 0 .../shapes/clipping_shape.hpp | 0 .../shapes/cubic_asymmetric_vertex.hpp | 0 .../shapes/cubic_detached_vertex.hpp | 0 .../shapes/cubic_mirrored_vertex.hpp | 0 .../shapes/cubic_vertex.hpp | 0 {rive/include => include}/shapes/ellipse.hpp | 0 .../shapes/paint/blend_mode.hpp | 0 .../shapes/paint/color.hpp | 0 .../include => include}/shapes/paint/fill.hpp | 0 .../shapes/paint/gradient_stop.hpp | 0 .../shapes/paint/linear_gradient.hpp | 0 .../shapes/paint/radial_gradient.hpp | 0 .../shapes/paint/shape_paint.hpp | 0 .../shapes/paint/shape_paint_mutator.hpp | 0 .../shapes/paint/solid_color.hpp | 0 .../shapes/paint/stroke.hpp | 0 .../shapes/paint/stroke_cap.hpp | 0 .../shapes/paint/stroke_join.hpp | 0 .../shapes/parametric_path.hpp | 0 {rive/include => include}/shapes/path.hpp | 0 .../shapes/path_composer.hpp | 0 .../include => include}/shapes/path_space.hpp | 0 .../shapes/path_vertex.hpp | 0 .../shapes/points_path.hpp | 0 .../include => include}/shapes/rectangle.hpp | 0 {rive/include => include}/shapes/shape.hpp | 0 .../shapes/shape_paint_container.hpp | 0 .../shapes/straight_vertex.hpp | 0 {rive/include => include}/shapes/triangle.hpp | 0 .../transform_component.hpp | 0 .../animation/cubic_interpolator.cpp | 0 {rive/src => src}/animation/keyed_object.cpp | 0 .../src => src}/animation/keyed_property.cpp | 0 {rive/src => src}/animation/keyframe.cpp | 0 .../src => src}/animation/keyframe_color.cpp | 0 .../src => src}/animation/keyframe_double.cpp | 0 .../animation/keyframe_draw_order.cpp | 0 .../animation/linear_animation.cpp | 0 .../animation/linear_animation_instance.cpp | 0 {rive/src => src}/artboard.cpp | 0 {rive/src => src}/bones/bone.cpp | 0 {rive/src => src}/component.cpp | 0 {rive/src => src}/core/binary_reader.cpp | 0 .../core/field_types/core_bool_type.cpp | 0 .../core/field_types/core_color_type.cpp | 0 .../core/field_types/core_double_type.cpp | 0 .../core/field_types/core_string_type.cpp | 0 .../core/field_types/core_uint_type.cpp | 0 {rive/src => src}/dependency_sorter.cpp | 0 {rive/src => src}/drawable.cpp | 0 {rive/src => src}/file.cpp | 0 {rive/src => src}/layout.cpp | 0 {rive/src => src}/math/aabb.cpp | 0 {rive/src => src}/math/mat2d.cpp | 0 {rive/src => src}/math/vec2d.cpp | 0 {rive/src => src}/node.cpp | 0 {rive/src => src}/shapes/clipping_shape.cpp | 0 .../shapes/cubic_asymmetric_vertex.cpp | 0 .../shapes/cubic_detached_vertex.cpp | 0 .../shapes/cubic_mirrored_vertex.cpp | 0 {rive/src => src}/shapes/cubic_vertex.cpp | 0 {rive/src => src}/shapes/ellipse.cpp | 0 {rive/src => src}/shapes/paint/color.cpp | 0 {rive/src => src}/shapes/paint/fill.cpp | 0 .../shapes/paint/gradient_stop.cpp | 0 .../shapes/paint/linear_gradient.cpp | 0 .../shapes/paint/radial_gradient.cpp | 0 .../src => src}/shapes/paint/shape_paint.cpp | 0 .../shapes/paint/shape_paint_mutator.cpp | 0 .../src => src}/shapes/paint/solid_color.cpp | 0 {rive/src => src}/shapes/paint/stroke.cpp | 0 {rive/src => src}/shapes/parametric_path.cpp | 0 {rive/src => src}/shapes/path.cpp | 0 {rive/src => src}/shapes/path_composer.cpp | 0 {rive/src => src}/shapes/path_vertex.cpp | 0 {rive/src => src}/shapes/rectangle.cpp | 0 {rive/src => src}/shapes/shape.cpp | 0 .../shapes/shape_paint_container.cpp | 0 {rive/src => src}/shapes/straight_vertex.cpp | 0 {rive/src => src}/transform_component.cpp | 0 {assets => test/assets}/dependency_test.riv | Bin {assets => test/assets}/fix_rectangle.riv | Bin {assets => test/assets}/juice.riv | Bin {assets => test/assets}/shapetest.riv | Bin {assets => test/assets}/two_artboards.riv | Bin {rive/test => test}/clip_test.cpp | 24 +- {rive/test => test}/file_test.cpp | 6 +- {rive/test => test}/main_test.cpp | 0 {rive/test => test}/no_op_renderer.cpp | 0 {rive/test => test}/no_op_renderer.hpp | 0 {rive/test => test}/node_test.cpp | 0 {rive/test => test}/path_test.cpp | 0 {rive/test => test}/reader_test.cpp | 0 wasm/build.sh | 23 -- wasm/build_wasm.sh | 50 --- wasm/index.html | 93 ----- wasm/js/marker.js | 1 - wasm/js/renderer.js | 274 ------------- wasm/publish/LICENSE | 21 - wasm/publish/README.md | 20 - wasm/publish/package.json | 20 - wasm/publish_wasm.sh | 4 - wasm/setup_build_tool.sh | 34 -- wasm/src/bindings.cpp | 364 ------------------ 196 files changed, 211 insertions(+), 929 deletions(-) rename rive/Doxyfile => Doxyfile (100%) rename rive/build.sh => build.sh (100%) create mode 100644 build/_premake5.lua rename {rive/build => build}/premake5.lua (100%) rename {rive/include => include}/animation/animation.hpp (100%) rename {rive/include => include}/animation/cubic_interpolator.hpp (100%) rename {rive/include => include}/animation/keyed_object.hpp (100%) rename {rive/include => include}/animation/keyed_property.hpp (100%) rename {rive/include => include}/animation/keyframe.hpp (100%) rename {rive/include => include}/animation/keyframe_color.hpp (100%) rename {rive/include => include}/animation/keyframe_double.hpp (100%) rename {rive/include => include}/animation/keyframe_draw_order.hpp (100%) rename {rive/include => include}/animation/keyframe_draw_order_value.hpp (100%) rename {rive/include => include}/animation/linear_animation.hpp (100%) rename {rive/include => include}/animation/linear_animation_instance.hpp (100%) rename {rive/include => include}/animation/loop.hpp (100%) rename {rive/include => include}/artboard.hpp (100%) rename {rive/include => include}/backboard.hpp (100%) rename {rive/include => include}/bones/bone.hpp (100%) rename {rive/include => include}/bones/root_bone.hpp (100%) rename {rive/include => include}/bones/skeletal_component.hpp (100%) rename {rive/include => include}/component.hpp (100%) rename {rive/include => include}/component_dirt.hpp (100%) rename {rive/include => include}/container_component.hpp (100%) rename {rive/include => include}/core.hpp (100%) rename {rive/include => include}/core/binary_reader.hpp (100%) rename {rive/include => include}/core/field_types/core_bool_type.hpp (100%) rename {rive/include => include}/core/field_types/core_color_type.hpp (100%) rename {rive/include => include}/core/field_types/core_double_type.hpp (100%) rename {rive/include => include}/core/field_types/core_string_type.hpp (100%) rename {rive/include => include}/core/field_types/core_uint_type.hpp (100%) rename {rive/include => include}/core/reader.h (100%) rename {rive/include => include}/core_context.hpp (100%) rename {rive/include => include}/dependency_sorter.hpp (100%) rename {rive/include => include}/drawable.hpp (100%) rename {rive/include => include}/file.hpp (100%) rename {rive/include => include}/generated/animation/animation_base.hpp (100%) rename {rive/include => include}/generated/animation/cubic_interpolator_base.hpp (100%) rename {rive/include => include}/generated/animation/keyed_object_base.hpp (100%) rename {rive/include => include}/generated/animation/keyed_property_base.hpp (100%) rename {rive/include => include}/generated/animation/keyframe_base.hpp (100%) rename {rive/include => include}/generated/animation/keyframe_color_base.hpp (100%) rename {rive/include => include}/generated/animation/keyframe_double_base.hpp (100%) rename {rive/include => include}/generated/animation/keyframe_draw_order_base.hpp (100%) rename {rive/include => include}/generated/animation/keyframe_draw_order_value_base.hpp (100%) rename {rive/include => include}/generated/animation/linear_animation_base.hpp (100%) rename {rive/include => include}/generated/artboard_base.hpp (100%) rename {rive/include => include}/generated/backboard_base.hpp (100%) rename {rive/include => include}/generated/bones/bone_base.hpp (100%) rename {rive/include => include}/generated/bones/root_bone_base.hpp (100%) rename {rive/include => include}/generated/bones/skeletal_component_base.hpp (100%) rename {rive/include => include}/generated/component_base.hpp (100%) rename {rive/include => include}/generated/container_component_base.hpp (100%) rename {rive/include => include}/generated/core_registry.hpp (100%) rename {rive/include => include}/generated/drawable_base.hpp (100%) rename {rive/include => include}/generated/node_base.hpp (100%) rename {rive/include => include}/generated/shapes/clipping_shape_base.hpp (100%) rename {rive/include => include}/generated/shapes/cubic_asymmetric_vertex_base.hpp (100%) rename {rive/include => include}/generated/shapes/cubic_detached_vertex_base.hpp (100%) rename {rive/include => include}/generated/shapes/cubic_mirrored_vertex_base.hpp (100%) rename {rive/include => include}/generated/shapes/cubic_vertex_base.hpp (100%) rename {rive/include => include}/generated/shapes/ellipse_base.hpp (100%) rename {rive/include => include}/generated/shapes/paint/fill_base.hpp (100%) rename {rive/include => include}/generated/shapes/paint/gradient_stop_base.hpp (100%) rename {rive/include => include}/generated/shapes/paint/linear_gradient_base.hpp (100%) rename {rive/include => include}/generated/shapes/paint/radial_gradient_base.hpp (100%) rename {rive/include => include}/generated/shapes/paint/shape_paint_base.hpp (100%) rename {rive/include => include}/generated/shapes/paint/solid_color_base.hpp (100%) rename {rive/include => include}/generated/shapes/paint/stroke_base.hpp (100%) rename {rive/include => include}/generated/shapes/parametric_path_base.hpp (100%) rename {rive/include => include}/generated/shapes/path_base.hpp (100%) rename {rive/include => include}/generated/shapes/path_composer_base.hpp (100%) rename {rive/include => include}/generated/shapes/path_vertex_base.hpp (100%) rename {rive/include => include}/generated/shapes/points_path_base.hpp (100%) rename {rive/include => include}/generated/shapes/rectangle_base.hpp (100%) rename {rive/include => include}/generated/shapes/shape_base.hpp (100%) rename {rive/include => include}/generated/shapes/straight_vertex_base.hpp (100%) rename {rive/include => include}/generated/shapes/triangle_base.hpp (100%) rename {rive/include => include}/generated/transform_component_base.hpp (100%) rename {rive/include => include}/layout.hpp (100%) rename {rive/include => include}/math/aabb.hpp (100%) rename {rive/include => include}/math/circle_constant.hpp (100%) rename {rive/include => include}/math/color.hpp (100%) rename {rive/include => include}/math/mat2d.hpp (100%) rename {rive/include => include}/math/transform_components.hpp (100%) rename {rive/include => include}/math/vec2d.hpp (100%) rename {rive/include => include}/node.hpp (100%) rename {rive/include => include}/renderer.hpp (100%) rename {rive/include => include}/runtime_header.hpp (100%) rename {rive/include => include}/shapes/clipping_shape.hpp (100%) rename {rive/include => include}/shapes/cubic_asymmetric_vertex.hpp (100%) rename {rive/include => include}/shapes/cubic_detached_vertex.hpp (100%) rename {rive/include => include}/shapes/cubic_mirrored_vertex.hpp (100%) rename {rive/include => include}/shapes/cubic_vertex.hpp (100%) rename {rive/include => include}/shapes/ellipse.hpp (100%) rename {rive/include => include}/shapes/paint/blend_mode.hpp (100%) rename {rive/include => include}/shapes/paint/color.hpp (100%) rename {rive/include => include}/shapes/paint/fill.hpp (100%) rename {rive/include => include}/shapes/paint/gradient_stop.hpp (100%) rename {rive/include => include}/shapes/paint/linear_gradient.hpp (100%) rename {rive/include => include}/shapes/paint/radial_gradient.hpp (100%) rename {rive/include => include}/shapes/paint/shape_paint.hpp (100%) rename {rive/include => include}/shapes/paint/shape_paint_mutator.hpp (100%) rename {rive/include => include}/shapes/paint/solid_color.hpp (100%) rename {rive/include => include}/shapes/paint/stroke.hpp (100%) rename {rive/include => include}/shapes/paint/stroke_cap.hpp (100%) rename {rive/include => include}/shapes/paint/stroke_join.hpp (100%) rename {rive/include => include}/shapes/parametric_path.hpp (100%) rename {rive/include => include}/shapes/path.hpp (100%) rename {rive/include => include}/shapes/path_composer.hpp (100%) rename {rive/include => include}/shapes/path_space.hpp (100%) rename {rive/include => include}/shapes/path_vertex.hpp (100%) rename {rive/include => include}/shapes/points_path.hpp (100%) rename {rive/include => include}/shapes/rectangle.hpp (100%) rename {rive/include => include}/shapes/shape.hpp (100%) rename {rive/include => include}/shapes/shape_paint_container.hpp (100%) rename {rive/include => include}/shapes/straight_vertex.hpp (100%) rename {rive/include => include}/shapes/triangle.hpp (100%) rename {rive/include => include}/transform_component.hpp (100%) rename {rive/src => src}/animation/cubic_interpolator.cpp (100%) rename {rive/src => src}/animation/keyed_object.cpp (100%) rename {rive/src => src}/animation/keyed_property.cpp (100%) rename {rive/src => src}/animation/keyframe.cpp (100%) rename {rive/src => src}/animation/keyframe_color.cpp (100%) rename {rive/src => src}/animation/keyframe_double.cpp (100%) rename {rive/src => src}/animation/keyframe_draw_order.cpp (100%) rename {rive/src => src}/animation/linear_animation.cpp (100%) rename {rive/src => src}/animation/linear_animation_instance.cpp (100%) rename {rive/src => src}/artboard.cpp (100%) rename {rive/src => src}/bones/bone.cpp (100%) rename {rive/src => src}/component.cpp (100%) rename {rive/src => src}/core/binary_reader.cpp (100%) rename {rive/src => src}/core/field_types/core_bool_type.cpp (100%) rename {rive/src => src}/core/field_types/core_color_type.cpp (100%) rename {rive/src => src}/core/field_types/core_double_type.cpp (100%) rename {rive/src => src}/core/field_types/core_string_type.cpp (100%) rename {rive/src => src}/core/field_types/core_uint_type.cpp (100%) rename {rive/src => src}/dependency_sorter.cpp (100%) rename {rive/src => src}/drawable.cpp (100%) rename {rive/src => src}/file.cpp (100%) rename {rive/src => src}/layout.cpp (100%) rename {rive/src => src}/math/aabb.cpp (100%) rename {rive/src => src}/math/mat2d.cpp (100%) rename {rive/src => src}/math/vec2d.cpp (100%) rename {rive/src => src}/node.cpp (100%) rename {rive/src => src}/shapes/clipping_shape.cpp (100%) rename {rive/src => src}/shapes/cubic_asymmetric_vertex.cpp (100%) rename {rive/src => src}/shapes/cubic_detached_vertex.cpp (100%) rename {rive/src => src}/shapes/cubic_mirrored_vertex.cpp (100%) rename {rive/src => src}/shapes/cubic_vertex.cpp (100%) rename {rive/src => src}/shapes/ellipse.cpp (100%) rename {rive/src => src}/shapes/paint/color.cpp (100%) rename {rive/src => src}/shapes/paint/fill.cpp (100%) rename {rive/src => src}/shapes/paint/gradient_stop.cpp (100%) rename {rive/src => src}/shapes/paint/linear_gradient.cpp (100%) rename {rive/src => src}/shapes/paint/radial_gradient.cpp (100%) rename {rive/src => src}/shapes/paint/shape_paint.cpp (100%) rename {rive/src => src}/shapes/paint/shape_paint_mutator.cpp (100%) rename {rive/src => src}/shapes/paint/solid_color.cpp (100%) rename {rive/src => src}/shapes/paint/stroke.cpp (100%) rename {rive/src => src}/shapes/parametric_path.cpp (100%) rename {rive/src => src}/shapes/path.cpp (100%) rename {rive/src => src}/shapes/path_composer.cpp (100%) rename {rive/src => src}/shapes/path_vertex.cpp (100%) rename {rive/src => src}/shapes/rectangle.cpp (100%) rename {rive/src => src}/shapes/shape.cpp (100%) rename {rive/src => src}/shapes/shape_paint_container.cpp (100%) rename {rive/src => src}/shapes/straight_vertex.cpp (100%) rename {rive/src => src}/transform_component.cpp (100%) rename {assets => test/assets}/dependency_test.riv (100%) rename {assets => test/assets}/fix_rectangle.riv (100%) rename {assets => test/assets}/juice.riv (100%) rename {assets => test/assets}/shapetest.riv (100%) rename {assets => test/assets}/two_artboards.riv (100%) rename {rive/test => test}/clip_test.cpp (59%) rename {rive/test => test}/file_test.cpp (96%) rename {rive/test => test}/main_test.cpp (100%) rename {rive/test => test}/no_op_renderer.cpp (100%) rename {rive/test => test}/no_op_renderer.hpp (100%) rename {rive/test => test}/node_test.cpp (100%) rename {rive/test => test}/path_test.cpp (100%) rename {rive/test => test}/reader_test.cpp (100%) delete mode 100755 wasm/build.sh delete mode 100755 wasm/build_wasm.sh delete mode 100644 wasm/index.html delete mode 100644 wasm/js/marker.js delete mode 100644 wasm/js/renderer.js delete mode 100644 wasm/publish/LICENSE delete mode 100644 wasm/publish/README.md delete mode 100644 wasm/publish/package.json delete mode 100755 wasm/publish_wasm.sh delete mode 100755 wasm/setup_build_tool.sh delete mode 100644 wasm/src/bindings.cpp diff --git a/.gitignore b/.gitignore index 14010912..f30ab8d6 100644 --- a/.gitignore +++ b/.gitignore @@ -50,15 +50,13 @@ pubspec.lock *.DS_Store # Generated docs -rive/docs +docs # Analysis results dev/analysis_report # Build directories -wasm/build -rive/build/bin -wasm/custom_emcc +build/bin # Skia dependencies skia/dependencies/skia diff --git a/rive/Doxyfile b/Doxyfile similarity index 100% rename from rive/Doxyfile rename to Doxyfile diff --git a/rive/build.sh b/build.sh similarity index 100% rename from rive/build.sh rename to build.sh diff --git a/build/_premake5.lua b/build/_premake5.lua new file mode 100644 index 00000000..8e59782f --- /dev/null +++ b/build/_premake5.lua @@ -0,0 +1,172 @@ +-- require "./premake-emscripten/emscripten" + + +-- local emcc_tools = { +-- cc = "emcc", +-- cxx = "emcc", -- cxx = "em++", +-- ar = "emar" +-- } + +-- local clang = premake.tools.clang + +-- premake.tools.emcc = { +-- gettoolname = function(cfg, tool) +-- return emcc_tools[tool] +-- end, +-- getdefines = clang.getdefines, +-- getundefines = clang.getundefines, +-- getincludedirs = clang.getincludedirs, +-- getforceincludes = clang.getforceincludes, +-- getlocalflags = clang.getlocalflags, +-- getcxxflags = function(cfg) +-- local flags = clang.getcxxflags(cfg) +-- print('--getcxxflags:') +-- table.foreachi(cfg.flags, function(value) +-- print('cfg value ' .. value) +-- end) + +-- table.insertflat(flags, '-fno-rtti') +-- table.foreachi(flags, function(value) +-- print('cxx flag ' .. value) +-- end) +-- return flags +-- end, +-- getcppflags = clang.getcppflags, +-- getcflags = clang.getcflags, +-- getlinks = clang.getlinks, +-- getLibraryDirectories = clang.getLibraryDirectories, +-- getrunpathdirs = clang.getrunpathdirs, +-- getldflags = function(cfg) +-- local flags = clang.getldflags(cfg) +-- table.insertflat(flags, "-s EXPORT_NAME=\"RiveWasmTest\"") +-- return flags +-- end, +-- getmakesettings = clang.getmakesettings, +-- } + + + +-- function emcc.gettoolname(cfg, tool) +-- return emcc_tools[tool]; +-- end + +-- premake.tools.emcc.gettoolname = gettoolname + +-- function premake.tools.emcc.gettoolname(cfg, tool) +-- return emcc_tools[tool] +-- end + + +workspace "rive" + configurations { "debug", "release" } + +project "rive" + kind "StaticLib" + language "C++" + cppdialect "C++17" + targetdir "bin/%{cfg.buildcfg}" + objdir "obj/%{cfg.buildcfg}" + includedirs { "../include" } + + files { "../src/**.cpp" } + + filter "configurations:debug" + defines { "DEBUG" } + symbols "On" + + filter "configurations:release" + defines { "RELEASE" } + optimize "On" + +-- project "rive-wasm-runtimme" +-- rules { "MyWasmRule" } +-- kind "Utility" + +-- rule "MyWasmRule" +-- display "My custom wasm compiler" +-- fileextension ".cpp" + +-- buildmessage "Compiling to WASM" +-- buildcommands 'emcc -O3 --bind -o wasm_test.js -s FORCE_FILESYSTEM=0 -s MODULARIZE=1 -s NO_EXIT_RUNTIME=1 -s STRICT=1 -s WARN_UNALIGNED=1 -s ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXCEPTION_CATCHING=1 -s WASM=1 -s EXPORT_NAME="WasmTest" -DSINGLE -DANSI_DECLARATORS -DTRILIBRARY -Wno-c++17-extensions -I../include --no-entry ../src/*/*.cpp' +-- buildcommands 'echo YOOOOOOOOOOOOOOO' + + +-- buildmessage 'Compiling %(Filename) with MyCustomCC' +-- buildcommands 'MyCustomCC.exe -c "%(FullPath)" -o "%(IntDir)/%(Filename).obj"' +-- buildoutputs '%(IntDir)/%(Filename).obj"' + + +-- project "rive-by-rules" +-- -- rules { "MyWasmRule" } +-- -- kind "None" +-- filter 'files:**.lua' +-- -- A message to display while this build step is running (optional) +-- buildmessage 'Compiling %{file.relpath}' + +-- -- One or more commands to run (required) +-- buildcommands { +-- 'luac -o "%{cfg.objdir}/%{file.basename}.out" "%{file.relpath}"' +-- } + +-- -- One or more outputs resulting from the build (required) +-- buildoutputs { '%{cfg.objdir}/%{file.basename}.c' } + +-- -- One or more additional dependencies for this build command (optional) +-- buildinputs { 'path/to/file1.ext', 'path/to/file2.ext' } + + +-- project "rive.js" +-- kind "None" +-- toolset "emcc" +-- language "C++" +-- cppdialect "C++17" + +-- buildoptions { +-- "--bind", +-- "-s FORCE_FILESYSTEM=0", +-- "-s MODULARIZE=1", +-- "-s NO_EXIT_RUNTIME=1", +-- "-s STRICT=1", +-- "-s WARN_UNALIGNED=1", +-- "-s ALLOW_MEMORY_GROWTH=1", +-- "-s DISABLE_EXCEPTION_CATCHING=1", +-- "-s WASM=1", +-- "-s EXPORT_NAME=\"RiveWasmTest\"", +-- "-DSINGLE", +-- "-DANSI_DECLARATORS", +-- "-DTRILIBRARY", +-- "-Wno-c++17-extensions", +-- "--no-entry" +-- } + +-- targetdir "bin/%{cfg.buildcfg}" +-- objdir "obj/%{cfg.buildcfg}" +-- includedirs { "../include" } + +-- files { "../src/**.cpp" } + +-- postbuildcommands { "echo Running postbuild" } + +-- filter "configurations:debug" +-- defines { "DEBUG" } +-- symbols "On" + +-- filter "configurations:release" +-- defines { "RELEASE" } +-- optimize "On" + + +-- Clean Function -- +newaction { + trigger = "clean", + description = "clean the build", + execute = function () + print("clean the build...") + os.rmdir("./bin") + os.rmdir("./obj") + os.remove("Makefile") + -- no wildcards in os.remove, so use shell + os.execute("rm *.make") + print("build cleaned") + end +} \ No newline at end of file diff --git a/rive/build/premake5.lua b/build/premake5.lua similarity index 100% rename from rive/build/premake5.lua rename to build/premake5.lua diff --git a/dev/test.sh b/dev/test.sh index 1d5452d5..619c5795 100755 --- a/dev/test.sh +++ b/dev/test.sh @@ -1,9 +1,25 @@ #!/bin/bash -cd test -# premake5 clean || exit 1 -premake5 gmake || exit 1 +pushd test &>/dev/null + +OPTION=$1 + +if [ "$OPTION" = "help" ] +then + echo test.sh - run the tests + echo test.sh clean - clean and run the tests + exit +elif [ "$OPTION" = "clean" ] +then + echo Cleaning project ... + premake5 clean || exit 1 + shift +fi + +premake5 gmake2 || exit 1 make -j7 || exit 1 for file in ./build/bin/debug/*; do echo testing $file $file "$1" done + +popd &>/dev/null \ No newline at end of file diff --git a/dev/test/premake5.lua b/dev/test/premake5.lua index a9e819ee..41a06ec2 100644 --- a/dev/test/premake5.lua +++ b/dev/test/premake5.lua @@ -34,12 +34,12 @@ buildoptions { includedirs { "./include", - "../../rive/include" + "../../include" } files { - "../../rive/src/**.cpp", -- the Rive runtime source - "../../rive/test/**.cpp" -- the tests + "../../src/**.cpp", -- the Rive runtime source + "../../test/**.cpp" -- the tests } diff --git a/rive/include/animation/animation.hpp b/include/animation/animation.hpp similarity index 100% rename from rive/include/animation/animation.hpp rename to include/animation/animation.hpp diff --git a/rive/include/animation/cubic_interpolator.hpp b/include/animation/cubic_interpolator.hpp similarity index 100% rename from rive/include/animation/cubic_interpolator.hpp rename to include/animation/cubic_interpolator.hpp diff --git a/rive/include/animation/keyed_object.hpp b/include/animation/keyed_object.hpp similarity index 100% rename from rive/include/animation/keyed_object.hpp rename to include/animation/keyed_object.hpp diff --git a/rive/include/animation/keyed_property.hpp b/include/animation/keyed_property.hpp similarity index 100% rename from rive/include/animation/keyed_property.hpp rename to include/animation/keyed_property.hpp diff --git a/rive/include/animation/keyframe.hpp b/include/animation/keyframe.hpp similarity index 100% rename from rive/include/animation/keyframe.hpp rename to include/animation/keyframe.hpp diff --git a/rive/include/animation/keyframe_color.hpp b/include/animation/keyframe_color.hpp similarity index 100% rename from rive/include/animation/keyframe_color.hpp rename to include/animation/keyframe_color.hpp diff --git a/rive/include/animation/keyframe_double.hpp b/include/animation/keyframe_double.hpp similarity index 100% rename from rive/include/animation/keyframe_double.hpp rename to include/animation/keyframe_double.hpp diff --git a/rive/include/animation/keyframe_draw_order.hpp b/include/animation/keyframe_draw_order.hpp similarity index 100% rename from rive/include/animation/keyframe_draw_order.hpp rename to include/animation/keyframe_draw_order.hpp diff --git a/rive/include/animation/keyframe_draw_order_value.hpp b/include/animation/keyframe_draw_order_value.hpp similarity index 100% rename from rive/include/animation/keyframe_draw_order_value.hpp rename to include/animation/keyframe_draw_order_value.hpp diff --git a/rive/include/animation/linear_animation.hpp b/include/animation/linear_animation.hpp similarity index 100% rename from rive/include/animation/linear_animation.hpp rename to include/animation/linear_animation.hpp diff --git a/rive/include/animation/linear_animation_instance.hpp b/include/animation/linear_animation_instance.hpp similarity index 100% rename from rive/include/animation/linear_animation_instance.hpp rename to include/animation/linear_animation_instance.hpp diff --git a/rive/include/animation/loop.hpp b/include/animation/loop.hpp similarity index 100% rename from rive/include/animation/loop.hpp rename to include/animation/loop.hpp diff --git a/rive/include/artboard.hpp b/include/artboard.hpp similarity index 100% rename from rive/include/artboard.hpp rename to include/artboard.hpp diff --git a/rive/include/backboard.hpp b/include/backboard.hpp similarity index 100% rename from rive/include/backboard.hpp rename to include/backboard.hpp diff --git a/rive/include/bones/bone.hpp b/include/bones/bone.hpp similarity index 100% rename from rive/include/bones/bone.hpp rename to include/bones/bone.hpp diff --git a/rive/include/bones/root_bone.hpp b/include/bones/root_bone.hpp similarity index 100% rename from rive/include/bones/root_bone.hpp rename to include/bones/root_bone.hpp diff --git a/rive/include/bones/skeletal_component.hpp b/include/bones/skeletal_component.hpp similarity index 100% rename from rive/include/bones/skeletal_component.hpp rename to include/bones/skeletal_component.hpp diff --git a/rive/include/component.hpp b/include/component.hpp similarity index 100% rename from rive/include/component.hpp rename to include/component.hpp diff --git a/rive/include/component_dirt.hpp b/include/component_dirt.hpp similarity index 100% rename from rive/include/component_dirt.hpp rename to include/component_dirt.hpp diff --git a/rive/include/container_component.hpp b/include/container_component.hpp similarity index 100% rename from rive/include/container_component.hpp rename to include/container_component.hpp diff --git a/rive/include/core.hpp b/include/core.hpp similarity index 100% rename from rive/include/core.hpp rename to include/core.hpp diff --git a/rive/include/core/binary_reader.hpp b/include/core/binary_reader.hpp similarity index 100% rename from rive/include/core/binary_reader.hpp rename to include/core/binary_reader.hpp diff --git a/rive/include/core/field_types/core_bool_type.hpp b/include/core/field_types/core_bool_type.hpp similarity index 100% rename from rive/include/core/field_types/core_bool_type.hpp rename to include/core/field_types/core_bool_type.hpp diff --git a/rive/include/core/field_types/core_color_type.hpp b/include/core/field_types/core_color_type.hpp similarity index 100% rename from rive/include/core/field_types/core_color_type.hpp rename to include/core/field_types/core_color_type.hpp diff --git a/rive/include/core/field_types/core_double_type.hpp b/include/core/field_types/core_double_type.hpp similarity index 100% rename from rive/include/core/field_types/core_double_type.hpp rename to include/core/field_types/core_double_type.hpp diff --git a/rive/include/core/field_types/core_string_type.hpp b/include/core/field_types/core_string_type.hpp similarity index 100% rename from rive/include/core/field_types/core_string_type.hpp rename to include/core/field_types/core_string_type.hpp diff --git a/rive/include/core/field_types/core_uint_type.hpp b/include/core/field_types/core_uint_type.hpp similarity index 100% rename from rive/include/core/field_types/core_uint_type.hpp rename to include/core/field_types/core_uint_type.hpp diff --git a/rive/include/core/reader.h b/include/core/reader.h similarity index 100% rename from rive/include/core/reader.h rename to include/core/reader.h diff --git a/rive/include/core_context.hpp b/include/core_context.hpp similarity index 100% rename from rive/include/core_context.hpp rename to include/core_context.hpp diff --git a/rive/include/dependency_sorter.hpp b/include/dependency_sorter.hpp similarity index 100% rename from rive/include/dependency_sorter.hpp rename to include/dependency_sorter.hpp diff --git a/rive/include/drawable.hpp b/include/drawable.hpp similarity index 100% rename from rive/include/drawable.hpp rename to include/drawable.hpp diff --git a/rive/include/file.hpp b/include/file.hpp similarity index 100% rename from rive/include/file.hpp rename to include/file.hpp diff --git a/rive/include/generated/animation/animation_base.hpp b/include/generated/animation/animation_base.hpp similarity index 100% rename from rive/include/generated/animation/animation_base.hpp rename to include/generated/animation/animation_base.hpp diff --git a/rive/include/generated/animation/cubic_interpolator_base.hpp b/include/generated/animation/cubic_interpolator_base.hpp similarity index 100% rename from rive/include/generated/animation/cubic_interpolator_base.hpp rename to include/generated/animation/cubic_interpolator_base.hpp diff --git a/rive/include/generated/animation/keyed_object_base.hpp b/include/generated/animation/keyed_object_base.hpp similarity index 100% rename from rive/include/generated/animation/keyed_object_base.hpp rename to include/generated/animation/keyed_object_base.hpp diff --git a/rive/include/generated/animation/keyed_property_base.hpp b/include/generated/animation/keyed_property_base.hpp similarity index 100% rename from rive/include/generated/animation/keyed_property_base.hpp rename to include/generated/animation/keyed_property_base.hpp diff --git a/rive/include/generated/animation/keyframe_base.hpp b/include/generated/animation/keyframe_base.hpp similarity index 100% rename from rive/include/generated/animation/keyframe_base.hpp rename to include/generated/animation/keyframe_base.hpp diff --git a/rive/include/generated/animation/keyframe_color_base.hpp b/include/generated/animation/keyframe_color_base.hpp similarity index 100% rename from rive/include/generated/animation/keyframe_color_base.hpp rename to include/generated/animation/keyframe_color_base.hpp diff --git a/rive/include/generated/animation/keyframe_double_base.hpp b/include/generated/animation/keyframe_double_base.hpp similarity index 100% rename from rive/include/generated/animation/keyframe_double_base.hpp rename to include/generated/animation/keyframe_double_base.hpp diff --git a/rive/include/generated/animation/keyframe_draw_order_base.hpp b/include/generated/animation/keyframe_draw_order_base.hpp similarity index 100% rename from rive/include/generated/animation/keyframe_draw_order_base.hpp rename to include/generated/animation/keyframe_draw_order_base.hpp diff --git a/rive/include/generated/animation/keyframe_draw_order_value_base.hpp b/include/generated/animation/keyframe_draw_order_value_base.hpp similarity index 100% rename from rive/include/generated/animation/keyframe_draw_order_value_base.hpp rename to include/generated/animation/keyframe_draw_order_value_base.hpp diff --git a/rive/include/generated/animation/linear_animation_base.hpp b/include/generated/animation/linear_animation_base.hpp similarity index 100% rename from rive/include/generated/animation/linear_animation_base.hpp rename to include/generated/animation/linear_animation_base.hpp diff --git a/rive/include/generated/artboard_base.hpp b/include/generated/artboard_base.hpp similarity index 100% rename from rive/include/generated/artboard_base.hpp rename to include/generated/artboard_base.hpp diff --git a/rive/include/generated/backboard_base.hpp b/include/generated/backboard_base.hpp similarity index 100% rename from rive/include/generated/backboard_base.hpp rename to include/generated/backboard_base.hpp diff --git a/rive/include/generated/bones/bone_base.hpp b/include/generated/bones/bone_base.hpp similarity index 100% rename from rive/include/generated/bones/bone_base.hpp rename to include/generated/bones/bone_base.hpp diff --git a/rive/include/generated/bones/root_bone_base.hpp b/include/generated/bones/root_bone_base.hpp similarity index 100% rename from rive/include/generated/bones/root_bone_base.hpp rename to include/generated/bones/root_bone_base.hpp diff --git a/rive/include/generated/bones/skeletal_component_base.hpp b/include/generated/bones/skeletal_component_base.hpp similarity index 100% rename from rive/include/generated/bones/skeletal_component_base.hpp rename to include/generated/bones/skeletal_component_base.hpp diff --git a/rive/include/generated/component_base.hpp b/include/generated/component_base.hpp similarity index 100% rename from rive/include/generated/component_base.hpp rename to include/generated/component_base.hpp diff --git a/rive/include/generated/container_component_base.hpp b/include/generated/container_component_base.hpp similarity index 100% rename from rive/include/generated/container_component_base.hpp rename to include/generated/container_component_base.hpp diff --git a/rive/include/generated/core_registry.hpp b/include/generated/core_registry.hpp similarity index 100% rename from rive/include/generated/core_registry.hpp rename to include/generated/core_registry.hpp diff --git a/rive/include/generated/drawable_base.hpp b/include/generated/drawable_base.hpp similarity index 100% rename from rive/include/generated/drawable_base.hpp rename to include/generated/drawable_base.hpp diff --git a/rive/include/generated/node_base.hpp b/include/generated/node_base.hpp similarity index 100% rename from rive/include/generated/node_base.hpp rename to include/generated/node_base.hpp diff --git a/rive/include/generated/shapes/clipping_shape_base.hpp b/include/generated/shapes/clipping_shape_base.hpp similarity index 100% rename from rive/include/generated/shapes/clipping_shape_base.hpp rename to include/generated/shapes/clipping_shape_base.hpp diff --git a/rive/include/generated/shapes/cubic_asymmetric_vertex_base.hpp b/include/generated/shapes/cubic_asymmetric_vertex_base.hpp similarity index 100% rename from rive/include/generated/shapes/cubic_asymmetric_vertex_base.hpp rename to include/generated/shapes/cubic_asymmetric_vertex_base.hpp diff --git a/rive/include/generated/shapes/cubic_detached_vertex_base.hpp b/include/generated/shapes/cubic_detached_vertex_base.hpp similarity index 100% rename from rive/include/generated/shapes/cubic_detached_vertex_base.hpp rename to include/generated/shapes/cubic_detached_vertex_base.hpp diff --git a/rive/include/generated/shapes/cubic_mirrored_vertex_base.hpp b/include/generated/shapes/cubic_mirrored_vertex_base.hpp similarity index 100% rename from rive/include/generated/shapes/cubic_mirrored_vertex_base.hpp rename to include/generated/shapes/cubic_mirrored_vertex_base.hpp diff --git a/rive/include/generated/shapes/cubic_vertex_base.hpp b/include/generated/shapes/cubic_vertex_base.hpp similarity index 100% rename from rive/include/generated/shapes/cubic_vertex_base.hpp rename to include/generated/shapes/cubic_vertex_base.hpp diff --git a/rive/include/generated/shapes/ellipse_base.hpp b/include/generated/shapes/ellipse_base.hpp similarity index 100% rename from rive/include/generated/shapes/ellipse_base.hpp rename to include/generated/shapes/ellipse_base.hpp diff --git a/rive/include/generated/shapes/paint/fill_base.hpp b/include/generated/shapes/paint/fill_base.hpp similarity index 100% rename from rive/include/generated/shapes/paint/fill_base.hpp rename to include/generated/shapes/paint/fill_base.hpp diff --git a/rive/include/generated/shapes/paint/gradient_stop_base.hpp b/include/generated/shapes/paint/gradient_stop_base.hpp similarity index 100% rename from rive/include/generated/shapes/paint/gradient_stop_base.hpp rename to include/generated/shapes/paint/gradient_stop_base.hpp diff --git a/rive/include/generated/shapes/paint/linear_gradient_base.hpp b/include/generated/shapes/paint/linear_gradient_base.hpp similarity index 100% rename from rive/include/generated/shapes/paint/linear_gradient_base.hpp rename to include/generated/shapes/paint/linear_gradient_base.hpp diff --git a/rive/include/generated/shapes/paint/radial_gradient_base.hpp b/include/generated/shapes/paint/radial_gradient_base.hpp similarity index 100% rename from rive/include/generated/shapes/paint/radial_gradient_base.hpp rename to include/generated/shapes/paint/radial_gradient_base.hpp diff --git a/rive/include/generated/shapes/paint/shape_paint_base.hpp b/include/generated/shapes/paint/shape_paint_base.hpp similarity index 100% rename from rive/include/generated/shapes/paint/shape_paint_base.hpp rename to include/generated/shapes/paint/shape_paint_base.hpp diff --git a/rive/include/generated/shapes/paint/solid_color_base.hpp b/include/generated/shapes/paint/solid_color_base.hpp similarity index 100% rename from rive/include/generated/shapes/paint/solid_color_base.hpp rename to include/generated/shapes/paint/solid_color_base.hpp diff --git a/rive/include/generated/shapes/paint/stroke_base.hpp b/include/generated/shapes/paint/stroke_base.hpp similarity index 100% rename from rive/include/generated/shapes/paint/stroke_base.hpp rename to include/generated/shapes/paint/stroke_base.hpp diff --git a/rive/include/generated/shapes/parametric_path_base.hpp b/include/generated/shapes/parametric_path_base.hpp similarity index 100% rename from rive/include/generated/shapes/parametric_path_base.hpp rename to include/generated/shapes/parametric_path_base.hpp diff --git a/rive/include/generated/shapes/path_base.hpp b/include/generated/shapes/path_base.hpp similarity index 100% rename from rive/include/generated/shapes/path_base.hpp rename to include/generated/shapes/path_base.hpp diff --git a/rive/include/generated/shapes/path_composer_base.hpp b/include/generated/shapes/path_composer_base.hpp similarity index 100% rename from rive/include/generated/shapes/path_composer_base.hpp rename to include/generated/shapes/path_composer_base.hpp diff --git a/rive/include/generated/shapes/path_vertex_base.hpp b/include/generated/shapes/path_vertex_base.hpp similarity index 100% rename from rive/include/generated/shapes/path_vertex_base.hpp rename to include/generated/shapes/path_vertex_base.hpp diff --git a/rive/include/generated/shapes/points_path_base.hpp b/include/generated/shapes/points_path_base.hpp similarity index 100% rename from rive/include/generated/shapes/points_path_base.hpp rename to include/generated/shapes/points_path_base.hpp diff --git a/rive/include/generated/shapes/rectangle_base.hpp b/include/generated/shapes/rectangle_base.hpp similarity index 100% rename from rive/include/generated/shapes/rectangle_base.hpp rename to include/generated/shapes/rectangle_base.hpp diff --git a/rive/include/generated/shapes/shape_base.hpp b/include/generated/shapes/shape_base.hpp similarity index 100% rename from rive/include/generated/shapes/shape_base.hpp rename to include/generated/shapes/shape_base.hpp diff --git a/rive/include/generated/shapes/straight_vertex_base.hpp b/include/generated/shapes/straight_vertex_base.hpp similarity index 100% rename from rive/include/generated/shapes/straight_vertex_base.hpp rename to include/generated/shapes/straight_vertex_base.hpp diff --git a/rive/include/generated/shapes/triangle_base.hpp b/include/generated/shapes/triangle_base.hpp similarity index 100% rename from rive/include/generated/shapes/triangle_base.hpp rename to include/generated/shapes/triangle_base.hpp diff --git a/rive/include/generated/transform_component_base.hpp b/include/generated/transform_component_base.hpp similarity index 100% rename from rive/include/generated/transform_component_base.hpp rename to include/generated/transform_component_base.hpp diff --git a/rive/include/layout.hpp b/include/layout.hpp similarity index 100% rename from rive/include/layout.hpp rename to include/layout.hpp diff --git a/rive/include/math/aabb.hpp b/include/math/aabb.hpp similarity index 100% rename from rive/include/math/aabb.hpp rename to include/math/aabb.hpp diff --git a/rive/include/math/circle_constant.hpp b/include/math/circle_constant.hpp similarity index 100% rename from rive/include/math/circle_constant.hpp rename to include/math/circle_constant.hpp diff --git a/rive/include/math/color.hpp b/include/math/color.hpp similarity index 100% rename from rive/include/math/color.hpp rename to include/math/color.hpp diff --git a/rive/include/math/mat2d.hpp b/include/math/mat2d.hpp similarity index 100% rename from rive/include/math/mat2d.hpp rename to include/math/mat2d.hpp diff --git a/rive/include/math/transform_components.hpp b/include/math/transform_components.hpp similarity index 100% rename from rive/include/math/transform_components.hpp rename to include/math/transform_components.hpp diff --git a/rive/include/math/vec2d.hpp b/include/math/vec2d.hpp similarity index 100% rename from rive/include/math/vec2d.hpp rename to include/math/vec2d.hpp diff --git a/rive/include/node.hpp b/include/node.hpp similarity index 100% rename from rive/include/node.hpp rename to include/node.hpp diff --git a/rive/include/renderer.hpp b/include/renderer.hpp similarity index 100% rename from rive/include/renderer.hpp rename to include/renderer.hpp diff --git a/rive/include/runtime_header.hpp b/include/runtime_header.hpp similarity index 100% rename from rive/include/runtime_header.hpp rename to include/runtime_header.hpp diff --git a/rive/include/shapes/clipping_shape.hpp b/include/shapes/clipping_shape.hpp similarity index 100% rename from rive/include/shapes/clipping_shape.hpp rename to include/shapes/clipping_shape.hpp diff --git a/rive/include/shapes/cubic_asymmetric_vertex.hpp b/include/shapes/cubic_asymmetric_vertex.hpp similarity index 100% rename from rive/include/shapes/cubic_asymmetric_vertex.hpp rename to include/shapes/cubic_asymmetric_vertex.hpp diff --git a/rive/include/shapes/cubic_detached_vertex.hpp b/include/shapes/cubic_detached_vertex.hpp similarity index 100% rename from rive/include/shapes/cubic_detached_vertex.hpp rename to include/shapes/cubic_detached_vertex.hpp diff --git a/rive/include/shapes/cubic_mirrored_vertex.hpp b/include/shapes/cubic_mirrored_vertex.hpp similarity index 100% rename from rive/include/shapes/cubic_mirrored_vertex.hpp rename to include/shapes/cubic_mirrored_vertex.hpp diff --git a/rive/include/shapes/cubic_vertex.hpp b/include/shapes/cubic_vertex.hpp similarity index 100% rename from rive/include/shapes/cubic_vertex.hpp rename to include/shapes/cubic_vertex.hpp diff --git a/rive/include/shapes/ellipse.hpp b/include/shapes/ellipse.hpp similarity index 100% rename from rive/include/shapes/ellipse.hpp rename to include/shapes/ellipse.hpp diff --git a/rive/include/shapes/paint/blend_mode.hpp b/include/shapes/paint/blend_mode.hpp similarity index 100% rename from rive/include/shapes/paint/blend_mode.hpp rename to include/shapes/paint/blend_mode.hpp diff --git a/rive/include/shapes/paint/color.hpp b/include/shapes/paint/color.hpp similarity index 100% rename from rive/include/shapes/paint/color.hpp rename to include/shapes/paint/color.hpp diff --git a/rive/include/shapes/paint/fill.hpp b/include/shapes/paint/fill.hpp similarity index 100% rename from rive/include/shapes/paint/fill.hpp rename to include/shapes/paint/fill.hpp diff --git a/rive/include/shapes/paint/gradient_stop.hpp b/include/shapes/paint/gradient_stop.hpp similarity index 100% rename from rive/include/shapes/paint/gradient_stop.hpp rename to include/shapes/paint/gradient_stop.hpp diff --git a/rive/include/shapes/paint/linear_gradient.hpp b/include/shapes/paint/linear_gradient.hpp similarity index 100% rename from rive/include/shapes/paint/linear_gradient.hpp rename to include/shapes/paint/linear_gradient.hpp diff --git a/rive/include/shapes/paint/radial_gradient.hpp b/include/shapes/paint/radial_gradient.hpp similarity index 100% rename from rive/include/shapes/paint/radial_gradient.hpp rename to include/shapes/paint/radial_gradient.hpp diff --git a/rive/include/shapes/paint/shape_paint.hpp b/include/shapes/paint/shape_paint.hpp similarity index 100% rename from rive/include/shapes/paint/shape_paint.hpp rename to include/shapes/paint/shape_paint.hpp diff --git a/rive/include/shapes/paint/shape_paint_mutator.hpp b/include/shapes/paint/shape_paint_mutator.hpp similarity index 100% rename from rive/include/shapes/paint/shape_paint_mutator.hpp rename to include/shapes/paint/shape_paint_mutator.hpp diff --git a/rive/include/shapes/paint/solid_color.hpp b/include/shapes/paint/solid_color.hpp similarity index 100% rename from rive/include/shapes/paint/solid_color.hpp rename to include/shapes/paint/solid_color.hpp diff --git a/rive/include/shapes/paint/stroke.hpp b/include/shapes/paint/stroke.hpp similarity index 100% rename from rive/include/shapes/paint/stroke.hpp rename to include/shapes/paint/stroke.hpp diff --git a/rive/include/shapes/paint/stroke_cap.hpp b/include/shapes/paint/stroke_cap.hpp similarity index 100% rename from rive/include/shapes/paint/stroke_cap.hpp rename to include/shapes/paint/stroke_cap.hpp diff --git a/rive/include/shapes/paint/stroke_join.hpp b/include/shapes/paint/stroke_join.hpp similarity index 100% rename from rive/include/shapes/paint/stroke_join.hpp rename to include/shapes/paint/stroke_join.hpp diff --git a/rive/include/shapes/parametric_path.hpp b/include/shapes/parametric_path.hpp similarity index 100% rename from rive/include/shapes/parametric_path.hpp rename to include/shapes/parametric_path.hpp diff --git a/rive/include/shapes/path.hpp b/include/shapes/path.hpp similarity index 100% rename from rive/include/shapes/path.hpp rename to include/shapes/path.hpp diff --git a/rive/include/shapes/path_composer.hpp b/include/shapes/path_composer.hpp similarity index 100% rename from rive/include/shapes/path_composer.hpp rename to include/shapes/path_composer.hpp diff --git a/rive/include/shapes/path_space.hpp b/include/shapes/path_space.hpp similarity index 100% rename from rive/include/shapes/path_space.hpp rename to include/shapes/path_space.hpp diff --git a/rive/include/shapes/path_vertex.hpp b/include/shapes/path_vertex.hpp similarity index 100% rename from rive/include/shapes/path_vertex.hpp rename to include/shapes/path_vertex.hpp diff --git a/rive/include/shapes/points_path.hpp b/include/shapes/points_path.hpp similarity index 100% rename from rive/include/shapes/points_path.hpp rename to include/shapes/points_path.hpp diff --git a/rive/include/shapes/rectangle.hpp b/include/shapes/rectangle.hpp similarity index 100% rename from rive/include/shapes/rectangle.hpp rename to include/shapes/rectangle.hpp diff --git a/rive/include/shapes/shape.hpp b/include/shapes/shape.hpp similarity index 100% rename from rive/include/shapes/shape.hpp rename to include/shapes/shape.hpp diff --git a/rive/include/shapes/shape_paint_container.hpp b/include/shapes/shape_paint_container.hpp similarity index 100% rename from rive/include/shapes/shape_paint_container.hpp rename to include/shapes/shape_paint_container.hpp diff --git a/rive/include/shapes/straight_vertex.hpp b/include/shapes/straight_vertex.hpp similarity index 100% rename from rive/include/shapes/straight_vertex.hpp rename to include/shapes/straight_vertex.hpp diff --git a/rive/include/shapes/triangle.hpp b/include/shapes/triangle.hpp similarity index 100% rename from rive/include/shapes/triangle.hpp rename to include/shapes/triangle.hpp diff --git a/rive/include/transform_component.hpp b/include/transform_component.hpp similarity index 100% rename from rive/include/transform_component.hpp rename to include/transform_component.hpp diff --git a/rive/src/animation/cubic_interpolator.cpp b/src/animation/cubic_interpolator.cpp similarity index 100% rename from rive/src/animation/cubic_interpolator.cpp rename to src/animation/cubic_interpolator.cpp diff --git a/rive/src/animation/keyed_object.cpp b/src/animation/keyed_object.cpp similarity index 100% rename from rive/src/animation/keyed_object.cpp rename to src/animation/keyed_object.cpp diff --git a/rive/src/animation/keyed_property.cpp b/src/animation/keyed_property.cpp similarity index 100% rename from rive/src/animation/keyed_property.cpp rename to src/animation/keyed_property.cpp diff --git a/rive/src/animation/keyframe.cpp b/src/animation/keyframe.cpp similarity index 100% rename from rive/src/animation/keyframe.cpp rename to src/animation/keyframe.cpp diff --git a/rive/src/animation/keyframe_color.cpp b/src/animation/keyframe_color.cpp similarity index 100% rename from rive/src/animation/keyframe_color.cpp rename to src/animation/keyframe_color.cpp diff --git a/rive/src/animation/keyframe_double.cpp b/src/animation/keyframe_double.cpp similarity index 100% rename from rive/src/animation/keyframe_double.cpp rename to src/animation/keyframe_double.cpp diff --git a/rive/src/animation/keyframe_draw_order.cpp b/src/animation/keyframe_draw_order.cpp similarity index 100% rename from rive/src/animation/keyframe_draw_order.cpp rename to src/animation/keyframe_draw_order.cpp diff --git a/rive/src/animation/linear_animation.cpp b/src/animation/linear_animation.cpp similarity index 100% rename from rive/src/animation/linear_animation.cpp rename to src/animation/linear_animation.cpp diff --git a/rive/src/animation/linear_animation_instance.cpp b/src/animation/linear_animation_instance.cpp similarity index 100% rename from rive/src/animation/linear_animation_instance.cpp rename to src/animation/linear_animation_instance.cpp diff --git a/rive/src/artboard.cpp b/src/artboard.cpp similarity index 100% rename from rive/src/artboard.cpp rename to src/artboard.cpp diff --git a/rive/src/bones/bone.cpp b/src/bones/bone.cpp similarity index 100% rename from rive/src/bones/bone.cpp rename to src/bones/bone.cpp diff --git a/rive/src/component.cpp b/src/component.cpp similarity index 100% rename from rive/src/component.cpp rename to src/component.cpp diff --git a/rive/src/core/binary_reader.cpp b/src/core/binary_reader.cpp similarity index 100% rename from rive/src/core/binary_reader.cpp rename to src/core/binary_reader.cpp diff --git a/rive/src/core/field_types/core_bool_type.cpp b/src/core/field_types/core_bool_type.cpp similarity index 100% rename from rive/src/core/field_types/core_bool_type.cpp rename to src/core/field_types/core_bool_type.cpp diff --git a/rive/src/core/field_types/core_color_type.cpp b/src/core/field_types/core_color_type.cpp similarity index 100% rename from rive/src/core/field_types/core_color_type.cpp rename to src/core/field_types/core_color_type.cpp diff --git a/rive/src/core/field_types/core_double_type.cpp b/src/core/field_types/core_double_type.cpp similarity index 100% rename from rive/src/core/field_types/core_double_type.cpp rename to src/core/field_types/core_double_type.cpp diff --git a/rive/src/core/field_types/core_string_type.cpp b/src/core/field_types/core_string_type.cpp similarity index 100% rename from rive/src/core/field_types/core_string_type.cpp rename to src/core/field_types/core_string_type.cpp diff --git a/rive/src/core/field_types/core_uint_type.cpp b/src/core/field_types/core_uint_type.cpp similarity index 100% rename from rive/src/core/field_types/core_uint_type.cpp rename to src/core/field_types/core_uint_type.cpp diff --git a/rive/src/dependency_sorter.cpp b/src/dependency_sorter.cpp similarity index 100% rename from rive/src/dependency_sorter.cpp rename to src/dependency_sorter.cpp diff --git a/rive/src/drawable.cpp b/src/drawable.cpp similarity index 100% rename from rive/src/drawable.cpp rename to src/drawable.cpp diff --git a/rive/src/file.cpp b/src/file.cpp similarity index 100% rename from rive/src/file.cpp rename to src/file.cpp diff --git a/rive/src/layout.cpp b/src/layout.cpp similarity index 100% rename from rive/src/layout.cpp rename to src/layout.cpp diff --git a/rive/src/math/aabb.cpp b/src/math/aabb.cpp similarity index 100% rename from rive/src/math/aabb.cpp rename to src/math/aabb.cpp diff --git a/rive/src/math/mat2d.cpp b/src/math/mat2d.cpp similarity index 100% rename from rive/src/math/mat2d.cpp rename to src/math/mat2d.cpp diff --git a/rive/src/math/vec2d.cpp b/src/math/vec2d.cpp similarity index 100% rename from rive/src/math/vec2d.cpp rename to src/math/vec2d.cpp diff --git a/rive/src/node.cpp b/src/node.cpp similarity index 100% rename from rive/src/node.cpp rename to src/node.cpp diff --git a/rive/src/shapes/clipping_shape.cpp b/src/shapes/clipping_shape.cpp similarity index 100% rename from rive/src/shapes/clipping_shape.cpp rename to src/shapes/clipping_shape.cpp diff --git a/rive/src/shapes/cubic_asymmetric_vertex.cpp b/src/shapes/cubic_asymmetric_vertex.cpp similarity index 100% rename from rive/src/shapes/cubic_asymmetric_vertex.cpp rename to src/shapes/cubic_asymmetric_vertex.cpp diff --git a/rive/src/shapes/cubic_detached_vertex.cpp b/src/shapes/cubic_detached_vertex.cpp similarity index 100% rename from rive/src/shapes/cubic_detached_vertex.cpp rename to src/shapes/cubic_detached_vertex.cpp diff --git a/rive/src/shapes/cubic_mirrored_vertex.cpp b/src/shapes/cubic_mirrored_vertex.cpp similarity index 100% rename from rive/src/shapes/cubic_mirrored_vertex.cpp rename to src/shapes/cubic_mirrored_vertex.cpp diff --git a/rive/src/shapes/cubic_vertex.cpp b/src/shapes/cubic_vertex.cpp similarity index 100% rename from rive/src/shapes/cubic_vertex.cpp rename to src/shapes/cubic_vertex.cpp diff --git a/rive/src/shapes/ellipse.cpp b/src/shapes/ellipse.cpp similarity index 100% rename from rive/src/shapes/ellipse.cpp rename to src/shapes/ellipse.cpp diff --git a/rive/src/shapes/paint/color.cpp b/src/shapes/paint/color.cpp similarity index 100% rename from rive/src/shapes/paint/color.cpp rename to src/shapes/paint/color.cpp diff --git a/rive/src/shapes/paint/fill.cpp b/src/shapes/paint/fill.cpp similarity index 100% rename from rive/src/shapes/paint/fill.cpp rename to src/shapes/paint/fill.cpp diff --git a/rive/src/shapes/paint/gradient_stop.cpp b/src/shapes/paint/gradient_stop.cpp similarity index 100% rename from rive/src/shapes/paint/gradient_stop.cpp rename to src/shapes/paint/gradient_stop.cpp diff --git a/rive/src/shapes/paint/linear_gradient.cpp b/src/shapes/paint/linear_gradient.cpp similarity index 100% rename from rive/src/shapes/paint/linear_gradient.cpp rename to src/shapes/paint/linear_gradient.cpp diff --git a/rive/src/shapes/paint/radial_gradient.cpp b/src/shapes/paint/radial_gradient.cpp similarity index 100% rename from rive/src/shapes/paint/radial_gradient.cpp rename to src/shapes/paint/radial_gradient.cpp diff --git a/rive/src/shapes/paint/shape_paint.cpp b/src/shapes/paint/shape_paint.cpp similarity index 100% rename from rive/src/shapes/paint/shape_paint.cpp rename to src/shapes/paint/shape_paint.cpp diff --git a/rive/src/shapes/paint/shape_paint_mutator.cpp b/src/shapes/paint/shape_paint_mutator.cpp similarity index 100% rename from rive/src/shapes/paint/shape_paint_mutator.cpp rename to src/shapes/paint/shape_paint_mutator.cpp diff --git a/rive/src/shapes/paint/solid_color.cpp b/src/shapes/paint/solid_color.cpp similarity index 100% rename from rive/src/shapes/paint/solid_color.cpp rename to src/shapes/paint/solid_color.cpp diff --git a/rive/src/shapes/paint/stroke.cpp b/src/shapes/paint/stroke.cpp similarity index 100% rename from rive/src/shapes/paint/stroke.cpp rename to src/shapes/paint/stroke.cpp diff --git a/rive/src/shapes/parametric_path.cpp b/src/shapes/parametric_path.cpp similarity index 100% rename from rive/src/shapes/parametric_path.cpp rename to src/shapes/parametric_path.cpp diff --git a/rive/src/shapes/path.cpp b/src/shapes/path.cpp similarity index 100% rename from rive/src/shapes/path.cpp rename to src/shapes/path.cpp diff --git a/rive/src/shapes/path_composer.cpp b/src/shapes/path_composer.cpp similarity index 100% rename from rive/src/shapes/path_composer.cpp rename to src/shapes/path_composer.cpp diff --git a/rive/src/shapes/path_vertex.cpp b/src/shapes/path_vertex.cpp similarity index 100% rename from rive/src/shapes/path_vertex.cpp rename to src/shapes/path_vertex.cpp diff --git a/rive/src/shapes/rectangle.cpp b/src/shapes/rectangle.cpp similarity index 100% rename from rive/src/shapes/rectangle.cpp rename to src/shapes/rectangle.cpp diff --git a/rive/src/shapes/shape.cpp b/src/shapes/shape.cpp similarity index 100% rename from rive/src/shapes/shape.cpp rename to src/shapes/shape.cpp diff --git a/rive/src/shapes/shape_paint_container.cpp b/src/shapes/shape_paint_container.cpp similarity index 100% rename from rive/src/shapes/shape_paint_container.cpp rename to src/shapes/shape_paint_container.cpp diff --git a/rive/src/shapes/straight_vertex.cpp b/src/shapes/straight_vertex.cpp similarity index 100% rename from rive/src/shapes/straight_vertex.cpp rename to src/shapes/straight_vertex.cpp diff --git a/rive/src/transform_component.cpp b/src/transform_component.cpp similarity index 100% rename from rive/src/transform_component.cpp rename to src/transform_component.cpp diff --git a/assets/dependency_test.riv b/test/assets/dependency_test.riv similarity index 100% rename from assets/dependency_test.riv rename to test/assets/dependency_test.riv diff --git a/assets/fix_rectangle.riv b/test/assets/fix_rectangle.riv similarity index 100% rename from assets/fix_rectangle.riv rename to test/assets/fix_rectangle.riv diff --git a/assets/juice.riv b/test/assets/juice.riv similarity index 100% rename from assets/juice.riv rename to test/assets/juice.riv diff --git a/assets/shapetest.riv b/test/assets/shapetest.riv similarity index 100% rename from assets/shapetest.riv rename to test/assets/shapetest.riv diff --git a/assets/two_artboards.riv b/test/assets/two_artboards.riv similarity index 100% rename from assets/two_artboards.riv rename to test/assets/two_artboards.riv diff --git a/rive/test/clip_test.cpp b/test/clip_test.cpp similarity index 59% rename from rive/test/clip_test.cpp rename to test/clip_test.cpp index 1c3aa149..4bd2124e 100644 --- a/rive/test/clip_test.cpp +++ b/test/clip_test.cpp @@ -3,14 +3,14 @@ #include "file.hpp" #include "no_op_renderer.hpp" #include "node.hpp" +#include "shapes/clipping_shape.hpp" #include "shapes/rectangle.hpp" #include "shapes/shape.hpp" -#include "shapes/clipping_shape.hpp" #include TEST_CASE("clipping loads correctly", "[clipping]") { - FILE* fp = fopen("../../assets/circle_clips.riv", "r"); + FILE* fp = fopen("../../test/assets/circle_clips.riv", "r"); REQUIRE(fp != nullptr); fseek(fp, 0, SEEK_END); @@ -26,19 +26,19 @@ TEST_CASE("clipping loads correctly", "[clipping]") REQUIRE(file != nullptr); REQUIRE(file->artboard() != nullptr); - auto node = file->artboard()->node("TopEllipse"); - REQUIRE(node != nullptr); - REQUIRE(node->is()); + auto node = file->artboard()->node("TopEllipse"); + REQUIRE(node != nullptr); + REQUIRE(node->is()); - auto shape = node->as(); - REQUIRE(shape->clippingShapes().size() == 2); - REQUIRE(shape->clippingShapes()[0]->shape()->name() == "ClipRect2"); - REQUIRE(shape->clippingShapes()[1]->shape()->name() == "BabyEllipse"); + auto shape = node->as(); + REQUIRE(shape->clippingShapes().size() == 2); + REQUIRE(shape->clippingShapes()[0]->shape()->name() == "ClipRect2"); + REQUIRE(shape->clippingShapes()[1]->shape()->name() == "BabyEllipse"); - file->artboard()->updateComponents(); + file->artboard()->updateComponents(); - rive::NoOpRenderer renderer; - file->artboard()->draw(&renderer); + rive::NoOpRenderer renderer; + file->artboard()->draw(&renderer); delete file; delete[] bytes; diff --git a/rive/test/file_test.cpp b/test/file_test.cpp similarity index 96% rename from rive/test/file_test.cpp rename to test/file_test.cpp index 17cef440..c03bab32 100644 --- a/rive/test/file_test.cpp +++ b/test/file_test.cpp @@ -9,7 +9,7 @@ TEST_CASE("file can be read", "[file]") { - FILE* fp = fopen("../../assets/two_artboards.riv", "r"); + FILE* fp = fopen("../../test/assets/two_artboards.riv", "r"); REQUIRE(fp != nullptr); fseek(fp, 0, SEEK_END); @@ -37,7 +37,7 @@ TEST_CASE("file can be read", "[file]") TEST_CASE("file with animation can be read", "[file]") { - FILE* fp = fopen("../../assets/juice.riv", "r"); + FILE* fp = fopen("../../test/assets/juice.riv", "r"); REQUIRE(fp != nullptr); fseek(fp, 0, SEEK_END); @@ -93,7 +93,7 @@ TEST_CASE("dependencies are as expected", "[file]") // │ ┌──────────────┐ // └▶│Rectangle Path│ // └──────────────┘ - FILE* fp = fopen("../../assets/dependency_test.riv", "r"); + FILE* fp = fopen("../../test/assets/dependency_test.riv", "r"); REQUIRE(fp != nullptr); fseek(fp, 0, SEEK_END); diff --git a/rive/test/main_test.cpp b/test/main_test.cpp similarity index 100% rename from rive/test/main_test.cpp rename to test/main_test.cpp diff --git a/rive/test/no_op_renderer.cpp b/test/no_op_renderer.cpp similarity index 100% rename from rive/test/no_op_renderer.cpp rename to test/no_op_renderer.cpp diff --git a/rive/test/no_op_renderer.hpp b/test/no_op_renderer.hpp similarity index 100% rename from rive/test/no_op_renderer.hpp rename to test/no_op_renderer.hpp diff --git a/rive/test/node_test.cpp b/test/node_test.cpp similarity index 100% rename from rive/test/node_test.cpp rename to test/node_test.cpp diff --git a/rive/test/path_test.cpp b/test/path_test.cpp similarity index 100% rename from rive/test/path_test.cpp rename to test/path_test.cpp diff --git a/rive/test/reader_test.cpp b/test/reader_test.cpp similarity index 100% rename from rive/test/reader_test.cpp rename to test/reader_test.cpp diff --git a/wasm/build.sh b/wasm/build.sh deleted file mode 100755 index 182f554c..00000000 --- a/wasm/build.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -pushd build &>/dev/null - -OPTION=$1 - -if [ "$OPTION" = 'help' ] -then - echo build.sh - build debug library - echo build.sh clean - clean the build - echo build.sh release - build release library -elif [ "$OPTION" = "clean" ] -then - echo Cleaning project ... - premake5 clean -elif [ "$OPTION" = "release" ] -then - premake5 gmake2 && make config=release -else - premake5 gmake2 && make config=debug -fi - -popd &>/dev/null \ No newline at end of file diff --git a/wasm/build_wasm.sh b/wasm/build_wasm.sh deleted file mode 100755 index ac186b9f..00000000 --- a/wasm/build_wasm.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -OUTPUT_DIR=bin/release - -mkdir -p build -pushd build &>/dev/null - -# make the output directory if it dont's exist -mkdir -p $OUTPUT_DIR - -em++ -Oz --js-opts 0 -g1 \ - --closure 0 \ - --bind \ - -o $OUTPUT_DIR/rive.js \ - -s ASSERTIONS=0 \ - -s FORCE_FILESYSTEM=0 \ - -s MODULARIZE=1 \ - -s NO_EXIT_RUNTIME=1 \ - -s STRICT=1 \ - -s WARN_UNALIGNED=1 \ - -s ALLOW_MEMORY_GROWTH=1 \ - -s DISABLE_EXCEPTION_CATCHING=1 \ - -s WASM=1 \ - -s EXPORT_NAME="Rive" \ - -s LLD_REPORT_UNDEFINED \ - -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ - -DSINGLE \ - -DANSI_DECLARATORS \ - -Wno-c++17-extensions \ - -fno-exceptions \ - -fno-rtti \ - -fno-unwind-tables \ - -I../../rive/include \ - --no-entry \ - --post-js ../js/marker.js \ - ../../rive/src/*/*.cpp \ - ../../rive/src/*.cpp \ - ../../rive/src/core/field_types/*.cpp \ - ../../rive/src/shapes/paint/*.cpp \ - ../src/bindings.cpp - -awk 'NR==FNR { a[n++]=$0; next } -/console\.log\("--REPLACE WITH RENDERING CODE--"\);/ { for (i=0;i./bin/release/rive_combined.js - -if ! command -v terser &>/dev/null; then - npm install terser -g -fi -terser --compress --mangle -o ./bin/release/rive.min.js -- ./bin/release/rive_combined.js -popd &>/dev/null diff --git a/wasm/index.html b/wasm/index.html deleted file mode 100644 index 49853175..00000000 --- a/wasm/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Test Animation - - - - - - - - - - \ No newline at end of file diff --git a/wasm/js/marker.js b/wasm/js/marker.js deleted file mode 100644 index 02e95aad..00000000 --- a/wasm/js/marker.js +++ /dev/null @@ -1 +0,0 @@ -console.log("--REPLACE WITH RENDERING CODE--"); \ No newline at end of file diff --git a/wasm/js/renderer.js b/wasm/js/renderer.js deleted file mode 100644 index 9023abce..00000000 --- a/wasm/js/renderer.js +++ /dev/null @@ -1,274 +0,0 @@ -var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - -function makeMatrix(m2d) { - var m = svg.createSVGMatrix(); - m.a = m2d.xx; - m.b = m2d.xy; - m.c = m2d.yx; - m.d = m2d.yy; - m.e = m2d.tx; - m.f = m2d.ty; - return m; -} - -Module.onRuntimeInitialized = function () { - const { - RenderPaintStyle, - FillRule, - RenderPath, - RenderPaint, - Renderer, - StrokeCap, - StrokeJoin, - BlendMode - } = Module; - - const { - fill, - stroke - } = RenderPaintStyle; - - const { - evenOdd, - nonZero - } = FillRule; - - var CanvasRenderPath = RenderPath.extend("CanvasRenderPath", { - __construct: function () { - this.__parent.__construct.call(this); - this._path2D = new Path2D(); - }, - reset: function () { - this._path2D = new Path2D(); - }, - addPath: function (path, m2d) { - this._path2D.addPath(path._path2D, makeMatrix(m2d)); - }, - fillRule: function(fillRule) { - this._fillRule = fillRule; - }, - moveTo: function (x, y) { - this._path2D.moveTo(x, y); - }, - lineTo: function (x, y) { - this._path2D.lineTo(x, y); - }, - cubicTo: function (ox, oy, ix, iy, x, y) { - this._path2D.bezierCurveTo(ox, oy, ix, iy, x, y); - }, - close: function () { - this._path2D.closePath(); - } - }); - - function _colorStyle(value) { - return 'rgba(' + ((0x00ff0000 & value) >>> - 16) + ',' + ((0x0000ff00 & - value) >>> 8) + ',' + ((0x000000ff & value) >>> 0) + ',' + - (((0xff000000 & value) >>> 24) / 0xFF) + ')' - } - var CanvasRenderPaint = RenderPaint.extend("CanvasRenderPaint", { - color: function (value) { - this._value = _colorStyle(value); - }, - thickness: function (value) { - this._thickness = value; - }, - join: function (value) { - switch (value) { - case StrokeJoin.miter: - this._join = 'miter'; - break; - case StrokeJoin.round: - this._join = 'round'; - break; - case StrokeJoin.bevel: - this._join = 'bevel'; - break; - } - }, - cap: function (value) { - switch (value) { - case StrokeCap.butt: - this._cap = 'butt'; - break; - case StrokeCap.round: - this._cap = 'round'; - break; - case StrokeCap.square: - this._cap = 'square'; - break; - } - }, - style: function (value) { - this._style = value; - }, - blendMode: function (value) { - switch (value) { - case BlendMode.srcOver: - this._blend = 'source-over'; - break; - case BlendMode.screen: - this._blend = 'screen'; - break; - case BlendMode.overlay: - this._blend = 'overlay'; - break; - case BlendMode.darken: - this._blend = 'darken'; - break; - case BlendMode.lighten: - this._blend = 'lighten'; - break; - case BlendMode.colorDodge: - this._blend = 'color-dodge'; - break; - case BlendMode.colorBurn: - this._blend = 'color-burn'; - break; - case BlendMode.hardLight: - this._blend = 'hard-light'; - break; - case BlendMode.softLight: - this._blend = 'soft-light'; - break; - case BlendMode.difference: - this._blend = 'difference'; - break; - case BlendMode.exclusion: - this._blend = 'exclusion'; - break; - case BlendMode.multiply: - this._blend = 'multiply'; - break; - case BlendMode.hue: - this._blend = 'hue'; - break; - case BlendMode.saturation: - this._blend = 'saturation'; - break; - case BlendMode.color: - this._blend = 'color'; - break; - case BlendMode.luminosity: - this._blend = 'luminosity'; - break; - } - }, - linearGradient: function (sx, sy, ex, ey) { - this._gradient = { - sx, - sy, - ex, - ey, - stops: [] - }; - }, - radialGradient: function (sx, sy, ex, ey) { - this._gradient = { - sx, - sy, - ex, - ey, - stops: [], - isRadial: true - }; - }, - addStop: function (color, stop) { - this._gradient.stops.push({ - color, - stop - }); - }, - - completeGradient: function () { - - }, - - draw: function (ctx, path) { - let { - _style, - _value, - _gradient, - _blend - } = this; - - ctx.globalCompositeOperation = _blend; - - if (_gradient != null) { - const { - sx, - sy, - ex, - ey, - stops, - isRadial - } = _gradient; - - if (isRadial) { - var dx = ex - sx; - var dy = ey - sy; - var radius = Math.sqrt(dx * dx + dy * dy); - _value = ctx.createRadialGradient(sx, sy, 0, sx, sy, radius); - } else { - _value = ctx.createLinearGradient(sx, sy, ex, ey); - } - - for ({ - stop, - color - } of stops) { - _value.addColorStop(stop, _colorStyle(color)); - } - this._value = _value; - this._gradient = null; - } - switch (_style) { - case stroke: - ctx.strokeStyle = _value; - ctx.lineWidth = this._thickness; - ctx.lineCap = this._cap; - ctx.lineJoin = this._join; - ctx.stroke(path._path2D); - break; - case fill: - ctx.fillStyle = _value; - ctx.fill(path._path2D); - break; - } - } - }); - - Module.CanvasRenderer = Renderer.extend("Renderer", { - __construct: function (ctx) { - this.__parent.__construct.call(this); - this._ctx = ctx; - }, - save: function () { - this._ctx.save(); - }, - restore: function () { - this._ctx.restore(); - }, - transform: function (matrix) { - this._ctx.transform(matrix.xx, matrix.xy, matrix.yx, matrix.yy, matrix.tx, - matrix.ty); - }, - drawPath: function (path, paint) { - paint.draw(this._ctx, path); - }, - clipPath: function (path) { - - this._ctx.clip(path._path2D, path._fillRule === evenOdd ? 'evenodd' : 'nonzero'); - } - }); - - Module.renderFactory = { - makeRenderPaint: function () { - return new CanvasRenderPaint(); - }, - makeRenderPath: function () { - return new CanvasRenderPath(); - } - }; -}; \ No newline at end of file diff --git a/wasm/publish/LICENSE b/wasm/publish/LICENSE deleted file mode 100644 index aec1d173..00000000 --- a/wasm/publish/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Rive - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/wasm/publish/README.md b/wasm/publish/README.md deleted file mode 100644 index aa963607..00000000 --- a/wasm/publish/README.md +++ /dev/null @@ -1,20 +0,0 @@ -Lightweight Rive runtime for the Web using WASM and Canvas2D. - -# Getting Started - -## Browser -To use the library, run `npm install rive-canvas` and then simply include it: - - - Rive({ - locateFile: (file) => '/node_modules/rive-canvas/'+file, - }).then((module) => { - // Code goes here using Rive. - }); - -As with all npm packages, there's a freely available CDN via unpkg.com: - - - Rive({ - locateFile: (file) => 'https://unpkg.com/rive-canvas@0.0.2/'+file, - }).then(...) \ No newline at end of file diff --git a/wasm/publish/package.json b/wasm/publish/package.json deleted file mode 100644 index d5e3154d..00000000 --- a/wasm/publish/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "rive-canvas", - "version": "0.0.10", - "description": "Rive JS WASM runtime.", - "main": "rive.js", - "repository": { - "type": "git", - "url": "https://github.com/rive-app/rive-cpp" - }, - "keywords": [ - "rive", - "animation" - ], - "author": "Rive", - "contributors": [ - "Luigi Rosso (https://rive.app)", - "Matthew Sullivan (https://rive.app)" - ], - "license": "MIT" -} \ No newline at end of file diff --git a/wasm/publish_wasm.sh b/wasm/publish_wasm.sh deleted file mode 100755 index 1aacfb49..00000000 --- a/wasm/publish_wasm.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cp ./build/bin/release/rive.wasm ./publish -cp ./build/bin/release/rive.min.js ./publish/rive.js diff --git a/wasm/setup_build_tool.sh b/wasm/setup_build_tool.sh deleted file mode 100755 index d9ea65cc..00000000 --- a/wasm/setup_build_tool.sh +++ /dev/null @@ -1,34 +0,0 @@ -# We need to compile without RTTI. In order to do that we need to use a fork -# with a fix to emscripten by @dnfield. -# https://github.com/emscripten-core/emscripten/pull/10914 -mkdir -p custom_emcc -cd custom_emcc -if [ ! -d emsdk ] -then - command -v cmake > /dev/null || brew install cmake - git clone https://github.com/emscripten-core/emsdk.git - cd emsdk - ./emsdk install latest - ./emsdk activate latest - ./emsdk install sdk-upstream-master-64bit - ./emsdk activate sdk-upstream-master-64bit - source ./emsdk_env.sh - cd emscripten/master - git remote add luigis https://github.com/luigi-rosso/emscripten.git - git fetch luigis - git checkout -b luigismaster --track luigis/master - npm install - # add dan's remote - # git remote add dans https://github.com/dnfield/emscripten.git - # git fetch dans - # git checkout -b dansmaster --track dans/master - # get closure compiler - npm install - cd ../../ -else - cd emsdk - source ./emsdk_env.sh -fi - -# Note that you'll need to cd into custom_emcc/emsdk and run source -# ./emsdk_env.sh manually from the shell where you'll call build_wasm.sh. \ No newline at end of file diff --git a/wasm/src/bindings.cpp b/wasm/src/bindings.cpp deleted file mode 100644 index 59894b6d..00000000 --- a/wasm/src/bindings.cpp +++ /dev/null @@ -1,364 +0,0 @@ -#include "animation/linear_animation.hpp" -#include "animation/linear_animation_instance.hpp" -#include "artboard.hpp" -#include "core/binary_reader.hpp" -#include "file.hpp" -#include "layout.hpp" -#include "math/mat2d.hpp" -#include "node.hpp" -#include "renderer.hpp" -#include -#include -#include -#include -#include -#include - -using namespace emscripten; - -class RendererWrapper : public wrapper -{ -public: - EMSCRIPTEN_WRAPPER(RendererWrapper); - - void save() override { call("save"); } - - void restore() override { call("restore"); } - - void transform(const rive::Mat2D& transform) override - { - call("transform", transform); - } - - void drawPath(rive::RenderPath* path, rive::RenderPaint* paint) override - { - call("drawPath", path, paint); - } - - void clipPath(rive::RenderPath* path) override - { - call("clipPath", path); - } -}; - -class RenderPathWrapper : public wrapper -{ -public: - EMSCRIPTEN_WRAPPER(RenderPathWrapper); - - void reset() override { call("reset"); } - // TODO: add commands like cubicTo, moveTo, etc... - void addPath(rive::RenderPath* path, const rive::Mat2D& transform) override - { - call("addPath", path, transform); - } - void fillRule(rive::FillRule value) override - { - call("fillRule", value); - } - - void moveTo(float x, float y) override { call("moveTo", x, y); } - void lineTo(float x, float y) override { call("lineTo", x, y); } - void - cubicTo(float ox, float oy, float ix, float iy, float x, float y) override - { - call("cubicTo", ox, oy, ix, iy, x, y); - } - void close() override { call("close"); } -}; - -class RenderPaintWrapper : public wrapper -{ -public: - EMSCRIPTEN_WRAPPER(RenderPaintWrapper); - - void color(unsigned int value) override { call("color", value); } - void thickness(float value) override { call("thickness", value); } - void join(rive::StrokeJoin value) override { call("join", value); } - void cap(rive::StrokeCap value) override { call("cap", value); } - void blendMode(rive::BlendMode value) override - { - call("blendMode", value); - } - - void style(rive::RenderPaintStyle value) override - { - call("style", value); - } - void linearGradient(float sx, float sy, float ex, float ey) override - { - call("linearGradient", sx, sy, ex, ey); - } - void radialGradient(float sx, float sy, float ex, float ey) override - { - call("radialGradient", sx, sy, ex, ey); - } - void addStop(unsigned int color, float stop) override - { - call("addStop", color, stop); - } - void completeGradient() override { call("completeGradient"); } -}; - -namespace rive -{ - RenderPaint* makeRenderPaint() - { - val renderPaint = - val::module_property("renderFactory").call("makeRenderPaint"); - return renderPaint.as(allow_raw_pointers()); - } - - RenderPath* makeRenderPath() - { - val renderPath = - val::module_property("renderFactory").call("makeRenderPath"); - return renderPath.as(allow_raw_pointers()); - } -} // namespace rive - -rive::File* load(emscripten::val byteArray) -{ - std::vector rv; - - const auto l = byteArray["byteLength"].as(); - rv.resize(l); - - emscripten::val memoryView{emscripten::typed_memory_view(l, rv.data())}; - memoryView.call("set", byteArray); - auto reader = rive::BinaryReader(rv.data(), rv.size()); - rive::File* file = nullptr; - auto result = rive::File::import(reader, &file); - return file; -} - -EMSCRIPTEN_BINDINGS(RiveWASM) -{ - function("load", &load, allow_raw_pointers()); - - class_("Renderer") - .function("save", - &RendererWrapper::save, - pure_virtual(), - allow_raw_pointers()) - .function("restore", - &RendererWrapper::restore, - pure_virtual(), - allow_raw_pointers()) - .function("transform", - &RendererWrapper::transform, - pure_virtual(), - allow_raw_pointers()) - .function("drawPath", - &RendererWrapper::drawPath, - pure_virtual(), - allow_raw_pointers()) - .function("clipPath", - &RendererWrapper::clipPath, - pure_virtual(), - allow_raw_pointers()) - .function("align", &rive::Renderer::align) - .allow_subclass("RendererWrapper"); - - class_("RenderPath") - .function("reset", - &RenderPathWrapper::reset, - pure_virtual(), - allow_raw_pointers()) - .function("addPath", - &RenderPathWrapper::addPath, - pure_virtual(), - allow_raw_pointers()) - .function("fillRule", &RenderPathWrapper::fillRule, pure_virtual()) - .function("moveTo", - &RenderPathWrapper::moveTo, - pure_virtual(), - allow_raw_pointers()) - .function("lineTo", - &RenderPathWrapper::lineTo, - pure_virtual(), - allow_raw_pointers()) - .function("cubicTo", - &RenderPathWrapper::cubicTo, - pure_virtual(), - allow_raw_pointers()) - .function("close", - &RenderPathWrapper::close, - pure_virtual(), - allow_raw_pointers()) - .allow_subclass("RenderPathWrapper"); - - enum_("RenderPaintStyle") - .value("fill", rive::RenderPaintStyle::fill) - .value("stroke", rive::RenderPaintStyle::stroke); - - enum_("FillRule") - .value("nonZero", rive::FillRule::nonZero) - .value("evenOdd", rive::FillRule::evenOdd); - - enum_("StrokeCap") - .value("butt", rive::StrokeCap::butt) - .value("round", rive::StrokeCap::round) - .value("square", rive::StrokeCap::square); - - enum_("StrokeJoin") - .value("miter", rive::StrokeJoin::miter) - .value("round", rive::StrokeJoin::round) - .value("bevel", rive::StrokeJoin::bevel); - - enum_("BlendMode") - .value("srcOver", rive::BlendMode::srcOver) - .value("screen", rive::BlendMode::screen) - .value("overlay", rive::BlendMode::overlay) - .value("darken", rive::BlendMode::darken) - .value("lighten", rive::BlendMode::lighten) - .value("colorDodge", rive::BlendMode::colorDodge) - .value("colorBurn", rive::BlendMode::colorBurn) - .value("hardLight", rive::BlendMode::hardLight) - .value("softLight", rive::BlendMode::softLight) - .value("difference", rive::BlendMode::difference) - .value("exclusion", rive::BlendMode::exclusion) - .value("multiply", rive::BlendMode::multiply) - .value("hue", rive::BlendMode::hue) - .value("saturation", rive::BlendMode::saturation) - .value("color", rive::BlendMode::color) - .value("luminosity", rive::BlendMode::luminosity); - - class_("RenderPaint") - .function("color", - &RenderPaintWrapper::color, - pure_virtual(), - allow_raw_pointers()) - - .function("style", - &RenderPaintWrapper::style, - pure_virtual(), - allow_raw_pointers()) - .function("thickness", - &RenderPaintWrapper::thickness, - pure_virtual(), - allow_raw_pointers()) - .function("join", - &RenderPaintWrapper::join, - pure_virtual(), - allow_raw_pointers()) - .function("cap", - &RenderPaintWrapper::cap, - pure_virtual(), - allow_raw_pointers()) - .function("blendMode", - &RenderPaintWrapper::blendMode, - pure_virtual(), - allow_raw_pointers()) - .function("linearGradient", - &RenderPaintWrapper::linearGradient, - pure_virtual(), - allow_raw_pointers()) - .function("radialGradient", - &RenderPaintWrapper::radialGradient, - pure_virtual(), - allow_raw_pointers()) - .function("addStop", - &RenderPaintWrapper::addStop, - pure_virtual(), - allow_raw_pointers()) - .function("completeGradient", - &RenderPaintWrapper::completeGradient, - pure_virtual(), - allow_raw_pointers()) - .allow_subclass("RenderPaintWrapper"); - - class_("Mat2D") - .property("xx", &rive::Mat2D::xx) - .property("xy", &rive::Mat2D::xy) - .property("yx", &rive::Mat2D::yx) - .property("yy", &rive::Mat2D::yy) - .property("tx", &rive::Mat2D::tx) - .property("ty", &rive::Mat2D::ty); - - class_("File") - .function("artboard", - select_overload( - &rive::File::artboard), - allow_raw_pointers()) - .function( - "defaultArtboard", - select_overload(&rive::File::artboard), - allow_raw_pointers()); - - class_("Artboard") - .function("advance", &rive::Artboard::advance) - .function("draw", &rive::Artboard::draw, allow_raw_pointers()) - .function("node", &rive::Artboard::node, allow_raw_pointers()) - .function( - "animation", - optional_override([](rive::Artboard& artboard, - std::string name) -> rive::LinearAnimation* { - return artboard.animation(name); - }), - allow_raw_pointers()) - .function("animationAt", - optional_override([](rive::Artboard& artboard, - size_t index) -> rive::LinearAnimation* { - return artboard.animation(index); - }), - allow_raw_pointers()) - .function("animationCount", &rive::Artboard::animationCount) - .property("bounds", &rive::Artboard::bounds); - - class_("Node") - .property("x", - select_overload(&rive::Node::x), - select_overload(&rive::Node::x)) - .property("y", - select_overload(&rive::Node::y), - select_overload(&rive::Node::y)); - - class_("LinearAnimation") - .property( - "duration", - select_overload(&rive::LinearAnimationBase::duration)) - .property("fps", - select_overload(&rive::LinearAnimationBase::fps)) - .function("apply", &rive::LinearAnimation::apply, allow_raw_pointers()); - - class_("LinearAnimationInstance") - .constructor() - .property( - "time", - select_overload( - &rive::LinearAnimationInstance::time), - select_overload(&rive::LinearAnimationInstance::time)) - .function("advance", &rive::LinearAnimationInstance::advance) - .function("apply", - &rive::LinearAnimationInstance::apply, - allow_raw_pointers()); - - enum_("Fit") - .value("fill", rive::Fit::fill) - .value("contain", rive::Fit::contain) - .value("cover", rive::Fit::cover) - .value("fitWidth", rive::Fit::fitWidth) - .value("fitHeight", rive::Fit::fitHeight) - .value("none", rive::Fit::none) - .value("scaleDown", rive::Fit::scaleDown); - - class_("Alignment") - .property("x", &rive::Alignment::x) - .property("y", &rive::Alignment::y) - .class_property("topLeft", &rive::Alignment::topLeft) - .class_property("topCenter", &rive::Alignment::topCenter) - .class_property("topRight", &rive::Alignment::topRight) - .class_property("centerLeft", &rive::Alignment::centerLeft) - .class_property("center", &rive::Alignment::center) - .class_property("centerRight", &rive::Alignment::centerRight) - .class_property("bottomLeft", &rive::Alignment::bottomLeft) - .class_property("bottomCenter", &rive::Alignment::bottomCenter) - .class_property("bottomRight", &rive::Alignment::bottomRight); - - value_object("AABB") - .field("minX", &rive::AABB::minX) - .field("minY", &rive::AABB::minY) - .field("maxX", &rive::AABB::maxX) - .field("maxY", &rive::AABB::maxY); -} \ No newline at end of file