Skip to content

Commit

Permalink
chore: refactor some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Apr 27, 2024
1 parent 0dee83e commit e1f19ae
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gui/src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Gui {
}
}

pub struct GuiOptions {
struct GuiOptions {
width: i32,
height: i32,

Expand All @@ -89,7 +89,7 @@ impl<'a> Drawer<'a> {
self.draw_board();
}

pub fn draw_board(&mut self) {
fn draw_board(&mut self) {
self.drawer.clear_background(Color::BLACK);

for rank in Rank::iter().rev() {
Expand Down Expand Up @@ -123,7 +123,7 @@ impl<'a> Drawer<'a> {
);
}

pub fn draw_square(&mut self, sq: Square) {
fn draw_square(&mut self, sq: Square) {
let pc = self.gui.board.at(sq);
let a = match pc {
ataxx::Color::White => 0.0,
Expand Down Expand Up @@ -158,6 +158,7 @@ impl<'a> Drawer<'a> {
);

if pc == ataxx::Color::None {
// No piece to draw.
return;
}

Expand All @@ -172,7 +173,7 @@ impl<'a> Drawer<'a> {
}
}

pub struct Textures {
struct Textures {
pieces: Texture2D,
square: Texture2D,
border: Texture2D,
Expand All @@ -187,7 +188,7 @@ macro_rules! load_png_texture {
}

impl Textures {
pub fn load(rl: &mut RaylibHandle, thread: &RaylibThread) -> Textures {
fn load(rl: &mut RaylibHandle, thread: &RaylibThread) -> Textures {
Textures {
pieces: load_png_texture!(rl, thread, "../assets/ataxx-pieces.png"),
square: load_png_texture!(rl, thread, "../assets/ataxx-square.png"),
Expand Down

0 comments on commit e1f19ae

Please sign in to comment.