#include <project_graphics_source.h>

Classes | |
| struct | History |
| struct | PixelAction |
| struct | PreviewFiles |
| struct | Resource |
| struct | Slice |
Public Member Functions | |
| ProjectGraphicsSource () | |
| ~ProjectGraphicsSource () | |
| ProjectGraphicsSource (ProjectGraphicsSource &&) noexcept | |
| ProjectGraphicsSource & | operator= (ProjectGraphicsSource &&) noexcept |
| ProjectGraphicsSource (const ProjectGraphicsSource &)=delete | |
| ProjectGraphicsSource & | operator= (const ProjectGraphicsSource &)=delete |
| absl::Status | Load (const std::string &source_root, const std::string &portable_catalog, int parent_map) |
| const std::vector< Resource > & | resources () const |
| const Resource * | selected_resource () const |
| std::string | selected_resource_id () const |
| absl::Status | SelectResource (const std::string &resource_id) |
| const std::string & | source_root () const |
| const std::string & | portable_catalog () const |
| const std::string & | profile_id () const |
| int | parent_map () const |
| bool | loaded () const |
| bool | backend_available () const |
| absl::StatusOr< uint8_t > | GetPixel (size_t tile, int x, int y) const |
| absl::Status | SetPixel (size_t tile, int x, int y, uint8_t index) |
| absl::Status | Undo () |
| absl::Status | Redo () |
| bool | can_undo () const |
| bool | can_redo () const |
| bool | dirty () const |
| bool | any_dirty () const |
| absl::Status | ReplaceResourceBytes (const std::vector< uint8_t > &bytes) |
| absl::Status | ReplaceResourceBytes (const std::string &source_path, const std::vector< uint8_t > &bytes) |
| absl::StatusOr< zelda3::OverworldGraphicsPreview > | PendingGraphicsPreview () const |
| absl::StatusOr< nlohmann::json > | Preview () |
| absl::StatusOr< nlohmann::json > | Publish () |
| bool | has_preview () const |
| const nlohmann::json & | preview_json () const |
Private Member Functions | |
| absl::Status | CheckUnchanged () const |
| absl::Status | ReplaceResourceBytesAt (size_t resource, const std::vector< uint8_t > &bytes) |
| absl::Status | CheckPixel (size_t tile, int x, int y) const |
| void | WritePixel (size_t tile, int x, int y, uint8_t index) |
| void | InvalidatePreview () |
Private Attributes | |
| std::string | source_root_ |
| std::string | portable_catalog_ |
| std::string | profile_id_ |
| int | parent_map_ = -1 |
| size_t | selected_ = 0 |
| std::vector< Resource > | resources_ |
| std::vector< History > | histories_ |
| std::map< std::string, std::string > | loaded_hashes_ |
| std::unique_ptr< PreviewFiles > | preview_ |
| nlohmann::json | preview_json_ |
Definition at line 20 of file project_graphics_source.h.
|
default |
|
default |
|
defaultnoexcept |
|
delete |
|
defaultnoexcept |
|
delete |
| absl::Status yaze::editor::ProjectGraphicsSource::Load | ( | const std::string & | source_root, |
| const std::string & | portable_catalog, | ||
| int | parent_map ) |
Definition at line 229 of file project_graphics_source.cc.
References yaze::editor::ProjectGraphicsSource::Slice::bg_character_base_word, yaze::editor::ProjectGraphicsSource::Slice::byte_count, yaze::core::ComputeSourceArtifactSha256(), yaze::zelda3::DecodeGraphicsPreviewTransfer(), yaze::editor::ProjectGraphicsSource::Resource::id, yaze::editor::ProjectGraphicsSource::Resource::original_bytes, yaze::editor::ProjectGraphicsSource::Slice::parent_maps, yaze::editor::ProjectGraphicsSource::Resource::parent_maps, yaze::editor::ProjectGraphicsSource::Resource::pending_bytes, yaze::editor::ProjectGraphicsSource::Resource::portable_path, yaze::editor::ProjectGraphicsSource::Slice::profile_id, yaze::editor::ProjectGraphicsSource::Resource::profile_ids, yaze::editor::ProjectGraphicsSource::Resource::sha256, yaze::editor::ProjectGraphicsSource::Resource::slices, yaze::editor::ProjectGraphicsSource::Slice::source_offset, yaze::editor::ProjectGraphicsSource::Resource::source_path, yaze::editor::ProjectGraphicsSource::Resource::tiles, yaze::editor::ProjectGraphicsSource::Slice::vram_word_address, and yaze::Json::exception::what().
Referenced by Publish().

