1#ifndef YAZE_ZELDA3_DUNGEON_OBJECT_TILE_EDITOR_H_
2#define YAZE_ZELDA3_DUNGEON_OBJECT_TILE_EDITOR_H_
12#include "absl/status/status.h"
13#include "absl/status/statusor.h"
43 std::vector<ObjectTileSourceSpan>
spans;
134 const std::vector<ObjectDrawer::TileTrace>& traces);
171 const std::vector<std::pair<uint32_t, uint32_t>>&
write_ranges()
const {
209 uint8_t object_size);
227 const uint8_t* room_gfx_buffer,
235 gfx::Bitmap& atlas,
const uint8_t* room_gfx_buffer,
237 std::optional<int16_t> custom_object_id = std::nullopt,
238 uint16_t retained_attributes = 0);
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Represents a bitmap image optimized for SNES ROM hacking.
SNES 16-bit tile metadata container.
Captures and edits the tile8 composition of dungeon objects.
absl::StatusOr< ObjectTileSourceImpact > AnalyzeStandardTileSourceImpact(const ObjectTileLayout &layout) const
absl::Status ApplyStandardWritePlan(const ObjectTileWritePlan &plan)
static constexpr int kAtlasTilesPerRow
ObjectTileEditor(Rom *rom)
absl::Status RenderLayoutToBitmap(const ObjectTileLayout &layout, gfx::Bitmap &bitmap, const uint8_t *room_gfx_buffer, const gfx::PaletteGroup &palette)
static bool IsEditableStandardObject(int16_t object_id)
absl::Status BuildTile8Atlas(gfx::Bitmap &atlas, const uint8_t *room_gfx_buffer, const gfx::PaletteGroup &palette, int display_palette=2, std::optional< int16_t > custom_object_id=std::nullopt, uint16_t retained_attributes=0)
static constexpr int kAtlasTileRows
absl::StatusOr< ObjectTileLayout > CaptureObjectLayout(int16_t object_id, const Room &room, const gfx::PaletteGroup &palette)
absl::Status WriteBack(ObjectTileLayout &layout)
static constexpr int kAtlasWidthPx
static constexpr int kAtlasTileCount
static constexpr int kAtlasHeightPx
absl::StatusOr< ObjectTileLayout > CaptureEditableObjectLayout(int16_t object_id, const Room &room, const gfx::PaletteGroup &palette)
absl::StatusOr< ObjectTileWritePlan > BuildStandardWritePlan(const ObjectTileLayout &layout) const
absl::StatusOr< ObjectTileLayout > LoadCustomObjectLayout(int16_t object_id, int subtype)
Fully resolved standard-object ROM writes.
ObjectTileWritePlan()=default
std::vector< std::pair< uint32_t, uint32_t > > write_ranges_
const std::vector< Write > & writes() const
std::vector< Write > writes_
const std::vector< WordPrecondition > & preconditions() const
std::vector< WordPrecondition > preconditions_
ObjectTileWritePlan(const ObjectTileWritePlan &)=default
const std::vector< std::pair< uint32_t, uint32_t > > & write_ranges() const
ObjectTileWritePlan(ObjectTileWritePlan &&) noexcept=default
ObjectTileRuntimeConsumer
Represents a group of palettes.
std::optional< ObjectTileSourceRef > source_ref
Editable tile8 layout captured from an object's draw trace.
bool HasModifications() const
std::vector< uint8_t > custom_source_bytes
std::optional< ObjectTileSourceProvenance > source_provenance
std::filesystem::path custom_resolved_path
Cell * FindCell(int rel_x, int rel_y)
std::vector< Cell > cells
std::string custom_filename
static ObjectTileLayout FromTraces(const std::vector< ObjectDrawer::TileTrace > &traces)
ObjectTileRuntimeConsumer consumer
std::vector< ObjectTileReadRange > overlapping_ranges
One standard object whose parser-visible tile sources overlap an editable layout's authorized source ...
std::vector< ObjectTileReadRange > overlapping_ranges
Fail-closed impact inventory within ObjectParser's source model plus explicitly modeled runtime consu...
size_t consumer_count() const
std::vector< ObjectTileRuntimeConsumerImpactEntry > runtime_consumers
std::vector< ObjectTileSourceImpactEntry > affected_objects
ROM descriptor and source snapshot authorizing an editable capture.
uint16_t expected_descriptor_word
uint32_t descriptor_pc_address
std::vector< ObjectTileSourceSpan > spans
A cell's exact word within an authorized source span.
One contiguous ROM-backed source span for an object's tile words.
std::vector< uint16_t > expected_words