From d98e0f9a2e0fa3d4ab3ccf2857b14685e8a7a565 Mon Sep 17 00:00:00 2001 From: GValiente Date: Tue, 17 Oct 2023 13:00:34 +0200 Subject: [PATCH] butano: some clangd warnings fixed --- butano/hw/include/bn_hw_audio.h | 2 +- butano/hw/include/bn_hw_dma.h | 6 ++-- butano/hw/include/bn_hw_hblank_effects.h | 1 - butano/hw/include/bn_hw_sram.h | 4 +-- butano/hw/include/bn_hw_timer.h | 1 - butano/hw/src/bn_hw_audio.cpp | 5 ++-- butano/hw/src/bn_hw_common.bn_noflto.cpp | 4 +-- butano/hw/src/bn_hw_link.cpp | 2 +- butano/hw/src/bn_hw_memory.cpp | 5 +++- butano/include/bn_assert.h | 3 +- butano/include/bn_best_fit_allocator.h | 2 +- butano/include/bn_bitset.h | 2 +- butano/include/bn_blending_fade_alpha.h | 3 +- butano/include/bn_dmg_music_position.h | 8 ++--- butano/include/bn_documentation.h | 2 +- butano/include/bn_regular_bg_map_cell_info.h | 4 +-- butano/include/bn_rumble.h | 1 - butano/include/bn_sprite_affine_mat_actions.h | 1 - butano/include/bn_sprite_tiles_item.h | 6 ++-- butano/src/bn_audio_manager.cpp | 1 - butano/src/bn_bg_blocks_manager.cpp | 22 +++++++------- butano/src/bn_cameras_manager.cpp | 2 +- butano/src/bn_hdma_manager.cpp | 5 ---- butano/src/bn_keypad_manager.cpp | 2 +- butano/src/bn_reciprocal_lut.cpp | 2 +- ...gular_bg_horizontal_position_hbe_handler.h | 1 - ...regular_bg_vertical_position_hbe_handler.h | 1 - butano/src/bn_sprite_affine_mats_manager.cpp | 1 + butano/src/bn_sprite_tiles_manager.cpp | 30 +++++++------------ butano/src/bn_sprites_manager.bn_iwram.cpp | 1 + butano/src/bn_sprites_manager.cpp | 4 +-- butano/src/bn_sprites_manager_item.h | 1 - docs/changelog.html | 2 +- 33 files changed, 60 insertions(+), 77 deletions(-) diff --git a/butano/hw/include/bn_hw_audio.h b/butano/hw/include/bn_hw_audio.h index cc29f54f7..9ae8cf33a 100644 --- a/butano/hw/include/bn_hw_audio.h +++ b/butano/hw/include/bn_hw_audio.h @@ -94,7 +94,7 @@ namespace bn::hw::audio inline void set_sound_master_volume(int volume) { - mmSetEffectsVolume(volume); + mmSetEffectsVolume(mm_word(volume)); } [[nodiscard]] bool update_on_vblank(); diff --git a/butano/hw/include/bn_hw_dma.h b/butano/hw/include/bn_hw_dma.h index c84306249..406a1400b 100644 --- a/butano/hw/include/bn_hw_dma.h +++ b/butano/hw/include/bn_hw_dma.h @@ -26,7 +26,7 @@ inline void copy_half_words(const void* source, int half_words, void* destinatio REG_DMA[3].cnt = 0; REG_DMA[3].src = source; REG_DMA[3].dst = destination; - REG_DMA[3].cnt = half_words | DMA_CPY16; + REG_DMA[3].cnt = unsigned(half_words) | DMA_CPY16; } inline void copy_words(const void* source, int words, void* destination) @@ -34,7 +34,7 @@ inline void copy_words(const void* source, int words, void* destination) REG_DMA[3].cnt = 0; REG_DMA[3].src = source; REG_DMA[3].dst = destination; - REG_DMA[3].cnt = words | DMA_CPY32; + REG_DMA[3].cnt = unsigned(words) | DMA_CPY32; } inline void start_hdma(int channel, const uint16_t* source, int half_words, uint16_t* destination) @@ -42,7 +42,7 @@ inline void start_hdma(int channel, const uint16_t* source, int half_words, uint REG_DMA[channel].cnt = 0; REG_DMA[channel].src = source; REG_DMA[channel].dst = destination; - REG_DMA[channel].cnt = half_words | DMA_HDMA; + REG_DMA[channel].cnt = unsigned(half_words) | DMA_HDMA; } inline void stop_hdma(int channel) diff --git a/butano/hw/include/bn_hw_hblank_effects.h b/butano/hw/include/bn_hw_hblank_effects.h index 47f427931..325b79476 100644 --- a/butano/hw/include/bn_hw_hblank_effects.h +++ b/butano/hw/include/bn_hw_hblank_effects.h @@ -6,7 +6,6 @@ #ifndef BN_HW_HBLANK_EFFECTS_H #define BN_HW_HBLANK_EFFECTS_H -#include "bn_algorithm.h" #include "bn_config_hbes.h" #include "bn_hw_irq.h" diff --git a/butano/hw/include/bn_hw_sram.h b/butano/hw/include/bn_hw_sram.h index eddc27d86..3abdf6a8e 100644 --- a/butano/hw/include/bn_hw_sram.h +++ b/butano/hw/include/bn_hw_sram.h @@ -19,14 +19,14 @@ namespace bn::hw::sram { auto source_ptr = reinterpret_cast(source); auto destination_ptr = reinterpret_cast(MEM_SRAM) + offset; - __agbabi_memcpy1(destination_ptr, source_ptr, size); + __agbabi_memcpy1(destination_ptr, source_ptr, unsigned(size)); } inline void read(void* destination, int size, int offset) { auto source_ptr = reinterpret_cast(MEM_SRAM) + offset; auto destination_ptr = reinterpret_cast(destination); - __agbabi_memcpy1(destination_ptr, source_ptr, size); + __agbabi_memcpy1(destination_ptr, source_ptr, unsigned(size)); } inline void set_bytes(uint8_t value, int size, int offset) diff --git a/butano/hw/include/bn_hw_timer.h b/butano/hw/include/bn_hw_timer.h index 9b64f3b55..32dc5f491 100644 --- a/butano/hw/include/bn_hw_timer.h +++ b/butano/hw/include/bn_hw_timer.h @@ -7,7 +7,6 @@ #define BN_HW_TIMER_H #include "bn_hw_tonc.h" -#include "bn_hw_timer_constants.h" namespace bn::hw::timer { diff --git a/butano/hw/src/bn_hw_audio.cpp b/butano/hw/src/bn_hw_audio.cpp index 2a274ce8f..8b78a37a6 100644 --- a/butano/hw/src/bn_hw_audio.cpp +++ b/butano/hw/src/bn_hw_audio.cpp @@ -9,7 +9,6 @@ #include "bn_config_audio.h" #include "../include/bn_hw_irq.h" #include "../include/bn_hw_link.h" -#include "../include/bn_hw_tonc.h" #include "../3rd_party/vgm-player/include/vgm.h" extern "C" @@ -313,9 +312,9 @@ void set_dmg_music_position(int pattern, int row) } else { - BN_ASSERT(! row, "Invalid row: ", row); + BN_BASIC_ASSERT(! row, "Invalid row: ", row); - VgmSetOffsetPlay(pattern); + VgmSetOffsetPlay(unsigned(pattern)); } } diff --git a/butano/hw/src/bn_hw_common.bn_noflto.cpp b/butano/hw/src/bn_hw_common.bn_noflto.cpp index df5f7027b..0845e77f5 100644 --- a/butano/hw/src/bn_hw_common.bn_noflto.cpp +++ b/butano/hw/src/bn_hw_common.bn_noflto.cpp @@ -18,12 +18,12 @@ extern "C" void __libc_init_array(void) { - for(size_t index = 0, limit = __preinit_array_end - __preinit_array_start; index < limit; ++index) + for(int index = 0, limit = __preinit_array_end - __preinit_array_start; index < limit; ++index) { __preinit_array_start[index](); } - for(size_t index = 0, limit = __init_array_end - __init_array_start; index < limit; ++index) + for(int index = 0, limit = __init_array_end - __init_array_start; index < limit; ++index) { __init_array_start[index](); } diff --git a/butano/hw/src/bn_hw_link.cpp b/butano/hw/src/bn_hw_link.cpp index 95e9c4948..08df5cc57 100644 --- a/butano/hw/src/bn_hw_link.cpp +++ b/butano/hw/src/bn_hw_link.cpp @@ -160,7 +160,7 @@ void send(int data_to_send) data.sendMessages.pop_front(); } - data.sendMessages.push_back(data_to_send); + data.sendMessages.push_back(uint16_t(data_to_send)); BN_BARRIER; data.blockSendMessages = false; diff --git a/butano/hw/src/bn_hw_memory.cpp b/butano/hw/src/bn_hw_memory.cpp index e49cdbbb4..e4ab7f95d 100644 --- a/butano/hw/src/bn_hw_memory.cpp +++ b/butano/hw/src/bn_hw_memory.cpp @@ -5,9 +5,12 @@ #include "../include/bn_hw_memory.h" -#include "bn_random.h" #include "bn_config_ewram.h" +#if BN_CFG_EWRAM_WAIT_STATE == BN_EWRAM_WAIT_STATE_1 + #include "bn_random.h" +#endif + extern unsigned __iwram_start__; extern unsigned __iwram_top; extern unsigned __fini_array_end; diff --git a/butano/include/bn_assert.h b/butano/include/bn_assert.h index 8826ae3b4..3ad57ccfc 100644 --- a/butano/include/bn_assert.h +++ b/butano/include/bn_assert.h @@ -246,7 +246,8 @@ [[noreturn]] void show(const char* condition, const char* file_name, const char* function, int line, const bn::istring_base& message); - inline void show_args(const char* condition_msg, const char* file, const char* function, int line) + [[noreturn]] inline void show_args( + const char* condition_msg, const char* file, const char* function, int line) { _bn::assert::show(condition_msg, file, function, line); } diff --git a/butano/include/bn_best_fit_allocator.h b/butano/include/bn_best_fit_allocator.h index fcd1941d1..6dfadcae6 100644 --- a/butano/include/bn_best_fit_allocator.h +++ b/butano/include/bn_best_fit_allocator.h @@ -193,7 +193,7 @@ class best_fit_allocator public: item_type* previous = nullptr; - size_type size: 30 = 0; + size_type size: 31 = 0; bool used: 1 = false; free_items_pair free_items; diff --git a/butano/include/bn_bitset.h b/butano/include/bn_bitset.h index 765b594d0..41fb8d37c 100644 --- a/butano/include/bn_bitset.h +++ b/butano/include/bn_bitset.h @@ -528,7 +528,7 @@ class ibitset [[nodiscard]] constexpr static element_t _bit(int index) { - return element_t(1) << (index & (_bits_per_element - 1)); + return element_t(1 << (index & (_bits_per_element - 1))); } }; diff --git a/butano/include/bn_blending_fade_alpha.h b/butano/include/bn_blending_fade_alpha.h index 17a24685d..b3cc8ece8 100644 --- a/butano/include/bn_blending_fade_alpha.h +++ b/butano/include/bn_blending_fade_alpha.h @@ -65,7 +65,8 @@ class blending_fade_alpha /** * @brief Default equal operator. */ - [[nodiscard]] constexpr friend bool operator==(const blending_fade_alpha& a, const blending_fade_alpha& b) = default; + [[nodiscard]] constexpr friend bool operator==( + const blending_fade_alpha& a, const blending_fade_alpha& b) = default; private: fixed _value; diff --git a/butano/include/bn_dmg_music_position.h b/butano/include/bn_dmg_music_position.h index 93fe24de2..cdc720df7 100644 --- a/butano/include/bn_dmg_music_position.h +++ b/butano/include/bn_dmg_music_position.h @@ -39,8 +39,8 @@ class dmg_music_position * @param row Row inside the pattern. */ constexpr dmg_music_position(int pattern, int row) : - _pattern(pattern), - _row(row) + _pattern(unsigned(pattern)), + _row(unsigned(row)) { BN_ASSERT(pattern >= 0 && pattern < (1 << 26), "Invalid pattern: ", pattern); BN_ASSERT(row >= 0 && row < 64, "Invalid row: ", row); @@ -62,7 +62,7 @@ class dmg_music_position { BN_ASSERT(pattern >= 0 && pattern < (1 << 26), "Invalid pattern: ", pattern); - _pattern = pattern; + _pattern = unsigned(pattern); } /** @@ -80,7 +80,7 @@ class dmg_music_position { BN_ASSERT(row >= 0 && row < 64, "Invalid row: ", row); - _row = row; + _row = unsigned(row); } /** diff --git a/butano/include/bn_documentation.h b/butano/include/bn_documentation.h index 2a4391b39..69bd79e42 100644 --- a/butano/include/bn_documentation.h +++ b/butano/include/bn_documentation.h @@ -2159,7 +2159,7 @@ * @section changelog_15_9_0 15.9.0 (next release) * * * Same maps with different tiles or palettes supported. - * * Some Clang-Tidy warnings fixed. + * * Some clangd and Clang-Tidy warnings fixed. * * * @section changelog_15_8_2 15.8.2 diff --git a/butano/include/bn_regular_bg_map_cell_info.h b/butano/include/bn_regular_bg_map_cell_info.h index 24094b528..157801773 100644 --- a/butano/include/bn_regular_bg_map_cell_info.h +++ b/butano/include/bn_regular_bg_map_cell_info.h @@ -72,7 +72,7 @@ class regular_bg_map_cell_info { BN_ASSERT(tile_index >= 0 && tile_index < 1024, "Invalid tile index: ", tile_index); - _fields.tile_index = tile_index; + _fields.tile_index = uint16_t(tile_index); } /** @@ -90,7 +90,7 @@ class regular_bg_map_cell_info { BN_ASSERT(palette_id >= 0 && palette_id < 16, "Invalid palette id: ", palette_id); - _fields.palette_id = palette_id; + _fields.palette_id = uint8_t(palette_id); } /** diff --git a/butano/include/bn_rumble.h b/butano/include/bn_rumble.h index 252ca0e7a..841cd1399 100644 --- a/butano/include/bn_rumble.h +++ b/butano/include/bn_rumble.h @@ -15,7 +15,6 @@ #include "bn_common.h" - /** * @brief Rumble related functions. * diff --git a/butano/include/bn_sprite_affine_mat_actions.h b/butano/include/bn_sprite_affine_mat_actions.h index e48c6b200..468430ac5 100644 --- a/butano/include/bn_sprite_affine_mat_actions.h +++ b/butano/include/bn_sprite_affine_mat_actions.h @@ -15,7 +15,6 @@ * @ingroup action */ -#include "bn_fixed.h" #include "bn_sprite_affine_mat_ptr.h" #include "bn_value_template_actions.h" diff --git a/butano/include/bn_sprite_tiles_item.h b/butano/include/bn_sprite_tiles_item.h index 7cbb0cb11..4ac5646bb 100644 --- a/butano/include/bn_sprite_tiles_item.h +++ b/butano/include/bn_sprite_tiles_item.h @@ -84,7 +84,7 @@ class sprite_tiles_item constexpr sprite_tiles_item(const span& tiles_ref, bpp_mode bpp, compression_type compression) : _tiles_ref(tiles_ref), _graphics_count(1), - _tiles_count_per_graphic(tiles_ref.size()), + _tiles_count_per_graphic(uint8_t(tiles_ref.size())), _compression(uint8_t(compression)), _bpp(uint8_t(bpp)) { @@ -121,7 +121,7 @@ class sprite_tiles_item constexpr sprite_tiles_item(const span& tiles_ref, bpp_mode bpp, compression_type compression, int graphics_count) : _tiles_ref(tiles_ref), - _graphics_count(graphics_count), + _graphics_count(uint16_t(graphics_count)), _tiles_count_per_graphic(0), _compression(uint8_t(compression)), _bpp(uint8_t(bpp)) @@ -135,7 +135,7 @@ class sprite_tiles_item int tcpg = tiles_ref.size() / graphics_count; BN_ASSERT(valid_tiles_count(tcpg, bpp), "Invalid tiles count per graphic: ", tcpg, " - ", int(bpp)); - _tiles_count_per_graphic = tcpg; + _tiles_count_per_graphic = uint8_t(tcpg); } /** diff --git a/butano/src/bn_audio_manager.cpp b/butano/src/bn_audio_manager.cpp index eb12c6fd4..7ebd550d0 100644 --- a/butano/src/bn_audio_manager.cpp +++ b/butano/src/bn_audio_manager.cpp @@ -5,7 +5,6 @@ #include "bn_audio_manager.h" -#include "bn_math.h" #include "bn_config_audio.h" #include "bn_dmg_music_position.h" #include "../hw/include/bn_hw_audio.h" diff --git a/butano/src/bn_bg_blocks_manager.cpp b/butano/src/bn_bg_blocks_manager.cpp index 808c4615a..b20a5aea3 100644 --- a/butano/src/bn_bg_blocks_manager.cpp +++ b/butano/src/bn_bg_blocks_manager.cpp @@ -823,7 +823,7 @@ namespace } uint16_t offset = hw::bg_blocks::affine_map_cells_offset(tiles_offset); - _hw_commit_offset(source_data_ptr, half_words, offset, destination_vram_ptr); + _hw_commit_offset(source_data_ptr, unsigned(half_words), offset, destination_vram_ptr); } else { @@ -853,7 +853,7 @@ namespace if(tiles_offset || palette_offset) { uint16_t offset = hw::bg_blocks::regular_map_cells_offset(tiles_offset, palette_offset); - _hw_commit_offset(source_data_ptr, half_words, offset, destination_vram_ptr); + _hw_commit_offset(source_data_ptr, unsigned(half_words), offset, destination_vram_ptr); } else { @@ -2593,10 +2593,10 @@ void update_regular_map_row(int id, int x, int y) if(tiles_offset || palette_offset) { uint16_t offset = hw::bg_blocks::regular_map_cells_offset(tiles_offset, palette_offset); - _hw_commit_offset(source_data, elements, offset, dest_data); + _hw_commit_offset(source_data, unsigned(elements), offset, dest_data); source_data += elements; dest_data -= x_separator; - _hw_commit_offset(source_data, x_separator, offset, dest_data); + _hw_commit_offset(source_data, unsigned(x_separator), offset, dest_data); } else { @@ -2629,11 +2629,11 @@ void update_affine_map_row(int id, int x, int y) if(auto tiles_offset = unsigned(item.affine_tiles_offset())) { uint16_t offset = hw::bg_blocks::affine_map_cells_offset(tiles_offset); - _hw_commit_offset(reinterpret_cast(source_data), elements / 2, offset, + _hw_commit_offset(reinterpret_cast(source_data), unsigned(elements) / 2, offset, reinterpret_cast(dest_data)); source_data += elements; dest_data -= x_separator; - _hw_commit_offset(reinterpret_cast(source_data), x_separator / 2, offset, + _hw_commit_offset(reinterpret_cast(source_data), unsigned(x_separator) / 2, offset, reinterpret_cast(dest_data)); } else @@ -2670,10 +2670,10 @@ void set_regular_map_position(int id, int x, int y) { const uint16_t* source_data = item_data + ((row * map_width) + x); uint16_t* dest_data = vram_data + (((row & 31) * 32) + x_separator); - _hw_commit_offset(source_data, elements, offset, dest_data); + _hw_commit_offset(source_data, unsigned(elements), offset, dest_data); source_data += elements; dest_data -= x_separator; - _hw_commit_offset(source_data, x_separator, offset, dest_data); + _hw_commit_offset(source_data, unsigned(x_separator), offset, dest_data); } } else @@ -2715,11 +2715,11 @@ void set_affine_map_position(int id, int x, int y) { const uint8_t* source_data = item_data + ((row * map_width) + x); uint8_t* dest_data = vram_data + (((row & 31) * 32) + x_separator); - _hw_commit_offset(reinterpret_cast(source_data), elements / 2, offset, + _hw_commit_offset(reinterpret_cast(source_data), unsigned(elements) / 2, offset, reinterpret_cast(dest_data)); source_data += elements; dest_data -= x_separator; - _hw_commit_offset(reinterpret_cast(source_data), x_separator / 2, offset, + _hw_commit_offset(reinterpret_cast(source_data), unsigned(x_separator) / 2, offset, reinterpret_cast(dest_data)); } } @@ -2794,7 +2794,7 @@ void update() } else if(item.commit) { - data.to_commit_items_array[commit_items_count] = iterator.id(); + data.to_commit_items_array[commit_items_count] = uint8_t(iterator.id()); ++commit_items_count; } diff --git a/butano/src/bn_cameras_manager.cpp b/butano/src/bn_cameras_manager.cpp index 273b836e8..0a2dd57ee 100644 --- a/butano/src/bn_cameras_manager.cpp +++ b/butano/src/bn_cameras_manager.cpp @@ -39,7 +39,7 @@ namespace public: item_type items[max_items]; alignas(int) uint8_t free_item_indexes_array[max_items]; - int free_item_indexes_size = max_items; + uint16_t free_item_indexes_size = max_items; bool update = false; }; diff --git a/butano/src/bn_hdma_manager.cpp b/butano/src/bn_hdma_manager.cpp index 0b6de2f04..216578241 100644 --- a/butano/src/bn_hdma_manager.cpp +++ b/butano/src/bn_hdma_manager.cpp @@ -121,11 +121,6 @@ namespace int8_t _current_state_index = 0; bool _updated = false; - [[nodiscard]] const state& _current_state() const - { - return _states[_current_state_index]; - } - [[nodiscard]] state& _current_state() { return _states[_current_state_index]; diff --git a/butano/src/bn_keypad_manager.cpp b/butano/src/bn_keypad_manager.cpp index 185926625..7361402ad 100644 --- a/butano/src/bn_keypad_manager.cpp +++ b/butano/src/bn_keypad_manager.cpp @@ -132,7 +132,7 @@ void update() { uint8_t low_part = data.commands[0] - '0'; uint8_t high_part = data.commands[1] - '0'; - current_keys = (high_part << 5) + low_part; + current_keys = (unsigned(high_part) << 5) + low_part; data.commands.remove_prefix(2); } } diff --git a/butano/src/bn_reciprocal_lut.cpp b/butano/src/bn_reciprocal_lut.cpp index 7f4564f72..73a4cdb8b 100644 --- a/butano/src/bn_reciprocal_lut.cpp +++ b/butano/src/bn_reciprocal_lut.cpp @@ -23,7 +23,7 @@ namespace for(int index = 1; index < reciprocal_16_lut_size; ++index) { - result[index] = calculate_reciprocal_lut_value<16>(index).data(); + result[index] = uint16_t(calculate_reciprocal_lut_value<16>(index).data()); } return result; diff --git a/butano/src/bn_regular_bg_horizontal_position_hbe_handler.h b/butano/src/bn_regular_bg_horizontal_position_hbe_handler.h index 8d2918054..885498b63 100644 --- a/butano/src/bn_regular_bg_horizontal_position_hbe_handler.h +++ b/butano/src/bn_regular_bg_horizontal_position_hbe_handler.h @@ -6,7 +6,6 @@ #ifndef BN_REGULAR_BG_HORIZONTAL_POSITION_HBE_HANDLER_H #define BN_REGULAR_BG_HORIZONTAL_POSITION_HBE_HANDLER_H -#include "bn_fixed_point.h" #include "bn_bgs_manager.h" #include "../hw/include/bn_hw_bgs.h" diff --git a/butano/src/bn_regular_bg_vertical_position_hbe_handler.h b/butano/src/bn_regular_bg_vertical_position_hbe_handler.h index 7fb6dd84f..c3683991c 100644 --- a/butano/src/bn_regular_bg_vertical_position_hbe_handler.h +++ b/butano/src/bn_regular_bg_vertical_position_hbe_handler.h @@ -6,7 +6,6 @@ #ifndef BN_REGULAR_BG_VERTICAL_POSITION_HBE_HANDLER_H #define BN_REGULAR_BG_VERTICAL_POSITION_HBE_HANDLER_H -#include "bn_fixed_point.h" #include "bn_bgs_manager.h" #include "../hw/include/bn_hw_bgs.h" diff --git a/butano/src/bn_sprite_affine_mats_manager.cpp b/butano/src/bn_sprite_affine_mats_manager.cpp index a55105954..815f61d85 100644 --- a/butano/src/bn_sprite_affine_mats_manager.cpp +++ b/butano/src/bn_sprite_affine_mats_manager.cpp @@ -7,6 +7,7 @@ #include "bn_vector.h" #include "bn_sprites_manager_item.h" +#include "../hw/include/bn_hw_sprites_constants.h" #include "../hw/include/bn_hw_sprite_affine_mats.h" #include "../hw/include/bn_hw_sprite_affine_mats_constants.h" diff --git a/butano/src/bn_sprite_tiles_manager.cpp b/butano/src/bn_sprite_tiles_manager.cpp index 19799a96e..0cbbb67e6 100644 --- a/butano/src/bn_sprite_tiles_manager.cpp +++ b/butano/src/bn_sprite_tiles_manager.cpp @@ -136,11 +136,6 @@ namespace return _list->_items[_index]; } - item_type* operator->() - { - return _list->_items + _index; - } - [[nodiscard]] friend bool operator==(const iterator& a, const iterator& b) { return a._index == b._index; @@ -193,11 +188,6 @@ namespace return _items[index]; } - [[nodiscard]] int index(const item_type& item) const - { - return &item - _items; - } - [[nodiscard]] iterator it(int index) { return iterator(index, *this); @@ -248,10 +238,10 @@ namespace node_type& new_node = _items[new_index]; int prev_index = position_node.prev_index; node_type& prev_node = _items[prev_index]; - prev_node.next_index = new_index; - new_node.prev_index = prev_index; - new_node.next_index = position_index; - position_node.prev_index = new_index; + prev_node.next_index = uint16_t(new_index); + new_node.prev_index = uint16_t(prev_index); + new_node.next_index = uint16_t(position_index); + position_node.prev_index = uint16_t(new_index); } void _remove_node(int position_index) @@ -261,8 +251,8 @@ namespace node_type& prev_node = _items[prev_index]; int next_index = position_node.next_index; node_type& next_node = _items[next_index]; - prev_node.next_index = next_index; - next_node.prev_index = prev_index; + prev_node.next_index = uint16_t(next_index); + next_node.prev_index = uint16_t(prev_index); } }; @@ -385,7 +375,7 @@ namespace const item_type& item = data.items.item(id); auto free_items_it = upper_bound(data.free_items.begin(), free_items_last, item.tiles_count, tiles_count_upper_bound_comparator); - data.free_items.insert(free_items_it, id); + data.free_items.insert(free_items_it, uint16_t(id)); } void _insert_free_item(int id) @@ -412,7 +402,7 @@ namespace const item_type& item = data.items.item(id); auto to_remove_items_it = upper_bound(data.to_remove_items.begin(), data.to_remove_items.end(), item.tiles_count, tiles_count_upper_bound_comparator); - data.to_remove_items.insert(to_remove_items_it, id); + data.to_remove_items.insert(to_remove_items_it, uint16_t(id)); } void _erase_to_remove_item(int id) @@ -438,7 +428,7 @@ namespace vector& to_commit_items = item.compression() == compression_type::NONE ? data.to_commit_uncompressed_items : data.to_commit_compressed_items; - to_commit_items.push_back(id); + to_commit_items.push_back(uint16_t(id)); } } @@ -687,7 +677,7 @@ void init() item_type new_item; new_item.tiles_count = hw::sprite_tiles::tiles_count(); data.items.push_front(new_item); - data.free_items.push_back(data.items.begin().id()); + data.free_items.push_back(uint16_t(data.items.begin().id())); data.free_tiles_count = new_item.tiles_count; BN_SPRITE_TILES_LOG_STATUS(); diff --git a/butano/src/bn_sprites_manager.bn_iwram.cpp b/butano/src/bn_sprites_manager.bn_iwram.cpp index b9aef82ab..a8666e106 100644 --- a/butano/src/bn_sprites_manager.bn_iwram.cpp +++ b/butano/src/bn_sprites_manager.bn_iwram.cpp @@ -6,6 +6,7 @@ #include "bn_sprites_manager.h" #include "bn_sorted_sprites.h" +#include "../hw/include/bn_hw_sprites_constants.h" namespace bn::sprites_manager { diff --git a/butano/src/bn_sprites_manager.cpp b/butano/src/bn_sprites_manager.cpp index f654196e1..ad58a4b9e 100644 --- a/butano/src/bn_sprites_manager.cpp +++ b/butano/src/bn_sprites_manager.cpp @@ -870,9 +870,9 @@ void set_double_size_mode(id_type id, sprite_double_size_mode double_size_mode) { auto item = static_cast(id); - if(item->double_size_mode != unsigned(double_size_mode)) + if(item->double_size_mode != uint8_t(double_size_mode)) { - item->double_size_mode = unsigned(double_size_mode); + item->double_size_mode = uint8_t(double_size_mode); if(sprite_affine_mat_ptr* affine_mat = item->affine_mat.get()) { diff --git a/butano/src/bn_sprites_manager_item.h b/butano/src/bn_sprites_manager_item.h index 3c7d1241f..d065a1d1c 100644 --- a/butano/src/bn_sprites_manager_item.h +++ b/butano/src/bn_sprites_manager_item.h @@ -7,7 +7,6 @@ #define BN_SPRITES_MANAGER_ITEM_H #include "bn_display.h" -#include "bn_sprites.h" #include "bn_sort_key.h" #include "bn_camera_ptr.h" #include "bn_fixed_point.h" diff --git a/docs/changelog.html b/docs/changelog.html index 77c06d470..e207d3c1c 100644 --- a/docs/changelog.html +++ b/docs/changelog.html @@ -189,7 +189,7 @@

