"Census" overlay for the Room Matrix. More...
#include <room_matrix_census.h>

Public Types | |
| using | ManifestProvider = std::function<const core::HackManifest*()> |
Public Member Functions | |
| RoomMatrixCensusOverlay () | |
| ~RoomMatrixCensusOverlay () | |
| void | SetManifestProvider (ManifestProvider provider) |
| bool | enabled () const |
| void | SetEnabled (bool enabled) |
| void | Update (Rom *rom) |
| void | Invalidate () |
| void | DrawControls (Rom *rom) |
| const zelda3::RoomCensus * | census () const |
| bool | computing () const |
| ImU32 | FillColor (int room_id) const |
| std::optional< ImU32 > | StatusOutline (int room_id) const |
| bool | InLargestFreeBlock (int room_id) const |
| bool | IsOrphan (int room_id) const |
| bool | MatchesChips (int room_id) const |
| bool | HasActiveChips () const |
| void | DrawTooltip (int room_id) const |
| void | SetFilterFree (bool on) |
| void | SetFilterReclaimable (bool on) |
| void | ToggleOwnerFilter (int owner_index) |
Static Public Member Functions | |
| static ImU32 | OrphanMarkColor () |
| static ImU32 | BlockHaloColor (float alpha) |
| static ImVec4 | OwnerColor (int owner_index, bool interior) |
Private Member Functions | |
| void | StartComputation (Rom *rom) |
| bool | DrawChip (const char *id, const std::string &label, ImVec4 swatch, bool outline_only, bool active, bool first) |
Static Private Member Functions | |
| static void | WrapBeforeItem (float item_width, bool first) |
Private Attributes | |
| ManifestProvider | manifest_provider_ |
| bool | enabled_ = false |
| bool | stale_ = true |
| const Rom * | computed_for_ = nullptr |
| uint64_t | observed_asset_generation_ = 0 |
| uint64_t | observed_rom_revision_ = 0 |
| bool | observed_custom_enabled_ = false |
| std::optional< zelda3::RoomCensus > | census_ |
| std::string | error_ |
| std::future< absl::StatusOr< zelda3::RoomCensus > > | pending_ |
| util::StopSource | stop_source_ {util::kNoStopState} |
| std::set< int > | largest_block_ |
| bool | filter_free_ = false |
| bool | filter_reclaimable_ = false |
| bool | filter_orphan_ = false |
| std::set< int > | filter_owners_ |
Friends | |
| class | RoomMatrixCensusTestPeer |
"Census" overlay for the Room Matrix.
Runs zelda3::ComputeRoomCensus (the model behind z3ed dungeon-room-census) on a copy of the ROM in the background, then colors cells by owner, outlines free (green) and reclaimable (yellow) rooms, draws the legend/filter chips and the largest-free-block summary, and fills the cell tooltip.
Definition at line 32 of file room_matrix_census.h.
| using yaze::editor::RoomMatrixCensusOverlay::ManifestProvider = std::function<const core::HackManifest*()> |
Definition at line 34 of file room_matrix_census.h.
|
default |
| yaze::editor::RoomMatrixCensusOverlay::~RoomMatrixCensusOverlay | ( | ) |
Definition at line 78 of file room_matrix_census.cc.
References yaze::util::StopSource::request_stop(), and stop_source_.

|
inline |
Definition at line 39 of file room_matrix_census.h.
References Invalidate(), and manifest_provider_.
Referenced by yaze::editor::RoomMatrixContent::DetachRuntimeContext(), and yaze::editor::RoomMatrixContent::SetCensusManifestProvider().

|
inline |
Definition at line 44 of file room_matrix_census.h.
References enabled_.
Referenced by yaze::editor::RoomMatrixContent::Draw(), and SetEnabled().
|
inline |
Definition at line 45 of file room_matrix_census.h.
References enabled(), enabled_, Invalidate(), and pending_.
Referenced by yaze::editor::RoomMatrixContent::DetachRuntimeContext().

| void yaze::editor::RoomMatrixCensusOverlay::Update | ( | Rom * | rom | ) |
Definition at line 139 of file room_matrix_census.cc.
References yaze::zelda3::CustomObjectManager::asset_generation(), yaze::core::FeatureFlags::get(), yaze::zelda3::CustomObjectManager::Get(), yaze::Rom::is_loaded(), yaze::core::FeatureFlags::Flags::kEnableCustomObjects, and yaze::Rom::object_tile_revision().
Referenced by yaze::editor::RoomMatrixContent::Draw().
|
inline |
Definition at line 55 of file room_matrix_census.h.
References census_, error_, largest_block_, yaze::util::StopSource::request_stop(), stale_, and stop_source_.
Referenced by yaze::editor::DungeonEditorV2::InvalidateDungeonRenderContextCensus(), SetEnabled(), SetManifestProvider(), and yaze::editor::RoomMatrixContent::SetRooms().

| void yaze::editor::RoomMatrixCensusOverlay::DrawControls | ( | Rom * | rom | ) |
Definition at line 284 of file room_matrix_census.cc.
References yaze::gui::AutoRegisterLastItem(), yaze::gui::GetErrorColor(), ICON_MD_CROP_FREE, ICON_MD_INFO_OUTLINE, and ICON_MD_REFRESH.
Referenced by yaze::editor::RoomMatrixContent::DrawMatrixHeader().

