Merge pull request #8572 from akien-mga/thirdparty
Moving more thirdparty stuff (minizip, some single-file external libs) to the thirdparty directory
This commit is contained in:
commit
de7eba887e
46
core/SCsub
46
core/SCsub
@ -5,6 +5,7 @@ Import('env')
|
||||
env.core_sources = []
|
||||
|
||||
|
||||
# Generate global defaults
|
||||
gd_call = ""
|
||||
gd_inc = ""
|
||||
|
||||
@ -21,6 +22,8 @@ f = open("global_defaults.cpp", "wb")
|
||||
f.write(gd_cpp)
|
||||
f.close()
|
||||
|
||||
|
||||
# Generate AES256 script encryption key
|
||||
import os
|
||||
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
|
||||
if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ):
|
||||
@ -49,20 +52,57 @@ f.write("#include \"global_config.h\"\nuint8_t script_encryption_key[32]={" + tx
|
||||
f.close()
|
||||
|
||||
|
||||
# Add required thirdparty code. Header paths are hardcoded, we don't need to append
|
||||
# to the include path (saves a few chars on the compiler invocation for touchy MSVC...)
|
||||
thirdparty_dir = "#thirdparty/misc/"
|
||||
thirdparty_sources = [
|
||||
# C sources
|
||||
"base64.c",
|
||||
"fastlz.c",
|
||||
"sha256.c",
|
||||
"smaz.c",
|
||||
|
||||
# C++ sources
|
||||
"aes256.cpp",
|
||||
"hq2x.cpp",
|
||||
"md5.cpp",
|
||||
"pcg.cpp",
|
||||
"triangulator.cpp",
|
||||
]
|
||||
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
||||
env.add_source_files(env.core_sources, thirdparty_sources)
|
||||
|
||||
# Minizip library, can be unbundled in theory
|
||||
# However, our version has some custom modifications, so it won't compile with the system one
|
||||
thirdparty_minizip_dir = "#thirdparty/minizip/"
|
||||
thirdparty_minizip_sources = [
|
||||
"ioapi.c",
|
||||
"unzip.c",
|
||||
"zip.c",
|
||||
]
|
||||
thirdparty_minizip_sources = [thirdparty_minizip_dir + file for file in thirdparty_minizip_sources]
|
||||
env.add_source_files(env.core_sources, thirdparty_minizip_sources)
|
||||
|
||||
|
||||
# Godot's own sources
|
||||
env.add_source_files(env.core_sources, "*.cpp")
|
||||
|
||||
|
||||
Export('env')
|
||||
|
||||
# Make binders
|
||||
import make_binders
|
||||
env.Command(['method_bind.inc', 'method_bind_ext.inc'], 'make_binders.py', make_binders.run)
|
||||
|
||||
|
||||
# Chain load SCsubs
|
||||
SConscript('os/SCsub')
|
||||
SConscript('math/SCsub')
|
||||
SConscript('io/SCsub')
|
||||
SConscript('bind/SCsub')
|
||||
SConscript('helper/SCsub')
|
||||
|
||||
lib = env.Library("core", env.core_sources)
|
||||
|
||||
# Build it all as a library
|
||||
lib = env.Library("core", env.core_sources)
|
||||
env.Prepend(LIBS=[lib])
|
||||
|
||||
Export('env')
|
||||
|
@ -28,14 +28,16 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "core_bind.h"
|
||||
|
||||
#include "core/global_config.h"
|
||||
#include "geometry.h"
|
||||
#include "io/base64.h"
|
||||
#include "io/file_access_encrypted.h"
|
||||
#include "io/marshalls.h"
|
||||
#include "os/keyboard.h"
|
||||
#include "os/os.h"
|
||||
|
||||
#include "thirdparty/misc/base64.h"
|
||||
|
||||
/**
|
||||
* Time constants borrowed from loc_time.h
|
||||
*/
|
||||
|
@ -30,218 +30,11 @@
|
||||
#include "compressed_translation.h"
|
||||
|
||||
#include "pair.h"
|
||||
#include <string.h>
|
||||
|
||||
/////////// SMAZ /////////////
|
||||
|
||||
/*
|
||||
Copyright (c) 2006-2009, Salvatore Sanfilippo
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Our compression codebook, used for compression */
|
||||
static const char *Smaz_cb[241] = {
|
||||
"\002s,\266", "\003had\232\002leW", "\003on \216", "", "\001yS",
|
||||
"\002ma\255\002li\227", "\003or \260", "", "\002ll\230\003s t\277",
|
||||
"\004fromg\002mel", "", "\003its\332", "\001z\333", "\003ingF", "\001>\336",
|
||||
"\001 \000\003 (\002nc\344", "\002nd=\003 on\312",
|
||||
"\002ne\213\003hat\276\003re q", "", "\002ngT\003herz\004have\306\003s o\225",
|
||||
"", "\003ionk\003s a\254\002ly\352", "\003hisL\003 inN\003 be\252", "",
|
||||
"\003 fo\325\003 of \003 ha\311", "", "\002of\005",
|
||||
"\003 co\241\002no\267\003 ma\370", "", "", "\003 cl\356\003enta\003 an7",
|
||||
"\002ns\300\001\"e", "\003n t\217\002ntP\003s, \205",
|
||||
"\002pe\320\003 we\351\002om\223", "\002on\037", "", "\002y G", "\003 wa\271",
|
||||
"\003 re\321\002or*", "", "\002=\"\251\002ot\337", "\003forD\002ou[",
|
||||
"\003 toR", "\003 th\r", "\003 it\366",
|
||||
"\003but\261\002ra\202\003 wi\363\002</\361", "\003 wh\237", "\002 4",
|
||||
"\003nd ?", "\002re!", "", "\003ng c", "",
|
||||
"\003ly \307\003ass\323\001a\004\002rir", "", "", "", "\002se_", "\003of \"",
|
||||
"\003div\364\002ros\003ere\240", "", "\002ta\310\001bZ\002si\324", "",
|
||||
"\003and\a\002rs\335", "\002rt\362", "\002teE", "\003ati\316", "\002so\263",
|
||||
"\002th\021", "\002tiJ\001c\034\003allp", "\003ate\345", "\002ss\246",
|
||||
"\002stM", "", "\002><\346", "\002to\024", "\003arew", "\001d\030",
|
||||
"\002tr\303", "", "\001\n1\003 a \222", "\003f tv\002veo", "\002un\340", "",
|
||||
"\003e o\242", "\002a \243\002wa\326\001e\002", "\002ur\226\003e a\274",
|
||||
"\002us\244\003\n\r\n\247", "\002ut\304\003e c\373", "\002we\221", "", "",
|
||||
"\002wh\302", "\001f,", "", "", "", "\003d t\206", "", "", "\003th \343",
|
||||
"\001g;", "", "", "\001\r9\003e s\265", "\003e t\234", "", "\003to Y",
|
||||
"\003e\r\n\236", "\002d \036\001h\022", "", "\001,Q", "\002 a\031", "\002 b^",
|
||||
"\002\r\n\025\002 cI", "\002 d\245", "\002 e\253", "\002 fh\001i\b\002e \v",
|
||||
"", "\002 hU\001-\314", "\002 i8", "", "", "\002 l\315", "\002 m{",
|
||||
"\002f :\002 n\354", "\002 o\035", "\002 p}\001.n\003\r\n\r\250", "",
|
||||
"\002 r\275", "\002 s>", "\002 t\016", "", "\002g \235\005which+\003whi\367",
|
||||
"\002 w5", "\001/\305", "\003as \214", "\003at \207", "", "\003who\331", "",
|
||||
"\001l\026\002h \212", "", "\002, $", "", "\004withV", "", "", "", "\001m-", "",
|
||||
"", "\002ac\357", "\002ad\350", "\003TheH", "", "", "\004this\233\001n\t",
|
||||
"", "\002. y", "", "\002alX\003e, \365", "\003tio\215\002be\\",
|
||||
"\002an\032\003ver\347", "", "\004that0\003tha\313\001o\006", "\003was2",
|
||||
"\002arO", "\002as.", "\002at'\003the\001\004they\200\005there\322\005theird",
|
||||
"\002ce\210", "\004were]", "", "\002ch\231\002l \264\001p<", "", "",
|
||||
"\003one\256", "", "\003he \023\002dej", "\003ter\270", "\002cou", "",
|
||||
"\002by\177\002di\201\002eax", "", "\002ec\327", "\002edB", "\002ee\353", "",
|
||||
"", "\001r\f\002n )", "", "", "", "\002el\262", "", "\003in i\002en3", "",
|
||||
"\002o `\001s\n", "", "\002er\033", "\003is t\002es6", "", "\002ge\371",
|
||||
"\004.com\375", "\002fo\334\003our\330", "\003ch \301\001t\003", "\002hab", "",
|
||||
"\003men\374", "", "\002he\020", "", "", "\001u&", "\002hif", "",
|
||||
"\003not\204\002ic\203", "\003ed @\002id\355", "", "", "\002ho\273",
|
||||
"\002r K\001vm", "", "", "", "\003t t\257\002il\360", "\002im\342",
|
||||
"\003en \317\002in\017", "\002io\220", "\002s \027\001wA", "", "\003er |",
|
||||
"\003es ~\002is%", "\002it/", "", "\002iv\272", "",
|
||||
"\002t #\ahttp://C\001x\372", "\002la\211", "\001<\341", "\003, a\224"
|
||||
};
|
||||
|
||||
/* Reverse compression codebook, used for decompression */
|
||||
static const char *Smaz_rcb[254] = {
|
||||
" ", "the", "e", "t", "a", "of", "o", "and", "i", "n", "s", "e ", "r", " th",
|
||||
" t", "in", "he", "th", "h", "he ", "to", "\r\n", "l", "s ", "d", " a", "an",
|
||||
"er", "c", " o", "d ", "on", " of", "re", "of ", "t ", ", ", "is", "u", "at",
|
||||
" ", "n ", "or", "which", "f", "m", "as", "it", "that", "\n", "was", "en",
|
||||
" ", " w", "es", " an", " i", "\r", "f ", "g", "p", "nd", " s", "nd ", "ed ",
|
||||
"w", "ed", "http://", "for", "te", "ing", "y ", "The", " c", "ti", "r ", "his",
|
||||
"st", " in", "ar", "nt", ",", " to", "y", "ng", " h", "with", "le", "al", "to ",
|
||||
"b", "ou", "be", "were", " b", "se", "o ", "ent", "ha", "ng ", "their", "\"",
|
||||
"hi", "from", " f", "in ", "de", "ion", "me", "v", ".", "ve", "all", "re ",
|
||||
"ri", "ro", "is ", "co", "f t", "are", "ea", ". ", "her", " m", "er ", " p",
|
||||
"es ", "by", "they", "di", "ra", "ic", "not", "s, ", "d t", "at ", "ce", "la",
|
||||
"h ", "ne", "as ", "tio", "on ", "n t", "io", "we", " a ", "om", ", a", "s o",
|
||||
"ur", "li", "ll", "ch", "had", "this", "e t", "g ", "e\r\n", " wh", "ere",
|
||||
" co", "e o", "a ", "us", " d", "ss", "\n\r\n", "\r\n\r", "=\"", " be", " e",
|
||||
"s a", "ma", "one", "t t", "or ", "but", "el", "so", "l ", "e s", "s,", "no",
|
||||
"ter", " wa", "iv", "ho", "e a", " r", "hat", "s t", "ns", "ch ", "wh", "tr",
|
||||
"ut", "/", "have", "ly ", "ta", " ha", " on", "tha", "-", " l", "ati", "en ",
|
||||
"pe", " re", "there", "ass", "si", " fo", "wa", "ec", "our", "who", "its", "z",
|
||||
"fo", "rs", ">", "ot", "un", "<", "im", "th ", "nc", "ate", "><", "ver", "ad",
|
||||
" we", "ly", "ee", " n", "id", " cl", "ac", "il", "</", "rt", " wi", "div",
|
||||
"e, ", " it", "whi", " ma", "ge", "x", "e c", "men", ".com"
|
||||
};
|
||||
|
||||
static int smaz_compress(const char *in, int inlen, char *out, int outlen) {
|
||||
unsigned int h1, h2, h3 = 0;
|
||||
int verblen = 0, _outlen = outlen;
|
||||
char verb[256], *_out = out;
|
||||
|
||||
while (inlen) {
|
||||
int j = 7, needed;
|
||||
char *flush = NULL;
|
||||
const char *slot;
|
||||
|
||||
h1 = h2 = in[0] << 3;
|
||||
if (inlen > 1) h2 += in[1];
|
||||
if (inlen > 2) h3 = h2 ^ in[2];
|
||||
if (j > inlen) j = inlen;
|
||||
|
||||
/* Try to lookup substrings into the hash table, starting from the
|
||||
* longer to the shorter substrings */
|
||||
for (; j > 0; j--) {
|
||||
switch (j) {
|
||||
case 1: slot = Smaz_cb[h1 % 241]; break;
|
||||
case 2: slot = Smaz_cb[h2 % 241]; break;
|
||||
default: slot = Smaz_cb[h3 % 241]; break;
|
||||
}
|
||||
while (slot[0]) {
|
||||
if (slot[0] == j && memcmp(slot + 1, in, j) == 0) {
|
||||
/* Match found in the hash table,
|
||||
* prepare a verbatim bytes flush if needed */
|
||||
if (verblen) {
|
||||
needed = (verblen == 1) ? 2 : 2 + verblen;
|
||||
flush = out;
|
||||
out += needed;
|
||||
outlen -= needed;
|
||||
}
|
||||
/* Emit the byte */
|
||||
if (outlen <= 0) return _outlen + 1;
|
||||
out[0] = slot[slot[0] + 1];
|
||||
out++;
|
||||
outlen--;
|
||||
inlen -= j;
|
||||
in += j;
|
||||
goto out;
|
||||
} else {
|
||||
slot += slot[0] + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Match not found - add the byte to the verbatim buffer */
|
||||
verb[verblen] = in[0];
|
||||
verblen++;
|
||||
inlen--;
|
||||
in++;
|
||||
out:
|
||||
/* Prepare a flush if we reached the flush length limit, and there
|
||||
* is not already a pending flush operation. */
|
||||
if (!flush && (verblen == 256 || (verblen > 0 && inlen == 0))) {
|
||||
needed = (verblen == 1) ? 2 : 2 + verblen;
|
||||
flush = out;
|
||||
out += needed;
|
||||
outlen -= needed;
|
||||
if (outlen < 0) return _outlen + 1;
|
||||
}
|
||||
/* Perform a verbatim flush if needed */
|
||||
if (flush) {
|
||||
if (verblen == 1) {
|
||||
flush[0] = (signed char)254;
|
||||
flush[1] = verb[0];
|
||||
} else {
|
||||
flush[0] = (signed char)255;
|
||||
flush[1] = (signed char)(verblen - 1);
|
||||
memcpy(flush + 2, verb, verblen);
|
||||
}
|
||||
flush = NULL;
|
||||
verblen = 0;
|
||||
}
|
||||
}
|
||||
return out - _out;
|
||||
extern "C" {
|
||||
#include "thirdparty/misc/smaz.h"
|
||||
}
|
||||
|
||||
static int smaz_decompress(const char *in, int inlen, char *out, int outlen) {
|
||||
unsigned char *c = (unsigned char *)in;
|
||||
char *_out = out;
|
||||
int _outlen = outlen;
|
||||
|
||||
while (inlen) {
|
||||
if (*c == 254) {
|
||||
/* Verbatim byte */
|
||||
if (outlen < 1) return _outlen + 1;
|
||||
*out = *(c + 1);
|
||||
out++;
|
||||
outlen--;
|
||||
c += 2;
|
||||
inlen -= 2;
|
||||
} else if (*c == 255) {
|
||||
/* Verbatim string */
|
||||
int len = (*(c + 1)) + 1;
|
||||
if (outlen < len) return _outlen + 1;
|
||||
memcpy(out, c + 2, len);
|
||||
out += len;
|
||||
outlen -= len;
|
||||
c += 2 + len;
|
||||
inlen -= 2 + len;
|
||||
} else {
|
||||
/* Codebook entry */
|
||||
const char *s = Smaz_rcb[*c];
|
||||
int len = strlen(s);
|
||||
|
||||
if (outlen < len) return _outlen + 1;
|
||||
memcpy(out, s, len);
|
||||
out += len;
|
||||
outlen -= len;
|
||||
c++;
|
||||
inlen--;
|
||||
}
|
||||
}
|
||||
return out - _out;
|
||||
}
|
||||
|
||||
/////////// END OF SMAZ /////////////
|
||||
|
||||
struct _PHashTranslationCmp {
|
||||
|
||||
int orig_len;
|
||||
|
@ -32,9 +32,10 @@
|
||||
#include "core/io/image_loader.h"
|
||||
#include "core/os/copymem.h"
|
||||
#include "hash_map.h"
|
||||
#include "hq2x.h"
|
||||
#include "print_string.h"
|
||||
|
||||
#include "thirdparty/misc/hq2x.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
const char *Image::format_names[Image::FORMAT_MAX] = {
|
||||
|
@ -3,7 +3,5 @@
|
||||
Import('env')
|
||||
|
||||
env.add_source_files(env.core_sources, "*.cpp")
|
||||
env.add_source_files(env.core_sources, "*.c")
|
||||
# env.core_sources.append("io/fastlz.c")
|
||||
|
||||
Export('env')
|
||||
|
@ -28,12 +28,14 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "compression.h"
|
||||
#include "os/copymem.h"
|
||||
#include "zlib.h"
|
||||
|
||||
#include "fastlz.h"
|
||||
#include "os/copymem.h"
|
||||
#include "zip_io.h"
|
||||
|
||||
#include "thirdparty/misc/fastlz.h"
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
int Compression::compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size, Mode p_mode) {
|
||||
|
||||
switch (p_mode) {
|
||||
|
@ -28,15 +28,18 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "file_access_encrypted.h"
|
||||
#include "aes256.h"
|
||||
#include "md5.h"
|
||||
#include "os/copymem.h"
|
||||
#include "print_string.h"
|
||||
#define COMP_MAGIC 0x43454447
|
||||
|
||||
#include "core/variant.h"
|
||||
#include "os/copymem.h"
|
||||
#include "print_string.h"
|
||||
|
||||
#include "thirdparty/misc/aes256.h"
|
||||
#include "thirdparty/misc/md5.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define COMP_MAGIC 0x43454447
|
||||
|
||||
Error FileAccessEncrypted::open_and_parse(FileAccess *p_base, const Vector<uint8_t> &p_key, Mode p_mode) {
|
||||
|
||||
//print_line("open and parse!");
|
||||
|
@ -34,7 +34,9 @@
|
||||
|
||||
#include "core/io/file_access_pack.h"
|
||||
#include "map.h"
|
||||
#include "unzip.h"
|
||||
|
||||
#include "thirdparty/minizip/unzip.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
class ZipArchive : public PackSource {
|
||||
|
@ -1,5 +0,0 @@
|
||||
SHA256
|
||||
======
|
||||
|
||||
SHA-256 implementation to compliment a portable byte-oriented AES-256
|
||||
implementation in C at http://www.literatecode.com/aes256
|
@ -30,11 +30,12 @@
|
||||
#ifndef ZIP_IO_H
|
||||
#define ZIP_IO_H
|
||||
|
||||
#include "io/unzip.h"
|
||||
#include "io/zip.h"
|
||||
#include "os/copymem.h"
|
||||
#include "os/file_access.h"
|
||||
|
||||
#include "thirdparty/minizip/unzip.h"
|
||||
#include "thirdparty/minizip/zip.h"
|
||||
|
||||
static void *zipio_open(void *data, const char *p_fname, int mode) {
|
||||
|
||||
FileAccess *&f = *(FileAccess **)data;
|
||||
|
@ -31,9 +31,10 @@
|
||||
#define MATH_FUNCS_H
|
||||
|
||||
#include "math_defs.h"
|
||||
#include "pcg.h"
|
||||
#include "typedefs.h"
|
||||
|
||||
#include "thirdparty/misc/pcg.h"
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
|
||||
|
@ -28,13 +28,15 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "file_access.h"
|
||||
|
||||
#include "core/io/file_access_pack.h"
|
||||
#include "core/io/marshalls.h"
|
||||
#include "global_config.h"
|
||||
#include "io/md5.h"
|
||||
#include "io/sha256.h"
|
||||
#include "os/os.h"
|
||||
|
||||
#include "thirdparty/misc/md5.h"
|
||||
#include "thirdparty/misc/sha256.h"
|
||||
|
||||
FileAccess::CreateFunc FileAccess::create_func[ACCESS_MAX] = { 0, 0 };
|
||||
|
||||
FileAccess::FileCloseFailNotify FileAccess::close_fail_notify = NULL;
|
||||
|
@ -30,14 +30,15 @@
|
||||
#include "ustring.h"
|
||||
|
||||
#include "color.h"
|
||||
#include "io/md5.h"
|
||||
#include "io/sha256.h"
|
||||
#include "math_funcs.h"
|
||||
#include "os/memory.h"
|
||||
#include "print_string.h"
|
||||
#include "ucaps.h"
|
||||
#include "variant.h"
|
||||
|
||||
#include "thirdparty/misc/md5.h"
|
||||
#include "thirdparty/misc/sha256.h"
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
#ifndef NO_USE_STDLIB
|
||||
|
@ -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')
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -28,13 +28,13 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "editor_export.h"
|
||||
|
||||
#include "editor/editor_file_system.h"
|
||||
#include "editor/plugins/script_editor_plugin.h"
|
||||
#include "editor_node.h"
|
||||
#include "editor_settings.h"
|
||||
#include "global_config.h"
|
||||
#include "io/config_file.h"
|
||||
#include "io/md5.h"
|
||||
#include "io/resource_loader.h"
|
||||
#include "io/resource_saver.h"
|
||||
#include "io/zip_io.h"
|
||||
@ -43,6 +43,8 @@
|
||||
#include "script_language.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "thirdparty/misc/md5.h"
|
||||
|
||||
static int _get_pad(int p_alignment, int p_n) {
|
||||
|
||||
int rest = p_n % p_alignment;
|
||||
|
@ -1,11 +1,40 @@
|
||||
/*************************************************************************/
|
||||
/* export_template_manager.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#include "export_template_manager.h"
|
||||
|
||||
#include "editor_node.h"
|
||||
#include "editor_scale.h"
|
||||
#include "io/zip_io.h"
|
||||
#include "os/dir_access.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "io/zip_io.h"
|
||||
|
||||
void ExportTemplateManager::_update_template_list() {
|
||||
|
||||
while (current_hb->get_child_count()) {
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*************************************************************************/
|
||||
/* export_template_manager.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#ifndef EXPORT_TEMPLATE_MANAGER_H
|
||||
#define EXPORT_TEMPLATE_MANAGER_H
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "editor_texture_import_plugin.h"
|
||||
|
||||
#if 0
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_settings.h"
|
||||
@ -35,13 +36,14 @@
|
||||
#include "global_config.h"
|
||||
#include "io/image_loader.h"
|
||||
#include "io/marshalls.h"
|
||||
#include "io/md5.h"
|
||||
#include "io/resource_saver.h"
|
||||
#include "scene/gui/button_group.h"
|
||||
#include "scene/gui/check_button.h"
|
||||
#include "scene/gui/margin_container.h"
|
||||
#include "scene/io/resource_format_image.h"
|
||||
|
||||
#include "thirdparty/misc/md5.h"
|
||||
|
||||
static const char *flag_names[]={
|
||||
("Streaming Format"),
|
||||
("Fix Border Alpha"),
|
||||
|
@ -1,8 +1,38 @@
|
||||
/*************************************************************************/
|
||||
/* curve_editor_plugin.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#include "curve_editor_plugin.h"
|
||||
|
||||
#include "canvas_item_editor_plugin.h"
|
||||
#include "os/keyboard.h"
|
||||
#include "spatial_editor_plugin.h"
|
||||
|
||||
void CurveTextureEdit::_gui_input(const InputEvent &p_event) {
|
||||
|
||||
if (p_event.type == InputEvent::KEY && p_event.key.pressed && p_event.key.scancode == KEY_DELETE && grabbed != -1) {
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*************************************************************************/
|
||||
/* curve_editor_plugin.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#ifndef CURVE_EDITOR_PLUGIN_H
|
||||
#define CURVE_EDITOR_PLUGIN_H
|
||||
|
||||
|
@ -1,10 +1,39 @@
|
||||
/*************************************************************************/
|
||||
/* gradient_texture_editor_plugin.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#include "gradient_texture_editor_plugin.h"
|
||||
|
||||
#include "canvas_item_editor_plugin.h"
|
||||
#include "spatial_editor_plugin.h"
|
||||
|
||||
#include "os/keyboard.h"
|
||||
#include "scene/resources/default_theme/theme_data.h"
|
||||
#include "spatial_editor_plugin.h"
|
||||
|
||||
#define POINT_WIDTH 8
|
||||
|
||||
GradientTextureEdit::GradientTextureEdit() {
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*************************************************************************/
|
||||
/* gradient_texture_editor_plugin.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* http://www.godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
|
||||
/* */
|
||||
/* 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. */
|
||||
/*************************************************************************/
|
||||
#ifndef GRADIENT_TEXTURE_EDITOR_PLUGIN_H
|
||||
#define GRADIENT_TEXTURE_EDITOR_PLUGIN_H
|
||||
|
||||
|
@ -677,7 +677,16 @@ 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)
|
||||
|
||||
|
||||
# platform/uwp need to know openssl is available, pass to main env
|
||||
if "platform" in env and env["platform"] == "uwp":
|
||||
|
@ -30,17 +30,19 @@
|
||||
#ifndef STREAM_PEER_OPEN_SSL_H
|
||||
#define STREAM_PEER_OPEN_SSL_H
|
||||
|
||||
#include "curl_hostcheck.h"
|
||||
#include "global_config.h"
|
||||
#include "io/stream_peer_ssl.h"
|
||||
#include "os/file_access.h"
|
||||
#include <stdio.h> // If you don't know what this is for stop reading now.
|
||||
|
||||
#include "thirdparty/misc/curl_hostcheck.h"
|
||||
|
||||
#include <openssl/bio.h> // BIO objects for I/O
|
||||
#include <openssl/err.h> // Error reporting
|
||||
#include <openssl/ssl.h> // SSL and SSL_CTX for SSL connections
|
||||
#include <openssl/x509v3.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
class StreamPeerOpenSSL : public StreamPeerSSL {
|
||||
private:
|
||||
static int _bio_create(BIO *b);
|
||||
|
@ -30,7 +30,8 @@
|
||||
#include "audio_stream_ogg_vorbis.h"
|
||||
|
||||
#include "os/file_access.h"
|
||||
#include "thirdparty/stb_vorbis/stb_vorbis.c"
|
||||
|
||||
#include "thirdparty/misc/stb_vorbis.c"
|
||||
|
||||
void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_frames) {
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "servers/audio/audio_stream.h"
|
||||
|
||||
#define STB_VORBIS_HEADER_ONLY
|
||||
#include "thirdparty/stb_vorbis/stb_vorbis.c"
|
||||
#include "thirdparty/misc/stb_vorbis.c"
|
||||
#undef STB_VORBIS_HEADER_ONLY
|
||||
|
||||
class AudioStreamOGGVorbis;
|
||||
|
@ -31,7 +31,8 @@
|
||||
|
||||
#include "global_config.h"
|
||||
#include "os/os.h"
|
||||
#include "yuv2rgb.h"
|
||||
|
||||
#include "thirdparty/misc/yuv2rgb.h"
|
||||
|
||||
int VideoStreamPlaybackTheora::buffer_data() {
|
||||
|
||||
|
@ -32,12 +32,13 @@
|
||||
#include "OpusVorbisDecoder.hpp"
|
||||
#include "VPXDecoder.hpp"
|
||||
|
||||
#include "../theora/yuv2rgb.h"
|
||||
#include "mkvparser/mkvparser.h"
|
||||
|
||||
#include "global_config.h"
|
||||
#include "os/file_access.h"
|
||||
|
||||
#include "thirdparty/misc/yuv2rgb.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
class MkvReader : public mkvparser::IMkvReader {
|
||||
|
@ -72,17 +72,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "editor/editor_import_export.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "global_config.h"
|
||||
#include "io/base64.h"
|
||||
#include "io/marshalls.h"
|
||||
#include "io/sha256.h"
|
||||
#include "io/unzip.h"
|
||||
#include "io/zip.h"
|
||||
#include "io/zip_io.h"
|
||||
#include "object.h"
|
||||
#include "os/file_access.h"
|
||||
#include "platform/uwp/logo.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "thirdparty/minizip/unzip.h"
|
||||
#include "thirdparty/minizip/zip.h"
|
||||
#include "thirdparty/misc/base64.h"
|
||||
#include "thirdparty/misc/sha256.h"
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
// Capabilities
|
||||
|
@ -28,10 +28,13 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "collision_polygon_2d.h"
|
||||
|
||||
#include "collision_object_2d.h"
|
||||
#include "scene/resources/concave_polygon_shape_2d.h"
|
||||
#include "scene/resources/convex_polygon_shape_2d.h"
|
||||
#include "triangulator.h"
|
||||
|
||||
#include "thirdparty/misc/triangulator.h"
|
||||
|
||||
void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) {
|
||||
|
||||
if (unparenting || !can_update_body)
|
||||
|
@ -28,9 +28,11 @@
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
#include "navigation_polygon.h"
|
||||
|
||||
#include "core_string_names.h"
|
||||
#include "navigation2d.h"
|
||||
#include "triangulator.h"
|
||||
|
||||
#include "thirdparty/misc/triangulator.h"
|
||||
|
||||
void NavigationPolygon::set_vertices(const PoolVector<Vector2> &p_vertices) {
|
||||
|
||||
|
19
scene/SCsub
19
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')
|
||||
|
@ -3,7 +3,6 @@
|
||||
Import('env')
|
||||
|
||||
env.add_source_files(env.scene_sources, "*.cpp")
|
||||
env.add_source_files(env.scene_sources, "*.c")
|
||||
|
||||
Export('env')
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
|
||||
#define STB_TRUETYPE_IMPLEMENTATION
|
||||
#include "os/file_access.h"
|
||||
#include "stb_truetype.h"
|
||||
|
||||
void DynamicFontData::lock() {
|
||||
|
||||
|
@ -34,7 +34,8 @@
|
||||
|
||||
#include "font.h"
|
||||
#include "io/resource_loader.h"
|
||||
#include "stb_truetype.h"
|
||||
|
||||
#include "thirdparty/misc/stb_truetype.h"
|
||||
|
||||
class DynamicFontAtSize;
|
||||
class DynamicFont;
|
||||
|
@ -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 {
|
||||
|
||||
GDCLASS(SurfaceTool, Reference);
|
||||
|
92
thirdparty/README.md
vendored
92
thirdparty/README.md
vendored
@ -1,6 +1,13 @@
|
||||
# Third party libraries
|
||||
|
||||
|
||||
## b2d_convexdecomp
|
||||
|
||||
- Upstream: https://github.com/erincatto/Box2D (Contributions/Utilities/ConvexDecomposition)
|
||||
- Version: TBD
|
||||
- License: zlib
|
||||
|
||||
|
||||
## certs
|
||||
|
||||
- Upstream: ?
|
||||
@ -142,6 +149,91 @@ changes to ensure they build for Javascript/HTML5. Those
|
||||
changes are marked with `// -- GODOT --` comments.
|
||||
|
||||
|
||||
## minizip
|
||||
|
||||
- Upstream: http://www.zlib.net
|
||||
- Version: 1.2.4 (zlib contrib)
|
||||
- License: zlib
|
||||
|
||||
Files extracted from the upstream source:
|
||||
|
||||
- contrib/minizip/{crypt.h,ioapi.{c,h},zip.{c,h},unzip.{c,h}}
|
||||
|
||||
Important: Some files have Godot-made changes for use in core/io.
|
||||
TODO: Properly sync with version 1.2.4 and document changes.
|
||||
|
||||
|
||||
## misc
|
||||
|
||||
Collection of single-file libraries used in Godot components.
|
||||
|
||||
### core
|
||||
|
||||
- `aes256.{cpp,h}`
|
||||
* Upstream: http://www.literatecode.com/aes256
|
||||
* Version: latest, as of April 2017
|
||||
* License: ISC
|
||||
- `base64.{c,h}`
|
||||
* Upstream: http://episec.com/people/edelkind/c.html
|
||||
* Version: latest, as of April 2017
|
||||
* License: Public Domain
|
||||
- `fastlz.{c,h}`
|
||||
* Upstream: https://code.google.com/archive/p/fastlz
|
||||
* Version: svn (r12)
|
||||
* License: MIT
|
||||
- `hq2x.{cpp,h}`
|
||||
* Upstream: https://github.com/brunexgeek/hqx
|
||||
* Version: TBD, file structure differs
|
||||
* License: Apache 2.0
|
||||
- `md5.{cpp,h}`
|
||||
* Upstream: http://www.efgh.com/software/md5.htm
|
||||
* Version: TBD, might not be latest from above URL
|
||||
* License: RSA Message-Digest License
|
||||
- `pcg.{cpp,h}`
|
||||
* Upstream: http://www.pcg-random.org
|
||||
* Version: minimal C implemention, http://www.pcg-random.org/download.html
|
||||
* License: Apache 2.0
|
||||
- `sha256.{c,h}`
|
||||
* Upstream: https://github.com/ilvn/SHA256
|
||||
* Version: git (35ff823, 2015)
|
||||
* License: ISC
|
||||
- `smaz.{c,h}`
|
||||
* Upstream: https://github.com/antirez/smaz
|
||||
* Version: git (150e125, 2009)
|
||||
* License: BSD 3-clause
|
||||
* Modifications: use `const char*` instead of `char*` for input string
|
||||
- `triangulator.{cpp,h}`
|
||||
* Upstream: https://github.com/ivanfratric/polypartition (`src/polypartition.cpp`)
|
||||
* 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
|
||||
- `stb_vorbis.c`
|
||||
* Upstream: https://github.com/nothings/stb
|
||||
* Version: 1.09
|
||||
* License: Public Domain (Unlicense) or MIT
|
||||
|
||||
|
||||
## openssl
|
||||
|
||||
- Upstream: https://www.openssl.org
|
||||
|
0
core/hq2x.h → thirdparty/misc/hq2x.h
vendored
0
core/hq2x.h → thirdparty/misc/hq2x.h
vendored
4
core/io/md5.cpp → thirdparty/misc/md5.cpp
vendored
4
core/io/md5.cpp → thirdparty/misc/md5.cpp
vendored
@ -1,5 +1,3 @@
|
||||
#include "md5.h"
|
||||
|
||||
/*
|
||||
**********************************************************************
|
||||
** md5.c **
|
||||
@ -34,7 +32,7 @@
|
||||
*/
|
||||
|
||||
/* -- include the following line if the md5.h header file is separate -- */
|
||||
/* #include "md5.h" */
|
||||
#include "md5.h"
|
||||
|
||||
/* forward declaration */
|
||||
static void Transform (uint32_t *buf, uint32_t *in);
|
0
core/io/md5.h → thirdparty/misc/md5.h
vendored
0
core/io/md5.h → thirdparty/misc/md5.h
vendored
0
core/math/pcg.h → thirdparty/misc/pcg.h
vendored
0
core/math/pcg.h → thirdparty/misc/pcg.h
vendored
207
thirdparty/misc/smaz.c
vendored
Normal file
207
thirdparty/misc/smaz.c
vendored
Normal file
@ -0,0 +1,207 @@
|
||||
/*
|
||||
Copyright (c) 2006-2009, Salvatore Sanfilippo
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Our compression codebook, used for compression */
|
||||
static const char *Smaz_cb[241] = {
|
||||
"\002s,\266", "\003had\232\002leW", "\003on \216", "", "\001yS",
|
||||
"\002ma\255\002li\227", "\003or \260", "", "\002ll\230\003s t\277",
|
||||
"\004fromg\002mel", "", "\003its\332", "\001z\333", "\003ingF", "\001>\336",
|
||||
"\001 \000\003 (\002nc\344", "\002nd=\003 on\312",
|
||||
"\002ne\213\003hat\276\003re q", "", "\002ngT\003herz\004have\306\003s o\225",
|
||||
"", "\003ionk\003s a\254\002ly\352", "\003hisL\003 inN\003 be\252", "",
|
||||
"\003 fo\325\003 of \003 ha\311", "", "\002of\005",
|
||||
"\003 co\241\002no\267\003 ma\370", "", "", "\003 cl\356\003enta\003 an7",
|
||||
"\002ns\300\001\"e", "\003n t\217\002ntP\003s, \205",
|
||||
"\002pe\320\003 we\351\002om\223", "\002on\037", "", "\002y G", "\003 wa\271",
|
||||
"\003 re\321\002or*", "", "\002=\"\251\002ot\337", "\003forD\002ou[",
|
||||
"\003 toR", "\003 th\r", "\003 it\366",
|
||||
"\003but\261\002ra\202\003 wi\363\002</\361", "\003 wh\237", "\002 4",
|
||||
"\003nd ?", "\002re!", "", "\003ng c", "",
|
||||
"\003ly \307\003ass\323\001a\004\002rir", "", "", "", "\002se_", "\003of \"",
|
||||
"\003div\364\002ros\003ere\240", "", "\002ta\310\001bZ\002si\324", "",
|
||||
"\003and\a\002rs\335", "\002rt\362", "\002teE", "\003ati\316", "\002so\263",
|
||||
"\002th\021", "\002tiJ\001c\034\003allp", "\003ate\345", "\002ss\246",
|
||||
"\002stM", "", "\002><\346", "\002to\024", "\003arew", "\001d\030",
|
||||
"\002tr\303", "", "\001\n1\003 a \222", "\003f tv\002veo", "\002un\340", "",
|
||||
"\003e o\242", "\002a \243\002wa\326\001e\002", "\002ur\226\003e a\274",
|
||||
"\002us\244\003\n\r\n\247", "\002ut\304\003e c\373", "\002we\221", "", "",
|
||||
"\002wh\302", "\001f,", "", "", "", "\003d t\206", "", "", "\003th \343",
|
||||
"\001g;", "", "", "\001\r9\003e s\265", "\003e t\234", "", "\003to Y",
|
||||
"\003e\r\n\236", "\002d \036\001h\022", "", "\001,Q", "\002 a\031", "\002 b^",
|
||||
"\002\r\n\025\002 cI", "\002 d\245", "\002 e\253", "\002 fh\001i\b\002e \v",
|
||||
"", "\002 hU\001-\314", "\002 i8", "", "", "\002 l\315", "\002 m{",
|
||||
"\002f :\002 n\354", "\002 o\035", "\002 p}\001.n\003\r\n\r\250", "",
|
||||
"\002 r\275", "\002 s>", "\002 t\016", "", "\002g \235\005which+\003whi\367",
|
||||
"\002 w5", "\001/\305", "\003as \214", "\003at \207", "", "\003who\331", "",
|
||||
"\001l\026\002h \212", "", "\002, $", "", "\004withV", "", "", "", "\001m-", "",
|
||||
"", "\002ac\357", "\002ad\350", "\003TheH", "", "", "\004this\233\001n\t",
|
||||
"", "\002. y", "", "\002alX\003e, \365", "\003tio\215\002be\\",
|
||||
"\002an\032\003ver\347", "", "\004that0\003tha\313\001o\006", "\003was2",
|
||||
"\002arO", "\002as.", "\002at'\003the\001\004they\200\005there\322\005theird",
|
||||
"\002ce\210", "\004were]", "", "\002ch\231\002l \264\001p<", "", "",
|
||||
"\003one\256", "", "\003he \023\002dej", "\003ter\270", "\002cou", "",
|
||||
"\002by\177\002di\201\002eax", "", "\002ec\327", "\002edB", "\002ee\353", "",
|
||||
"", "\001r\f\002n )", "", "", "", "\002el\262", "", "\003in i\002en3", "",
|
||||
"\002o `\001s\n", "", "\002er\033", "\003is t\002es6", "", "\002ge\371",
|
||||
"\004.com\375", "\002fo\334\003our\330", "\003ch \301\001t\003", "\002hab", "",
|
||||
"\003men\374", "", "\002he\020", "", "", "\001u&", "\002hif", "",
|
||||
"\003not\204\002ic\203", "\003ed @\002id\355", "", "", "\002ho\273",
|
||||
"\002r K\001vm", "", "", "", "\003t t\257\002il\360", "\002im\342",
|
||||
"\003en \317\002in\017", "\002io\220", "\002s \027\001wA", "", "\003er |",
|
||||
"\003es ~\002is%", "\002it/", "", "\002iv\272", "",
|
||||
"\002t #\ahttp://C\001x\372", "\002la\211", "\001<\341", "\003, a\224"
|
||||
};
|
||||
|
||||
/* Reverse compression codebook, used for decompression */
|
||||
static char *Smaz_rcb[254] = {
|
||||
" ", "the", "e", "t", "a", "of", "o", "and", "i", "n", "s", "e ", "r", " th",
|
||||
" t", "in", "he", "th", "h", "he ", "to", "\r\n", "l", "s ", "d", " a", "an",
|
||||
"er", "c", " o", "d ", "on", " of", "re", "of ", "t ", ", ", "is", "u", "at",
|
||||
" ", "n ", "or", "which", "f", "m", "as", "it", "that", "\n", "was", "en",
|
||||
" ", " w", "es", " an", " i", "\r", "f ", "g", "p", "nd", " s", "nd ", "ed ",
|
||||
"w", "ed", "http://", "for", "te", "ing", "y ", "The", " c", "ti", "r ", "his",
|
||||
"st", " in", "ar", "nt", ",", " to", "y", "ng", " h", "with", "le", "al", "to ",
|
||||
"b", "ou", "be", "were", " b", "se", "o ", "ent", "ha", "ng ", "their", "\"",
|
||||
"hi", "from", " f", "in ", "de", "ion", "me", "v", ".", "ve", "all", "re ",
|
||||
"ri", "ro", "is ", "co", "f t", "are", "ea", ". ", "her", " m", "er ", " p",
|
||||
"es ", "by", "they", "di", "ra", "ic", "not", "s, ", "d t", "at ", "ce", "la",
|
||||
"h ", "ne", "as ", "tio", "on ", "n t", "io", "we", " a ", "om", ", a", "s o",
|
||||
"ur", "li", "ll", "ch", "had", "this", "e t", "g ", "e\r\n", " wh", "ere",
|
||||
" co", "e o", "a ", "us", " d", "ss", "\n\r\n", "\r\n\r", "=\"", " be", " e",
|
||||
"s a", "ma", "one", "t t", "or ", "but", "el", "so", "l ", "e s", "s,", "no",
|
||||
"ter", " wa", "iv", "ho", "e a", " r", "hat", "s t", "ns", "ch ", "wh", "tr",
|
||||
"ut", "/", "have", "ly ", "ta", " ha", " on", "tha", "-", " l", "ati", "en ",
|
||||
"pe", " re", "there", "ass", "si", " fo", "wa", "ec", "our", "who", "its", "z",
|
||||
"fo", "rs", ">", "ot", "un", "<", "im", "th ", "nc", "ate", "><", "ver", "ad",
|
||||
" we", "ly", "ee", " n", "id", " cl", "ac", "il", "</", "rt", " wi", "div",
|
||||
"e, ", " it", "whi", " ma", "ge", "x", "e c", "men", ".com"
|
||||
};
|
||||
|
||||
int smaz_compress(const char *in, int inlen, char *out, int outlen) {
|
||||
unsigned int h1,h2,h3=0;
|
||||
int verblen = 0, _outlen = outlen;
|
||||
char verb[256], *_out = out;
|
||||
|
||||
while(inlen) {
|
||||
int j = 7, needed;
|
||||
char *flush = NULL;
|
||||
char *slot;
|
||||
|
||||
h1 = h2 = in[0]<<3;
|
||||
if (inlen > 1) h2 += in[1];
|
||||
if (inlen > 2) h3 = h2^in[2];
|
||||
if (j > inlen) j = inlen;
|
||||
|
||||
/* Try to lookup substrings into the hash table, starting from the
|
||||
* longer to the shorter substrings */
|
||||
for (; j > 0; j--) {
|
||||
switch(j) {
|
||||
case 1: slot = Smaz_cb[h1%241]; break;
|
||||
case 2: slot = Smaz_cb[h2%241]; break;
|
||||
default: slot = Smaz_cb[h3%241]; break;
|
||||
}
|
||||
while(slot[0]) {
|
||||
if (slot[0] == j && memcmp(slot+1,in,j) == 0) {
|
||||
/* Match found in the hash table,
|
||||
* prepare a verbatim bytes flush if needed */
|
||||
if (verblen) {
|
||||
needed = (verblen == 1) ? 2 : 2+verblen;
|
||||
flush = out;
|
||||
out += needed;
|
||||
outlen -= needed;
|
||||
}
|
||||
/* Emit the byte */
|
||||
if (outlen <= 0) return _outlen+1;
|
||||
out[0] = slot[slot[0]+1];
|
||||
out++;
|
||||
outlen--;
|
||||
inlen -= j;
|
||||
in += j;
|
||||
goto out;
|
||||
} else {
|
||||
slot += slot[0]+2;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Match not found - add the byte to the verbatim buffer */
|
||||
verb[verblen] = in[0];
|
||||
verblen++;
|
||||
inlen--;
|
||||
in++;
|
||||
out:
|
||||
/* Prepare a flush if we reached the flush length limit, and there
|
||||
* is not already a pending flush operation. */
|
||||
if (!flush && (verblen == 256 || (verblen > 0 && inlen == 0))) {
|
||||
needed = (verblen == 1) ? 2 : 2+verblen;
|
||||
flush = out;
|
||||
out += needed;
|
||||
outlen -= needed;
|
||||
if (outlen < 0) return _outlen+1;
|
||||
}
|
||||
/* Perform a verbatim flush if needed */
|
||||
if (flush) {
|
||||
if (verblen == 1) {
|
||||
flush[0] = (signed char)254;
|
||||
flush[1] = verb[0];
|
||||
} else {
|
||||
flush[0] = (signed char)255;
|
||||
flush[1] = (signed char)(verblen-1);
|
||||
memcpy(flush+2,verb,verblen);
|
||||
}
|
||||
flush = NULL;
|
||||
verblen = 0;
|
||||
}
|
||||
}
|
||||
return out-_out;
|
||||
}
|
||||
|
||||
int smaz_decompress(const char *in, int inlen, char *out, int outlen) {
|
||||
unsigned char *c = (unsigned char*) in;
|
||||
char *_out = out;
|
||||
int _outlen = outlen;
|
||||
|
||||
while(inlen) {
|
||||
if (*c == 254) {
|
||||
/* Verbatim byte */
|
||||
if (outlen < 1) return _outlen+1;
|
||||
*out = *(c+1);
|
||||
out++;
|
||||
outlen--;
|
||||
c += 2;
|
||||
inlen -= 2;
|
||||
} else if (*c == 255) {
|
||||
/* Verbatim string */
|
||||
int len = (*(c+1))+1;
|
||||
if (outlen < len) return _outlen+1;
|
||||
memcpy(out,c+2,len);
|
||||
out += len;
|
||||
outlen -= len;
|
||||
c += 2+len;
|
||||
inlen -= 2+len;
|
||||
} else {
|
||||
/* Codebook entry */
|
||||
const char *s = Smaz_rcb[*c];
|
||||
int len = strlen(s);
|
||||
|
||||
if (outlen < len) return _outlen+1;
|
||||
memcpy(out,s,len);
|
||||
out += len;
|
||||
outlen -= len;
|
||||
c++;
|
||||
inlen--;
|
||||
}
|
||||
}
|
||||
return out-_out;
|
||||
}
|
20
thirdparty/misc/smaz.h
vendored
Normal file
20
thirdparty/misc/smaz.h
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright (c) 2006-2009, Salvatore Sanfilippo
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SMAZ_H
|
||||
#define _SMAZ_H
|
||||
|
||||
int smaz_compress(const char *in, int inlen, char *out, int outlen);
|
||||
int smaz_decompress(const char *in, int inlen, char *out, int outlen);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user