From 6cf507f004729ca82e56128d9128f6333393abcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 28 Apr 2017 19:28:21 +0200 Subject: [PATCH] Move other lone thirdparty files to thirdparty/misc Also move Box2D ConvexDecomposition contrib code to thirdparty/b2d_convexdecomp. (cherry picked from commit d4029aa51a0f0bce5dc73885af74b592e3aa33b7) --- core/SCsub | 2 +- drivers/convex_decomp/SCsub | 9 +++++ drivers/convex_decomp/b2d_decompose.cpp | 3 +- modules/openssl/SCsub | 11 ++++++- modules/openssl/stream_peer_openssl.h | 6 ++-- modules/theora/video_stream_theora.cpp | 3 +- scene/SCsub | 19 +++++++++-- scene/resources/SCsub | 1 - scene/resources/dynamic_font_stb.cpp | 1 - scene/resources/dynamic_font_stb.h | 3 +- scene/resources/surface_tool.h | 3 +- thirdparty/README.md | 33 ++++++++++++++++++- .../b2d_convexdecomp}/b2Glue.h | 0 .../b2d_convexdecomp}/b2Polygon.cpp | 0 .../b2d_convexdecomp}/b2Polygon.h | 0 .../b2d_convexdecomp}/b2Triangle.cpp | 0 .../b2d_convexdecomp}/b2Triangle.h | 0 .../misc}/curl_hostcheck.c | 0 .../misc}/curl_hostcheck.h | 0 .../misc}/mikktspace.c | 0 .../misc}/mikktspace.h | 0 .../misc}/stb_truetype.h | 0 {modules/theora => thirdparty/misc}/yuv2rgb.h | 0 23 files changed, 81 insertions(+), 13 deletions(-) rename {drivers/convex_decomp => thirdparty/b2d_convexdecomp}/b2Glue.h (100%) rename {drivers/convex_decomp => thirdparty/b2d_convexdecomp}/b2Polygon.cpp (100%) rename {drivers/convex_decomp => thirdparty/b2d_convexdecomp}/b2Polygon.h (100%) rename {drivers/convex_decomp => thirdparty/b2d_convexdecomp}/b2Triangle.cpp (100%) rename {drivers/convex_decomp => thirdparty/b2d_convexdecomp}/b2Triangle.h (100%) rename {modules/openssl => thirdparty/misc}/curl_hostcheck.c (100%) rename {modules/openssl => thirdparty/misc}/curl_hostcheck.h (100%) rename {scene/resources => thirdparty/misc}/mikktspace.c (100%) rename {scene/resources => thirdparty/misc}/mikktspace.h (100%) rename {scene/resources => thirdparty/misc}/stb_truetype.h (100%) rename {modules/theora => thirdparty/misc}/yuv2rgb.h (100%) diff --git a/core/SCsub b/core/SCsub index 66fe31a8185..2d285cdf85e 100644 --- a/core/SCsub +++ b/core/SCsub @@ -83,7 +83,7 @@ thirdparty_minizip_sources = [thirdparty_minizip_dir + file for file in thirdpar env.add_source_files(env.core_sources, thirdparty_minizip_sources) -# Godot's own source +# Godot's own sources env.add_source_files(env.core_sources, "*.cpp") diff --git a/drivers/convex_decomp/SCsub b/drivers/convex_decomp/SCsub index ee39fd26317..f017e551208 100644 --- a/drivers/convex_decomp/SCsub +++ b/drivers/convex_decomp/SCsub @@ -4,4 +4,13 @@ Import('env') env.add_source_files(env.drivers_sources, "*.cpp") +# Thirdparty dependencies +thirdparty_dir = "#thirdparty/b2d_convexdecomp/" +thirdparty_sources = [ + "b2Polygon.cpp", + "b2Triangle.cpp", +] +thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] +env.add_source_files(env.drivers_sources, thirdparty_sources) + Export('env') diff --git a/drivers/convex_decomp/b2d_decompose.cpp b/drivers/convex_decomp/b2d_decompose.cpp index d33c387b92b..eb36735b3e1 100644 --- a/drivers/convex_decomp/b2d_decompose.cpp +++ b/drivers/convex_decomp/b2d_decompose.cpp @@ -28,7 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "b2d_decompose.h" -#include "b2Polygon.h" + +#include "thirdparty/b2d_convexdecomp/b2Polygon.h" namespace b2ConvexDecomp { diff --git a/modules/openssl/SCsub b/modules/openssl/SCsub index ae78e1c364d..38a230a4cf3 100644 --- a/modules/openssl/SCsub +++ b/modules/openssl/SCsub @@ -674,6 +674,15 @@ if (env['builtin_openssl'] != 'no'): # Module sources env_openssl.add_source_files(env.modules_sources, "*.cpp") -env_openssl.add_source_files(env.modules_sources, "*.c") + + +# Other thirdparty dependencies +thirdparty_misc_dir = "#thirdparty/misc/" +thirdparty_misc_sources = [ + "curl_hostcheck.c", +] +thirdparty_misc_sources = [thirdparty_misc_dir + file for file in thirdparty_misc_sources] +env_openssl.add_source_files(env.modules_sources, thirdparty_misc_sources) + Export('env') diff --git a/modules/openssl/stream_peer_openssl.h b/modules/openssl/stream_peer_openssl.h index 56e08697cb8..cdbbfa6e2e4 100644 --- a/modules/openssl/stream_peer_openssl.h +++ b/modules/openssl/stream_peer_openssl.h @@ -30,17 +30,19 @@ #ifndef STREAM_PEER_OPEN_SSL_H #define STREAM_PEER_OPEN_SSL_H -#include "curl_hostcheck.h" #include "globals.h" #include "io/stream_peer_ssl.h" #include "os/file_access.h" -#include // If you don't know what this is for stop reading now. + +#include "thirdparty/misc/curl_hostcheck.h" #include // BIO objects for I/O #include // Error reporting #include // SSL and SSL_CTX for SSL connections #include +#include + class StreamPeerOpenSSL : public StreamPeerSSL { private: static int _bio_create(BIO *b); diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index ffa14a1bff4..73dacd95cd6 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -31,7 +31,8 @@ #include "globals.h" #include "os/os.h" -#include "yuv2rgb.h" + +#include "thirdparty/misc/yuv2rgb.h" int VideoStreamPlaybackTheora::buffer_data() { diff --git a/scene/SCsub b/scene/SCsub index bd2da1eab99..df52e9c6cb4 100644 --- a/scene/SCsub +++ b/scene/SCsub @@ -3,10 +3,23 @@ Import('env') env.scene_sources = [] + + +# Thirdparty code +thirdparty_dir = "#thirdparty/misc/" +thirdparty_sources = [ + # C sources + "mikktspace.c", +] +thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] +env.add_source_files(env.scene_sources, thirdparty_sources) + + +# Godot's own sources env.add_source_files(env.scene_sources, "*.cpp") -Export('env') +# Chain load SCsubs SConscript('main/SCsub') SConscript('gui/SCsub') SConscript('3d/SCsub') @@ -17,6 +30,8 @@ SConscript('resources/SCsub') SConscript('io/SCsub') +# Build it all as a library lib = env.Library("scene", env.scene_sources) - env.Prepend(LIBS=[lib]) + +Export('env') diff --git a/scene/resources/SCsub b/scene/resources/SCsub index 60b16cd0d4d..2ad90247a78 100644 --- a/scene/resources/SCsub +++ b/scene/resources/SCsub @@ -3,7 +3,6 @@ Import('env') env.add_source_files(env.scene_sources, "*.cpp") -env.add_source_files(env.scene_sources, "*.c") Export('env') diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp index eb7d7169276..93f157e68a8 100644 --- a/scene/resources/dynamic_font_stb.cpp +++ b/scene/resources/dynamic_font_stb.cpp @@ -4,7 +4,6 @@ #define STB_TRUETYPE_IMPLEMENTATION #include "os/file_access.h" -#include "stb_truetype.h" void DynamicFontData::lock() { diff --git a/scene/resources/dynamic_font_stb.h b/scene/resources/dynamic_font_stb.h index f2a11b8db55..ec2fb938853 100644 --- a/scene/resources/dynamic_font_stb.h +++ b/scene/resources/dynamic_font_stb.h @@ -5,7 +5,8 @@ #include "font.h" #include "io/resource_loader.h" -#include "stb_truetype.h" + +#include "thirdparty/misc/stb_truetype.h" class DynamicFontAtSize; class DynamicFont; diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h index 9d29733bb35..8345929eae8 100644 --- a/scene/resources/surface_tool.h +++ b/scene/resources/surface_tool.h @@ -30,9 +30,10 @@ #ifndef SURFACE_TOOL_H #define SURFACE_TOOL_H -#include "mikktspace.h" #include "scene/resources/mesh.h" +#include "thirdparty/misc/mikktspace.h" + class SurfaceTool : public Reference { OBJ_TYPE(SurfaceTool, Reference); diff --git a/thirdparty/README.md b/thirdparty/README.md index 82d71547ea6..26d5d9f6f4f 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -1,6 +1,13 @@ # Third party libraries +## b2d_convexdecomp + +- Upstream: https://github.com/erincatto/Box2D (Contributions/Utilities/ConvexDecomposition) +- Version: TBD +- License: zlib + + ## certs - Upstream: ? @@ -137,7 +144,9 @@ TODO: Properly sync with version 1.2.4 and document changes. ## misc -Collection of single-file libraries used in Godot. +Collection of single-file libraries used in Godot components. + +### core - `aes256.{cpp,h}` * Upstream: http://www.literatecode.com/aes256 @@ -173,6 +182,28 @@ Collection of single-file libraries used in Godot. * Version: TBD, class was renamed * License: MIT +### modules + +- `curl_hostcheck.{c,h}` + * Upstream: https://curl.haxx.se/ + * Version: ? (2013) + * License: MIT +- `yuv2rgb.h` + * Upstream: http://wss.co.uk/pinknoise/yuv2rgb/ (to check) + * Version: ? + * License: BSD + +### scene + +- `mikktspace.{c,h}` + * Upstream: https://wiki.blender.org/index.php/Dev:Shading/Tangent_Space_Normal_Maps + * Version: 1.0 + * License: zlib +- `stb_truetype.h` + * Upstream: https://github.com/nothings/stb + * Version: 1.11 + * License: Public Domain (Unlicense) or MIT + ## openssl diff --git a/drivers/convex_decomp/b2Glue.h b/thirdparty/b2d_convexdecomp/b2Glue.h similarity index 100% rename from drivers/convex_decomp/b2Glue.h rename to thirdparty/b2d_convexdecomp/b2Glue.h diff --git a/drivers/convex_decomp/b2Polygon.cpp b/thirdparty/b2d_convexdecomp/b2Polygon.cpp similarity index 100% rename from drivers/convex_decomp/b2Polygon.cpp rename to thirdparty/b2d_convexdecomp/b2Polygon.cpp diff --git a/drivers/convex_decomp/b2Polygon.h b/thirdparty/b2d_convexdecomp/b2Polygon.h similarity index 100% rename from drivers/convex_decomp/b2Polygon.h rename to thirdparty/b2d_convexdecomp/b2Polygon.h diff --git a/drivers/convex_decomp/b2Triangle.cpp b/thirdparty/b2d_convexdecomp/b2Triangle.cpp similarity index 100% rename from drivers/convex_decomp/b2Triangle.cpp rename to thirdparty/b2d_convexdecomp/b2Triangle.cpp diff --git a/drivers/convex_decomp/b2Triangle.h b/thirdparty/b2d_convexdecomp/b2Triangle.h similarity index 100% rename from drivers/convex_decomp/b2Triangle.h rename to thirdparty/b2d_convexdecomp/b2Triangle.h diff --git a/modules/openssl/curl_hostcheck.c b/thirdparty/misc/curl_hostcheck.c similarity index 100% rename from modules/openssl/curl_hostcheck.c rename to thirdparty/misc/curl_hostcheck.c diff --git a/modules/openssl/curl_hostcheck.h b/thirdparty/misc/curl_hostcheck.h similarity index 100% rename from modules/openssl/curl_hostcheck.h rename to thirdparty/misc/curl_hostcheck.h diff --git a/scene/resources/mikktspace.c b/thirdparty/misc/mikktspace.c similarity index 100% rename from scene/resources/mikktspace.c rename to thirdparty/misc/mikktspace.c diff --git a/scene/resources/mikktspace.h b/thirdparty/misc/mikktspace.h similarity index 100% rename from scene/resources/mikktspace.h rename to thirdparty/misc/mikktspace.h diff --git a/scene/resources/stb_truetype.h b/thirdparty/misc/stb_truetype.h similarity index 100% rename from scene/resources/stb_truetype.h rename to thirdparty/misc/stb_truetype.h diff --git a/modules/theora/yuv2rgb.h b/thirdparty/misc/yuv2rgb.h similarity index 100% rename from modules/theora/yuv2rgb.h rename to thirdparty/misc/yuv2rgb.h