Skip to content

Commit c2a53a6

Browse files
authored
Merge pull request #2 from firefly-zero/quit
Add `quit` function
2 parents 8beed2d + 4c5adb1 commit c2a53a6

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

src/bindings.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ extern {
2020
pub(crate) fn log_error(ptr: u32, len: u32);
2121
pub(crate) fn set_seed(seed: u32);
2222
pub(crate) fn get_random() -> u32;
23+
pub(crate) fn quit();
2324
}

src/graphics/funcs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn set_color(c: Color, v: RGB) {
1515
}
1616
}
1717

18-
/// Set the color palette for the current frame.
18+
/// Set the color palette.
1919
pub fn set_colors(dark: RGB, accent: RGB, secondary: RGB, light: RGB) {
2020
unsafe {
2121
b::set_colors(
@@ -42,7 +42,7 @@ pub fn draw_point(p: Point, c: Color) {
4242
}
4343
}
4444

45-
/// Draw a direct line from point a to point b.
45+
/// Draw a straight line from point a to point b.
4646
pub fn draw_line(a: Point, b: Point, s: LineStyle) {
4747
unsafe {
4848
b::draw_line(a.x, a.y, b.x, b.y, s.color.into(), s.width);

src/graphics/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub struct RGB {
66
pub b: u8,
77
}
88

9-
/// Style of the shape.
9+
/// Style of a shape.
1010
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
1111
pub struct Style {
1212
/// The color to use to fill the shape.

src/input.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl From<Size> for Pad {
8484
}
8585
}
8686

87-
/// DPad-like representation of the [Pad].
87+
/// DPad-like representation of the [`Pad`].
8888
///
8989
/// Constructed with [`Pad::as_dpad`]. Useful for simple games and ports.
9090
/// The middle of the pad is a "dead zone" pressing which will not activate any direction.
@@ -129,7 +129,7 @@ impl DPad {
129129
}
130130
}
131131

132-
/// Given the old state, get directions that were pressed but are still pressed now.
132+
/// Given the old state, get directions that were pressed and are still pressed now.
133133
#[must_use]
134134
pub fn held(&self, old: &Self) -> Self {
135135
Self {

src/misc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ pub fn set_seed(seed: u32) {
3030
pub fn get_random() -> u32 {
3131
unsafe { b::get_random() }
3232
}
33+
34+
/// Exit the app after the current update is finished.
35+
pub fn quit() {
36+
unsafe { b::quit() }
37+
}

0 commit comments

Comments
 (0)