aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-10-13 14:59:55 +0200
committermetamuffin <metamuffin@disroot.org>2022-10-13 14:59:55 +0200
commit1247f46149cbb3a21590573fdcef23e920d0addc (patch)
tree7d784499f48ea533d1fa7fb3e91df23fa14f2c6f
parente3a4790893b5d5f9cf8fbc44ececd65711d572cb (diff)
downloadtwclient-1247f46149cbb3a21590573fdcef23e920d0addc.tar
twclient-1247f46149cbb3a21590573fdcef23e920d0addc.tar.bz2
twclient-1247f46149cbb3a21590573fdcef23e920d0addc.tar.zst
-rw-r--r--Cargo.lock284
-rw-r--r--client/Cargo.toml28
-rw-r--r--client/src/client/mod.rs2
-rw-r--r--renderer/Cargo.toml4
-rw-r--r--renderer/src/main.rs14
-rw-r--r--renderer/src/tee.rs36
6 files changed, 264 insertions, 104 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 538fd5e..2a87df4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -84,14 +84,14 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "bindgen"
-version = "0.59.2"
+version = "0.60.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8"
+checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6"
dependencies = [
"bitflags",
"cexpr",
"clang-sys",
- "clap",
+ "clap 3.2.14",
"env_logger 0.9.0",
"lazy_static",
"lazycell",
@@ -206,12 +206,36 @@ dependencies = [
"atty",
"bitflags",
"strsim 0.8.0",
- "textwrap",
+ "textwrap 0.11.0",
"unicode-width",
"vec_map",
]
[[package]]
+name = "clap"
+version = "3.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54635806b078b7925d6e36810b1755f2a4b5b4d57560432c1ecf60bcbe10602b"
+dependencies = [
+ "atty",
+ "bitflags",
+ "clap_lex",
+ "indexmap",
+ "strsim 0.10.0",
+ "termcolor",
+ "textwrap 0.15.0",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
+dependencies = [
+ "os_str_bytes",
+]
+
+[[package]]
name = "cocoa"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -245,6 +269,17 @@ dependencies = [
[[package]]
name = "common"
version = "0.0.1"
+dependencies = [
+ "arrayvec",
+ "file_offset",
+ "num-traits 0.1.43",
+ "ref_slice",
+ "unreachable",
+]
+
+[[package]]
+name = "common"
+version = "0.0.1"
source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"arrayvec",
@@ -409,11 +444,10 @@ dependencies = [
[[package]]
name = "datafile"
version = "0.0.1"
-source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
- "common",
+ "common 0.0.1",
"hexdump",
- "itertools 0.4.19",
+ "itertools",
"log 0.3.9",
"logger",
"zlib_minimal",
@@ -472,12 +506,11 @@ dependencies = [
[[package]]
name = "event_loop"
version = "0.0.1"
-source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"arrayvec",
- "common",
+ "common 0.0.1",
"hexdump",
- "itertools 0.4.19",
+ "itertools",
"log 0.3.9",
"logger",
"net",
@@ -569,12 +602,26 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
name = "gamenet_common"
version = "0.0.1"
+dependencies = [
+ "arrayvec",
+ "buffer",
+ "common 0.0.1",
+ "packer 0.0.1",
+ "serde",
+ "serde_derive",
+ "uuid",
+ "warn",
+]
+
+[[package]]
+name = "gamenet_common"
+version = "0.0.1"
source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"arrayvec",
"buffer",
- "common",
- "packer",
+ "common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "packer 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
"serde",
"serde_derive",
"uuid",
@@ -584,13 +631,39 @@ dependencies = [
[[package]]
name = "gamenet_ddnet"
version = "0.0.1"
+dependencies = [
+ "arrayvec",
+ "buffer",
+ "common 0.0.1",
+ "gamenet_common 0.0.1",
+ "packer 0.0.1",
+ "uuid",
+ "warn",
+]
+
+[[package]]
+name = "gamenet_ddnet"
+version = "0.0.1"
source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"arrayvec",
"buffer",
- "common",
- "gamenet_common",
- "packer",
+ "common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "gamenet_common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "packer 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "uuid",
+ "warn",
+]
+
+[[package]]
+name = "gamenet_teeworlds_0_5"
+version = "0.0.1"
+dependencies = [
+ "arrayvec",
+ "buffer",
+ "common 0.0.1",
+ "gamenet_common 0.0.1",
+ "packer 0.0.1",
"uuid",
"warn",
]
@@ -602,9 +675,22 @@ source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6
dependencies = [
"arrayvec",
"buffer",
- "common",
- "gamenet_common",
- "packer",
+ "common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "gamenet_common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "packer 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "uuid",
+ "warn",
+]
+
+[[package]]
+name = "gamenet_teeworlds_0_6"
+version = "0.0.1"
+dependencies = [
+ "arrayvec",
+ "buffer",
+ "common 0.0.1",
+ "gamenet_common 0.0.1",
+ "packer 0.0.1",
"uuid",
"warn",
]
@@ -616,9 +702,22 @@ source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6
dependencies = [
"arrayvec",
"buffer",
- "common",
- "gamenet_common",
- "packer",
+ "common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "gamenet_common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "packer 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "uuid",
+ "warn",
+]
+
+[[package]]
+name = "gamenet_teeworlds_0_7"
+version = "0.0.1"
+dependencies = [
+ "arrayvec",
+ "buffer",
+ "common 0.0.1",
+ "gamenet_common 0.0.1",
+ "packer 0.0.1",
"uuid",
"warn",
]
@@ -630,9 +729,9 @@ source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6
dependencies = [
"arrayvec",
"buffer",
- "common",
- "gamenet_common",
- "packer",
+ "common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "gamenet_common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "packer 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
"uuid",
"warn",
]
@@ -747,6 +846,12 @@ dependencies = [
]
[[package]]
+name = "hashbrown"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+
+[[package]]
name = "heck"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -768,18 +873,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e40283dadb02f3af778878be1d717b17b4e4ab92e1d935ab03a730b0542905f2"
dependencies = [
"arrayvec",
- "itertools 0.4.19",
+ "itertools",
]
[[package]]
name = "huffman"
version = "0.0.1"
-source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"arrayvec",
"buffer",
- "common",
- "itertools 0.4.19",
+ "common 0.0.1",
+ "itertools",
]
[[package]]
@@ -806,6 +910,16 @@ dependencies = [
]
[[package]]
+name = "indexmap"
+version = "1.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
+dependencies = [
+ "autocfg",
+ "hashbrown",
+]
+
+[[package]]
name = "instant"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -833,15 +947,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a9b56eb56058f43dc66e58f40a214b2ccbc9f3df51861b63d51dec7b65bc3f"
[[package]]
-name = "itertools"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3f2be4da1690a039e9ae5fd575f706a63ad5a2120f161b1d653c9da3930dd21"
-dependencies = [
- "either",
-]
-
-[[package]]
name = "itoa"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -955,7 +1060,6 @@ dependencies = [
[[package]]
name = "logger"
version = "0.0.1"
-source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"env_logger 0.3.5",
]
@@ -978,9 +1082,8 @@ dependencies = [
[[package]]
name = "map"
version = "0.0.1"
-source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
- "common",
+ "common 0.0.1",
"datafile",
"ndarray",
]
@@ -993,9 +1096,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "matrixmultiply"
-version = "0.1.15"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcad67dcec2d58ff56f6292582377e6921afdf3bfbd533e26fb8900ae575e002"
+checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84"
dependencies = [
"rawpointer",
]
@@ -1093,14 +1196,15 @@ dependencies = [
[[package]]
name = "ndarray"
-version = "0.9.1"
+version = "0.15.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d0603e041601804a61a33ebecbea220b43a86437b9ee20680a1f9fdaaa922a8"
+checksum = "dec23e6762830658d2b3d385a75aa212af2f67a4586d4442907144f3bb6a1ca8"
dependencies = [
- "itertools 0.6.5",
"matrixmultiply",
"num-complex",
- "num-traits 0.1.43",
+ "num-integer",
+ "num-traits 0.2.14",
+ "rawpointer",
]
[[package]]
@@ -1159,12 +1263,11 @@ checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121"
[[package]]
name = "net"
version = "0.0.1"
-source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"arrayvec",
"assert_matches",
"buffer",
- "common",
+ "common 0.0.1",
"huffman",
"linear-map",
"matches",
@@ -1209,14 +1312,24 @@ dependencies = [
[[package]]
name = "num-complex"
-version = "0.1.43"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656"
+checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19"
dependencies = [
"num-traits 0.2.14",
]
[[package]]
+name = "num-integer"
+version = "0.1.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
+dependencies = [
+ "autocfg",
+ "num-traits 0.2.14",
+]
+
+[[package]]
name = "num-traits"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1277,6 +1390,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf72fc7f93afa4f42298f870abcc10ec1ab116198985719638bfe37535170092"
[[package]]
+name = "os_str_bytes"
+version = "6.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4"
+
+[[package]]
name = "osmesa-sys"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1288,11 +1407,22 @@ dependencies = [
[[package]]
name = "packer"
version = "0.0.1"
+dependencies = [
+ "arrayvec",
+ "buffer",
+ "common 0.0.1",
+ "uuid",
+ "warn",
+]
+
+[[package]]
+name = "packer"
+version = "0.0.1"
source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"arrayvec",
"buffer",
- "common",
+ "common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
"uuid",
"warn",
]
@@ -1453,9 +1583,9 @@ dependencies = [
[[package]]
name = "rawpointer"
-version = "0.1.0"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebac11a9d2e11f2af219b8b8d833b76b1ea0e054aa0e8d8e9e4cbde353bdf019"
+checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
[[package]]
name = "rdrand"
@@ -1649,9 +1779,9 @@ dependencies = [
[[package]]
name = "skia-bindings"
-version = "0.50.0"
+version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00f45439145d90b18bce3dc0bfb50c73b25a75666ac391089b23e4ee245a7f67"
+checksum = "5f249be649ae13f65934370168f742a7be27096f432f15572fb70f5367916b8f"
dependencies = [
"bindgen",
"cc",
@@ -1667,9 +1797,9 @@ dependencies = [
[[package]]
name = "skia-safe"
-version = "0.50.0"
+version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5e8f14ca7a6e7338e7cf6bfdad314c4e735003c1a56001e1e545bd22c994d43"
+checksum = "5036fc8c167b0e1886aba4f924781d8589e67e5f43bfc3af09d5c9eda4d21940"
dependencies = [
"bitflags",
"lazy_static",
@@ -1712,12 +1842,12 @@ name = "snapshot"
version = "0.0.1"
dependencies = [
"buffer",
- "common",
- "gamenet_ddnet",
- "gamenet_teeworlds_0_5",
- "gamenet_teeworlds_0_6",
- "gamenet_teeworlds_0_7",
- "packer",
+ "common 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "gamenet_ddnet 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "gamenet_teeworlds_0_5 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "gamenet_teeworlds_0_6 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "gamenet_teeworlds_0_7 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
+ "packer 0.0.1 (git+https://github.com/heinrich5991/libtw2)",
"vec_map",
"warn",
]
@@ -1725,12 +1855,11 @@ dependencies = [
[[package]]
name = "socket"
version = "0.0.1"
-source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"buffer",
- "common",
+ "common 0.0.1",
"hexdump",
- "itertools 0.4.19",
+ "itertools",
"libc",
"log 0.3.9",
"mio 0.6.23",
@@ -1811,6 +1940,12 @@ dependencies = [
]
[[package]]
+name = "textwrap"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"
+
+[[package]]
name = "thiserror"
version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1879,25 +2014,25 @@ version = "0.1.0"
dependencies = [
"anyhow",
"arrayvec",
- "clap",
- "common",
+ "clap 2.34.0",
+ "common 0.0.1",
"crossbeam-channel",
"datafile",
"env_logger 0.9.0",
"event_loop",
- "gamenet_ddnet",
- "gamenet_teeworlds_0_5",
- "gamenet_teeworlds_0_6",
- "gamenet_teeworlds_0_7",
+ "gamenet_ddnet 0.0.1",
+ "gamenet_teeworlds_0_5 0.0.1",
+ "gamenet_teeworlds_0_6 0.0.1",
+ "gamenet_teeworlds_0_7 0.0.1",
"hexdump",
- "itertools 0.4.19",
+ "itertools",
"lazy_static",
"log 0.3.9",
"logger",
"map",
"ndarray",
"net",
- "packer",
+ "packer 0.0.1",
"rand 0.8.5",
"signal-hook",
"snapshot",
@@ -2388,7 +2523,6 @@ checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3"
[[package]]
name = "zlib_minimal"
version = "0.0.1"
-source = "git+https://github.com/heinrich5991/libtw2#c67bb33d7f2dc5bd78ea8238ec6119b754c13da3"
dependencies = [
"libc",
"libz-sys",
diff --git a/client/Cargo.toml b/client/Cargo.toml
index 5f14df4..1e58906 100644
--- a/client/Cargo.toml
+++ b/client/Cargo.toml
@@ -9,22 +9,22 @@ authors = [
license = "AGPL-3.0-only"
[dependencies]
-socket = { git = "https://github.com/heinrich5991/libtw2" }
-datafile = { git = "https://github.com/heinrich5991/libtw2" }
-map = { git = "https://github.com/heinrich5991/libtw2" }
-net = { git = "https://github.com/heinrich5991/libtw2" }
-common = { git = "https://github.com/heinrich5991/libtw2" }
-event_loop = { git = "https://github.com/heinrich5991/libtw2" }
-gamenet_teeworlds_0_5 = { git = "https://github.com/heinrich5991/libtw2", optional = true }
-gamenet_teeworlds_0_6 = { git = "https://github.com/heinrich5991/libtw2", optional = true }
-gamenet_teeworlds_0_7 = { git = "https://github.com/heinrich5991/libtw2", optional = true }
-gamenet_ddnet = { git = "https://github.com/heinrich5991/libtw2", optional = true }
-logger = { git = "https://github.com/heinrich5991/libtw2" }
-packer = { git = "https://github.com/heinrich5991/libtw2" }
-# snapshot = { git = "https://github.com/heinrich5991/libtw2" }
+socket = { path = "../../libtw2/socket" }
+datafile = { path = "../../libtw2/datafile" }
+map = { path = "../../libtw2/map" }
+net = { path = "../../libtw2/net" }
+common = { path = "../../libtw2/common" }
+event_loop = { path = "../../libtw2/event_loop" }
+gamenet_teeworlds_0_5 = { path = "../../libtw2/gamenet/teeworlds-0.5", optional = true }
+gamenet_teeworlds_0_6 = { path = "../../libtw2/gamenet/teeworlds-0.6", optional = true }
+gamenet_teeworlds_0_7 = { path = "../../libtw2/gamenet/teeworlds-0.7", optional = true }
+gamenet_ddnet = { path = "../../libtw2/gamenet/ddnet", optional = true }
+logger = { path = "../../libtw2/logger" }
+packer = { path = "../../libtw2/packer" }
+# snapshot = { path = "../../libtw2/snapshot" }
snapshot = { path = "../snapshot" }
-ndarray = "0.9.1"
+ndarray = "0.15.4"
arrayvec = "0.5.2"
clap = "2.31.2"
hexdump = "0.1.1"
diff --git a/client/src/client/mod.rs b/client/src/client/mod.rs
index c779317..c5e7b9e 100644
--- a/client/src/client/mod.rs
+++ b/client/src/client/mod.rs
@@ -239,6 +239,8 @@ impl<'a, L: Loop> Application<L> for Client {
System::Snap(_) | System::SnapEmpty(_) | System::SnapSingle(_) => {
self.num_snaps_since_reset += 1;
{
+ let a = gamenet::msg::system::Snap;
+ let b = gamenet_ddnet::msg::system::Snap;
let res = match *msg {
System::Snap(s) => self.snaps.snap(&mut Log, obj_size, s),
System::SnapEmpty(s) => self.snaps.snap_empty(&mut Log, obj_size, s),
diff --git a/renderer/Cargo.toml b/renderer/Cargo.toml
index 6ec23ca..d78190d 100644
--- a/renderer/Cargo.toml
+++ b/renderer/Cargo.toml
@@ -9,8 +9,8 @@ authors = [
license = "AGPL-3.0-only"
[dependencies]
-twclient = { path = "../client" }
-skia-safe = { version = "0.50.0", features = ["gl", "wayland"] }
+twclient = { path = "../client", features = ["gamenet_ddnet_0_6"]}
+skia-safe = { version = "0.52.0", features = ["gl", "wayland"] }
glutin = "0.28.0"
gl = "0.14.0"
log = "0.4.17"
diff --git a/renderer/src/main.rs b/renderer/src/main.rs
index af01021..186b773 100644
--- a/renderer/src/main.rs
+++ b/renderer/src/main.rs
@@ -138,6 +138,11 @@ fn main() {
env.windowed_context.window().request_redraw();
}
Event::WindowEvent { event, .. } => match event {
+ WindowEvent::MouseInput { button, state, .. } => match state {
+ ElementState::Pressed => renderer.input.fire = 1,
+ ElementState::Released => renderer.input.fire = 0,
+ },
+ WindowEvent::CursorMoved { position, .. } => {}
WindowEvent::Resized(physical_size) => {
env.surface =
create_surface(&env.windowed_context, &fb_info, &mut env.gr_context);
@@ -182,11 +187,6 @@ fn main() {
}
_ => (),
}
- renderer
- .client_interface
- .send
- .send(ClientMesgIn::Input(renderer.input))
- .unwrap();
}
}
}
@@ -216,6 +216,10 @@ pub struct Renderer {
impl Renderer {
pub fn tick(&mut self) {
+ self.client_interface
+ .send
+ .send(ClientMesgIn::Input(self.input))
+ .unwrap();
for m in self.client_interface.receive.try_iter() {
self.world.update(&m);
match m {
diff --git a/renderer/src/tee.rs b/renderer/src/tee.rs
index 8e8e3ba..4d9d945 100644
--- a/renderer/src/tee.rs
+++ b/renderer/src/tee.rs
@@ -11,6 +11,8 @@ const TEE_REND_RADIUS: f32 = 32.0;
const TEE_EYE_ROTATION_RADIUS: f32 = 8.0;
const TEE_EYE_SIZE: f32 = 12.0;
const TEE_EYE_DISTANCE: f32 = 8.0;
+const TEE_FOOT_SIZE: f32 = 14.0;
+const TEE_EYE_OFFSET_Y: f32 = -2.0;
pub struct TeeRenderer {
skins: BTreeMap<String, Image>,
@@ -61,6 +63,24 @@ impl TeeRenderer {
y: tee.y as f32,
};
+ {
+ canvas.save();
+
+ canvas.draw_image_rect(
+ &skin_texture,
+ Some((&SKIN_FOOT, SrcRectConstraint::Strict)),
+ Rect {
+ top: -TEE_FOOT_SIZE + TEE_REND_RADIUS * 0.5,
+ left: -TEE_FOOT_SIZE * 2.0 - TEE_FOOT_SIZE * 0.5,
+ right: TEE_FOOT_SIZE * 2.0 - TEE_FOOT_SIZE * 0.5,
+ bottom: TEE_FOOT_SIZE + TEE_REND_RADIUS * 0.5,
+ },
+ &tee_paint,
+ );
+
+ canvas.restore();
+ }
+
canvas.draw_image_rect(
&skin_texture,
Some((&SKIN_BODY_SHADOW, SrcRectConstraint::Strict)),
@@ -96,10 +116,10 @@ impl TeeRenderer {
&skin_texture,
Some((&SKIN_EYE_NORMAL, SrcRectConstraint::Strict)),
Rect {
- top: -TEE_EYE_SIZE,
+ top: -TEE_EYE_SIZE + TEE_EYE_OFFSET_Y,
left: -TEE_EYE_SIZE - TEE_EYE_DISTANCE / 2.0,
right: TEE_EYE_SIZE - TEE_EYE_DISTANCE / 2.0,
- bottom: TEE_EYE_SIZE,
+ bottom: TEE_EYE_SIZE + TEE_EYE_OFFSET_Y,
},
&tee_paint,
);
@@ -110,10 +130,10 @@ impl TeeRenderer {
&skin_texture,
Some((&SKIN_EYE_NORMAL, SrcRectConstraint::Strict)),
Rect {
- top: -TEE_EYE_SIZE,
+ top: -TEE_EYE_SIZE + TEE_EYE_OFFSET_Y,
left: -TEE_EYE_SIZE - TEE_EYE_DISTANCE / 2.0,
right: TEE_EYE_SIZE - TEE_EYE_DISTANCE / 2.0,
- bottom: TEE_EYE_SIZE,
+ bottom: TEE_EYE_SIZE + TEE_EYE_OFFSET_Y,
},
&tee_paint,
);
@@ -129,10 +149,10 @@ impl TeeRenderer {
&skin_texture,
Some((&SKIN_FOOT, SrcRectConstraint::Strict)),
Rect {
- top: -TEE_EYE_SIZE,
- left: -TEE_EYE_SIZE - TEE_EYE_DISTANCE / 2.0,
- right: TEE_EYE_SIZE - TEE_EYE_DISTANCE / 2.0,
- bottom: TEE_EYE_SIZE,
+ top: -TEE_FOOT_SIZE + TEE_REND_RADIUS * 0.5,
+ left: -TEE_FOOT_SIZE * 2.0 + TEE_FOOT_SIZE * 0.5,
+ right: TEE_FOOT_SIZE * 2.0 + TEE_FOOT_SIZE * 0.5,
+ bottom: TEE_FOOT_SIZE + TEE_REND_RADIUS * 0.5,
},
&tee_paint,
);