Skip to content

Commit b473cf4

Browse files
authored
Merge pull request #15 from Yarwin/qol/remove-macos-x86-ci
Update demo projects and remove macOS x86 (Intel) from CI
2 parents 44ee5f3 + 72648de commit b473cf4

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,6 @@ jobs:
154154
# macOS builds fail semi-randomly with an `libc++abi: Pure virtual function called!` error.
155155
# For now on run them with retry; resort to compiling only if it won't be enough (i.e. first time when it will fail three times in the row).
156156
# See: https://github.com/godot-rust/demo-projects/issues/12
157-
- name: macos-x86
158-
os: macos-13
159-
artifact-name: macos-x86-nightly
160-
godot-binary: godot.macos.editor.dev.x86_64
161-
retry: true
162-
163157
- name: macos-arm
164158
os: macos-latest
165159
artifact-name: macos-arm-nightly

dodge-the-creeps/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
rand = "0.8"
14-
godot = { git = "https://github.com/godot-rust/gdext.git" }
14+
godot = { git = "https://github.com/godot-rust/gdext.git", features = ["register-docs"]}
1515
# For Wasm, feature "experimental-wasm" can be added, but this is already done in build-wasm.sh script.
1616

net-pong/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "MPL-2.0"
77
publish = false
88

99
[dependencies]
10-
godot = {git = "https://github.com/godot-rust/gdext.git"}
10+
godot = {git = "https://github.com/godot-rust/gdext.git", features = ["register-docs"]}
1111

1212
[lib]
1313
crate-type = ["cdylib"] # Compile this crate to a dynamic C library.

net-pong/rust/src/ball.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::pong::Pong;
22
use godot::classes::{Area2D, IArea2D};
33
use godot::prelude::*;
44

5-
const DEFAULT_SPEED: f64 = 100.0;
5+
const DEFAULT_SPEED: f32 = 100.0;
66

77
#[derive(GodotClass)]
88
#[class(init, base=Area2D)]
@@ -11,13 +11,13 @@ pub struct Ball {
1111
direction: Vector2,
1212
stopped: bool,
1313
#[init(val = DEFAULT_SPEED)]
14-
speed: f64,
14+
speed: f32,
1515
base: Base<Area2D>,
1616
}
1717

1818
#[godot_api]
1919
impl IArea2D for Ball {
20-
fn process(&mut self, delta: f64) {
20+
fn process(&mut self, delta: f32) {
2121
let screen_size = self.base().get_viewport_rect().size;
2222
self.speed += delta;
2323

@@ -26,7 +26,7 @@ impl IArea2D for Ball {
2626
// even if it's sightly out of sync between them,
2727
// so each player sees the motion as smooth and not jerky.
2828
let direction = self.direction;
29-
let translation = direction * (self.speed * delta) as f32;
29+
let translation = direction * self.speed * delta;
3030
self.base_mut().translate(translation);
3131
}
3232

@@ -39,8 +39,7 @@ impl IArea2D for Ball {
3939
}
4040

4141
let mut parent = self.base().get_parent().unwrap().cast::<Pong>();
42-
// Allows re-entrancy – required if a game stops and we need to reset our ball.
43-
// this help fixes the double bind error
42+
// Use base_mut() to allow for reentrancy – required if a game stops, and we need to reset our ball.
4443
let mut guard = self.base_mut();
4544
if guard.is_multiplayer_authority() {
4645
// Only the master will decide when the ball is out on

net-pong/rust/src/paddle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl IArea2D for Paddle {
3838
});
3939
}
4040

41-
fn process(&mut self, delta: f64) {
41+
fn process(&mut self, delta: f32) {
4242
if self.base().is_multiplayer_authority() {
4343
let input = Input::singleton();
4444
self.motion = input.get_axis("move_up", "move_down");
@@ -57,7 +57,7 @@ impl IArea2D for Paddle {
5757
self.you_label.hide();
5858
}
5959

60-
let translation = Vector2::new(0.0, self.motion * delta as f32);
60+
let translation = Vector2::new(0.0, self.motion * delta);
6161

6262
self.base_mut().translate(translation);
6363

0 commit comments

Comments
 (0)