Skip to content

Commit

Permalink
Rename PossibleWindowUpdater to MaybeWindowUpdater
Browse files Browse the repository at this point in the history
  • Loading branch information
CaspianA1 committed Jan 23, 2025
1 parent ef6707a commit 3c2077f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/dashboard_defs/spinitron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{
ColorSDL,
WindowContents,
WindowUpdaterParams,
PossibleWindowUpdater
MaybeWindowUpdater
},

spinitron::model::{SpinitronModelName, NUM_SPINITRON_MODEL_TYPES}
Expand Down Expand Up @@ -137,7 +137,7 @@ pub fn make_spinitron_windows(

////////// Making the model windows

let spinitron_model_window_updater: PossibleWindowUpdater = Some((spinitron_model_window_updater_fn, model_update_rate));
let spinitron_model_window_updater: MaybeWindowUpdater = Some((spinitron_model_window_updater_fn, model_update_rate));

// TODO: perhaps for making multiple model windows, allow for an option to have sub-model-windows
all_model_windows_info.iter().flat_map(|general_info| {
Expand Down
10 changes: 5 additions & 5 deletions src/window_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct WindowUpdaterParams<'a, 'b, 'c, 'd> {
pub area_drawn_to_screen: (u32, u32)
}

pub type PossibleWindowUpdater = Option<(
pub type MaybeWindowUpdater = Option<(
fn(WindowUpdaterParams) -> MaybeError,
UpdateRate
)>;
Expand Down Expand Up @@ -134,7 +134,7 @@ impl WindowContents {
//////////

pub struct Window {
possible_updater: PossibleWindowUpdater,
maybe_updater: MaybeWindowUpdater,
state: DynamicOptional,
contents: WindowContents,

Expand Down Expand Up @@ -181,7 +181,7 @@ pub struct Window {

impl Window {
pub fn new(
possible_updater: PossibleWindowUpdater,
maybe_updater: MaybeWindowUpdater,
state: DynamicOptional,
contents: WindowContents,
maybe_border_color: Option<ColorSDL>,
Expand All @@ -196,7 +196,7 @@ impl Window {
};

Self {
possible_updater, state, contents,
maybe_updater, state, contents,
skip_drawing: false,
skip_aspect_ratio_correction: false,
maybe_border_color,
Expand Down Expand Up @@ -277,7 +277,7 @@ impl Window {
- If no updaters are called, don't redraw anything.
- For any specific node, if that updater doesn't have an effect, then don't draw for that node. */

if let Some((updater, update_rate)) = self.possible_updater {
if let Some((updater, update_rate)) = self.maybe_updater {
if update_rate.is_time_to_update(rendering_params.frame_counter) {
//////////

Expand Down

0 comments on commit 3c2077f

Please sign in to comment.