|
inline |
Definition at line 66 of file room_matrix_census.h.
References census_, and enabled_.
Referenced by yaze::editor::RoomMatrixContent::Draw(), and StartComputation().
|
inline |
Definition at line 69 of file room_matrix_census.h.
References pending_.
| ImU32 yaze::editor::RoomMatrixCensusOverlay::FillColor | ( | int | room_id | ) | const |
Definition at line 414 of file room_matrix_census.cc.
Referenced by yaze::editor::RoomMatrixContent::Draw().
| std::optional< ImU32 > yaze::editor::RoomMatrixCensusOverlay::StatusOutline | ( | int | room_id | ) | const |
Definition at line 431 of file room_matrix_census.cc.
References yaze::zelda3::kFree, yaze::zelda3::kInUse, and yaze::zelda3::kReclaimable.
Referenced by yaze::editor::RoomMatrixContent::DrawCensusCellMarks().
| bool yaze::editor::RoomMatrixCensusOverlay::InLargestFreeBlock | ( | int | room_id | ) | const |
Definition at line 457 of file room_matrix_census.cc.
Referenced by yaze::editor::RoomMatrixContent::DrawCensusCellMarks().
|
static |
Definition at line 447 of file room_matrix_census.cc.
Referenced by yaze::editor::RoomMatrixContent::DrawCensusCellMarks().
|
static |
Definition at line 451 of file room_matrix_census.cc.
Referenced by yaze::editor::RoomMatrixContent::DrawCensusCellMarks().
| bool yaze::editor::RoomMatrixCensusOverlay::IsOrphan | ( | int | room_id | ) | const |
Definition at line 461 of file room_matrix_census.cc.
Referenced by yaze::editor::RoomMatrixContent::DrawCensusCellMarks().
| bool yaze::editor::RoomMatrixCensusOverlay::MatchesChips | ( | int | room_id | ) | const |
Definition at line 467 of file room_matrix_census.cc.
References yaze::zelda3::kFree, and yaze::zelda3::kReclaimable.
Referenced by yaze::editor::RoomMatrixContent::Draw().
|
inline |
Definition at line 81 of file room_matrix_census.h.
References filter_free_, filter_orphan_, filter_owners_, and filter_reclaimable_.
| void yaze::editor::RoomMatrixCensusOverlay::DrawTooltip | ( | int | room_id | ) | const |
Definition at line 482 of file room_matrix_census.cc.
References yaze::zelda3::kFree, yaze::zelda3::kInUse, and yaze::zelda3::kReclaimable.
Referenced by yaze::editor::RoomMatrixContent::Draw().
|
inline |
Definition at line 90 of file room_matrix_census.h.
References filter_free_.
|
inline |
Definition at line 91 of file room_matrix_census.h.
References filter_reclaimable_.
| void yaze::editor::RoomMatrixCensusOverlay::ToggleOwnerFilter | ( | int | owner_index | ) |
Definition at line 278 of file room_matrix_census.cc.
|
static |
Definition at line 82 of file room_matrix_census.cc.
|
private |
Definition at line 92 of file room_matrix_census.cc.
References yaze::core::RomSettings::address_overrides(), yaze::zelda3::BuildRoomCensus(), yaze::zelda3::CustomObjectManager::CaptureRenderSnapshot(), census(), yaze::core::FeatureFlags::get(), yaze::core::RomSettings::Get(), yaze::zelda3::CustomObjectManager::Get(), yaze::zelda3::DrawRoutineRegistry::Get(), yaze::util::StopSource::get_token(), manifest_provider_, pending_, yaze::zelda3::RoomCensusOwnersFromProject(), yaze::zelda3::RoomCensusWarpTagsFromManifest(), and stop_source_.
|
staticprivate |
Definition at line 189 of file room_matrix_census.cc.
|
private |
Definition at line 201 of file room_matrix_census.cc.
References yaze::gui::AutoRegisterLastItem().

|
friend |
Definition at line 96 of file room_matrix_census.h.
|
private |
Definition at line 103 of file room_matrix_census.h.
Referenced by SetManifestProvider(), and StartComputation().
|
private |
Definition at line 104 of file room_matrix_census.h.
Referenced by census(), enabled(), and SetEnabled().
|
private |
Definition at line 105 of file room_matrix_census.h.
Referenced by Invalidate().
|
private |
Definition at line 106 of file room_matrix_census.h.
|
private |
Definition at line 107 of file room_matrix_census.h.
|
private |
Definition at line 108 of file room_matrix_census.h.
|
private |
Definition at line 109 of file room_matrix_census.h.
|
private |
Definition at line 110 of file room_matrix_census.h.
Referenced by census(), and Invalidate().
|
private |
Definition at line 111 of file room_matrix_census.h.
Referenced by Invalidate().
|
private |
Definition at line 112 of file room_matrix_census.h.
Referenced by computing(), SetEnabled(), and StartComputation().
|
private |
Definition at line 113 of file room_matrix_census.h.
Referenced by Invalidate(), StartComputation(), and ~RoomMatrixCensusOverlay().
|
private |
Definition at line 114 of file room_matrix_census.h.
Referenced by Invalidate().
|
private |
Definition at line 116 of file room_matrix_census.h.
Referenced by HasActiveChips(), and SetFilterFree().
|
private |
Definition at line 117 of file room_matrix_census.h.
Referenced by HasActiveChips(), and SetFilterReclaimable().
|
private |
Definition at line 118 of file room_matrix_census.h.
Referenced by HasActiveChips().
|
private |
Definition at line 119 of file room_matrix_census.h.
Referenced by HasActiveChips().