| 802 | } |
| 803 | |
| 804 | void decrease_usages(id_type id) |
| 805 | { |
| 806 | auto item = static_cast<item_type*>(id); |
| 807 | --item->usages; |
| 808 | |
| 809 | if(! item->usages) [[likely]] |
| 810 | { |
| 811 | static_data& data = data_ref(); |
| 812 | |
| 813 | if(! data.rebuild_handles && item->visible) |
| 814 | { |
| 815 | data.rebuild_handles = true; |
| 816 | } |
| 817 | |
| 818 | erase(data.items_vector, item); |
| 819 | data.items_pool.destroy(*item); |
| 820 | |
| 821 | if(data.bitmap_affine_bg_tiles_handle != -1) |
| 822 | { |
| 823 | bg_blocks_manager::decrease_usages(data.bitmap_affine_bg_tiles_handle); |
| 824 | data.bitmap_affine_bg_tiles_handle = -1; |
| 825 | |
| 826 | sprite_tiles_manager::decrease_usages(data.bitmap_sprite_tiles_handle); |
| 827 | data.bitmap_sprite_tiles_handle = -1; |
| 828 | |
| 829 | data.bitmap_palette.reset(); |
| 830 | } |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | int hw_id(id_type id) |
| 835 | { |
no test coverage detected