MCPcopy Index your code
hub / github.com/endbasic/endbasic / print_graphical_welcome

Function print_graphical_welcome

repl/src/lib.rs:42–63  ·  view source on GitHub ↗

Prints the EndBASIC welcome message to a graphical console.

(console: &mut dyn Console)

Source from the content-addressed store, hash-verified

40
41/// Prints the EndBASIC welcome message to a graphical console.
42fn 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.
66fn has_graphics(console: &dyn Console) -> bool {

Callers 1

print_welcomeFunction · 0.85

Calls 4

print_wide_welcomeFunction · 0.85
draw_logoFunction · 0.85
glyph_sizeMethod · 0.45
set_syncMethod · 0.45

Tested by

no test coverage detected