Skip to content

Commit 731b0c4

Browse files
authored
Merge pull request #49 from louisgjohnson/updating-specs-sample
removed deprecated function add_resouce and replaced with insert
2 parents 2ec2318 + b496381 commit 731b0c4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

samples/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ repository = "https://github.com/deltaphc/raylib-rs"
1111
[dependencies]
1212
raylib = { version = "1.0", path = "../raylib" }
1313
structopt = "0.2"
14-
specs-derive = "0.4"
14+
specs-derive = "0.4.1"
1515
rand = "0.7"
1616
tcod = "0.15"
1717
serde = { version = "1.0", features = ["derive"] }
1818
serde_json = "1.0"
1919
arr_macro = "0.1.3"
2020

2121
[dependencies.specs]
22-
version = "0.14"
22+
version = "0.16.1"
2323
default-features = false
2424

2525
[[bin]]

samples/specs.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,21 +154,21 @@ fn main() {
154154
register_components(&mut world);
155155
let emap = init_world(&rl, &mut world);
156156

157-
world.add_resource(rl);
157+
world.insert(rl);
158158
// Raylib Thread is not safe to send between threads, but we can force it with an ARC
159159
// It's up to the user to ensure the only systems that use it are
160160
// thread local otherwise you will segfault
161-
world.add_resource(emap);
162-
world.add_resource(GameState::PLAYING);
161+
world.insert(emap);
162+
world.insert(GameState::PLAYING);
163163
let mut dispatcher = DispatcherBuilder::new()
164164
.with(DeathSys, "death_sys", &[])
165165
.with(PlayerSys, "player_sys", &[])
166166
// Drawing must be done on the same thread
167-
.with_thread_local(DrawSys { thread: thread })
167+
.with_thread_local(DrawSys { thread })
168168
.build();
169-
dispatcher.setup(&mut world.res);
169+
dispatcher.setup(&mut world);
170170
while !window_should_close(&world) && !player_lost(&world) {
171-
dispatcher.dispatch(&mut world.res);
171+
dispatcher.dispatch(&mut world);
172172
}
173173
}
174174

0 commit comments

Comments
 (0)