fix(ui): black lines between blocks

This commit is contained in:
rick 2022-02-16 01:32:55 +01:00
parent bc546a22c8
commit 065be39357
Signed by: Rick
GPG key ID: 4A6223D66294EB20

View file

@ -35,8 +35,6 @@ use std::env;
fn main() {
let name_file = &env::args().collect::<Vec<String>>()[1];
//read_file(Path::new("15PUZZLE"));
//return;
let mut t: Machine = Machine::new();
t.init();
match t.load_rom(Path::new(name_file)) {
@ -49,8 +47,7 @@ fn main() {
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
//let window = video_subsystem.window("Chip8 Emulator", 200 + 11 * WIDTH as u32, 11 * HEIGHT as u32)
let window = video_subsystem.window("Chip8 Emulator", 11 * WIDTH as u32, 11 * HEIGHT as u32)
let window = video_subsystem.window("Chip8 Emulator", 200 + 11 * WIDTH as u32, 11 * HEIGHT as u32)
.position_centered()
.build()
.unwrap();
@ -59,9 +56,9 @@ fn main() {
canvas.set_draw_color(Color::RGB(0, 0, 0));
canvas.clear();
canvas.present();
//canvas.set_draw_color(Color::RGB(255, 255, 255));
//canvas.draw_line(Point::new(74 + 10 * WIDTH as i32, 0),
// Point::new(74 + 10 * WIDTH as i32, 42 + 10 * HEIGHT as i32));
canvas.set_draw_color(Color::RGB(255, 255, 255));
canvas.draw_line(Point::new(11 * WIDTH as i32, 0),
Point::new(11 * WIDTH as i32, 11 * HEIGHT as i32)).unwrap();
canvas.present();
let mut event_pump = sdl_context.event_pump().unwrap();
@ -71,8 +68,8 @@ fn main() {
for i in 0..t.display_buffer.len() {
for j in 0..t.display_buffer[i].len() {
let ti = i * 10 + i;
let tj = j * 10 + j;
let ti = i * 10 + 10;
let tj = j * 10 + 10;
if t.display_buffer[i][j] == 1 {
canvas.set_draw_color(Color::RGB(255, 255, 255));
canvas.fill_rect(Rect::new(tj as i32, ti as i32, 10, 10)).unwrap();