Fix Overworld sprite drawing system
- Updated the MapPropertiesSystem to improve the layout of the simplified map settings table, increasing column widths for better visibility and usability. - Adjusted button sizes in the OverworldEditor for Graphics, Palettes, Overlays, and Properties to enhance user interaction. - Implemented filtering of sprites in the OverworldEditor based on the current world, ensuring only relevant sprites are displayed. - Refactored sprite drawing logic to utilize global coordinates directly, improving accuracy in sprite rendering.
This commit is contained in:
@@ -32,6 +32,11 @@ absl::Status Overworld::Load(Rom *rom) {
|
||||
for (int map_index = 0; map_index < kNumOverworldMaps; ++map_index)
|
||||
overworld_maps_.emplace_back(map_index, rom_);
|
||||
|
||||
// Populate map_parent_ array with parent information from each map
|
||||
for (int map_index = 0; map_index < kNumOverworldMaps; ++map_index) {
|
||||
map_parent_[map_index] = overworld_maps_[map_index].parent();
|
||||
}
|
||||
|
||||
FetchLargeMaps();
|
||||
RETURN_IF_ERROR(LoadEntrances());
|
||||
RETURN_IF_ERROR(LoadHoles());
|
||||
@@ -509,7 +514,7 @@ absl::Status Overworld::LoadSpritesFromMap(int sprites_per_gamestate_ptr,
|
||||
all_sprites_[game_state].emplace_back(
|
||||
*overworld_maps_[i].mutable_current_graphics(), (uint8_t)i, b3,
|
||||
(uint8_t)(b2 & 0x3F), (uint8_t)(b1 & 0x3F), realX, realY);
|
||||
all_sprites_[game_state][i].Draw();
|
||||
all_sprites_[game_state].back().Draw();
|
||||
|
||||
sprite_address += 3;
|
||||
}
|
||||
|
||||
@@ -205,8 +205,17 @@ class OverworldMap : public gfx::GfxContext {
|
||||
message_id_ = 0;
|
||||
area_graphics_ = 0;
|
||||
area_palette_ = 0;
|
||||
main_palette_ = 0;
|
||||
animated_gfx_ = 0;
|
||||
subscreen_overlay_ = 0;
|
||||
area_specific_bg_color_ = 0;
|
||||
custom_gfx_ids_.fill(0);
|
||||
sprite_graphics_.fill(0);
|
||||
sprite_palette_.fill(0);
|
||||
area_music_.fill(0);
|
||||
static_graphics_.fill(0);
|
||||
mosaic_expanded_.fill(false);
|
||||
area_size_ = AreaSizeEnum::SmallArea;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user