#declare project
project( rlottie VERSION 0.0.1 LANGUAGES C CXX ASM)
+add_definitions(-DLOT_BUILD)
+
#declare target
add_library( rlottie SHARED "" )
#include<iostream>
#include<vector>
#include<array>
+
+#ifndef _WIN32
#include<libgen.h>
+#else
+#include <windows.h>
+#endif
class GifBuilder {
public:
return result();
}
+#ifndef _WIN32
int setup(int argc, char **argv)
{
if (argc > 1) fileName = argv[1];
snprintf(baseName.data(), baseName.size(), "%s.gif",base);
return 0;
}
+#else
+ int setup(int argc, char **argv)
+ {
+ std::cout<<"Yet to implement in Windows\m";
+ return 1;
+ }
+#endif
private:
version : '0.0.1',
license : 'Apache')
-add_global_arguments('-DDEMO_DIR="@0@/example/resource/"'.format(meson.current_source_dir()), language : 'cpp')
+add_project_arguments('-DDEMO_DIR="@0@/example/resource/"'.format(meson.current_source_dir()), language : 'cpp')
-compiler_flags = []
+compiler_flags = ['-DLOT_BUILD']
compiler_flags_try = ['-std=c++14', '-Os', '-Wall', '-Werror', '-Wextra', '-fno-exceptions', '-fno-rtti',
'-fno-unwind-tables' , '-fno-asynchronous-unwind-tables',
'-Wnon-virtual-dtor', '-Woverloaded-virtual', '-Wno-unused-parameter', '-fvisibility=hidden']
endforeach
-if (build_machine.system() == 'linux')
+if (build_machine.system() == 'linux' and get_option('thread') == true)
compiler_flags += ['-pthread']
- add_global_link_arguments('-pthread', language: 'cpp')
+ add_project_link_arguments('-pthread', language: 'cpp')
endif
-add_global_arguments(compiler_flags, language: 'cpp')
+add_project_arguments(compiler_flags, language: 'cpp')
inc = [include_directories('inc')]
config_dir = include_directories('.')
if (vCompare(progress, 1.0f)) progress = 0.99f;
float startAngle = VLine(start, end).angle();
float highlightAngle = mHighlightAngle.value(frameNo);
- float angle = ((startAngle + highlightAngle) * M_PI) / 180.0f;
+ static constexpr float K_PI = 3.1415926f;
+ float angle = (startAngle + highlightAngle) * (K_PI / 180.0f);
grad->radial.fx =
grad->radial.cx + std::cos(angle) * progress * grad->radial.cradius;
grad->radial.fy =
}
/*
+ * std::to_string() function is missing in VS2017
+ * so this is workaround for windows build
+ */
+#include <sstream>
+template<class T>
+static std::string toString(const T &value) {
+ std::ostringstream os;
+ os << value;
+ return os.str();
+}
+
+/*
* https://github.com/airbnb/lottie-web/blob/master/docs/json/layers/shape.json
*
*/
asset->mRefId = std::string(GetString());
} else {
RAPIDJSON_ASSERT(PeekType() == kNumberType);
- asset->mRefId = std::to_string(GetInt());
+ asset->mRefId = toString(GetInt());
}
} else if (0 == strcmp(key, "layers")) {
asset->mAssetType = LOTAsset::Type::Precomp;
source_file = ['stb_image.cpp']
+inc_dir = [include_directories('.')]
+inc_dir += config_dir
+
if get_option('module') == true
rlottie_image_loader_lib = shared_library('rlottie-image-loader',
source_file,
+ include_directories : inc_dir,
install : true
)
# dl dependancy for dlopen, dlsym, dlclose symbol
stb_dep = cc.find_library('dl', required : false)
else
stb_dep = declare_dependency(
- include_directories : include_directories('.'),
+ include_directories : inc_dir,
sources : source_file
)
endif