summaryrefslogtreecommitdiff
path: root/crates/renderer/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/renderer/src/main.rs')
-rw-r--r--crates/renderer/src/main.rs43
1 files changed, 41 insertions, 2 deletions
diff --git a/crates/renderer/src/main.rs b/crates/renderer/src/main.rs
index ae8cc03..b71a836 100644
--- a/crates/renderer/src/main.rs
+++ b/crates/renderer/src/main.rs
@@ -1,3 +1,6 @@
+#![feature(unix_socket_ancillary_data)]
+#![feature(str_from_utf16_endian)]
+#![feature(try_blocks)]
#![allow(dead_code, unused_variables)]
mod assets;
mod terminal;
@@ -5,9 +8,12 @@ mod background;
mod toggle;
mod overlay;
mod input;
+mod ffi;
+mod texture_server;
use teleia::*;
-use clap::{command, Command};
+use clap::{command, Command, Arg};
+use std::io::Write as _;
pub fn main() -> Erm<()> {
let matches = command!()
@@ -22,6 +28,16 @@ pub fn main() -> Erm<()> {
Command::new("model-terminal")
.about("Run the LCOLONQ model renderer in a terminal")
)
+ .subcommand(
+ Command::new("validate-card")
+ .arg(Arg::new("path"))
+ .about("Validate the TCG card at the given path.")
+ )
+ .subcommand(
+ Command::new("repair-card")
+ .arg(Arg::new("path"))
+ .about("Repair the TCG card at the given path.")
+ )
.get_matches();
match matches.subcommand() {
Some(("overlay", _cm)) => {
@@ -29,8 +45,10 @@ pub fn main() -> Erm<()> {
overlay::Overlays::new(ctx, vec![
Box::new(overlay::automata::Overlay::new(ctx)),
Box::new(overlay::shader::Overlay::new(ctx)),
- Box::new(overlay::drawing::Overlay::new(ctx)),
Box::new(overlay::tcg::Overlay::new(ctx)),
+ Box::new(overlay::clippy::Overlay::new(ctx)),
+ Box::new(overlay::combo::Overlay::new(ctx)),
+ Box::new(overlay::drawing::Overlay::new(ctx)),
// Box::new(overlay::model::Overlay::new(ctx)),
// Box::new(overlay::loopback::Overlay::new(ctx)),
])
@@ -39,6 +57,27 @@ pub fn main() -> Erm<()> {
Some(("model-terminal", _cm)) => {
teleia::run("LCOLONQ", 1920, 1080, teleia::Options::HIDDEN, overlay::model::Terminal::new)?;
},
+ Some(("validate-card", cm)) => {
+ if let Some(path) = cm.get_one::<String>("path") {
+ if overlay::tcg::validate_card(&std::fs::read(path)?)? {
+ println!("signatures match!");
+ std::process::exit(0);
+ } else {
+ println!("signatures do not match");
+ std::process::exit(1);
+ }
+ } else {
+ eprintln!("no path specified");
+ }
+ },
+ Some(("repair-card", cm)) => {
+ if let Some(path) = cm.get_one::<String>("path") {
+ let res = overlay::tcg::repair_card(&std::fs::read(path)?)?;
+ std::io::stdout().write_all(&res)?;
+ } else {
+ eprintln!("no path specified");
+ }
+ },
_ => unreachable!("no subcommand"),
}
Ok(())