This commit is contained in:
gallant 2023-03-28 11:26:40 -05:00
parent 42c70cbc30
commit ed23a32945
2 changed files with 8 additions and 10 deletions

View file

@ -10,8 +10,7 @@ fn main() {
if target.contains("msvc") {
lib_dir.push("msvc");
dll_dir.push("msvc");
}
else {
} else {
lib_dir.push("gnu-mingw");
dll_dir.push("gnu-mingw");
}
@ -20,13 +19,12 @@ fn main() {
if target.contains("x86_64") {
lib_dir.push("64");
dll_dir.push("64");
}
else {
} else {
lib_dir.push("32");
dll_dir.push("32");
}
println!("cargo:rustc-link-search=all={}", lib_dir.display());
for entry in std::fs::read_dir(dll_dir).expect("Can't read DLL dir") {
for entry in std::fs::read_dir(dll_dir).expect("Can't read DLL dir") {
let entry_path = entry.expect("Invalid fs entry").path();
let file_name_result = entry_path.file_name();
let mut new_file_path = manifest_dir.clone();
@ -34,7 +32,8 @@ fn main() {
let file_name = file_name.to_str().unwrap();
if file_name.ends_with(".dll") {
new_file_path.push(file_name);
std::fs::copy(&entry_path, new_file_path.as_path()).expect("Can't copy from DLL dir");
std::fs::copy(&entry_path, new_file_path.as_path())
.expect("Can't copy from DLL dir");
}
}
}

View file

@ -83,12 +83,11 @@ fn main() {
println!("Sprites collided! {}", i);
}
game.t_reset();
}
s2.draw(ctx).unwrap();
s.draw(ctx).unwrap();
coll.draw(ctx).unwrap();
s2.draw(ctx).unwrap();
s.draw(ctx).unwrap();
coll.draw(ctx).unwrap();
})
.unwrap();
}