Use agb::fixnum rather than agb::number

This commit is contained in:
Gwilym Kuiper 2022-01-12 22:09:57 +00:00
parent fc6c575b88
commit 19f071fd5a
16 changed files with 37 additions and 13 deletions

View file

@ -1,8 +1,8 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
use agb::fixnum::Num;
use agb::input::{Button, ButtonController, Tri}; use agb::input::{Button, ButtonController, Tri};
use agb::number::Num;
use agb::sound::mixer::SoundChannel; use agb::sound::mixer::SoundChannel;
use agb::{include_wav, Gba}; use agb::{include_wav, Gba};

View file

@ -3,8 +3,8 @@
use agb::{ use agb::{
display::example_logo, display::example_logo,
fixnum::FixedNum,
interrupt::{Interrupt, Mutex}, interrupt::{Interrupt, Mutex},
number::FixedNum,
}; };
struct BackCosines { struct BackCosines {

View file

@ -1,8 +1,8 @@
use core::ops::Index; use core::ops::Index;
use crate::{ use crate::{
fixnum::{Rect, Vector2D},
memory_mapped::{MemoryMapped, MemoryMapped1DArray}, memory_mapped::{MemoryMapped, MemoryMapped1DArray},
number::{Rect, Vector2D},
}; };
use super::{ use super::{

View file

@ -2,8 +2,8 @@ use core::cell::RefCell;
use super::{palette16, Priority, DISPLAY_CONTROL}; use super::{palette16, Priority, DISPLAY_CONTROL};
use crate::bitarray::Bitarray; use crate::bitarray::Bitarray;
use crate::fixnum::Vector2D;
use crate::memory_mapped::MemoryMapped1DArray; use crate::memory_mapped::MemoryMapped1DArray;
use crate::number::Vector2D;
type AffineLoan<'a> = crate::arena::Loan<'a, 32>; type AffineLoan<'a> = crate::arena::Loan<'a, 32>;
type AffineArena = crate::arena::Arena<32>; type AffineArena = crate::arena::Arena<32>;

View file

@ -152,7 +152,7 @@ mod memory_mapped;
/// Implements logging to the mgba emulator. /// Implements logging to the mgba emulator.
pub mod mgba; pub mod mgba;
/// Implementation of fixnums for working with non-integer values. /// Implementation of fixnums for working with non-integer values.
pub use agb_fixnum as number; pub use agb_fixnum as fixnum;
mod single; mod single;
/// Implements sound output. /// Implements sound output.
pub mod sound; pub mod sound;

View file

@ -4,7 +4,7 @@ mod sw_mixer;
pub use sw_mixer::ChannelId; pub use sw_mixer::ChannelId;
pub use sw_mixer::Mixer; pub use sw_mixer::Mixer;
use crate::number::Num; use crate::fixnum::Num;
use crate::timer::Timer; use crate::timer::Timer;
#[non_exhaustive] #[non_exhaustive]

View file

@ -1,7 +1,7 @@
use super::hw; use super::hw;
use super::hw::LeftOrRight; use super::hw::LeftOrRight;
use super::{SoundChannel, SoundPriority}; use super::{SoundChannel, SoundPriority};
use crate::number::Num; use crate::fixnum::Num;
use crate::timer::Timer; use crate::timer::Timer;
// Defined in mixer.s // Defined in mixer.s

View file

@ -1,7 +1,7 @@
use core::arch::asm; use core::arch::asm;
use crate::display::object::AffineMatrixAttributes; use crate::display::object::AffineMatrixAttributes;
use crate::number::Num; use crate::fixnum::Num;
#[allow(non_snake_case)] #[allow(non_snake_case)]

View file

@ -12,12 +12,20 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
name = "agb" name = "agb"
version = "0.8.0" version = "0.8.0"
dependencies = [ dependencies = [
"agb_fixnum",
"agb_image_converter", "agb_image_converter",
"agb_macros", "agb_macros",
"agb_sound_converter", "agb_sound_converter",
"bitflags", "bitflags",
] ]
[[package]]
name = "agb_fixnum"
version = "0.1.0"
dependencies = [
"agb_macros",
]
[[package]] [[package]]
name = "agb_image_converter" name = "agb_image_converter"
version = "0.6.0" version = "0.6.0"

View file

@ -12,12 +12,20 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
name = "agb" name = "agb"
version = "0.8.0" version = "0.8.0"
dependencies = [ dependencies = [
"agb_fixnum",
"agb_image_converter", "agb_image_converter",
"agb_macros", "agb_macros",
"agb_sound_converter", "agb_sound_converter",
"bitflags", "bitflags",
] ]
[[package]]
name = "agb_fixnum"
version = "0.1.0"
dependencies = [
"agb_macros",
]
[[package]] [[package]]
name = "agb_image_converter" name = "agb_image_converter"
version = "0.6.0" version = "0.6.0"

View file

@ -170,7 +170,7 @@ mod tiled_export {
&mut writer, &mut writer,
r#" r#"
use crate::Level; use crate::Level;
use agb::number::Vector2D; use agb::fixnum::Vector2D;
pub const fn get_level() -> Level {{ pub const fn get_level() -> Level {{
Level {{ Level {{

View file

@ -1,7 +1,7 @@
use super::{object_tiles, sfx::SfxPlayer, Entity, FixedNumberType, HatState, Level}; use super::{object_tiles, sfx::SfxPlayer, Entity, FixedNumberType, HatState, Level};
use agb::{ use agb::{
display::object::{ObjectControl, Size}, display::object::{ObjectControl, Size},
number::Vector2D, fixnum::Vector2D,
}; };
enum UpdateState { enum UpdateState {

View file

@ -109,8 +109,8 @@ use agb::{
object::{ObjectControl, ObjectStandard, Size}, object::{ObjectControl, ObjectStandard, Size},
Priority, HEIGHT, WIDTH, Priority, HEIGHT, WIDTH,
}, },
fixnum::{FixedNum, Vector2D},
input::{self, Button, ButtonController}, input::{self, Button, ButtonController},
number::{FixedNum, Vector2D},
}; };
type FixedNumberType = FixedNum<10>; type FixedNumberType = FixedNum<10>;

View file

@ -12,12 +12,20 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
name = "agb" name = "agb"
version = "0.8.0" version = "0.8.0"
dependencies = [ dependencies = [
"agb_fixnum",
"agb_image_converter", "agb_image_converter",
"agb_macros", "agb_macros",
"agb_sound_converter", "agb_sound_converter",
"bitflags", "bitflags",
] ]
[[package]]
name = "agb_fixnum"
version = "0.1.0"
dependencies = [
"agb_macros",
]
[[package]] [[package]]
name = "agb_image_converter" name = "agb_image_converter"
version = "0.6.0" version = "0.6.0"

View file

@ -16,8 +16,8 @@ use agb::{
object::{ObjectControl, ObjectStandard}, object::{ObjectControl, ObjectStandard},
Priority, HEIGHT, WIDTH, Priority, HEIGHT, WIDTH,
}, },
fixnum::{FixedNum, Rect, Vector2D},
input::{Button, ButtonController, Tri}, input::{Button, ButtonController, Tri},
number::{FixedNum, Rect, Vector2D},
}; };
use generational_arena::Arena; use generational_arena::Arena;

View file

@ -1,5 +1,5 @@
use super::rng::get_random; use super::rng::get_random;
use agb::number::Num; use agb::fixnum::Num;
use agb::sound::mixer::{ChannelId, Mixer, SoundChannel}; use agb::sound::mixer::{ChannelId, Mixer, SoundChannel};
const BAT_DEATH: &[u8] = agb::include_wav!("sfx/BatDeath.wav"); const BAT_DEATH: &[u8] = agb::include_wav!("sfx/BatDeath.wav");