|
inline |
Definition at line 62 of file project_graphics_source.h.
References resources_.
| const ProjectGraphicsSource::Resource * yaze::editor::ProjectGraphicsSource::selected_resource | ( | ) | const |
Definition at line 358 of file project_graphics_source.cc.
References resources_, and selected_.
Referenced by CheckPixel(), dirty(), Publish(), and selected_resource_id().
|
inline |
Definition at line 64 of file project_graphics_source.h.
References selected_resource().

| absl::Status yaze::editor::ProjectGraphicsSource::SelectResource | ( | const std::string & | resource_id | ) |
Definition at line 374 of file project_graphics_source.cc.
References InvalidatePreview(), resources_, and selected_.
Referenced by Publish().

|
inline |
Definition at line 69 of file project_graphics_source.h.
References source_root_.
|
inline |
Definition at line 70 of file project_graphics_source.h.
References portable_catalog_.
|
inline |
Definition at line 71 of file project_graphics_source.h.
References profile_id_.
|
inline |
Definition at line 72 of file project_graphics_source.h.
References parent_map_.
|
inline |
Definition at line 73 of file project_graphics_source.h.
References resources_.
Referenced by PendingGraphicsPreview(), and ReplaceResourceBytes().
| bool yaze::editor::ProjectGraphicsSource::backend_available | ( | ) | const |
Definition at line 362 of file project_graphics_source.cc.
References source_root_.
Referenced by Preview().
| absl::StatusOr< uint8_t > yaze::editor::ProjectGraphicsSource::GetPixel | ( | size_t | tile, |
| int | x, | ||
| int | y ) const |
Definition at line 399 of file project_graphics_source.cc.
References CheckPixel(), resources_, and selected_.
Referenced by SetPixel().

| absl::Status yaze::editor::ProjectGraphicsSource::SetPixel | ( | size_t | tile, |
| int | x, | ||
| int | y, | ||
| uint8_t | index ) |
Definition at line 420 of file project_graphics_source.cc.
References GetPixel(), histories_, selected_, and WritePixel().

| absl::Status yaze::editor::ProjectGraphicsSource::Undo | ( | ) |
Definition at line 436 of file project_graphics_source.cc.
References can_undo(), histories_, selected_, and WritePixel().

| absl::Status yaze::editor::ProjectGraphicsSource::Redo | ( | ) |
Definition at line 447 of file project_graphics_source.cc.
References can_redo(), histories_, selected_, and WritePixel().

| bool yaze::editor::ProjectGraphicsSource::can_undo | ( | ) | const |
Definition at line 458 of file project_graphics_source.cc.
References histories_, and selected_.
Referenced by Undo().
| bool yaze::editor::ProjectGraphicsSource::can_redo | ( | ) | const |
Definition at line 461 of file project_graphics_source.cc.
References histories_, and selected_.
Referenced by Redo().
| bool yaze::editor::ProjectGraphicsSource::dirty | ( | ) | const |
Definition at line 464 of file project_graphics_source.cc.
References selected_resource().
Referenced by Preview(), and Publish().

| bool yaze::editor::ProjectGraphicsSource::any_dirty | ( | ) | const |
Definition at line 468 of file project_graphics_source.cc.
References resources_.
| absl::Status yaze::editor::ProjectGraphicsSource::ReplaceResourceBytes | ( | const std::vector< uint8_t > & | bytes | ) |
Definition at line 473 of file project_graphics_source.cc.
References ReplaceResourceBytesAt(), and selected_.

| absl::Status yaze::editor::ProjectGraphicsSource::ReplaceResourceBytes | ( | const std::string & | source_path, |
| const std::vector< uint8_t > & | bytes ) |
Definition at line 478 of file project_graphics_source.cc.
References loaded(), ReplaceResourceBytesAt(), and resources_.

