From f6b5bb69b08c06ac4a2a625e0992b4b0d313313c Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 17 Nov 2022 21:22:14 +0000 Subject: [PATCH] Fix spelling errors in hyperspace-roll --- examples/hyperspace-roll/src/customise.rs | 4 ++-- examples/hyperspace-roll/src/graphics.rs | 8 ++++---- examples/hyperspace-roll/src/save.rs | 17 ++++++++++------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/examples/hyperspace-roll/src/customise.rs b/examples/hyperspace-roll/src/customise.rs index ac0e9a96..407797af 100644 --- a/examples/hyperspace-roll/src/customise.rs +++ b/examples/hyperspace-roll/src/customise.rs @@ -280,12 +280,12 @@ pub(crate) fn customise_screen( } } CustomiseState::Upgrade => { - let old_updade = cursor.upgrade; + let old_upgrade = cursor.upgrade; cursor.upgrade = (cursor.upgrade as isize + ud as isize) .rem_euclid(upgrades.len() as isize) as usize; if (upgrades[cursor.upgrade] as u32) < 17 { - if cursor.upgrade != old_updade { + if cursor.upgrade != old_upgrade { load_description( upgrades[cursor.upgrade] as usize, descriptions_map, diff --git a/examples/hyperspace-roll/src/graphics.rs b/examples/hyperspace-roll/src/graphics.rs index bab60ae6..f9b75ff9 100644 --- a/examples/hyperspace-roll/src/graphics.rs +++ b/examples/hyperspace-roll/src/graphics.rs @@ -37,8 +37,8 @@ impl FaceSprites { const S_MALFUNCTION: &Sprite = SPRITES.tags().get("malfunction").sprite(0); const S_HEAL: &Sprite = SPRITES.tags().get("player_heal").sprite(0); const S_BYPASS: &Sprite = SPRITES.tags().get("shield bypass").sprite(0); - const S_DOUBLESHOT: &Sprite = SPRITES.tags().get("double shoot").sprite(0); - const S_TRIPLESHOT: &Sprite = SPRITES.tags().get("triple shoot").sprite(0); + const S_DOUBLE_SHOT: &Sprite = SPRITES.tags().get("double shoot").sprite(0); + const S_TRIPLE_SHOT: &Sprite = SPRITES.tags().get("triple shoot").sprite(0); const S_BLANK: &Sprite = SPRITES.tags().get("blank").sprite(0); const S_DISRUPT: &Sprite = SPRITES.tags().get("disruption").sprite(0); const S_MALFUNCTION_SHOOT: &Sprite = SPRITES.tags().get("malfunction shot").sprite(0); @@ -57,8 +57,8 @@ impl FaceSprites { S_MALFUNCTION, S_HEAL, S_BYPASS, - S_DOUBLESHOT, - S_TRIPLESHOT, + S_DOUBLE_SHOT, + S_TRIPLE_SHOT, S_BLANK, S_DISRUPT, S_MALFUNCTION_SHOOT, diff --git a/examples/hyperspace-roll/src/save.rs b/examples/hyperspace-roll/src/save.rs index 0db839de..804fa4bb 100644 --- a/examples/hyperspace-roll/src/save.rs +++ b/examples/hyperspace-roll/src/save.rs @@ -1,8 +1,8 @@ -use agb::Gba; use agb::save::Error; use agb::sync::Static; +use agb::Gba; -static HIGHSCORE: Static = Static::new(0); +static HIGH_SCORE: Static = Static::new(0); pub fn init_save(gba: &mut Gba) -> Result<(), Error> { gba.save.init_sram(); @@ -22,9 +22,9 @@ pub fn init_save(gba: &mut Gba) -> Result<(), Error> { let high_score = u32::from_le_bytes(buffer); if high_score > 100 { - HIGHSCORE.write(0) + HIGH_SCORE.write(0) } else { - HIGHSCORE.write(high_score) + HIGH_SCORE.write(high_score) } } @@ -32,11 +32,14 @@ pub fn init_save(gba: &mut Gba) -> Result<(), Error> { } pub fn load_high_score() -> u32 { - HIGHSCORE.read() + HIGH_SCORE.read() } pub fn save_high_score(gba: &mut Gba, score: u32) -> Result<(), Error> { - gba.save.access()?.prepare_write(1..5)?.write(1, &score.to_le_bytes())?; - HIGHSCORE.write(score); + gba.save + .access()? + .prepare_write(1..5)? + .write(1, &score.to_le_bytes())?; + HIGH_SCORE.write(score); Ok(()) }