15 std::array<gfx::Bitmap, 4> &sheets,
17 std::vector<uint8_t> &gfx_bin_data) {
19 if (bin_file.empty()) {
20 return absl::InternalError(
"No file selected");
23 std::ifstream file(bin_file, std::ios::binary);
26 std::vector<uint8_t> bin_data((std::istreambuf_iterator<char>(file)),
27 std::istreambuf_iterator<char>());
29 gfx_bin_data = converted_bin;
32 std::vector<std::vector<uint8_t>> gfx_sheets;
33 for (
int i = 0; i < 4; i++) {
34 gfx_sheets.emplace_back(converted_bin.begin() + (i * 0x1000),
35 converted_bin.begin() + ((i + 1) * 0x1000));
42 return absl::InternalError(
"Failed to load dungeon map tile16");
47 return absl::OkStatus();
The Rom class is used to load, save, and modify Rom data.
auto mutable_dungeon_palette(int i)
static std::string ShowOpenFileDialog()
ShowOpenFileDialog opens a file dialog and returns the selected filepath.
static Renderer & GetInstance()
void RenderBitmap(gfx::Bitmap *bitmap)
Used to render a bitmap to the screen.
Represents a bitmap image.
Represents a tilesheet, which is a collection of tiles stored in a bitmap.
#define RETURN_IF_ERROR(expression)
std::vector< uint8_t > SnesTo8bppSheet(const std::vector< uint8_t > &sheet, int bpp, int num_sheets)
Zelda 3 specific classes and functions.
absl::Status LoadDungeonMapTile16(const std::vector< uint8_t > &gfx_data, bool bin_mode)
absl::Status LoadDungeonMapGfxFromBinary(Rom &rom, std::array< gfx::Bitmap, 4 > &sheets, gfx::Tilesheet &tile16_sheet, std::vector< uint8_t > &gfx_bin_data)
Main namespace for the application.