Change Load2BppGraphics to standalone fn, add mutable_data accessor

This commit is contained in:
scawful
2024-12-29 09:58:58 -05:00
parent a8dcfe3d05
commit 54c170373b
6 changed files with 39 additions and 34 deletions

View File

@@ -133,16 +133,6 @@ constexpr uint32_t kMaxGraphics = 0xC3FB5;
*/
class Rom : public core::ExperimentFlags {
public:
/**
* @brief Loads 2bpp graphics from Rom data.
*
* This function loads 2bpp graphics from Rom data by iterating over a list of
* sheet IDs, decompressing the sheet data, converting it to 8bpp format, and
* appending the converted sheet data to a byte vector.
*
*/
absl::StatusOr<std::vector<uint8_t>> Load2BppGraphics();
/**
* @brief Loads the players 4bpp graphics sheet from Rom data.
*/
@@ -456,9 +446,12 @@ class Rom : public core::ExperimentFlags {
auto title() const { return title_; }
auto size() const { return size_; }
auto data() const { return rom_data_.data(); }
auto mutable_data() { return rom_data_.data(); }
auto begin() { return rom_data_.begin(); }
auto end() { return rom_data_.end(); }
auto data() { return rom_data_.data(); }
auto vector() const { return rom_data_; }
auto version() const { return version_; }
auto filename() const { return filename_; }
@@ -568,6 +561,16 @@ class Rom : public core::ExperimentFlags {
Z3_Version version_ = Z3_Version::US;
};
/**
* @brief Loads 2bpp graphics from Rom data.
*
* This function loads 2bpp graphics from Rom data by iterating over a list of
* sheet IDs, decompressing the sheet data, converting it to 8bpp format, and
* appending the converted sheet data to a byte vector.
*
*/
absl::StatusOr<std::vector<uint8_t>> Load2BppGraphics(const Rom& rom);
/**
* @brief A class to hold a shared pointer to a Rom object.
*/