From 482911f27193c4fbe83a4d79b5e198844b3976ec Mon Sep 17 00:00:00 2001 From: mii Date: Thu, 30 Dec 2021 23:11:31 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 33 +++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/main.rs | 3 +++ 3 files changed, 37 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index c9bbdba..e0f1ee3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bytemuck" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" + [[package]] name = "cfg-if" version = "1.0.0" @@ -59,6 +65,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + [[package]] name = "libc" version = "0.2.103" @@ -194,12 +206,22 @@ dependencies = [ "bitflags", ] +[[package]] +name = "rgb" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a374af9a0e5fdcdd98c1c7b64f05004f9ea2555b6c75f211daa81268a3c50f1" +dependencies = [ + "bytemuck", +] + [[package]] name = "rustris" version = "0.1.0" dependencies = [ "crossterm", "rand", + "winconsole", ] [[package]] @@ -271,3 +293,14 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winconsole" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "664fdcefd3903fbe6c463659a3fe4e7a541e717bbf6084cb1cfa98fcb6d88361" +dependencies = [ + "lazy_static", + "rgb", + "winapi", +] diff --git a/Cargo.toml b/Cargo.toml index fb4c86b..ba8d12e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,3 +8,4 @@ edition = "2018" [dependencies] crossterm = "0.21.0" rand = "0.8.4" +winconsole = "*" diff --git a/src/main.rs b/src/main.rs index 5bc60c0..677099b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,10 +11,13 @@ use crossterm::{cursor, event::{Event, KeyCode, KeyEvent, KeyModifiers, read}, e use game_data::GameData; use game_status::GameStatus; use mino_rotation::MinoRotation; +use winconsole::console; use crate::{block::Block, rustris::Rustris}; fn main() { + console::set_title("Rustris"); + let stdout = Arc::new(Mutex::new(stdout())); enable_raw_mode().unwrap();