Contents

  • 0.1.0
  • -

    15.9.0 (next release)

    • Same maps with different tiles or palettes supported.
    • Some Clang-Tidy warnings fixed.

    15.8.2

    15.8.1

    bn::vector::assign fixed.

    15.8.0

    15.7.1

    Python 2 support restored.

    15.7.0

    15.6.0

    • bn::display::size added.
    • Standard abort implemented.
    • Color-related H-Blank effects update fixed.

    15.5.0

    15.4.1

    bn::core::reset race condition fixed.

    15.4.0

    15.3.2

    BG blocks commit fixed.

    15.3.1

    Slow game pak detection fixed (again).

    15.3.0

    15.2.0

    • bn::seed_random added.
    • Standard assert implemented.
    • Thread-safe initialization of local statics disabled.
    • Static destructors fixed.
    • Maps commit optimized by more than 35% in some cases.
    • Palette search optimized by more than 25% in some cases.
    • Big maps commit optimized.
    • Display setup commit optimized.
    • BG blocks and sprite tiles managers ROM usage reduced.
    • map_collision example added.

    15.1.0

    • memcmp optimized.
    • Link flags fixed.

    15.0.0

    14.1.0

    14.0.0

    13.18.0

    13.17.0

    13.16.1

    bn::ibitset AND operator fixed.

    13.16.0

    13.15.0

    • Brightness, contrast and intensity color effects optimized.
    • bn::random internal variables are protected to allow child classes to access them.
    • compile_commands.json generation support.

    13.14.0

    13.13.0

    13.12.1

    Tonclib linking error fixed.

    13.12.0

    13.11.0

    13.10.1

    -flto memset undefined references fixed.

    13.10.0

    • memset moved to IWRAM.
    • Backdrop fade blending fixed.

    13.9.0

    13.8.1

    bn::any management with types that can't be copied, moved or swapped fixed.

    13.8.0

    13.7.0

    13.6.0

    13.5.0

    13.4.0

    • BN_BASIC_ASSERT added.
    • Repeated color palettes reduction can be disabled when importing a regular background. See the Regular backgrounds import guide to learn how to disable it.
    • Unaligned byte memset fixed.
    • Asserts without diagnostic information ROM usage reduced.
    • Input tiles in dynamic_regular_bg and dynamic_affine_bg examples are imported without using a map.
    • Frequently asked questions (FAQ) page improved.

    13.3.1

    bn::erase and bn::erase_if fixed.

    13.3.0

    13.2.0

    13.1.1

    Recovery of deleted background maps fixed.

    13.1.0

    13.0.0

    12.5.0

    BN_CFG_ASSERT_SHOW_DIAGNOSTIC added.

    12.4.0

    • SRAM magic string fixed.
    • BN_CODE_IWRAM macro can be used for thumb code too.
    • Destructors of classes with _ptr suffix ROM usage reduced.
    • 4BPP regular backgrounds quantization improved.
    • Some error messages improved.
    • Import images guide explains why Usenti is recommended over other image editors.

    12.3.0

    • bn::sprite_text_generator variable width fonts rendering fixed and optimized.
    • Sprite shape and size update ROM usage reduced.
    • Some Cppcheck warnings removed.

    12.2.0

    • Automatic sprite double size detection fixed.
    • Sprite tiles management optimized (EWRAM and CPU usage reduced).
    • Background tiles and maps management optimized (EWRAM and CPU usage reduced).
    • Color palettes management CPU usage reduced.
    • Sprites and sprite affine mats management CPU usage reduced.
    • Backgrounds management CPU usage reduced.
    • Cameras management CPU usage reduced.

    12.1.0

    • Sprite tiles delayed commit fixed.
    • V-Blank interrupt management optimized (EWRAM and CPU usage reduced).
    • Missed link messages frequency reduced.
    • bn::timer::elapsed_ticks optimized.

    12.0.0

    • (Breaking change) bn::aligned fixed.
    • Color effects optimized.

    11.0.1

    bn::string::starts_with and bn::string_view::starts_with fixed.

    11.0.0

    Huffman images compression support (make sure to update devkitARM before using it).

    10.7.0

    10.6.1

    bn::bitset AND, OR and XOR operators fixed.

    10.6.0

    10.5.0

    10.4.0

    • Avoid data decompression in V-Blank if possible.
    • Audio updates can no longer be interrupted.

    10.3.0

    10.2.0

    10.1.0

    10.0.0

    • Custom linker flags can be specified in the project's Makefile.
    • Asserts ROM usage reduced.
    • Audio startup fixed when link-time optimization is enabled.
    • Audio stop fixed when link communication is active.
    • Parallel link-time optimization temporal files ignored and added to the list of files to clean.

    9.5.0

    9.4.1

    BMP files colors count calculation fixed (again).

    9.4.0

    9.3.0

    9.2.0

    9.1.1

    bn::calculate_sin_lut_value sine and cosine symmetry with 135 and 315 degrees fixed.

    9.1.0

    9.0.0

    8.10.0

    8.9.0

    • Hue shift palette effect added. See the palettes example to learn how to use it.
    • Brightness effect ROM usage reduced.
    • bn::sprite_item and bn::sprite_tiles_item size reduced.
    • Automatic sprite double size detection fixed.
    • bn::hbe_visible_toggle_action removed, since it was not possible to use it.
    • Clang build fixes.
    • Clang-Tidy warnings fixed.
    • New games made with Butano added to README.md.

    8.8.0

    • Modified assets detection optimized.
    • Audio and graphics tools unified in order to reduce build time.
    • bn::newton_raphson_sqrt removed, since it doesn't work for bn::fixed input values.

    8.7.0

    • An external bn::bg_palette_item can be specified when importing regular and affine backgrounds.
    • Colors count can be specified when importing sprite and background palettes.
    • Standard containers equality comparison optimized.
    • Asserts file name hack fixed.
    • Universal GBA Library LGPL license files removed.
    • Standard containers documentation improved.
    • Frequently asked questions (FAQ) page improved.

    8.6.0

    8.5.0

    8.4.0

    8.3.0

    • Maps commit optimized by more than 50% in some cases.
    • Integer alignment at minimum enforced in all containers.
    • BG blocks manager and sprite tiles manager commit fixed.

    8.2.0

    • (Security issue) Source code files full path is not stored in output ROMs anymore.
    • Some Clang-Tidy and Cppcheck warnings removed.

    8.1.0

    8.0.0

    7.8.0

    7.7.0

    7.6.0

    7.5.1

    Audio and HDMA issues when updating at less than 60FPS fixed.

    7.5.0

    7.4.0

    • Run-length is preferred to LZ77 when choosing best compression mode.
    • Sprites automatic double size mode and affine matrix management fixed.
    • Frequently asked questions (FAQ) page improved.

    7.3.0

    • bn::sprite_text_generator now can plot multiple 16x16 variable width characters in a single sprite.
    • bn::sprite_text_generator IWRAM usage reduced.
    • Third party libraries to link can be specified in the project's Makefile.
    • Project's Makefile allows to build source files generated with an external tool. See the external_tool example to learn how to do it.
    • butano-audio-tool.py generates a list of all available music and sound items with their name.
    • audio_player example added.
    • Varooom 3D improved (check its readme.txt file for details).

    7.2.0

    7.1.1

    bn::vector, bn::unordered_map and bn::unordered_set move constructors and assignment operators fixed.

    7.1.0

    7.0.1

    bn::format build fix.

    7.0.0

    • Varooom 3D source code and assets added.
    • Maximum number of active H-Blank effects reduced to 6.
    • Common files moved to common namespace.

    6.18.0

    • Generated items are now constexpr inline to avoid being copied to every translation unit.
    • Sprites EWRAM usage reduced.
    • Different type backgrounds sorting fixed.

    6.17.1

    • bn::sort with 128bit sort keys fixed.
    • IRQs setup during startup improved.

    6.17.0

    6.16.0

    6.15.0

    6.14.0

    6.13.1

    6.13.0

    6.12.0

    6.11.0

    • An external tool can be called from the project's Makefile. See the external_tool example to learn how to call it.
    • Affine background tiles offset optimized.
    • Big numbers to string conversion optimized.
    • 32bit integer division optimized.
    • 64bit integer division by 0 assert added.
    • Big maps maximum valid position fixed.
    • Compressed tiles warning fixed.
    • GCC11 warning fixed.
    • Some 8x8 sprite text characters fixed.
    • Qt Creator setup guide added.
    • More questions added to Frequently asked questions (FAQ) page.

    6.10.0

    • dynamic_bg example added.
    • Affine background tiles offset fixed.

    6.9.0

    • bn::sprite_font supports all sprite shapes and sizes.
    • Trivial type containers destruction optimized.
    • Container destructors are always noexcept.
    • Redundant container asserts removed.
    • GPIO direction register setup.

    6.8.0

    • Sprites optimized.
    • Blending optimized.
    • Mosaic optimized.
    • Internal memory transfers optimized.
    • texture_polygons example affine parameters fixed.
    • Clouds removed from world_map example.

    6.7.0

    • Automatic sprite double size detection improved.
    • Butano Fighter allows to disable rumble in the title menu.

    6.6.2

    Automatic sprite double size detection fixed.

    6.6.1

    BG blocks manager use after move fixed.

    6.6.0

    • SRAM memory usage reduced.
    • Sprite animate actions memory usage reduced.
    • Missing asserts added to some actions.
    • bn::random is now a trivial class.
    • BG blocks manager search fixed.
    • world_map example frame rate back to 60FPS.

    6.5.0

    6.4.0

    6.3.0

    6.2.0

    6.1.0

    • Sprite tiles generation outputs sprite shape and size.
    • BN_ASSERT and BN_ERROR can be modified or disabled for specific code sections.
    • Sprites IWRAM usage reduced.
    • Some internal asserts removed.
    • Profiler screen fixed.
    • Documentation explains how to place data in ROM.

    6.0.0

    5.3.1

    bn::atan2 and bn::degrees_atan2 fixed.

    5.3.0

    5.2.0

    5.1.0

    5.0.0

    4.4.0

    • bn::sprite_font allows to specify space between characters.
    • Background palettes bits per pixel mode can be specified by the user.
    • Palettes change optimized.
    • Unused palette colors are not imported anymore.
    • bn::sprite_ptr::set_tiles() validation fixed.

    4.3.0

    • H-Blank effects EWRAM usage reduced (more than 2KB by default).
    • Optimization level changed to -O2 to avoid another No$gba crash.
    • SRAM code moved back from ROM to EWRAM, since doing that doesn't make No$gba crash anymore.
    • Redundant reset code removed.

    4.2.0

    • Sprite and background palettes can be generated from images alone, without tiles nor maps.
    • <cstddef> is always included (bn_cstddef.h header file removed).
    • bn::unordered_map and bn::unordered_set assignment fixed.

    4.1.0

    • H-Blank effects optimized (it fixes world_map example flickering).
    • SRAM code moved from EWRAM to ROM to avoid a No$gba crash.

    4.0.0

    3.3.0

    • HDMA properly supported (now it works at less than 60fps). See bn::hdma and the hdma_polygons example for more.
    • gba-link-connection remote timeout detection fixed.

    3.2.1

    bn::optional build fix.

    3.2.0

    bn::optional is now constexpr.

    3.1.0

    3.0.0

    Thanks to the awesome gba-link-connection, multiplayer support has been implemented! See bn::link and the link example for more.

    2.0.0

    • By removing some method overloads, lots of runtime asserts when creating resources have been removed.
    • bn::palette_bpp_mode has been renamed to bn::bpp_mode and bpp_mode() methods have been renamed to bpp().
    • 8 bits per pixel background tiles allocation fixed.

    1.0.0

    0.4.0

    • btn renamed to bn. No more API breaks will be made between minor releases after 1.0.0, promise.
    • Background tiles manager status can be printed in the log with bn::bg_tiles::log_status(). This is done automatically when a non-optional background tiles allocation fails too.
    • Background regular maps manager status can be printed in the log with bn::bg_maps::log_status(). This is done automatically when a non-optional regular background map allocation fails too.
    • Sprite tiles manager status can be printed in the log with bn::sprite_tiles::log_status(). This is done automatically when a non-optional sprite tiles allocation fails too.
    • Color palettes managers status can be printed in the log with bn::bg_palettes::log_status() and bn::sprite_palettes::log_status(). This is done automatically when a non-optional color palette allocation fails too.
    • Sprites destruction optimized.
    • Setters with an optional parameter added to some classes.
    • Optional components documentation fixed.
    • Other documentation improvements.

    0.3.0

    • Sprites update performance improved up to 30% in Butano Fighter thanks to avoid rebuilding sprites list as much as possible.
    • Profiler can show the maximum measured ticks per entry.
    • Assets tools print output binaries size.

    0.2.0

    • Performance improved up to 12% in Butano Fighter without -flto thanks to using less build translation units.
    • Documentation improved.

    0.1.0

    First release.

    +

    15.9.0 (next release)

    • Same maps with different tiles or palettes supported.
    • Some clangd and Clang-Tidy warnings fixed.

    15.8.2

    15.8.1

    bn::vector::assign fixed.

    15.8.0

    15.7.1

    Python 2 support restored.

    15.7.0

    15.6.0

    • bn::display::size added.
    • Standard abort implemented.
    • Color-related H-Blank effects update fixed.

    15.5.0

    15.4.1

    bn::core::reset race condition fixed.

    15.4.0

    15.3.2

    BG blocks commit fixed.

    15.3.1

    Slow game pak detection fixed (again).

    15.3.0

    15.2.0

    • bn::seed_random added.
    • Standard assert implemented.
    • Thread-safe initialization of local statics disabled.
    • Static destructors fixed.
    • Maps commit optimized by more than 35% in some cases.
    • Palette search optimized by more than 25% in some cases.
    • Big maps commit optimized.
    • Display setup commit optimized.
    • BG blocks and sprite tiles managers ROM usage reduced.
    • map_collision example added.

    15.1.0

    • memcmp optimized.
    • Link flags fixed.

    15.0.0

    14.1.0

    14.0.0

    13.18.0

    13.17.0

    13.16.1

    bn::ibitset AND operator fixed.

    13.16.0

    13.15.0

    • Brightness, contrast and intensity color effects optimized.
    • bn::random internal variables are protected to allow child classes to access them.
    • compile_commands.json generation support.

    13.14.0

    13.13.0

    13.12.1

    Tonclib linking error fixed.

    13.12.0

    13.11.0

    13.10.1

    -flto memset undefined references fixed.

    13.10.0

    • memset moved to IWRAM.
    • Backdrop fade blending fixed.

    13.9.0

    13.8.1

    bn::any management with types that can't be copied, moved or swapped fixed.

    13.8.0

    13.7.0

    13.6.0

    13.5.0

    13.4.0

    • BN_BASIC_ASSERT added.
    • Repeated color palettes reduction can be disabled when importing a regular background. See the Regular backgrounds import guide to learn how to disable it.
    • Unaligned byte memset fixed.
    • Asserts without diagnostic information ROM usage reduced.
    • Input tiles in dynamic_regular_bg and dynamic_affine_bg examples are imported without using a map.
    • Frequently asked questions (FAQ) page improved.

    13.3.1

    bn::erase and bn::erase_if fixed.

    13.3.0

    13.2.0

    13.1.1

    Recovery of deleted background maps fixed.

    13.1.0

    13.0.0

    12.5.0

    BN_CFG_ASSERT_SHOW_DIAGNOSTIC added.

    12.4.0

    • SRAM magic string fixed.
    • BN_CODE_IWRAM macro can be used for thumb code too.
    • Destructors of classes with _ptr suffix ROM usage reduced.
    • 4BPP regular backgrounds quantization improved.
    • Some error messages improved.
    • Import images guide explains why Usenti is recommended over other image editors.

    12.3.0

    • bn::sprite_text_generator variable width fonts rendering fixed and optimized.
    • Sprite shape and size update ROM usage reduced.
    • Some Cppcheck warnings removed.

    12.2.0

    • Automatic sprite double size detection fixed.
    • Sprite tiles management optimized (EWRAM and CPU usage reduced).
    • Background tiles and maps management optimized (EWRAM and CPU usage reduced).
    • Color palettes management CPU usage reduced.
    • Sprites and sprite affine mats management CPU usage reduced.
    • Backgrounds management CPU usage reduced.
    • Cameras management CPU usage reduced.

    12.1.0

    • Sprite tiles delayed commit fixed.
    • V-Blank interrupt management optimized (EWRAM and CPU usage reduced).
    • Missed link messages frequency reduced.
    • bn::timer::elapsed_ticks optimized.

    12.0.0

    • (Breaking change) bn::aligned fixed.
    • Color effects optimized.

    11.0.1

    bn::string::starts_with and bn::string_view::starts_with fixed.

    11.0.0

    Huffman images compression support (make sure to update devkitARM before using it).

    10.7.0

    10.6.1

    bn::bitset AND, OR and XOR operators fixed.

    10.6.0

    10.5.0

    10.4.0

    • Avoid data decompression in V-Blank if possible.
    • Audio updates can no longer be interrupted.

    10.3.0

    10.2.0

    10.1.0

    10.0.0

    • Custom linker flags can be specified in the project's Makefile.
    • Asserts ROM usage reduced.
    • Audio startup fixed when link-time optimization is enabled.
    • Audio stop fixed when link communication is active.
    • Parallel link-time optimization temporal files ignored and added to the list of files to clean.

    9.5.0

    9.4.1

    BMP files colors count calculation fixed (again).

    9.4.0

    9.3.0

    9.2.0

    9.1.1

    bn::calculate_sin_lut_value sine and cosine symmetry with 135 and 315 degrees fixed.

    9.1.0

    9.0.0

    8.10.0

    8.9.0

    • Hue shift palette effect added. See the palettes example to learn how to use it.
    • Brightness effect ROM usage reduced.
    • bn::sprite_item and bn::sprite_tiles_item size reduced.
    • Automatic sprite double size detection fixed.
    • bn::hbe_visible_toggle_action removed, since it was not possible to use it.
    • Clang build fixes.
    • Clang-Tidy warnings fixed.
    • New games made with Butano added to README.md.

    8.8.0

    • Modified assets detection optimized.
    • Audio and graphics tools unified in order to reduce build time.
    • bn::newton_raphson_sqrt removed, since it doesn't work for bn::fixed input values.

    8.7.0

    • An external bn::bg_palette_item can be specified when importing regular and affine backgrounds.
    • Colors count can be specified when importing sprite and background palettes.
    • Standard containers equality comparison optimized.
    • Asserts file name hack fixed.
    • Universal GBA Library LGPL license files removed.
    • Standard containers documentation improved.
    • Frequently asked questions (FAQ) page improved.

    8.6.0

    8.5.0

    8.4.0

    8.3.0

    • Maps commit optimized by more than 50% in some cases.
    • Integer alignment at minimum enforced in all containers.
    • BG blocks manager and sprite tiles manager commit fixed.

    8.2.0

    • (Security issue) Source code files full path is not stored in output ROMs anymore.
    • Some Clang-Tidy and Cppcheck warnings removed.

    8.1.0

    8.0.0

    7.8.0

    7.7.0

    7.6.0

    7.5.1

    Audio and HDMA issues when updating at less than 60FPS fixed.

    7.5.0

    7.4.0

    • Run-length is preferred to LZ77 when choosing best compression mode.
    • Sprites automatic double size mode and affine matrix management fixed.
    • Frequently asked questions (FAQ) page improved.

    7.3.0

    • bn::sprite_text_generator now can plot multiple 16x16 variable width characters in a single sprite.
    • bn::sprite_text_generator IWRAM usage reduced.
    • Third party libraries to link can be specified in the project's Makefile.
    • Project's Makefile allows to build source files generated with an external tool. See the external_tool example to learn how to do it.
    • butano-audio-tool.py generates a list of all available music and sound items with their name.
    • audio_player example added.
    • Varooom 3D improved (check its readme.txt file for details).

    7.2.0

    7.1.1

    bn::vector, bn::unordered_map and bn::unordered_set move constructors and assignment operators fixed.

    7.1.0

    7.0.1

    bn::format build fix.

    7.0.0

    • Varooom 3D source code and assets added.
    • Maximum number of active H-Blank effects reduced to 6.
    • Common files moved to common namespace.

    6.18.0

    • Generated items are now constexpr inline to avoid being copied to every translation unit.
    • Sprites EWRAM usage reduced.
    • Different type backgrounds sorting fixed.

    6.17.1

    • bn::sort with 128bit sort keys fixed.
    • IRQs setup during startup improved.

    6.17.0

    6.16.0

    6.15.0

    6.14.0

    6.13.1

    6.13.0

    6.12.0

    6.11.0

    • An external tool can be called from the project's Makefile. See the external_tool example to learn how to call it.
    • Affine background tiles offset optimized.
    • Big numbers to string conversion optimized.
    • 32bit integer division optimized.
    • 64bit integer division by 0 assert added.
    • Big maps maximum valid position fixed.
    • Compressed tiles warning fixed.
    • GCC11 warning fixed.
    • Some 8x8 sprite text characters fixed.
    • Qt Creator setup guide added.
    • More questions added to Frequently asked questions (FAQ) page.

    6.10.0

    • dynamic_bg example added.
    • Affine background tiles offset fixed.

    6.9.0

    • bn::sprite_font supports all sprite shapes and sizes.
    • Trivial type containers destruction optimized.
    • Container destructors are always noexcept.
    • Redundant container asserts removed.
    • GPIO direction register setup.

    6.8.0

    • Sprites optimized.
    • Blending optimized.
    • Mosaic optimized.
    • Internal memory transfers optimized.
    • texture_polygons example affine parameters fixed.
    • Clouds removed from world_map example.

    6.7.0

    • Automatic sprite double size detection improved.
    • Butano Fighter allows to disable rumble in the title menu.

    6.6.2

    Automatic sprite double size detection fixed.

    6.6.1

    BG blocks manager use after move fixed.

    6.6.0

    • SRAM memory usage reduced.
    • Sprite animate actions memory usage reduced.
    • Missing asserts added to some actions.
    • bn::random is now a trivial class.
    • BG blocks manager search fixed.
    • world_map example frame rate back to 60FPS.

    6.5.0

    6.4.0

    6.3.0

    6.2.0

    6.1.0

    • Sprite tiles generation outputs sprite shape and size.
    • BN_ASSERT and BN_ERROR can be modified or disabled for specific code sections.
    • Sprites IWRAM usage reduced.
    • Some internal asserts removed.
    • Profiler screen fixed.
    • Documentation explains how to place data in ROM.

    6.0.0

    5.3.1

    bn::atan2 and bn::degrees_atan2 fixed.

    5.3.0

    5.2.0

    5.1.0

    5.0.0

    4.4.0

    • bn::sprite_font allows to specify space between characters.
    • Background palettes bits per pixel mode can be specified by the user.
    • Palettes change optimized.
    • Unused palette colors are not imported anymore.
    • bn::sprite_ptr::set_tiles() validation fixed.

    4.3.0

    • H-Blank effects EWRAM usage reduced (more than 2KB by default).
    • Optimization level changed to -O2 to avoid another No$gba crash.
    • SRAM code moved back from ROM to EWRAM, since doing that doesn't make No$gba crash anymore.
    • Redundant reset code removed.

    4.2.0

    • Sprite and background palettes can be generated from images alone, without tiles nor maps.
    • <cstddef> is always included (bn_cstddef.h header file removed).
    • bn::unordered_map and bn::unordered_set assignment fixed.

    4.1.0

    • H-Blank effects optimized (it fixes world_map example flickering).
    • SRAM code moved from EWRAM to ROM to avoid a No$gba crash.

    4.0.0

    3.3.0

    • HDMA properly supported (now it works at less than 60fps). See bn::hdma and the hdma_polygons example for more.
    • gba-link-connection remote timeout detection fixed.

    3.2.1

    bn::optional build fix.

    3.2.0

    bn::optional is now constexpr.

    3.1.0

    3.0.0

    Thanks to the awesome gba-link-connection, multiplayer support has been implemented! See bn::link and the link example for more.

    2.0.0

    • By removing some method overloads, lots of runtime asserts when creating resources have been removed.
    • bn::palette_bpp_mode has been renamed to bn::bpp_mode and bpp_mode() methods have been renamed to bpp().
    • 8 bits per pixel background tiles allocation fixed.

    1.0.0

    0.4.0

    • btn renamed to bn. No more API breaks will be made between minor releases after 1.0.0, promise.
    • Background tiles manager status can be printed in the log with bn::bg_tiles::log_status(). This is done automatically when a non-optional background tiles allocation fails too.
    • Background regular maps manager status can be printed in the log with bn::bg_maps::log_status(). This is done automatically when a non-optional regular background map allocation fails too.
    • Sprite tiles manager status can be printed in the log with bn::sprite_tiles::log_status(). This is done automatically when a non-optional sprite tiles allocation fails too.
    • Color palettes managers status can be printed in the log with bn::bg_palettes::log_status() and bn::sprite_palettes::log_status(). This is done automatically when a non-optional color palette allocation fails too.
    • Sprites destruction optimized.
    • Setters with an optional parameter added to some classes.
    • Optional components documentation fixed.
    • Other documentation improvements.

    0.3.0

    • Sprites update performance improved up to 30% in Butano Fighter thanks to avoid rebuilding sprites list as much as possible.
    • Profiler can show the maximum measured ticks per entry.
    • Assets tools print output binaries size.

    0.2.0

    • Performance improved up to 12% in Butano Fighter without -flto thanks to using less build translation units.
    • Documentation improved.

    0.1.0

    First release.