mindustry logic execution, map- and schematic- parsing and rendering
| -rw-r--r-- | lemu/Cargo.toml | 2 | ||||
| -rw-r--r-- | lemu/src/instructions/draw.rs | 2 | ||||
| -rw-r--r-- | lemu/src/main.rs | 18 |
3 files changed, 12 insertions, 10 deletions
diff --git a/lemu/Cargo.toml b/lemu/Cargo.toml index 016a137..4f48092 100644 --- a/lemu/Cargo.toml +++ b/lemu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lemu" -version = "0.2.6" +version = "0.2.7" edition = "2021" description = "M-LOG runner" authors = ["bend-n <[email protected]>"] diff --git a/lemu/src/instructions/draw.rs b/lemu/src/instructions/draw.rs index bfeaf66..b090215 100644 --- a/lemu/src/instructions/draw.rs +++ b/lemu/src/instructions/draw.rs @@ -143,7 +143,7 @@ impl<'v> DrawInstruction<'v> for Line<'v> { macro_rules! unbounded { ($img:ident @ $x:expr => $y:expr) => { - $img.width() < $x || $img.height() < $y + $img.width() <= $x || $img.height() <= $y }; } diff --git a/lemu/src/main.rs b/lemu/src/main.rs index b0a2022..49841d1 100644 --- a/lemu/src/main.rs +++ b/lemu/src/main.rs @@ -10,14 +10,16 @@ fn main() -> ExitCode { args.next().unwrap(); // path to executable for file in args { let f = std::fs::read_to_string(&file).unwrap(); - let mut lex: Executor<Stdout> = - match Executor::with_output(io::stdout()).display().program(&f) { - Ok(x) => x, - Err(e) => { - eprint!("{}", e.diagnose(&f)); - return ExitCode::FAILURE; - } - }; + let mut lex: Executor<Stdout> = match Executor::with_output(io::stdout()) + .large_display() + .program(&f) + { + Ok(x) => x, + Err(e) => { + eprint!("{}", e.diagnose(&f)); + return ExitCode::FAILURE; + } + }; lex.run(); let Output { displays, .. } = lex.output(); for (d, i) in displays.iter().zip(1..=displays.len()) { |