#include <usage_preview.h>

Public Member Functions | |
| absl::Status | Render (Rom *rom, zelda3::GameData *game_data, int room_id, const SheetPixels &sheets, bool objects_only, zelda3::Room *live_room=nullptr) |
| const std::vector< RoomTileReference > & | tile_references () const |
| size_t | unknown_objects () const |
| int | room_id () const |
| const gfx::Bitmap & | bitmap () const |
| gfx::Bitmap & | mutable_bitmap () |
| PreviewImage | Snapshot () const |
| std::array< uint8_t, 16 > | blocks () const |
| Room graphics blocks (0-7 background, 8-15 sprites) of the loaded room. | |
| std::vector< SDL_Rect > | ObjectRectsUsingSheet (uint16_t sheet) const |
| std::vector< SDL_Rect > | ObjectRectsForObject (size_t index) const |
| absl::Status | TraceLoadedRoom (Rom *rom, zelda3::GameData *game_data, zelda3::Room *room) |
| void | Reset () |
| Clears the loaded room so the next Render() reloads it from the ROM. | |
Private Member Functions | |
| void | CaptureUsage (const zelda3::Room &room) |
Private Attributes | |
| std::unique_ptr< zelda3::Room > | room_ |
| std::array< uint8_t, 16 > | blocks_ {} |
| std::vector< RoomTileReference > | tile_references_ |
| std::map< size_t, SDL_Rect > | object_rects_ |
| size_t | unknown_objects_ = 0 |
| int | room_id_ = -1 |
| gfx::Bitmap | composite_ |
Definition at line 118 of file usage_preview.h.
| absl::Status yaze::editor::usage_preview::RoomUsagePreview::Render | ( | Rom * | rom, |
| zelda3::GameData * | game_data, | ||
| int | room_id, | ||
| const SheetPixels & | sheets, | ||
| bool | objects_only, | ||
| zelda3::Room * | live_room = nullptr ) |
Loads room_id on first use (or when it changes) and renders it with sheets swapped in. objects_only hides the floor and layout layers.
Definition at line 257 of file usage_preview.cc.
References yaze::zelda3::RoomLayerManager::ApplyGameLayerRegisters(), yaze::zelda3::RoomLayerManager::ApplyLayerMerging(), yaze::zelda3::RoomLayerManager::ApplyRoomEffect(), yaze::zelda3::BG1_Layout, yaze::zelda3::BG2_Layout, CaptureUsage(), composite_, yaze::zelda3::Room::effect(), yaze::zelda3::Room::game_data(), yaze::zelda3::Room::GameLayerRegisters(), yaze::zelda3::Room::id(), yaze::gfx::Bitmap::is_active(), yaze::Rom::is_loaded(), yaze::zelda3::Room::IsLoaded(), yaze::zelda3::kNumberOfRooms, yaze::zelda3::Room::layer_merging(), yaze::zelda3::LoadRoomFromRom(), yaze::zelda3::Room::MarkGraphicsDirty(), yaze::zelda3::Room::PrepareForRender(), yaze::zelda3::Room::RenderComposite(), yaze::zelda3::Room::rom(), room_, room_id(), room_id_, yaze::zelda3::RoomLayerManager::SetLayerVisible(), and yaze::gfx::Bitmap::width().
Referenced by yaze::editor::UsagePreviewView::DrawSharedUses().
|
inline |
Definition at line 126 of file usage_preview.h.
References tile_references_.
Referenced by yaze::editor::usage_preview::FindLoadedRoomSourceUses().
|
inline |
Definition at line 129 of file usage_preview.h.
References unknown_objects_.
Referenced by yaze::editor::usage_preview::FindLoadedRoomSourceUses().
|
inline |
|
inline |
Definition at line 132 of file usage_preview.h.
References composite_.
|
inline |
Definition at line 133 of file usage_preview.h.
References composite_.
Referenced by yaze::editor::UsagePreviewView::DrawSharedUses().
|
inline |
Definition at line 134 of file usage_preview.h.
References composite_, and yaze::editor::usage_preview::SnapshotBitmap().

| std::array< uint8_t, 16 > yaze::editor::usage_preview::RoomUsagePreview::blocks | ( | ) | const |
Room graphics blocks (0-7 background, 8-15 sprites) of the loaded room.
Definition at line 306 of file usage_preview.cc.
References blocks_.
| std::vector< SDL_Rect > yaze::editor::usage_preview::RoomUsagePreview::ObjectRectsUsingSheet | ( | uint16_t | sheet | ) | const |
Pixel rectangles of objects that draw at least one 8x8 tile from sheet (background blocks only).
Definition at line 356 of file usage_preview.cc.
References object_rects_, and tile_references_.
| std::vector< SDL_Rect > yaze::editor::usage_preview::RoomUsagePreview::ObjectRectsForObject | ( | size_t | index | ) | const |
Definition at line 367 of file usage_preview.cc.
References object_rects_.
Referenced by yaze::editor::UsagePreviewView::DrawSharedUses().
| absl::Status yaze::editor::usage_preview::RoomUsagePreview::TraceLoadedRoom | ( | Rom * | rom, |
| zelda3::GameData * | game_data, | ||
| zelda3::Room * | room ) |
Definition at line 221 of file usage_preview.cc.
References CaptureUsage(), yaze::zelda3::Room::game_data(), yaze::Rom::is_loaded(), yaze::zelda3::Room::IsLoaded(), yaze::zelda3::Room::PrepareForRender(), and yaze::zelda3::Room::rom().
Referenced by yaze::editor::usage_preview::FindLoadedRoomSourceUses().
| void yaze::editor::usage_preview::RoomUsagePreview::Reset | ( | ) |
Clears the loaded room so the next Render() reloads it from the ROM.
Definition at line 374 of file usage_preview.cc.
References blocks_, object_rects_, room_, room_id_, tile_references_, and unknown_objects_.
Referenced by yaze::editor::UsagePreviewView::Draw(), yaze::editor::UsagePreviewView::EnsureTables(), and yaze::editor::UsagePreviewView::InvalidateTables().
|
private |
Definition at line 310 of file usage_preview.cc.
References yaze::zelda3::Room::BackgroundPaletteOffset(), yaze::zelda3::Room::blocks(), blocks_, yaze::zelda3::ComposeYazeRoomTilemaps(), yaze::zelda3::ComputeObjectTileOwners(), yaze::zelda3::DimensionService::Get(), yaze::zelda3::DimensionService::GetSelectionBoundsPixels(), yaze::zelda3::Room::GetTileObjects(), yaze::zelda3::Room::id(), object_rects_, yaze::zelda3::Room::rendered_palette_addresses(), yaze::zelda3::Room::rom(), tile_references_, and unknown_objects_.
Referenced by Render(), and TraceLoadedRoom().
|
private |
Definition at line 151 of file usage_preview.h.
|
private |
Definition at line 152 of file usage_preview.h.
Referenced by blocks(), CaptureUsage(), and Reset().
|
private |
Definition at line 153 of file usage_preview.h.
Referenced by CaptureUsage(), ObjectRectsUsingSheet(), Reset(), and tile_references().
|
private |
Definition at line 154 of file usage_preview.h.
Referenced by CaptureUsage(), ObjectRectsForObject(), ObjectRectsUsingSheet(), and Reset().
|
private |
Definition at line 155 of file usage_preview.h.
Referenced by CaptureUsage(), Reset(), and unknown_objects().
|
private |
Definition at line 156 of file usage_preview.h.
|
private |
Definition at line 157 of file usage_preview.h.
Referenced by bitmap(), mutable_bitmap(), Render(), and Snapshot().