diff --git a/Cargo.lock b/Cargo.lock index be0d48f9..22c955cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,18 +12,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" dependencies = [ "gimli", ] [[package]] name = "adler" -version = "0.2.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "adler32" @@ -33,57 +33,56 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "aead" -version = "0.2.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf01b9b56e767bb57b94ebf91a58b338002963785cdd7013e21c0d4679471e4" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" dependencies = [ - "generic-array", + "generic-array 0.14.4", ] [[package]] name = "aes" -version = "0.3.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" dependencies = [ "aes-soft", "aesni", - "block-cipher-trait", + "cipher", ] [[package]] name = "aes-gcm" -version = "0.5.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "834a6bda386024dbb7c8fc51322856c10ffe69559f972261c868485f5759c638" +checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" dependencies = [ "aead", "aes", - "block-cipher-trait", + "cipher", + "ctr", "ghash", - "subtle 2.3.0", - "zeroize", + "subtle", ] [[package]] name = "aes-soft" -version = "0.3.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" dependencies = [ - "block-cipher-trait", - "byteorder", - "opaque-debug", + "cipher", + "opaque-debug 0.3.0", ] [[package]] name = "aesni" -version = "0.6.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" dependencies = [ - "block-cipher-trait", - "opaque-debug", + "cipher", + "opaque-debug 0.3.0", ] [[package]] @@ -147,14 +146,14 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.54" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2baad346b2d4e94a24347adeee9c7a93f412ee94b9cc26e5b59dea23848e9f28" +checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" dependencies = [ "addr2line", "cfg-if 1.0.0", "libc", - "miniz_oxide 0.4.3", + "miniz_oxide 0.4.4", "object", "rustc-demangle", ] @@ -184,6 +183,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + [[package]] name = "bitflags" version = "1.2.1" @@ -199,16 +204,16 @@ dependencies = [ "block-padding", "byte-tools", "byteorder", - "generic-array", + "generic-array 0.12.4", ] [[package]] -name = "block-cipher-trait" -version = "0.6.2" +name = "block-buffer" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array", + "generic-array 0.14.4", ] [[package]] @@ -228,15 +233,15 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41aa2ec95ca3b5c54cf73c91acf06d24f4495d5f1b1c12506ae3483d646177ac" +checksum = "bed57e2090563b83ba8f83366628ce535a7584c9afa4c9fc0612a03925c6df58" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -251,9 +256,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.61" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" [[package]] name = "cfg-if" @@ -280,6 +285,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array 0.14.4", +] + [[package]] name = "clap" version = "2.33.3" @@ -322,24 +336,18 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "const_fn" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" - [[package]] name = "cookie" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5795cda0897252e34380a27baf884c53aa7ad9990329cdad96d4c5d027015d44" +checksum = "80f6044740a4a516b8aac14c140cdf35c1a640b1bd6b98b6224e49143b2f1566" dependencies = [ "aes-gcm", - "base64 0.12.3", + "base64 0.13.0", "hkdf", "hmac", "percent-encoding 2.1.0", - "rand 0.7.3", + "rand 0.8.3", "sha2", "time", ] @@ -363,7 +371,7 @@ dependencies = [ "cookie 0.12.0", "failure", "idna 0.1.5", - "log 0.4.11", + "log 0.4.14", "publicsuffix", "serde", "serde_json", @@ -374,9 +382,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.7.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" dependencies = [ "core-foundation-sys", "libc", @@ -384,9 +392,21 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.7.0" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" + +[[package]] +name = "cpuid-bool" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" + +[[package]] +name = "cpuid-bool" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "crc32fast" @@ -404,7 +424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.0", + "crossbeam-utils 0.8.3", ] [[package]] @@ -425,8 +445,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.0", - "crossbeam-utils 0.8.0", + "crossbeam-epoch 0.9.3", + "crossbeam-utils 0.8.3", ] [[package]] @@ -440,21 +460,20 @@ dependencies = [ "crossbeam-utils 0.7.2", "lazy_static", "maybe-uninit", - "memoffset", + "memoffset 0.5.6", "scopeguard", ] [[package]] name = "crossbeam-epoch" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" +checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" dependencies = [ "cfg-if 1.0.0", - "const_fn", - "crossbeam-utils 0.8.0", + "crossbeam-utils 0.8.3", "lazy_static", - "memoffset", + "memoffset 0.6.1", "scopeguard", ] @@ -482,24 +501,32 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" +checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" dependencies = [ "autocfg 1.0.1", "cfg-if 1.0.0", - "const_fn", "lazy_static", ] [[package]] name = "crypto-mac" -version = "0.7.0" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" +dependencies = [ + "generic-array 0.14.4", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" dependencies = [ - "generic-array", - "subtle 1.0.0", + "cipher", ] [[package]] @@ -550,14 +577,23 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array", + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.4", ] [[package]] name = "dtoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" +checksum = "88d7ed2934d741c6b37e33e3832298e8850b53fd2d2bea03873375596c7cea4e" [[package]] name = "either" @@ -567,20 +603,11 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.24" +version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a51b8cf747471cb9499b6d59e59b0444f4c90eba8968c4e44874e92b5b64ace2" +checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "error-chain" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "version_check 0.9.2", + "cfg-if 1.0.0", ] [[package]] @@ -618,31 +645,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e69ab0d5aca163e388c3a49d284fed6c3d0810700e77c5ae2756a50ec1a4daaa" dependencies = [ "chrono", - "log 0.4.11", + "log 0.4.14", ] [[package]] name = "filetime" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e" +checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.5", "winapi 0.3.9", ] [[package]] name = "flate2" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da80be589a72651dcda34d8b35bcdc9b7254ad06325611074d9cc0fbb19f60ee" +checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "crc32fast", "libc", - "miniz_oxide 0.4.3", + "miniz_oxide 0.4.4", ] [[package]] @@ -666,6 +693,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding 2.1.0", +] + [[package]] name = "fsevent" version = "0.4.0" @@ -709,9 +746,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures-cpupool" @@ -725,30 +762,52 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check 0.9.3", +] + [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", +] + [[package]] name = "ghash" -version = "0.2.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f0930ed19a7184089ea46d2fedead2f6dc2b674c5db4276b7da336c7cd83252" +checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" dependencies = [ + "opaque-debug 0.3.0", "polyval", ] @@ -776,7 +835,7 @@ dependencies = [ "futures", "http", "indexmap", - "log 0.4.11", + "log 0.4.14", "slab", "string", "tokio-io", @@ -800,9 +859,9 @@ checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -819,22 +878,22 @@ dependencies = [ [[package]] name = "hkdf" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fa08a006102488bd9cd5b8013aabe84955cf5ae22e304c2caf655b633aefae3" +checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" dependencies = [ - "digest", + "digest 0.9.0", "hmac", ] [[package]] name = "hmac" -version = "0.7.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" +checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" dependencies = [ "crypto-mac", - "digest", + "digest 0.9.0", ] [[package]] @@ -862,9 +921,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.4" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" [[package]] name = "hyper" @@ -887,9 +946,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.35" +version = "0.12.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" dependencies = [ "bytes", "futures", @@ -900,7 +959,7 @@ dependencies = [ "httparse", "iovec", "itoa", - "log 0.4.11", + "log 0.4.14", "net2", "rustc_version", "time", @@ -923,7 +982,7 @@ checksum = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" dependencies = [ "bytes", "futures", - "hyper 0.12.35", + "hyper 0.12.36", "native-tls", "tokio-io", ] @@ -941,9 +1000,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" dependencies = [ "matches", "unicode-bidi", @@ -952,9 +1011,9 @@ dependencies = [ [[package]] name = "image" -version = "0.23.11" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f0a8345b33b082aedec2f4d7d4a926b845cee184cbe78b703413066564431b" +checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" dependencies = [ "bytemuck", "byteorder", @@ -967,9 +1026,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" +checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" dependencies = [ "autocfg 1.0.1", "hashbrown 0.9.1", @@ -988,9 +1047,9 @@ dependencies = [ [[package]] name = "inotify-sys" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" dependencies = [ "libc", ] @@ -1006,9 +1065,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "kernel32-sys" @@ -1040,15 +1099,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.80" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" +checksum = "ba4aede83fc3617411dc6993bc8c70919750c1c257c6ca6a502aed6e0e2394ae" [[package]] name = "linked_list_allocator" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84565678e403453d1a27a0886882b3b271701e65146d972d9d7d9a4c4a0ff498" +checksum = "822add9edb1860698b79522510da17bef885171f75aa395cff099d770c609c24" dependencies = [ "spinning_top", ] @@ -1079,16 +1138,16 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" dependencies = [ - "log 0.4.11", + "log 0.4.14", ] [[package]] name = "log" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -1118,6 +1177,15 @@ dependencies = [ "autocfg 1.0.1", ] +[[package]] +name = "memoffset" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" +dependencies = [ + "autocfg 1.0.1", +] + [[package]] name = "mime" version = "0.2.6" @@ -1154,9 +1222,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", "autocfg 1.0.1", @@ -1164,9 +1232,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.22" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" dependencies = [ "cfg-if 0.1.10", "fuchsia-zircon", @@ -1174,7 +1242,7 @@ dependencies = [ "iovec", "kernel32-sys", "libc", - "log 0.4.11", + "log 0.4.14", "miow", "net2", "slab", @@ -1188,16 +1256,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ "lazycell", - "log 0.4.11", + "log 0.4.14", "mio", "slab", ] [[package]] name = "miow" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" dependencies = [ "kernel32-sys", "net2", @@ -1213,13 +1281,13 @@ checksum = "a785740271256c230f57462d3b83e52f998433a7062fc18f96d5999474a9f915" [[package]] name = "native-tls" -version = "0.2.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" +checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" dependencies = [ "lazy_static", "libc", - "log 0.4.11", + "log 0.4.14", "openssl", "openssl-probe", "openssl-sys", @@ -1231,9 +1299,9 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.35" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" +checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" dependencies = [ "cfg-if 0.1.10", "libc", @@ -1246,7 +1314,7 @@ version = "0.3.3" source = "git+https://github.com/squirrel-labs/web_worker/?branch=feature/remove-wasm-bindgen#a1b20a4ef8710cd099237cb90c2814fa2895ffb9" dependencies = [ "futures", - "log 0.4.11", + "log 0.4.14", "rayon", "rayon-core", "spin", @@ -1259,7 +1327,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" dependencies = [ "memchr", - "version_check 0.9.2", + "version_check 0.9.3", ] [[package]] @@ -1303,9 +1371,9 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5fa6d5f418879385b213d905f7cf5bf4aa553d4c380f0152d1d4f2749186fa9" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" dependencies = [ "autocfg 1.0.1", "num-integer", @@ -1333,9 +1401,15 @@ dependencies = [ [[package]] name = "object" -version = "0.22.0" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" + +[[package]] +name = "once_cell" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" [[package]] name = "opaque-debug" @@ -1343,17 +1417,23 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "openssl" -version = "0.10.30" +version = "0.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" +checksum = "a61075b62a23fef5a29815de7536d940aa35ce96d18ce0cc5076272db678a577" dependencies = [ "bitflags", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "foreign-types", - "lazy_static", "libc", + "once_cell", "openssl-sys", ] @@ -1365,9 +1445,9 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-sys" -version = "0.9.58" +version = "0.9.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +checksum = "313752393519e876837e09e1fa183ddef0be7735868dced3196f4472d536277f" dependencies = [ "autocfg 1.0.1", "cc", @@ -1418,9 +1498,9 @@ dependencies = [ "cfg-if 0.1.10", "cloudabi", "libc", - "redox_syscall", + "redox_syscall 0.1.57", "rustc_version", - "smallvec 0.6.13", + "smallvec 0.6.14", "winapi 0.3.9", ] @@ -1442,7 +1522,7 @@ dependencies = [ "proc-macro2 0.4.30", "quote 0.6.13", "syn 0.15.44", - "version_check 0.9.2", + "version_check 0.9.3", "yansi", ] @@ -1466,9 +1546,9 @@ checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "png" -version = "0.16.7" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe7f9f1c730833200b134370e1d5098964231af8450bce9b78ee3ab5278b970" +checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" dependencies = [ "bitflags", "crc32fast", @@ -1478,19 +1558,20 @@ dependencies = [ [[package]] name = "polyval" -version = "0.3.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec3341498978de3bfd12d1b22f1af1de22818f5473a11e8a6ef997989e3a212" +checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" dependencies = [ - "cfg-if 0.1.10", + "cpuid-bool 0.2.0", + "opaque-debug 0.3.0", "universal-hash", ] [[package]] name = "ppv-lite86" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "proc-macro2" @@ -1512,15 +1593,12 @@ dependencies = [ [[package]] name = "publicsuffix" -version = "1.5.4" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" +checksum = "95b4ce31ff0a27d93c8de1849cf58162283752f065a90d508f1105fa6c9a213f" dependencies = [ - "error-chain", - "idna 0.2.0", - "lazy_static", - "regex", - "url 2.1.1", + "idna 0.2.2", + "url 2.2.1", ] [[package]] @@ -1566,13 +1644,25 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.16", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc 0.2.0", ] +[[package]] +name = "rand" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +dependencies = [ + "libc", + "rand_chacha 0.3.0", + "rand_core 0.6.2", + "rand_hc 0.3.0", +] + [[package]] name = "rand_chacha" version = "0.1.1" @@ -1593,6 +1683,16 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.2", +] + [[package]] name = "rand_core" version = "0.3.1" @@ -1614,7 +1714,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom 0.2.2", ] [[package]] @@ -1635,6 +1744,15 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_hc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +dependencies = [ + "rand_core 0.6.2", +] + [[package]] name = "rand_isaac" version = "0.1.1" @@ -1692,11 +1810,13 @@ dependencies = [ name = "rask-engine" version = "0.2.0" dependencies = [ + "hibitset", "image", "lazy_static", - "log 0.4.11", + "log 0.4.14", "ouroboros", "rayon", + "shrev", "specs", "specs-hierarchy", "spin", @@ -1710,7 +1830,7 @@ dependencies = [ "clap", "colored", "fern", - "log 0.4.11", + "log 0.4.14", "rask-engine", "reqwest", "serde", @@ -1723,7 +1843,7 @@ version = "0.1.0" dependencies = [ "lazy_static", "linked_list_allocator", - "log 0.4.11", + "log 0.4.14", "nobg-web_worker", "rask-engine", "rayon", @@ -1753,7 +1873,7 @@ checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ "crossbeam-channel", "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.0", + "crossbeam-utils 0.8.3", "lazy_static", "num_cpus", ] @@ -1779,23 +1899,31 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +[[package]] +name = "redox_syscall" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +dependencies = [ + "bitflags", +] + [[package]] name = "regex" -version = "1.4.1" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" dependencies = [ "aho-corasick", "memchr", "regex-syntax", - "thread_local", ] [[package]] name = "regex-syntax" -version = "0.6.20" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c" +checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" [[package]] name = "remove_dir_all" @@ -1820,9 +1948,9 @@ dependencies = [ "flate2", "futures", "http", - "hyper 0.12.35", + "hyper 0.12.36", "hyper-tls", - "log 0.4.11", + "log 0.4.14", "mime 0.3.16", "mime_guess", "native-tls", @@ -1842,13 +1970,13 @@ dependencies = [ [[package]] name = "rocket" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6130967b369cfb8411b0b73e96fcba1229c32a9cc6f295d144f879bfced13c6e" +checksum = "7febfdfd4d43facfc7daba20349ebe2c310c6735bd6a2a9255ea8bc425b4cb13" dependencies = [ "atty", "base64 0.12.3", - "log 0.4.11", + "log 0.4.14", "memchr", "num_cpus", "pear", @@ -1857,32 +1985,32 @@ dependencies = [ "state", "time", "toml", - "version_check 0.9.2", + "version_check 0.9.3", "yansi", ] [[package]] name = "rocket_codegen" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb852e6da168fb948a8f2b798ba2e2f0e4fc860eae0efa9cf2bf0f5466bb0425" +checksum = "ceac2c55b2c8b1cdc53add64332defa5fc227f64263b86b4114d1386286d42a3" dependencies = [ "devise", "glob", "indexmap", "quote 0.6.13", "rocket_http", - "version_check 0.9.2", + "version_check 0.9.3", "yansi", ] [[package]] name = "rocket_contrib" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3946ca815127041d8f64455561031d058c22ae1b135251502c5ea523cf9e14b" +checksum = "d7954a707f9ca18aa74ca8c1f5d1f900f52a4dceb68e96e3112143f759cfd20e" dependencies = [ - "log 0.4.11", + "log 0.4.14", "notify", "rocket", "serde", @@ -1891,16 +2019,16 @@ dependencies = [ [[package]] name = "rocket_http" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aff5a5480175f2f553a876b251e9350c74196128806d176da3a51c82aab5428" +checksum = "ce364100ed7a1bf39257b69ebd014c1d5b4979b0d365d8c9ab0aa9c79645493d" dependencies = [ - "cookie 0.11.3", + "cookie 0.11.4", "hyper 0.10.16", "indexmap", "pear", "percent-encoding 1.0.1", - "smallvec 1.4.2", + "smallvec 1.6.1", "state", "time", "unicode-xid 0.1.0", @@ -1966,9 +2094,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" -version = "0.4.4" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" +checksum = "d493c5f39e02dfb062cd8f33301f90f9b13b650e8c1b1d0fd75c19dd64bff69d" dependencies = [ "bitflags", "core-foundation", @@ -1979,9 +2107,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "0.4.3" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" +checksum = "dee48cdde5ed250b0d3252818f646e174ab414036edb884dde62d80a3ac6082d" dependencies = [ "core-foundation-sys", "libc", @@ -2004,18 +2132,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.117" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" +checksum = "bd761ff957cb2a45fbb9ab3da6512de9de55872866160b23c25f1a841e99d29f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.117" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.9", @@ -2024,9 +2152,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.59" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" dependencies = [ "itoa", "ryu", @@ -2051,22 +2179,23 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.7.3", + "digest 0.8.1", "fake-simd", - "opaque-debug", + "opaque-debug 0.2.3", ] [[package]] name = "sha2" -version = "0.8.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "opaque-debug", + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpuid-bool 0.1.2", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -2080,7 +2209,7 @@ dependencies = [ "mopa", "rayon", "shred-derive", - "smallvec 1.4.2", + "smallvec 1.6.1", "tynm", ] @@ -2109,18 +2238,18 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" dependencies = [ "maybe-uninit", ] [[package]] name = "smallvec" -version = "1.4.2" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "specs" @@ -2131,7 +2260,7 @@ dependencies = [ "crossbeam-queue", "hashbrown 0.7.2", "hibitset", - "log 0.4.11", + "log 0.4.14", "rayon", "shred", "shrev", @@ -2216,15 +2345,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "subtle" -version = "1.0.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" - -[[package]] -name = "subtle" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd" +checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" @@ -2262,14 +2385,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "rand 0.7.3", - "redox_syscall", + "rand 0.8.3", + "redox_syscall 0.2.5", "remove_dir_all", "winapi 0.3.9", ] @@ -2284,30 +2407,29 @@ dependencies = [ ] [[package]] -name = "thread_local" -version = "1.0.1" +name = "time" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ - "lazy_static", + "libc", + "winapi 0.3.9", ] [[package]] -name = "time" -version = "0.1.44" +name = "tinyvec" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", + "tinyvec_macros", ] [[package]] -name = "tinyvec" -version = "0.3.4" +name = "tinyvec_macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" @@ -2367,7 +2489,7 @@ checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes", "futures", - "log 0.4.11", + "log 0.4.14", ] [[package]] @@ -2379,7 +2501,7 @@ dependencies = [ "crossbeam-utils 0.7.2", "futures", "lazy_static", - "log 0.4.11", + "log 0.4.14", "mio", "num_cpus", "parking_lot", @@ -2424,7 +2546,7 @@ dependencies = [ "crossbeam-utils 0.7.2", "futures", "lazy_static", - "log 0.4.11", + "log 0.4.14", "num_cpus", "slab", "tokio-executor", @@ -2495,9 +2617,9 @@ checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" [[package]] name = "typenum" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" [[package]] name = "unicase" @@ -2514,7 +2636,7 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ - "version_check 0.9.2", + "version_check 0.9.3", ] [[package]] @@ -2528,9 +2650,9 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.13" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" dependencies = [ "tinyvec", ] @@ -2555,12 +2677,12 @@ checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "universal-hash" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0c900f2f9b4116803415878ff48b63da9edb268668e08cf9292d7503114a01" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ - "generic-array", - "subtle 2.3.0", + "generic-array 0.14.4", + "subtle", ] [[package]] @@ -2576,11 +2698,12 @@ dependencies = [ [[package]] name = "url" -version = "2.1.1" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" dependencies = [ - "idna 0.2.0", + "form_urlencoded", + "idna 0.2.2", "matches", "percent-encoding 2.1.0", ] @@ -2596,9 +2719,9 @@ dependencies = [ [[package]] name = "vcpkg" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" +checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" [[package]] name = "vec_map" @@ -2614,9 +2737,9 @@ checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "walkdir" @@ -2636,7 +2759,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" dependencies = [ "futures", - "log 0.4.11", + "log 0.4.14", "try-lock", ] @@ -2648,9 +2771,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-sync" @@ -2722,14 +2845,14 @@ dependencies = [ "byteorder", "bytes", "httparse", - "log 0.4.11", + "log 0.4.14", "mio", "mio-extras", "openssl", "rand 0.7.3", "sha-1", "slab", - "url 2.1.1", + "url 2.2.1", ] [[package]] @@ -2753,9 +2876,3 @@ name = "yansi" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" - -[[package]] -name = "zeroize" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f33972566adbd2d3588b0491eb94b98b43695c4ef897903470ede4f3f5a28a" diff --git a/rask-engine/Cargo.toml b/rask-engine/Cargo.toml index eb1cb8d0..345722c7 100644 --- a/rask-engine/Cargo.toml +++ b/rask-engine/Cargo.toml @@ -29,3 +29,5 @@ lazy_static = "1.4.0" ouroboros = "0.5" specs-hierarchy = "0.6" spin = {version = "0.5", optional = false} +shrev = "1.1" +hibitset = "0.6" diff --git a/rask-engine/src/boxes.rs b/rask-engine/src/boxes.rs index 4b459794..a0bc96a1 100644 --- a/rask-engine/src/boxes.rs +++ b/rask-engine/src/boxes.rs @@ -3,7 +3,7 @@ use core::ops; -use crate::math::Vec2; +use crate::math::{Mat2, Mat3, Vec2, Vec3}; /// An axis-aligned box. #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -156,3 +156,12 @@ impl From<&spine::skeleton::srt::SRT> for RBox { RBox { pos, v1, v2 } } } + +impl From<&Mat3> for RBox { + fn from(mat: &Mat3) -> RBox { + let pos = (*mat * Vec3::new(-1.0, -1.0, 1.0)).into(); + let v1 = (*mat * Vec3::new(0.0, 2.0, 0.0)).into(); + let v2 = (*mat * Vec3::new(2.0, 0.0, 0.0)).into(); + RBox { pos, v1, v2 } + } +} diff --git a/rask-engine/src/collide.rs b/rask-engine/src/collide.rs index f980f346..2b18f7d2 100644 --- a/rask-engine/src/collide.rs +++ b/rask-engine/src/collide.rs @@ -9,12 +9,14 @@ use crate::math::{Vec2, EPSILON}; /// A trait for objects that can collide with other objects. pub trait Collide { /// calculate the penetration depth (a scalar ratio of `dv`) + /// as well as the normal of the colliding edge /// of the collision after applying the velocity, /// if there was any. /// `dv` is the difference between the two velocities fn collide_after(&self, other: &Rhs, dv: Vec2) -> Option; } +#[derive(Debug, Clone)] pub enum Collidable { Point(Vec2), AABox(AABox), @@ -37,6 +39,23 @@ impl Collide for Collidable { } } +impl Collidable { + pub fn shift(&mut self, dv: Vec2) { + *self = match self { + Collidable::AABox(a) => Collidable::AABox(AABox { + pos: a.pos + dv, + size: a.size, + }), + Collidable::RBox(r) => Collidable::RBox(RBox { + pos: r.pos + dv, + v1: r.v1, + v2: r.v2, + }), + Collidable::Point(p) => Collidable::Point(*p + dv), + } + } +} + // Given a fraction of the dv vectors length, // return the amount to set the objects back // in case of a collision @@ -60,6 +79,26 @@ macro_rules! impl_collide { Self::$C(other) } } + + impl Collide<$A> for Collidable { + fn collide_after(&self, other: &$A, dv: Vec2) -> Option { + match self { + Collidable::Point(s) => s.collide_after(other, dv), + Collidable::AABox(s) => s.collide_after(other, dv), + Collidable::RBox(s) => s.collide_after(other, dv), + } + } + } + + impl Collide for $A { + fn collide_after(&self, other: &Collidable, dv: Vec2) -> Option { + match other { + Collidable::Point(s) => self.collide_after(s, dv), + Collidable::AABox(s) => self.collide_after(s, dv), + Collidable::RBox(s) => self.collide_after(s, dv), + } + } + } }; (for {$A:ident, $B:ident} $item:item) => { impl Collide<$B> for $A { diff --git a/rask-engine/src/engine/components.rs b/rask-engine/src/engine/components.rs index 07353fdc..022dacf1 100644 --- a/rask-engine/src/engine/components.rs +++ b/rask-engine/src/engine/components.rs @@ -1,11 +1,13 @@ +use crate::collide::Collidable; use crate::io; -use crate::math::Vec2; +use crate::math::{Mat3, Vec2}; use crate::resources::{ self, registry::{CharacterInfo, ResourceInfo}, }; use specs::{prelude::*, Component}; -use specs_hierarchy::Parent as PParent; +use specs_hierarchy::{Hierarchy, Parent as PParent}; +use std::collections::HashMap; #[derive(Debug, Default)] pub struct Gravitation(pub Vec2); @@ -42,11 +44,15 @@ impl PParent for Parent { } } -#[derive(Debug, Clone, Copy, Component)] +#[derive(Debug, Clone, Copy, Default, Component)] #[storage(VecStorage)] pub struct Vel(pub Vec2); -#[derive(Debug, Clone, Copy, Component)] +#[derive(Debug, Clone, Copy, Default, Component)] +#[storage(VecStorage)] +pub struct DeltaVel(pub Vec2); + +#[derive(Debug, Clone, Copy, Default, Component)] #[storage(VecStorage)] pub struct Pos(pub Vec2); @@ -55,12 +61,58 @@ pub struct Pos(pub Vec2); pub struct Speed(pub f32); #[derive(Debug, Clone, Component)] -#[storage(DenseVecStorage)] +pub struct Health { + pub value: u32, + pub max_value: u32, +} + +#[derive(Debug, Clone, Component)] +pub struct Damaging { + pub damage: f32, +} + +#[derive(Debug, Clone, Component)] +pub struct Vulnerable { + pub armor: f32, +} + +#[derive(Debug, Default, Clone, Component)] +#[storage(NullStorage)] +pub struct Terrain; + +#[derive(Debug, Clone)] +pub struct SubCollider { + pub collider: Collidable, +} + +impl Component for SubCollider { + type Storage = FlaggedStorage>; +} + +#[derive(Debug, Clone)] +pub enum HitboxType { + Damaging, + Vulnerable, + Repulsion, +} + +#[derive(Debug, Clone, Component)] +pub struct Collider { + pub mapping: HashMap, + pub default: HitboxType, +} + +#[derive(Debug, Clone)] pub struct Animation { pub id: u32, pub animation: String, pub start: f32, } + +impl Component for Animation { + type Storage = FlaggedStorage>; +} + #[derive(Debug, Clone, Component)] #[storage(VecStorage)] pub struct Scale(pub Vec2); @@ -69,11 +121,20 @@ pub struct Scale(pub Vec2); #[storage(VecStorage)] pub struct Sprite { pub id: u32, + pub sub_id: u64, +} + +#[derive(Debug, Default, Clone, Component)] +pub struct Transform(pub Mat3); + +impl Transform { + pub fn shift(&mut self, vec: Vec2) { + self.0 = Mat3::translation(vec.x(), vec.y()) * self.0 + } } #[derive(Debug, Default, Clone, Copy, Component)] -#[storage(NullStorage)] -pub struct Static; +pub struct Mass(pub f32); #[derive(Debug, Default, Clone, Copy, Component)] #[storage(NullStorage)] diff --git a/rask-engine/src/engine/mod.rs b/rask-engine/src/engine/mod.rs index 134efb8e..6a4bb027 100644 --- a/rask-engine/src/engine/mod.rs +++ b/rask-engine/src/engine/mod.rs @@ -6,6 +6,7 @@ use core::time::Duration; use specs::prelude::*; use specs::WorldExt; use specs_hierarchy::{Hierarchy, HierarchySystem}; +use std::collections::HashMap; mod components; mod systems; @@ -56,32 +57,87 @@ impl GameEngine for RaskEngine { .with(UpdateAnimationSystem, "update_anim", &["check_present"]) .with(MovementSystem, "movement", &["events"]) .with(GravitationSystem, "gravitation", &["movement"]) - .with(VelocitySystem, "velocity", &["gravitation"]) + .with(UpdateAnimationSystem, "update_anim", &["movement"]) + .with( + SimpleVelocitySystem, + "simple_velocity", + &["gravitation", "update_anim"], + ) + .with(VelocitySystem, "velocity", &["gravitation", "update_anim"]) .with_thread_local(RenderSystem) .build(); tick_dispatcher.setup(&mut world); - let _backround = world + + let _background = world .create_entity() .with(Pos(Vec2::new(0.0, 0.0))) .with(Sprite { id: registry::EMPTY.id, + sub_id: 0, + }) + .with(Terrain) + .with(Collider { + mapping: HashMap::new(), + default: HitboxType::Repulsion, }) .with(Scale(Vec2::new(1.0, 1.0))) - .with(Static) + .build(); + let _ground = world + .create_entity() + .with(Pos(Vec2::new(-2.0, -1.0))) + .with(Scale(Vec2::new(6.0, 0.15))) + .with(Sprite { + id: registry::EMPTY.id, + sub_id: 0, + }) + .with(SubCollider { + collider: crate::boxes::AABox { + pos: Vec2::new(-2.0, -1.0), + size: Vec2::new(6.0, 0.15), + } + .into(), + }) + .with(Parent { + entity: _background, + }) + .build(); + let _ground = world + .create_entity() + .with(Sprite { + id: registry::EMPTY.id, + sub_id: 0, + }) + .with(Pos(Vec2::new(1.0, -1.0))) + .with(Scale(Vec2::new(1.0, 0.5))) + .with(SubCollider { + collider: crate::boxes::AABox { + pos: Vec2::new(0.0, -1.0), + size: Vec2::new(2.0, 0.5), + } + .into(), + }) + .with(Parent { + entity: _background, + }) .build(); let _char = world .create_entity() - .with(Pos(Vec2::new(0.0, -0.8))) + .with(Pos(Vec2::new(0.3, 0.0))) .with(Vel(Vec2::new(0.0, 0.0))) - .with(Speed(0.2)) + .with(DeltaVel(Vec2::zero())) + .with(Speed(0.4)) + .with(Mass(1.0)) .with(Animation { id: registry::CHAR.id, animation: "walking".to_string(), start: 0.0, }) + .with(Collider { + mapping: HashMap::new(), + default: HitboxType::Vulnerable, + }) .with(Scale(Vec2::new(1.0, 1.0))) - .with(Static) .build(); Self { world, diff --git a/rask-engine/src/engine/systems.rs b/rask-engine/src/engine/systems.rs index 0e60c0fd..4f696d53 100644 --- a/rask-engine/src/engine/systems.rs +++ b/rask-engine/src/engine/systems.rs @@ -1,17 +1,22 @@ use super::components::*; +use crate::boxes::{AABox, RBox}; +use crate::collide::{Collidable, Collide}; use crate::events::{Event, Key, Keyboard}; use crate::io; use crate::math::{Mat3, Vec2}; use crate::resources::{self, registry, GetStore}; use crate::EngineError; +use specs::join::JoinIter; use specs::prelude::*; +use specs_hierarchy::Hierarchy; lazy_static::lazy_static! { pub static ref KEYBOARD: Keyboard = Keyboard::new(); } pub struct EventSystem; +pub struct SimpleVelocitySystem; pub struct VelocitySystem; pub struct GravitationSystem; pub struct RenderSystem; @@ -19,31 +24,112 @@ pub struct MovementSystem; pub struct CheckPresentSystem; pub struct UpdateAnimationSystem; -impl<'a> System<'a> for VelocitySystem { +impl<'a> System<'a> for SimpleVelocitySystem { type SystemData = ( WriteStorage<'a, Pos>, ReadStorage<'a, Vel>, + ReadStorage<'a, Mass>, Read<'a, DeltaTime>, ); - fn run(&mut self, (mut pos, vel, dt): Self::SystemData) { - for (vel, pos) in (&vel, &mut pos).join() { + fn run(&mut self, (mut pos, vel, mass, dt): Self::SystemData) { + for (vel, pos, _) in (&vel, &mut pos, !&mass).join() { pos.0 += vel.0 * dt.0.as_secs_f32(); } } } +impl<'a> System<'a> for VelocitySystem { + type SystemData = ( + WriteStorage<'a, Pos>, + WriteStorage<'a, Vel>, + ReadStorage<'a, DeltaVel>, + ReadStorage<'a, Mass>, + ReadStorage<'a, Collider>, + WriteStorage<'a, Transform>, + WriteStorage<'a, SubCollider>, + ReadStorage<'a, Terrain>, + Entities<'a>, + ReadExpect<'a, Hierarchy>, + Read<'a, DeltaTime>, + ); + + #[rustfmt::skip] + fn run( + &mut self, + (mut pos, mut vel, delta_vel, mass, collider, mut transform, mut sub, terrain, entities, hierarchy, dt): Self::SystemData, + ) { + let reset_values: Vec<_> = (&collider, &pos, &vel, (&delta_vel).maybe(), !&terrain, &pos, &mass, &entities) + .par_join() + .map(|(_col1, _, vel, delta_vel, _, _pos1, _mass, entity1)| { + let mut percent = -1.0; + let mut ids = (entity1.id(), 0); + let v_ = delta_vel.map(|x| x.0).unwrap_or_default(); + let v = (vel.0 + v_) * dt.0.as_secs_f32(); + for (_, _, _pos2, entity2) in (&collider, &terrain, &pos, &entities).join() { + for e1 in hierarchy.children(entity1) { + for e2 in hierarchy.children(entity2) { + if let ( + Some(SubCollider { collider: c1 }), + Some(SubCollider { collider: c2 }), + ) = (sub.get(*e1), sub.get(*e2)) + { + if let Some(move_out) = c1.collide_after(c2, v) { + /*if move_out == 1.0 { + log::debug!("move out 1.0 -> {:?}", (c1, c2, v)); + }*/ + if move_out > percent { + percent = move_out; + ids = (entity1.id(), entity2.id()); + } + } + } + } + } + } + if percent == -1.0 { + (ids.0, core::u32::MAX, v) + } else { + (ids.0, ids.1, v * (1.0 - percent - 0.01)) + } + }) + .collect(); + for (e1, e2, rv) in reset_values { + let e1 = entities.entity(e1); + if let Some(pos) = pos.get_mut(e1) { + //log::debug!("!!!!!!! pos {:?}\n^^^^^^ dv {:?}", pos.0, rv); + pos.0 += rv; + if let Some(vel) = vel.get_mut(e1) { + if e2 != core::u32::MAX { + vel.0 = Vec2::zero(); + } + } + for e in hierarchy.children(e1) { + if let Some(trans) = transform.get_mut(*e) { + trans.shift(rv); + } + if let Some(sub) = sub.get_mut(*e) { + sub.collider.shift(rv); + } + } + } + } + } +} + impl<'a> System<'a> for GravitationSystem { type SystemData = ( WriteStorage<'a, Vel>, - ReadStorage<'a, Static>, + ReadStorage<'a, Mass>, + ReadStorage<'a, Present>, // TODO: Remove as it is only used for debugging Read<'a, Gravitation>, Read<'a, DeltaTime>, ); - fn run(&mut self, (mut vel, is_static, g, dt): Self::SystemData) { - for (vel, ()) in (&mut vel, !&is_static).join() { - vel.0 += g.0 * dt.0.as_secs_f32(); + fn run(&mut self, (mut vel, mass, present, g, dt): Self::SystemData) { + let dt = dt.0.as_secs_f32(); + for (vel, _, _) in (&mut vel, &mass, &present).join() { + vel.0 += g.0 * 0.1 * dt; } } } @@ -51,13 +137,61 @@ impl<'a> System<'a> for GravitationSystem { impl<'a> System<'a> for UpdateAnimationSystem { type SystemData = ( WriteStorage<'a, Animation>, + WriteStorage<'a, Sprite>, + WriteStorage<'a, Transform>, + ReadStorage<'a, Collider>, + ReadStorage<'a, Terrain>, + WriteStorage<'a, SubCollider>, + WriteStorage<'a, Vulnerable>, + WriteStorage<'a, Damaging>, + WriteStorage<'a, Parent>, ReadStorage<'a, Present>, + ReadStorage<'a, Scale>, + WriteStorage<'a, Pos>, + WriteStorage<'a, Vel>, + WriteStorage<'a, DeltaVel>, + Entities<'a>, + ReadExpect<'a, Hierarchy>, Read<'a, ElapsedTime>, + Read<'a, DeltaTime>, ); - fn run(&mut self, (mut animations, present, elapsed): Self::SystemData) { + fn run( + &mut self, + ( + mut animations, + mut sprite, + mut transform, + colliders, + terrain, + mut sub, + mut vul, + mut dmg, + mut parent, + present, + scale, + mut pos, + mut vel, + mut delta_vel, + entities, + hierarchy, + elapsed, + dt, + ): Self::SystemData, + ) { let res = &mut *resources::RESOURCE_TABLE.write(); - for (mut animation, _) in (&mut animations, &present).join() { + for (mut animation, collider, scale, pos, vel, mut delta_vel, entity, _) in ( + &mut animations, + &colliders, + &scale, + &mut pos, + &mut vel, + &mut delta_vel, + &entities, + &present, + ) + .join() + { let cha: Result<&mut Box, EngineError> = res.get_mut(animation.id as usize); if let Ok(cha) = cha { @@ -71,6 +205,236 @@ impl<'a> System<'a> for UpdateAnimationSystem { .unwrap(); animation.start = elapsed.0.as_secs_f32(); } + + let sprites = cha + .interpolate(elapsed.0.as_secs_f32() - animation.start) + .unwrap(); + let trans_scale = Mat3::translation(pos.0.x(), pos.0.y()) + * Mat3::scaling(scale.0.x(), scale.0.y()); + let ci = hierarchy.children(entity); + let mut ci: Vec<_> = ci.to_vec(); + ci.sort_unstable_by_key(|x| x.id()); //TODO we might be able to remove this + let dv = vel.0; + #[derive(Debug, Clone)] + struct Side { + old: Vec2, + new: Vec2, + is_x: bool, + is_positive: bool, + inited: bool, + old_bound: Vec2, + } + impl Side { + fn new(is_x: bool, is_positive: bool) -> Self { + let n = if is_positive { + f32::NEG_INFINITY + } else { + f32::INFINITY + }; + Self { + old: Vec2::new(n, n), + old_bound: Vec2::new(n, n), + new: Vec2::new(n, n), + is_x, + is_positive, + inited: false, + } + } + fn ic(&self, v: f32) -> Vec2 { + if self.is_x { + Vec2::new(v, 0.0) + } else { + Vec2::new(0.0, v) + } + } + fn c(&self, vec: &Vec2) -> f32 { + if self.is_x { + vec.x() + } else { + vec.y() + } + } + fn c_mut<'a>(&self, vec: &'a mut Vec2) -> &'a mut f32 { + if self.is_x { + vec.x_mut() + } else { + vec.y_mut() + } + } + fn cmp_fl(&self, a: f32, b: f32) -> bool { + if self.is_positive { + a > b + } else { + a < b + } + } + fn cmp(&self, a: &Vec2, b: &Vec2) -> bool { + self.cmp_fl(self.c(a), self.c(b)) + } + fn bound_of_rbox(&self, rbox: &RBox) -> Vec2 { + let [a, b, c, d] = [ + rbox.pos, + rbox.pos + rbox.v1, + rbox.pos + rbox.v2, + rbox.pos + rbox.v1 + rbox.v2, + ]; + if self.cmp(&a, &b) { + if self.cmp(&a, &c) { + if self.cmp(&a, &d) { + a + } else { + d + } + } else { + if self.cmp(&c, &d) { + c + } else { + d + } + } + } else { + if self.cmp(&b, &c) { + if self.cmp(&b, &d) { + b + } else { + d + } + } else { + if self.cmp(&c, &d) { + c + } else { + d + } + } + } + } + fn bound_of(&self, col: &Collidable) -> Vec2 { + match col { + &Collidable::Point(v) => v, + &Collidable::AABox(AABox { pos, size }) => { + if self.is_positive { + pos + size + } else { + pos + } + } + Collidable::RBox(rbox) => self.bound_of_rbox(rbox), + } + } + fn update(&mut self, old: &Collidable, new: &Collidable) { + let (old, new) = (self.bound_of(old), self.bound_of(new)); + if self.cmp(&new, &self.new) { + self.new = new; + self.old = old; + self.inited = true; + } + if self.cmp(&old, &self.old_bound) { + self.old_bound = old + } + } + } + let mut xside = Side::new(true, dv.x() > 0.0); + let mut yside = Side::new(false, dv.y() > 0.0); + let mut ci = ci.iter(); + for (i, s) in sprites.enumerate() { + let s = s.unwrap(); + let mat = trans_scale * s.transform; + let (new_sprite, new_sub) = ( + Sprite { + id: animation.id, + sub_id: s.att_id, + }, + SubCollider { + collider: Collidable::RBox(RBox::from(&mat)), + }, + ); + if let Some(c) = ci.next().cloned() { + if let Some((sprite, transform, sub)) = JoinIter::get( + &mut (&mut sprite, &mut transform, &mut sub).join(), + c, + &entities, + ) { + xside.update(&sub.collider, &new_sub.collider); + yside.update(&sub.collider, &new_sub.collider); + *transform = Transform(mat); + *sprite = new_sprite; + *sub = new_sub; + } + } else { + let e = entities.create(); + entities + .build_entity() + .with(Transform(s.transform), &mut transform) + .with(new_sub, &mut sub) + .with(new_sprite, &mut sprite) + .with(Parent { entity }, &mut parent) + .build(); + + match collider.mapping.get(&(i as u32)) { + Some(HitboxType::Damaging) => { + dmg.insert(e, Damaging { damage: 0.0 }).unwrap(); + } + Some(HitboxType::Vulnerable) => { + vul.insert(e, Vulnerable { armor: 0.0 }).unwrap(); + } + _ => (), + } + } + } + + if xside.inited && yside.inited { + let mut delta_p = Vec2::zero(); + use core::iter::once; + for side in once(xside).chain(once(yside)) { + if side.c(&side.old_bound) == side.c(&side.new) { + continue; + } + let d = side.c(&side.new) - side.c(&side.old_bound); + *side.c_mut(&mut delta_vel.0) += d; + if !side.cmp_fl(d, 0.0) { + continue; + } + /*if !side.is_x { + log::debug!("{:?}", side); + }*/ + let mut v = Vec2::zero(); + *side.c_mut(&mut v) = d; + 's: for (_, ent, _) in (&colliders, &entities, &terrain).join() { + for &col in hierarchy.children(ent) { + if let Some(col) = sub.get(col) { + if let Some(p) = + side.old.collide_after(&col.collider, side.new - side.old) + { + let v = + side.ic(p * (side.c(&side.new) - side.c(&side.old))); + log::debug!( + "{:?}\n{:?}\n{:?}\n=> {:?}", + side, + side.new - side.old, + col.collider, + v, + ); + delta_p -= 1.1 * v; + break 's; + } + } + } + } + } + + if delta_p != Vec2::zero() { + pos.0 += delta_p; + for e in hierarchy.children(entity) { + if let Some(trans) = transform.get_mut(*e) { + trans.shift(delta_p); + } + if let Some(sub) = sub.get_mut(*e) { + log::debug!("zup {:?}\n{:?}", sub.collider, delta_p); + sub.collider.shift(delta_p); + } + } + } + } } } } @@ -80,46 +444,31 @@ impl<'a> System<'a> for RenderSystem { type SystemData = ( ReadStorage<'a, Pos>, ReadStorage<'a, Sprite>, - ReadStorage<'a, Animation>, ReadStorage<'a, Scale>, ReadStorage<'a, Present>, - Read<'a, ElapsedTime>, + ReadStorage<'a, Transform>, Write<'a, SystemApi>, Write<'a, TextureIds>, ); fn run( &mut self, - (pos, sprite, anim, scale, present, elapsed, mut sys, mut tex_ids): Self::SystemData, + (pos, sprite, scale, present, transform, mut sys, mut tex_ids): Self::SystemData, ) { let mut sprites = Vec::new(); for (pos, sprite, scale, _) in (&pos, &sprite, &scale, &present).join() { sprites.push(resources::Sprite::new( Mat3::translation(pos.0.x(), pos.0.y()) * Mat3::scaling(scale.0.x(), scale.0.y()), sprite.id, - 0, + sprite.sub_id, )) } - let res = &*resources::RESOURCE_TABLE.read(); - for (pos, anim, scale, _) in (&pos, &anim, &scale, &present).join() { - let cha: Result<&Box, EngineError> = res.get(anim.id as usize); - if let Ok(cha) = cha { - let trans = Mat3::translation(pos.0.x(), pos.0.y()); - let scale = Mat3::scaling(scale.0.x(), scale.0.y()); - - match cha.interpolate(elapsed.0.as_secs_f32() - anim.start) { - Ok(sps) => { - for sp in sps.flatten() { - sprites.push(resources::Sprite::new( - trans * scale * sp.transform, - anim.id, - sp.att_id, - )) - } - } - Err(e) => log::error!("{}", e), - } - } + for (sprite, transform, _) in (&sprite, &transform, &present).join() { + sprites.push(resources::Sprite::new( + transform.0, + sprite.id, + sprite.sub_id, + )) } let mut dirty = false; for sp in &sprites { @@ -146,15 +495,15 @@ impl<'a> System<'a> for MovementSystem { fn run(&mut self, (mut anim, mut vel, mut scale, speed): Self::SystemData) { for (anim, vel, scale, speed) in (&mut anim, &mut vel, &mut scale, &speed).join() { anim.animation = if KEYBOARD.get(Key::ARROW_RIGHT) { - scale.0 = Vec2::new(1.0, scale.0.y()); - vel.0 = Vec2::new(speed.0, 0.0); + scale.0 = Vec2::new(scale.0.x().abs(), scale.0.y()); + *vel.0.x_mut() = speed.0; "walking".to_owned() } else if KEYBOARD.get(Key::ARROW_LEFT) { - scale.0 = Vec2::new(-1.0, scale.0.y()); - vel.0 = Vec2::new(-speed.0, 0.0); + scale.0 = Vec2::new(-scale.0.y().abs(), scale.0.y()); + *vel.0.x_mut() = -speed.0; "walking".to_owned() } else { - vel.0 = Vec2::new(0.0, 0.0); + *vel.0.x_mut() = 0.0; "standing".to_owned() }; } diff --git a/rask-engine/src/math/mat2.rs b/rask-engine/src/math/mat2.rs index 7a0c0055..9b72b055 100644 --- a/rask-engine/src/math/mat2.rs +++ b/rask-engine/src/math/mat2.rs @@ -1,7 +1,7 @@ use core::convert; use core::ops; -use crate::math::{Vec2, EPSILON}; +use crate::math::{Mat3, Vec2, EPSILON}; /// A 2x2 matrix with `f32` elements. #[derive(Clone, Copy, Debug, Default)] @@ -191,3 +191,10 @@ impl convert::AsRef<[f32; 4]> for Mat2 { &self.data } } + +impl From<&Mat3> for Mat2 { + fn from(mat: &Mat3) -> Self { + let mat = mat.as_ref(); + Self::new(mat[0], mat[1], mat[3], mat[4]) + } +} diff --git a/rask-engine/src/math/vec2.rs b/rask-engine/src/math/vec2.rs index 0d0cfbc7..e552d553 100644 --- a/rask-engine/src/math/vec2.rs +++ b/rask-engine/src/math/vec2.rs @@ -1,7 +1,7 @@ use core::iter::{once, Chain, Once}; use core::ops; -use crate::math::EPSILON; +use crate::math::{Vec3, EPSILON}; /// A 2-dimensional euclidean vector with `f32` elements. #[derive(Clone, Copy, Debug, Default)] @@ -144,6 +144,12 @@ impl From for [f32; 2] { } } +impl From for Vec2 { + fn from(vec: Vec3) -> Self { + Vec2::new(vec.x(), vec.y()) + } +} + pub type IntoIter = Chain, Once>; impl IntoIterator for Vec2 { @@ -176,6 +182,16 @@ impl Vec2 { self.y } + /// Returns a mutable reference to the x coordinate. + pub fn x_mut(&mut self) -> &mut f32 { + &mut self.x + } + + /// Returns a mutable reference to the y coordinate. + pub fn y_mut(&mut self) -> &mut f32 { + &mut self.y + } + /// Returns the dot product. pub fn dot(self, other: Self) -> f32 { self.x * other.x + self.y * other.y diff --git a/rask-engine/src/resources/registry.rs b/rask-engine/src/resources/registry.rs index dff41d9d..95456f8a 100644 --- a/rask-engine/src/resources/registry.rs +++ b/rask-engine/src/resources/registry.rs @@ -37,10 +37,15 @@ resources! { (THIEF, Texture, "thief.png" ), (SOUND, Sound, "theme_song.mp3" ), (CHAR, Character, Character { + texture: "Thief/Square.png", + atlas: "Thief/Square.atlas", + animation: "Thief/Square.json" + } ) + /*(CHAR2, Character, Character { texture: "Thief/Thief.png", atlas: "Thief/Thief.atlas", animation: "Thief/Thief.json" - } ) + } )*/ } trait ResourceId { diff --git a/res/Thief/Square.atlas b/res/Thief/Square.atlas new file mode 100644 index 00000000..729196b5 --- /dev/null +++ b/res/Thief/Square.atlas @@ -0,0 +1,13 @@ + +Square.png +size: 4,4 +format: RGBA8888 +filter: Linear,Linear +repeat: none +Square + rotate: false + xy: 1, 1 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 diff --git a/res/Thief/Square.json b/res/Thief/Square.json new file mode 100644 index 00000000..d60600ef --- /dev/null +++ b/res/Thief/Square.json @@ -0,0 +1,58 @@ +{ + "skeleton": { + "width": 1, + "height": 1, + "fps": 24, + "hash": " ", + "name": "Armature" + }, + "bones": [{ "name": "root" }], + "slots": [ + { + "name": "Square", + "bone": "root", + "attachment": "Square" + } + ], + "skins": { + "default": { + "Square": { + "Square": { + "name": "Square", + "width": 1, + "height": 1, + "scaleX": 160, + "scaleY": 160 + } + } + } + }, + "animations": { + "walking": { + "bones": { + "root": { + "rotate": [ + {"time": 0, "angle": 0}, + {"time": 0.25, "angle": -45}, + {"time": 0.5, "angle": 0} + ], + "shear": [ + {"time": 0}, + {"time": 0.25}, + {"time": 0.5} + ] + } + } + }, + "standing": { + "bones": { + "root": { + "scale": [ + {"time": 0, "x": 1, "y": 1}, + {"time": 0.25, "x": 1.5, "y": 1} + ] + } + } + } + } +} diff --git a/res/Thief/Square.png b/res/Thief/Square.png new file mode 100644 index 00000000..c14f2f7c Binary files /dev/null and b/res/Thief/Square.png differ