| absl::StatusOr< zelda3::OverworldGraphicsPreview > yaze::editor::ProjectGraphicsSource::PendingGraphicsPreview | ( | ) | const |
Definition at line 526 of file project_graphics_source.cc.
References CheckUnchanged(), yaze::zelda3::DecodeGraphicsPreviewTransfer(), loaded(), and resources_.

| absl::StatusOr< Json > yaze::editor::ProjectGraphicsSource::Preview | ( | ) |
Definition at line 579 of file project_graphics_source.cc.
References backend_available(), CheckUnchanged(), yaze::core::ComputeSourceArtifactSha256(), dirty(), InvalidatePreview(), portable_catalog_, preview_, preview_json_, resources_, selected_, and source_root_.
| absl::StatusOr< Json > yaze::editor::ProjectGraphicsSource::Publish | ( | ) |
Definition at line 672 of file project_graphics_source.cc.
References CheckUnchanged(), yaze::core::ComputeSourceArtifactSha256(), dirty(), histories_, yaze::editor::ProjectGraphicsSource::Resource::id, Load(), yaze::editor::ProjectGraphicsSource::Resource::original_bytes, parent_map_, yaze::editor::ProjectGraphicsSource::Resource::pending_bytes, portable_catalog_, preview_, preview_json_, resources_, selected_, selected_resource(), SelectResource(), and source_root_.
|
inline |
Definition at line 106 of file project_graphics_source.h.
References preview_.
|
inline |
Definition at line 107 of file project_graphics_source.h.
References preview_json_.
|
private |
Definition at line 565 of file project_graphics_source.cc.
References yaze::core::ComputeSourceArtifactSha256(), and loaded_hashes_.
Referenced by PendingGraphicsPreview(), Preview(), Publish(), and ReplaceResourceBytesAt().

|
private |
Definition at line 491 of file project_graphics_source.cc.
References CheckUnchanged(), yaze::zelda3::DecodeGraphicsPreviewTransfer(), histories_, InvalidatePreview(), and resources_.
Referenced by ReplaceResourceBytes(), and ReplaceResourceBytes().

|
private |
Definition at line 387 of file project_graphics_source.cc.
References selected_resource().
Referenced by GetPixel().

|
private |
Definition at line 407 of file project_graphics_source.cc.
References InvalidatePreview(), resources_, and selected_.
Referenced by Redo(), SetPixel(), and Undo().

|
private |
Definition at line 560 of file project_graphics_source.cc.
References preview_, and preview_json_.
Referenced by Preview(), ReplaceResourceBytesAt(), SelectResource(), and WritePixel().
|
private |
Definition at line 129 of file project_graphics_source.h.
Referenced by backend_available(), Preview(), Publish(), and source_root().
|
private |
Definition at line 130 of file project_graphics_source.h.
Referenced by portable_catalog(), Preview(), and Publish().
|
private |
Definition at line 131 of file project_graphics_source.h.
Referenced by profile_id().
|
private |
Definition at line 132 of file project_graphics_source.h.
Referenced by parent_map(), and Publish().
|
private |
Definition at line 133 of file project_graphics_source.h.
Referenced by can_redo(), can_undo(), GetPixel(), Preview(), Publish(), Redo(), ReplaceResourceBytes(), selected_resource(), SelectResource(), SetPixel(), Undo(), and WritePixel().
|
private |
Definition at line 134 of file project_graphics_source.h.
Referenced by any_dirty(), GetPixel(), loaded(), PendingGraphicsPreview(), Preview(), Publish(), ReplaceResourceBytes(), ReplaceResourceBytesAt(), resources(), selected_resource(), SelectResource(), and WritePixel().
|
private |
Definition at line 135 of file project_graphics_source.h.
Referenced by can_redo(), can_undo(), Publish(), Redo(), ReplaceResourceBytesAt(), SetPixel(), and Undo().
|
private |
Definition at line 136 of file project_graphics_source.h.
Referenced by CheckUnchanged().
|
private |
Definition at line 137 of file project_graphics_source.h.
Referenced by has_preview(), InvalidatePreview(), Preview(), and Publish().
|
private |
Definition at line 138 of file project_graphics_source.h.
Referenced by InvalidatePreview(), Preview(), preview_json(), and Publish().