Prints the EndBASIC welcome message to a graphical console.
(console: &mut dyn Console)
| 40 | |
| 41 | /// Prints the EndBASIC welcome message to a graphical console. |
| 42 | fn print_graphical_welcome(console: &mut dyn Console) -> io::Result<()> { |
| 43 | let glyph_size = console.glyph_size()?; |
| 44 | |
| 45 | let previous_sync = console.set_sync(false)?; |
| 46 | let result = (|| { |
| 47 | print_wide_welcome(console, " ")?; |
| 48 | |
| 49 | let x1 = i32::from(glyph_size.width) * 4; |
| 50 | let x2 = i32::from(glyph_size.width) * 8; |
| 51 | let y1 = i32::from(glyph_size.height) / 2; |
| 52 | let y2 = i32::from(glyph_size.height) * 7 / 2; |
| 53 | logo::draw_logo( |
| 54 | console, |
| 55 | PixelsXY::new(x1 as i16, y1 as i16), |
| 56 | Some(PixelsXY::new(x2 as i16, y2 as i16)), |
| 57 | )?; |
| 58 | |
| 59 | Ok(()) |
| 60 | })(); |
| 61 | console.set_sync(previous_sync)?; |
| 62 | result |
| 63 | } |
| 64 | |
| 65 | /// Checks if the given `console` has graphics support. |
| 66 | fn has_graphics(console: &dyn Console) -> bool { |
no test coverage detected