From b03268f363ce06eb64041a3ece4d05bf8c2ad866 Mon Sep 17 00:00:00 2001 From: Constantin Date: Sat, 3 Feb 2024 13:40:59 +0100 Subject: [PATCH] Added macro doc --- agb-image-converter/src/lib.rs | 9 +++++++++ agb/src/display/object/sprites/sprite.rs | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/agb-image-converter/src/lib.rs b/agb-image-converter/src/lib.rs index f1d6f32e..4831da61 100644 --- a/agb-image-converter/src/lib.rs +++ b/agb-image-converter/src/lib.rs @@ -171,6 +171,15 @@ impl config::Config for IncludeBackgroundGfxInput { } } +/// Including from the out directory is supported through the `$OUT_DIR` token. +/// +/// ```rust,ignore +/// # #![no_std] +/// # #![no_main] +/// # use agb::include_background_gfx; +/// include_background_gfx!(generated_background, "000000", DATA => "$OUT_DIR/generated_background.aseprite"); +/// ``` +/// #[proc_macro] pub fn include_background_gfx(input: TokenStream) -> TokenStream { let config = Box::new(parse_macro_input!(input as IncludeBackgroundGfxInput)); diff --git a/agb/src/display/object/sprites/sprite.rs b/agb/src/display/object/sprites/sprite.rs index 0857e283..1c688dee 100644 --- a/agb/src/display/object/sprites/sprite.rs +++ b/agb/src/display/object/sprites/sprite.rs @@ -91,6 +91,17 @@ macro_rules! align_bytes { /// name in code. You should ensure tags are unique as this is not enforced by /// aseprite. /// +/// Including from the out directory is supported through the `$OUT_DIR` token. +/// +/// ```rust,ignore +/// # #![no_std] +/// # #![no_main] +/// # use agb::{display::object::Graphics, include_aseprite}; +/// const GRAPHICS: &Graphics = include_aseprite!( +/// "$OUT_DIR/generated_sprite.aseprite" +/// ); +/// ``` +/// #[macro_export] macro_rules! include_aseprite { ($($aseprite_path: expr),*) => {{