mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Added macro doc
This commit is contained in:
parent
3cd71b120f
commit
b03268f363
|
@ -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]
|
#[proc_macro]
|
||||||
pub fn include_background_gfx(input: TokenStream) -> TokenStream {
|
pub fn include_background_gfx(input: TokenStream) -> TokenStream {
|
||||||
let config = Box::new(parse_macro_input!(input as IncludeBackgroundGfxInput));
|
let config = Box::new(parse_macro_input!(input as IncludeBackgroundGfxInput));
|
||||||
|
|
|
@ -91,6 +91,17 @@ macro_rules! align_bytes {
|
||||||
/// name in code. You should ensure tags are unique as this is not enforced by
|
/// name in code. You should ensure tags are unique as this is not enforced by
|
||||||
/// aseprite.
|
/// 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_export]
|
||||||
macro_rules! include_aseprite {
|
macro_rules! include_aseprite {
|
||||||
($($aseprite_path: expr),*) => {{
|
($($aseprite_path: expr),*) => {{
|
||||||
|
|
Loading…
Reference in a new issue