feat: Removed useless deps
This commit is contained in:
Generated
+7
-24
@@ -20,21 +20,6 @@ dependencies = [
|
|||||||
"zerocopy",
|
"zerocopy",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "audio"
|
|
||||||
version = "0.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c2d8fdbcbaf6b6967eefcbf476d7ded6d3bd29ddfa5b141e39e25d3cd531a14f"
|
|
||||||
dependencies = [
|
|
||||||
"audio-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "audio-core"
|
|
||||||
version = "0.2.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "db446410e749ce0157f460ef73d97f002251808aa6b6ca69f476578f36e958e0"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
@@ -143,15 +128,6 @@ dependencies = [
|
|||||||
"png",
|
"png",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "lib"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"audio",
|
|
||||||
"macroquad",
|
|
||||||
"once_cell",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.155"
|
version = "0.2.155"
|
||||||
@@ -304,6 +280,13 @@ dependencies = [
|
|||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tadventure"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"macroquad",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ttf-parser"
|
name = "ttf-parser"
|
||||||
version = "0.15.2"
|
version = "0.15.2"
|
||||||
|
|||||||
+1
-3
@@ -1,11 +1,9 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lib"
|
name = "tadventure"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
audio = "0.2.0"
|
|
||||||
macroquad = "0.4.8"
|
macroquad = "0.4.8"
|
||||||
once_cell = "1.19.0"
|
|
||||||
|
|||||||
@@ -34,19 +34,26 @@
|
|||||||
stableToolchainWithRustAnalyzer = pkgs.rust-bin.stable.latest.default.override {
|
stableToolchainWithRustAnalyzer = pkgs.rust-bin.stable.latest.default.override {
|
||||||
extensions = ["rust-src" "rust-analyzer"];
|
extensions = ["rust-src" "rust-analyzer"];
|
||||||
# Extra targets if required
|
# Extra targets if required
|
||||||
# targets = [
|
targets = [
|
||||||
# "x86_64-unknown-linux-gnu"
|
"wasm32-unknown-unknown"
|
||||||
# "x86_64-unknown-linux-musl"
|
# "x86_64-unknown-linux-gnu"
|
||||||
# "x86_64-apple-darwin"
|
# "x86_64-unknown-linux-musl"
|
||||||
# "aarch64-apple-darwin"
|
# "x86_64-apple-darwin"
|
||||||
# ];
|
# "aarch64-apple-darwin"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
craneLib = (crane.mkLib pkgs).overrideToolchain stableToolchain;
|
craneLib = (crane.mkLib pkgs).overrideToolchain stableToolchain;
|
||||||
src = craneLib.cleanCargoSource (craneLib.path ./.);
|
src = craneLib.cleanCargoSource (craneLib.path ./.);
|
||||||
commonArgs = {
|
commonArgs = {
|
||||||
inherit src;
|
inherit src;
|
||||||
buildInputs = with pkgs;
|
buildInputs = with pkgs;
|
||||||
[]
|
[
|
||||||
|
alsa-lib
|
||||||
|
# wayland
|
||||||
|
# xorg.libX11
|
||||||
|
# xorg.libXi
|
||||||
|
# libGL
|
||||||
|
]
|
||||||
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
||||||
libiconv
|
libiconv
|
||||||
# pkgs.darwin.apple_sdk.frameworks.CoreServices
|
# pkgs.darwin.apple_sdk.frameworks.CoreServices
|
||||||
@@ -63,25 +70,60 @@
|
|||||||
# LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
|
# LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
|
||||||
# For using pkg-config that many libraries require
|
# For using pkg-config that many libraries require
|
||||||
# PKG_CONFIG_PATH = lib.makeSearchPath "lib/pkgconfig" (with pkgs;[ openssl.dev zlib.dev ]);
|
# PKG_CONFIG_PATH = lib.makeSearchPath "lib/pkgconfig" (with pkgs;[ openssl.dev zlib.dev ]);
|
||||||
|
LD_LIBRARY_PATH = builtins.concatStringsSep ":" [
|
||||||
|
"${pkgs.xorg.libX11}/lib"
|
||||||
|
"${pkgs.xorg.libXi}/lib"
|
||||||
|
"${pkgs.libGL}/lib"
|
||||||
|
"${pkgs.wayland}/lib"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
||||||
in {
|
in {
|
||||||
checks = {
|
checks = {
|
||||||
hello-clippy = craneLib.cargoClippy (commonArgs
|
tadventure-clippy = craneLib.cargoClippy (commonArgs
|
||||||
// {
|
// {
|
||||||
inherit cargoArtifacts;
|
inherit cargoArtifacts;
|
||||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||||
});
|
});
|
||||||
hello-fmt = craneLib.cargoFmt {
|
tadventure-fmt = craneLib.cargoFmt {
|
||||||
inherit src;
|
inherit src;
|
||||||
};
|
};
|
||||||
hello-nextest = craneLib.cargoNextest (commonArgs
|
tadventure-nextest = craneLib.cargoNextest (commonArgs
|
||||||
// {
|
// {
|
||||||
inherit cargoArtifacts;
|
inherit cargoArtifacts;
|
||||||
partitions = 1;
|
partitions = 1;
|
||||||
partitionType = "count";
|
partitionType = "count";
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
packages = rec {
|
||||||
|
tadventure-unwrapped = pkgs.rustPlatform.buildRustPackage {
|
||||||
|
pname = "tadventure";
|
||||||
|
version = "0.1.0";
|
||||||
|
cargoLock = {
|
||||||
|
lockFile = "${src}/Cargo.lock";
|
||||||
|
};
|
||||||
|
inherit src;
|
||||||
|
};
|
||||||
|
tadventure = pkgs.buildFHSEnv {
|
||||||
|
name = "tadventure";
|
||||||
|
targetPkgs = pkgs:
|
||||||
|
with pkgs; [
|
||||||
|
tadventure-unwrapped
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libXi
|
||||||
|
libGL
|
||||||
|
egl-wayland
|
||||||
|
];
|
||||||
|
multiPkgs = pkgs:
|
||||||
|
with pkgs; [
|
||||||
|
alsa-lib
|
||||||
|
];
|
||||||
|
runScript = ''
|
||||||
|
${tadventure-unwrapped}/bin/tadventure
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
default = tadventure;
|
||||||
|
};
|
||||||
|
|
||||||
devShells.default = (craneLib.overrideToolchain stableToolchainWithRustAnalyzer).devShell (commonArgs
|
devShells.default = (craneLib.overrideToolchain stableToolchainWithRustAnalyzer).devShell (commonArgs
|
||||||
// {
|
// {
|
||||||
@@ -90,6 +132,7 @@
|
|||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
cargo-nextest
|
cargo-nextest
|
||||||
cargo-criterion
|
cargo-criterion
|
||||||
|
trunk
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-9
@@ -1,5 +1,4 @@
|
|||||||
use macroquad::prelude::*;
|
use macroquad::prelude::*;
|
||||||
use once_cell::sync::Lazy;
|
|
||||||
|
|
||||||
pub struct Character {
|
pub struct Character {
|
||||||
pos: Vec2,
|
pos: Vec2,
|
||||||
@@ -9,15 +8,26 @@ pub struct Character {
|
|||||||
|
|
||||||
// static BACKGROUND_TEXTURE: Lazy<Texture2D> =
|
// static BACKGROUND_TEXTURE: Lazy<Texture2D> =
|
||||||
// Lazy::new(|| Texture2D::from_file_with_format(include_bytes!("../assets/grass.png"), None));
|
// Lazy::new(|| Texture2D::from_file_with_format(include_bytes!("../assets/grass.png"), None));
|
||||||
|
fn window_conf() -> Conf {
|
||||||
|
Conf {
|
||||||
|
window_title: "Window Conf".to_owned(),
|
||||||
|
fullscreen: true,
|
||||||
|
platform: miniquad::conf::Platform {
|
||||||
|
linux_backend: miniquad::conf::LinuxBackend::WaylandWithX11Fallback,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[macroquad::main("Tadventure")]
|
#[macroquad::main(window_conf)]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let mut character = Character::new(
|
let mut character = Character::new(
|
||||||
Vec2::new(100.0, 100.0),
|
Vec2::new(100.0, 100.0),
|
||||||
Vec2::new(0.0, 0.0),
|
Vec2::new(0.0, 0.0),
|
||||||
vec2(0f32, 0f32),
|
vec2(0f32, 0f32),
|
||||||
);
|
);
|
||||||
let mut cursor = Cursor::new();
|
let mut cursor = Cursor::default();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
clear_background(GREEN);
|
clear_background(GREEN);
|
||||||
@@ -64,17 +74,12 @@ impl Character {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
pub struct Cursor {
|
pub struct Cursor {
|
||||||
pos: Vec2,
|
pos: Vec2,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Cursor {
|
impl Cursor {
|
||||||
pub fn new() -> Self {
|
|
||||||
Self {
|
|
||||||
pos: vec2(0.0, 0.0),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn handle_mouse(&mut self) {
|
pub fn handle_mouse(&mut self) {
|
||||||
let mouse_pos = mouse_position();
|
let mouse_pos = mouse_position();
|
||||||
self.pos = vec2(mouse_pos.0, mouse_pos.1);
|
self.pos = vec2(mouse_pos.0, mouse_pos.1);
|
||||||
|
|||||||
Reference in New Issue
Block a user