yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::usage_preview Namespace Reference

Namespaces

namespace  anonymous_namespace{usage_preview.cc}
 

Classes

struct  LiveRoomContext
 
struct  LoadedRoomSourceUses
 
struct  PreviewImage
 
struct  RoomTileReference
 
class  RoomUsagePreview
 
struct  SourceObjectUse
 
class  SpriteUsagePreview
 
class  Tile16UsagePreview
 

Typedefs

using SheetPixels = std::map<uint16_t, std::vector<uint8_t>>
 Sheet id -> 4096 8bpp pixels (the GameData::graphics_buffer layout).
 
using LiveRoomContexts = std::map<int, LiveRoomContext>
 
using LiveRoomProvider = std::function<LiveRoomContexts()>
 

Functions

SheetPixels SnapshotSessionSheets (const std::set< uint16_t > &ids, const zelda3::GameData *game_data)
 
SheetPixels SnapshotArenaSheets (const std::set< uint16_t > &ids, const zelda3::GameData *game_data)
 
PreviewImage SnapshotBitmap (const gfx::Bitmap &bitmap)
 Copies a palettized Bitmap (for example a room composite).
 
std::map< int, std::array< uint8_t, 16 > > CollectRoomSheetBlocks (Rom *rom, zelda3::GameData *game_data, const std::map< int, zelda3::RoomGfxInfo > &rooms)
 
std::vector< int > RoomsUsingSheet (const std::map< int, std::array< uint8_t, 16 > > &room_blocks, uint16_t sheet, bool include_sprites)
 
std::string RoomContextLabel (const LiveRoomContext *live)
 
std::vector< SourceObjectUse > FindSourceObjectUses (const std::vector< RoomTileReference > &references, const std::vector< GraphicsEditTarget > &targets, const zelda3::GameData *owner)
 
std::vector< LoadedRoomSourceUses > FindLoadedRoomSourceUses (Rom *rom, zelda3::GameData *game_data, const LiveRoomContexts &rooms, const std::vector< GraphicsEditTarget > &targets)
 

Variables

constexpr size_t kSheetBytes = 4096
 

Typedef Documentation

◆ SheetPixels

using yaze::editor::usage_preview::SheetPixels = std::map<uint16_t, std::vector<uint8_t>>

Sheet id -> 4096 8bpp pixels (the GameData::graphics_buffer layout).

Definition at line 46 of file usage_preview.h.

◆ LiveRoomContexts

Definition at line 88 of file usage_preview.h.

◆ LiveRoomProvider

Definition at line 89 of file usage_preview.h.

Function Documentation

◆ SnapshotSessionSheets()

◆ SnapshotArenaSheets()

SheetPixels yaze::editor::usage_preview::SnapshotArenaSheets ( const std::set< uint16_t > & ids,
const zelda3::GameData * game_data )

Compatibility reader for Arena display copies, not authoritative pixels. Copies sheets in ids. Sheets that are not loaded or not 128x32 8bpp are left out. Returns nothing when the Arena holds another ROM's sheets (its owner is not game_data).

Definition at line 52 of file usage_preview.cc.

References yaze::gfx::Arena::Get(), and kSheetBytes.

Here is the call graph for this function:

◆ SnapshotBitmap()

◆ CollectRoomSheetBlocks()

std::map< int, std::array< uint8_t, 16 > > yaze::editor::usage_preview::CollectRoomSheetBlocks ( Rom * rom,
zelda3::GameData * game_data,
const std::map< int, zelda3::RoomGfxInfo > & rooms )

Graphics blocks (0-7 background, 8-15 sprites) per dungeon room, from Room::LoadRoomGraphics() with each room's header blockset and spriteset. Only the group tables are read; no room objects are loaded.

Definition at line 140 of file usage_preview.cc.

References yaze::zelda3::Room::blocks(), yaze::zelda3::Room::LoadRoomGraphics(), yaze::zelda3::Room::SetBlockset(), and yaze::zelda3::Room::SetSpriteset().

Referenced by yaze::editor::UsagePreviewView::EnsureTables().

Here is the call graph for this function:

◆ RoomsUsingSheet()

std::vector< int > yaze::editor::usage_preview::RoomsUsingSheet ( const std::map< int, std::array< uint8_t, 16 > > & room_blocks,
uint16_t sheet,
bool include_sprites )

Rooms whose background blocks (or, with include_sprites, sprite blocks) contain sheet. Sorted by room id.

Definition at line 160 of file usage_preview.cc.

Referenced by yaze::editor::UsagePreviewView::RefreshRoomContexts().

◆ RoomContextLabel()

std::string yaze::editor::usage_preview::RoomContextLabel ( const LiveRoomContext * live)

◆ FindSourceObjectUses()

std::vector< SourceObjectUse > yaze::editor::usage_preview::FindSourceObjectUses ( const std::vector< RoomTileReference > & references,
const std::vector< GraphicsEditTarget > & targets,
const zelda3::GameData * owner )

Definition at line 182 of file usage_preview.cc.

Referenced by FindLoadedRoomSourceUses().

◆ FindLoadedRoomSourceUses()

Variable Documentation

◆ kSheetBytes

constexpr size_t yaze::editor::usage_preview::kSheetBytes = 4096
constexpr