Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
542 changes: 272 additions & 270 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,14 @@ bincode = { version = "2.0.1", features = ["serde"] }
bytes = "1.10.1"
chrono = { version = "0.4.42", features = ["serde"] }
crossbeam = "0.8.4"
egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui-winit = { version = "0.32.3", default-features = false, features = [
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
egui-winit = { version = "0.33.0", default-features = false, features = [
"x11",
"arboard",
"links",
] }
egui_extras = { version = "0.32.3" }
emath = "0.32.3"
egui_extras = { version = "0.33.0" }
emath = "0.33.0"
env_logger = "0.11.8"
fixed = "1.29.0"
hashlink = { git = "https://github.com/Jupeyy/hashlink/", branch = "ddnet", features = [
Expand Down Expand Up @@ -292,7 +292,7 @@ alloc-track = { version = "0.3.1", optional = true }
stats_alloc = { version = "0.1.10", optional = true }

[target.'cfg(not(target_os = "android"))'.dependencies]
native-dialog = "0.9.2"
native-dialog = "0.9.3"

[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.15.1"
Expand Down
19 changes: 15 additions & 4 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,24 @@ cargo install cargo-watch --locked --version 8.1.2
# Network

Simulate network jitter, linux only:
sudo tc qdisc add dev lo root netem delay 100ms 10ms

```bash
# increases the ping by 100ms per direction with a jitter of 10ms
sudo tc qdisc add dev lo root netem delay 100ms 10ms
# disables the artificial ping change
sudo tc qdisc del dev lo root
```

# Sanitizers

ASan & TSan (the `--target` flag is important here!, `+nightly` might be required (after cargo)):

```bash
# ASan
RUSTFLAGS="-Z sanitizer=address" cargo run --target x86_64-unknown-linux-gnu
# TSan
TSAN_OPTIONS="ignore_noninstrumented_modules=1" RUSTFLAGS="-Z sanitizer=thread" cargo run --target x86_64-unknown-linux-gnu
```

# TOML formating

Expand All @@ -67,9 +77,10 @@ Extensions like `tamasfe.even-better-toml` also allow to use them inside code ed

# Linux helpers

Linux x11 mouse cursor while debugging:
install xdotool package
if you use the vscode workspace in misc/vscode it will do the following steps automatically
#### Linux x11 mouse cursor while debugging:
Install xdotool package.

If you use the vscode workspace in misc/vscode it will do the following steps automatically

lldb has to execute this add start of debugging:

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Features
--------

Some features require you to compile DDNet-rs with explicit features:
```

```bash
cargo run --release --features bundled_data_dir,ffmpeg,microphone,enable_steam
```

Expand All @@ -33,7 +34,7 @@ cargo run --release --features bundled_data_dir,ffmpeg,microphone,enable_steam
Android
-------

```
```bash
# using https://github.com/rust-mobile/xbuild
x build --release --arch arm64 --platform android --format apk -p ddnet-rs --features bundled_data_dir
```
2 changes: 1 addition & 1 deletion examples/lib-modules/editor-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ config = { path = "../../../lib/config" }
graphics = { path = "../../../lib/graphics" }
sound = { path = "../../../lib/sound" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
once_cell = "1.21.3"
rayon = "1.11.0"
2 changes: 1 addition & 1 deletion examples/wasm-modules/actionfeed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ client-types = { path = "../../../game/client-types" }
client-ui = { path = "../../../game/client-ui" }
game-interface = { path = "../../../game/game-interface" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
num-traits = "0.2.19"
2 changes: 1 addition & 1 deletion examples/wasm-modules/chat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ client-ui = { path = "../../../game/client-ui" }
game-base = { path = "../../../game/game-base" }
game-interface = { path = "../../../game/game-interface" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
2 changes: 1 addition & 1 deletion examples/wasm-modules/connecting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ ui-generic = { path = "../../../lib/ui-generic" }
api-ui-game = { path = "../../../game/api-ui-game" }
client-ui = { path = "../../../game/client-ui" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
2 changes: 1 addition & 1 deletion examples/wasm-modules/console/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ client-render-base = { path = "../../../game/client-render-base" }
client-types = { path = "../../../game/client-types" }
client-ui = { path = "../../../game/client-ui" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
2 changes: 1 addition & 1 deletion examples/wasm-modules/demo_player/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ ui-generic = { path = "../../../lib/ui-generic" }
api-ui-game = { path = "../../../game/api-ui-game" }
client-ui = { path = "../../../game/client-ui" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
2 changes: 1 addition & 1 deletion examples/wasm-modules/emote_wheel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ client-containers = { path = "../../../game/client-containers" }
client-render-base = { path = "../../../game/client-render-base" }
client-ui = { path = "../../../game/client-ui" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
2 changes: 1 addition & 1 deletion examples/wasm-modules/hud/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ client-render-base = { path = "../../../game/client-render-base" }
client-ui = { path = "../../../game/client-ui" }
game-interface = { path = "../../../game/game-interface" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
2 changes: 1 addition & 1 deletion examples/wasm-modules/ingame_menu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ game-interface = { path = "../../../game/game-interface" }

anyhow = { version = "1.0.100", features = ["backtrace"] }
async-trait = "0.1.89"
egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
email_address = { version = "0.2.9", features = ["serde"] }
serde_json = "1.0.145"
2 changes: 1 addition & 1 deletion examples/wasm-modules/mainmenu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ game-config = { path = "../../../game/game-config" }

anyhow = { version = "1.0.100", features = ["backtrace"] }
async-trait = "0.1.89"
egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
email_address = { version = "0.2.9", features = ["serde"] }
serde_json = "1.0.145"
2 changes: 1 addition & 1 deletion examples/wasm-modules/motd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ ui-generic = { path = "../../../lib/ui-generic" }
api-ui-game = { path = "../../../game/api-ui-game" }
client-ui = { path = "../../../game/client-ui" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
4 changes: 2 additions & 2 deletions examples/wasm-modules/prediction_timer_ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ ui-generic = { path = "../../../lib/ui-generic" }
api-ui-game = { path = "../../../game/api-ui-game" }
prediction-timer = { path = "../../../game/prediction-timer" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui_plot = { version = "0.33.0" }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
egui_plot = { version = "0.34.0" }
2 changes: 1 addition & 1 deletion examples/wasm-modules/scoreboard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ client-render-base = { path = "../../../game/client-render-base" }
client-ui = { path = "../../../game/client-ui" }
game-interface = { path = "../../../game/game-interface" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
2 changes: 1 addition & 1 deletion examples/wasm-modules/ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ ui-generic = { path = "../../../lib/ui-generic" }

api-ui-game = { path = "../../../game/api-ui-game" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
2 changes: 1 addition & 1 deletion examples/wasm-modules/vote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ client-render-base = { path = "../../../game/client-render-base" }
client-ui = { path = "../../../game/client-ui" }
game-interface = { path = "../../../game/game-interface" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
2 changes: 1 addition & 1 deletion game/api-editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ api-wasm-macros = { path = "../../lib/api-wasm-macros" }
config = { path = "../../lib/config" }
graphics-types = { path = "../../lib/graphics-types" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
once_cell = "1.21.3"
2 changes: 1 addition & 1 deletion game/client-console/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ui-base = { path = "../../lib/ui-base" }
ui-generic = { path = "../../lib/ui-generic" }

anyhow = { version = "1.0.100", features = ["backtrace"] }
egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
log = "0.4.28"
tracing = { version = "0.1.41", default-features = false, features = [
"attributes",
Expand Down
2 changes: 1 addition & 1 deletion game/client-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ game-config = { path = "../game-config" }
game-interface = { path = "../game-interface" }

anyhow = { version = "1.0.100", features = ["backtrace"] }
egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
log = "0.4.28"
rayon = "1.11.0"
serde = { version = "1.0.228", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion game/client-map/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ rayon = "1.11.0"
tracing = { version = "0.1.41", default-features = false, features = [
"attributes",
] }
wasmparser = "0.238.1"
wasmparser = "0.240.0"
4 changes: 2 additions & 2 deletions game/client-notifications/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ graphics = { path = "../../lib/graphics" }
ui-base = { path = "../../lib/ui-base" }
ui-generic = { path = "../../lib/ui-generic" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui-notify = "0.20.0"
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
egui-notify = "0.21.0"
tracing = { version = "0.1.41", default-features = false, features = [
"attributes",
] }
2 changes: 1 addition & 1 deletion game/client-render-game/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ game-interface = { path = "../game-interface" }
map = { path = "../map" }
vanilla = { path = "../vanilla" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
num-traits = "0.2.19"
rayon = "1.11.0"
serde = { version = "1.0.228", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion game/client-render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ client-ui = { path = "../client-ui" }
game-base = { path = "../game-base" }
game-interface = { path = "../game-interface" }

egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
serde = { version = "1.0.228", features = ["derive"] }
2 changes: 1 addition & 1 deletion game/client-render/src/nameplates/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl NameplateRender {
} in &mut *pipe.players
{
ui.set_opacity(phased_alpha);
let size = ui.ctx().screen_rect().size();
let size = ui.ctx().content_rect().size();
let (x0, y0, x1, y1) = pipe.state.get_canvas_mapping();

let w = x1 - x0;
Expand Down
2 changes: 1 addition & 1 deletion game/client-replay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ demo = { path = "../demo", features = ["recorder"] }
game-interface = { path = "../game-interface" }

anyhow = { version = "1.0.100", features = ["backtrace"] }
egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
rayon = "1.11.0"
6 changes: 3 additions & 3 deletions game/client-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ ui-generic = { path = "../../lib/ui-generic" }

anyhow = { version = "1.0.100", features = ["backtrace"] }
async-trait = "0.1.89"
egui = { version = "0.32.3", default-features = false, features = ["serde"] }
egui_commonmark = "0.21.1"
egui_extras = { version = "0.32.3" }
egui = { version = "0.33.0", default-features = false, features = ["serde"] }
egui_commonmark = "0.22.0"
egui_extras = { version = "0.33.0" }
email_address = { version = "0.2.9", features = ["serde"] }
fuzzy-matcher = "0.3.7"
gcd = "2.3.0"
Expand Down
4 changes: 2 additions & 2 deletions game/client-ui/src/chat/chat_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub fn render(
pipe.user_data.render_tee,
ui,
ui_state,
ui.ctx().screen_rect(),
ui.ctx().content_rect(),
Some(ui.clip_rect()),
to.skin.borrow(),
Some(&to.skin_info),
Expand All @@ -106,7 +106,7 @@ pub fn render(
pipe.user_data.render_tee,
ui,
ui_state,
ui.ctx().screen_rect(),
ui.ctx().content_rect(),
Some(ui.clip_rect()),
&msg.skin_name,
Some(&msg.skin_info),
Expand Down
4 changes: 2 additions & 2 deletions game/client-ui/src/chat/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn render_inner(ui: &mut egui::Ui, ui_state: &mut UiState, pipe: &mut UiRenderPi
pipe.user_data.render_tee,
ui,
ui_state,
ui.ctx().screen_rect(),
ui.ctx().content_rect(),
None,
to.info.skin.borrow(),
Some(&to.info.skin_info),
Expand Down Expand Up @@ -221,7 +221,7 @@ fn render_inner(ui: &mut egui::Ui, ui_state: &mut UiState, pipe: &mut UiRenderPi
pipe.user_data.render_tee,
ui,
ui_state,
ui.ctx().screen_rect(),
ui.ctx().content_rect(),
None,
msg_char.info.skin.borrow(),
Some(&msg_char.info.skin_info),
Expand Down
4 changes: 2 additions & 2 deletions game/client-ui/src/chat/system_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub fn render(
pipe.user_data.render_tee,
ui,
ui_state,
ui.ctx().screen_rect(),
ui.ctx().content_rect(),
Some(ui.clip_rect()),
&skin.skin_name,
Some(&skin.skin_info),
Expand All @@ -87,7 +87,7 @@ pub fn render(
pipe.user_data.render_tee,
ui,
ui_state,
ui.ctx().screen_rect(),
ui.ctx().content_rect(),
Some(ui.clip_rect()),
&skin.skin_name,
Some(&skin.skin_info),
Expand Down
2 changes: 1 addition & 1 deletion game/client-ui/src/console/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pub fn render(
}
}
colorize_semicolons(&mut layout_job, last_range..string.len());
ui.fonts(|f| f.layout_job(layout_job))
ui.fonts_mut(|f| f.layout_job(layout_job))
};
let had_quote = pipe.user_data.msg.char_indices().any(|(index, c)| {
if c == '"' {
Expand Down
4 changes: 2 additions & 2 deletions game/client-ui/src/demo_player/main_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn render(ui: &mut egui::Ui, pipe: &mut UiRenderPipe<UserData>, ui_state: &m
.show_separator_line(false)
.resizable(false)
.show(ui.ctx(), |ui| {
ui.set_clip_rect(ui.ctx().screen_rect());
ui.set_clip_rect(ui.ctx().content_rect());
ui.style_mut().spacing.item_spacing.y = 0.0;
let mut rect = ui.available_rect_before_wrap();
ui.add_space(10.0);
Expand Down Expand Up @@ -72,7 +72,7 @@ pub fn render(ui: &mut egui::Ui, pipe: &mut UiRenderPipe<UserData>, ui_state: &m
.clamp(0.0, f64::MAX),
);

let canvas = ui.ctx().screen_rect();
let canvas = ui.ctx().content_rect();
let canvas_width = canvas.width();
let canvas_height = canvas.height();
let ratio = canvas_width / canvas_height;
Expand Down
2 changes: 1 addition & 1 deletion game/client-ui/src/emote_wheel/main_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use super::user_data::{EmoteWheelEvent, UserData};
/// not required
#[instrument(level = "trace", skip_all)]
pub fn render(ui: &mut egui::Ui, pipe: &mut UiRenderPipe<UserData>, ui_state: &mut UiState) {
let rect = ui.ctx().screen_rect();
let rect = ui.ctx().content_rect();

let width_scale = rect.width() / pipe.user_data.canvas_handle.canvas_width() as f32;

Expand Down
Loading
Loading