agbrs / agb

Library for writing Game Boy Advance games in Rust
https://agbrs.dev/
Mozilla Public License 2.0
319 stars 27 forks source link

Allowing imported graphics to be exposed as `pub mod` #732

Closed kouta-kun closed 1 month ago

kouta-kun commented 4 months ago

I would like imported graphics in a module to be (optionally) exposed as pub mod and be used from other modules than the one it was imported in.

I already have a POC of it in this fork but the README mentions that an issue should be opened first for discussion :)

corwinkuiper commented 4 months ago

To unblock, you can achieve this now using re-exports. For example:

pub mod bg {
   agb::include_background_gfx!(backgrounds, "FFFFFF", some_map => "some-data.aseprite");

   pub use backgrounds::*;
}
gwilymk commented 4 months ago

From the code it seems you do pub backgrounds in @corwinkuiper's example above? I think that makes perfect sense, so happy for you to PR that as well :).

gwilymk commented 1 month ago

Added in 0.21.0