0.22.0
·
627 commits
to master
since this release
This release comes with a major change to everything in agb::display. Mostly built around the new GraphicsFrame
used to show both backgrounds and objects to the screen. See the newly expanded book
which covers many topics including advanced articles for more exciting graphical effects and completed
tutorial.
You can now also try all the examples online on your browser, including modifying the
code and seeing how that changes the behaviour of the example!
Added
GraphicsFrameis now how you manage what gets displayed to the screen. Both for backgrounds and objects.- Lots more examples.
- The crate is 100% documented!
#[agb::entry]now produces code which is compatible with rust 2024.- Introduced
agb::display::{Rgb15, Rgb}to represent colours and allow for basic interpolation and conversion. - You can now pass any constant expression to the
num!macro. - Added
roundmethods forNumandVector2Dthat rounds towards the nearest integer. - Added
clamp_pointand corner methods toRect. - Added
widthandheighttoTileDatato track the original size of your backgrounds. - Added an
eprintln!()macro which prints at error level for mgba. - More
num_traitshave been implemeted forNum<I, N>. - The template now includes
extern crate alloc;to avoid any confusion about whether alloc is supported. - Blending and windows now work with affine backgrounds as well as regular backgrounds
- Added
animation_frametoTagto allow for more efficient sprite animations. - You can now write your own doc tests using the
agb::doctestmacro.
Changed
- The VRamManager is now global, accessed via the
VRAM_MANAGER. - You no longer need to pick a tiled mode, instead this is managed by the
GraphicsFrame. - Blending, windows and DMA are managed via the
GraphicsFrame. - DMA is now entirely safe and is managed by
HBlankDma. - The
agb::displaymodule has been flattened quite significantly. InfiniteScrolledMapnow takes the tile generation function inset_posrather than in the constructor.- There are getters and setters for almost all properties in
RegularBackgroundandAffineBackground. - Affine tile allocation is now much more reliable, rather than it basically being pure luck whether a tile successfully displays.
- Where
agbused to acceptu16values for colours, it now expects the newRgb15type to avoid type confusion. - The mixer now uses
SoundDatarather than&[u8]sound effects and music. - In debug mode,
Numwill now panic if you're multiplying or dividing when it has too much precision set. - Palette16 is now in the
agb::displaymodule. - You get the
graphicsfromgba.graphicsrather thangba.display.graphics. - DynamicTiles are now automatically freed when they are dropped, so you don't need to manually manage that memory any more.
- Font rendering for backgrounds and objects have been unified via the
Layoutstruct, and are rendered using the new
ObjectFontRendererandBackgroundFontRenderer. Both fully support colour changes and other arbitrary tags. AffineMatrixInstanceis nowAffineMatrixObjectand the existingAffineMatrixObjecthas been removed to simplify the conversion.AffineMatrixis now generic on the integer type.sinandcosforNum<I, N>has been improved to use a look-up table with linear interpolation rather than a 3rd order polynomial.- Object's
set_position()function was renamed toset_pos(). include_background_gfx!now requires amodkeyword before the module name.inculde_aseprite!now creates static variables for each tag rather than using constant string matching.- Unmanaged objects are now managed by the
GraphicsFramerather thanOamIteratorand now only make their changes when.commit()is called. ObjectUnmanagedis nowObject.- Affine objects are now a separate type
ObjectAffine. - For compatibility with rust 2024,
rng::gen()has been renamed torng::next_u32().
Removed
- Removed bitmap modes. These were accidentally unsound and don't play well with objects or other tiled backgrounds. Some thought needs to go
into the API to bring these back. - Removed the dmg audio module. It will return in future but with a better thought out API which will work together with the existing mixer.
- Removed
VRamManager.set_background_palette_rawsince it is actually unsafe and didn't work as intended for smaller palettes in release mode. - Removed the
syscallmodule and put the usefulhaltmethod inagb::halt(). - Removed the
mgbamodule since you should do all printing via theprintln!()macro. - Removed 'managed' objects. The new
GraphicsFrameuses a similar paradigm to the old 'unmanaged objects'. But these are now justObject. - Removed
mixer.enable(). This is now done by default so you just don't need to call it.