9#include "yaze_config.h"
12 std::string current_version;
14 ss << YAZE_VERSION_MAJOR <<
"." << YAZE_VERSION_MINOR <<
"."
15 << YAZE_VERSION_PATCH;
16 ss >> current_version;
18 if (version != current_version) {
19 std::cout <<
"Yaze version mismatch: expected " << current_version
20 <<
", got " << version << std::endl;
28 return yaze_status::YAZE_ERROR;
32 if (yaze_ctx->
rom ==
nullptr) {
34 return yaze_status::YAZE_ERROR;
37 return yaze_status::YAZE_OK;
44 return yaze_status::YAZE_OK;
63 rom->
impl = internal_rom;
82 internal_rom->
SaveToFile(
false,
false, filename);
91 bitmap.
data =
nullptr;
96 int palette_set,
int palette,
100 color_struct.
green = 0;
101 color_struct.
blue = 0;
110 if (!get_color.ok()) {
113 color_struct = get_color.value().rom_color();
122 if (rom->
impl ==
nullptr) {
128 if (!internal_overworld->Load(*internal_rom).ok()) {
133 overworld->
impl = internal_overworld;
135 for (
const auto &ow_map : internal_overworld->overworld_maps()) {
137 overworld->
maps[map_id]->
id = map_id;
144 if (rom->
impl ==
nullptr) {
The Rom class is used to load, save, and modify Rom data.
absl::Status LoadFromFile(const std::string &filename, bool z3_load=true)
auto palette_group() const
absl::Status SaveToFile(bool backup, bool save_new=false, std::string filename="")
Saves the Rom data to a file.
Represents the full Overworld data, light and dark world.
struct zelda3_overworld_map zelda3_overworld_map
Primitive of an overworld map.
struct zelda3_overworld zelda3_overworld
Primitive of the overworld.
constexpr const char * kPaletteGroupAddressesKeys[]
Primitive of 16-bit RGB SNES color.
const char * error_message
const char * rom_filename
Primitive of the overworld.
zelda3_overworld_map ** maps
zelda3_overworld * yaze_load_overworld(const zelda3_rom *rom)
void yaze_unload_rom(zelda3_rom *rom)
yaze_status yaze_shutdown(yaze_editor_context *yaze_ctx)
yaze_bitmap yaze_load_bitmap(const char *filename)
yaze_status yaze_init(yaze_editor_context *yaze_ctx)
zelda3_dungeon_room * yaze_load_all_rooms(const zelda3_rom *rom)
void yaze_check_version(const char *version)
snes_color yaze_get_color_from_paletteset(const zelda3_rom *rom, int palette_set, int palette, int color)
yaze_project yaze_load_project(const char *filename)
zelda3_rom * yaze_load_rom(const char *filename)
void yaze_save_rom(zelda3_rom *rom, const char *filename)
struct zelda3_rom zelda3_rom