Code cleanup

This commit is contained in:
2026-05-03 18:11:32 +01:00
parent 3973ff94b0
commit 1ecf31b6fa
3 changed files with 44 additions and 24 deletions
+3 -3
View File
@@ -8,11 +8,11 @@ use crate::renderer::structs::Screen;
impl Screen<'_> {
pub fn _get_context(&self) -> &Sdl {
pub fn get_context(&self) -> &Sdl {
return &self.context;
}
pub fn _print(&mut self, line: u32, text: &str) {
pub fn print(&mut self, line: u32, text: &str) {
let rendered_text = self.font.render(text).solid(Color::RED).unwrap();
let texture_creator = self.canvas.texture_creator();
let texture = rendered_text.as_texture(&texture_creator).unwrap();
@@ -31,7 +31,7 @@ impl Screen<'_> {
/// Initialize video, allocate buffers and load fonts
/// Based on https://github.com/vhspace/sdl3-rs/blob/master/examples/ttf-demo.rs
pub fn _init(prefs: &Prefs) -> Screen<'_> {
pub fn init(prefs: &Prefs) -> Screen<'_> {
// Initialize the screen
let sdl_context = sdl3::init().unwrap();
let video_subsys = sdl_context.video().unwrap();