#include "yaze.h"
#include <iostream>
#include <memory>
#include <sstream>
#include "app/core/controller.h"
#include "app/core/platform/app_delegate.h"
#include "app/editor/message/message_data.h"
#include "app/rom.h"
#include "app/zelda3/overworld/overworld.h"
#include "util/flag.h"
#include "yaze_config.h"
Go to the source code of this file.
Functions | |
DEFINE_FLAG (std::string, rom_file, "", "Path to the ROM file to load. " "If not specified, the app will run without a ROM.") | |
int | yaze_app_main (int argc, char **argv) |
void | yaze_check_version (const char *version) |
yaze_status | yaze_init (yaze_editor_context *yaze_ctx, char *rom_filename) |
yaze_status | yaze_shutdown (yaze_editor_context *yaze_ctx) |
zelda3_rom * | yaze_load_rom (const char *filename) |
void | yaze_unload_rom (zelda3_rom *rom) |
void | yaze_save_rom (zelda3_rom *rom, const char *filename) |
yaze_bitmap | yaze_load_bitmap (const char *filename) |
snes_color | yaze_get_color_from_paletteset (const zelda3_rom *rom, int palette_set, int palette, int color) |
Get a color from a palette set. | |
zelda3_overworld * | yaze_load_overworld (const zelda3_rom *rom) |
Load the overworld from the ROM. | |
zelda3_dungeon_room * | yaze_load_all_rooms (const zelda3_rom *rom) |
Load all rooms from the ROM. | |
yaze_status | yaze_load_messages (zelda3_rom *rom, zelda3_message **messages) |
Load all messages from the ROM. | |
DEFINE_FLAG | ( | std::string | , |
rom_file | , | ||
"" | , | ||
"Path to the ROM file to load. " "If not | specified, | ||
the app will run without a ROM." | ) |
int yaze_app_main | ( | int | argc, |
char ** | argv ) |
Definition at line 19 of file yaze.cc.
References EXIT_IF_ERROR, yaze::util::global_flag_registry(), yaze::util::FlagParser::Parse(), and RETURN_IF_EXCEPTION.
yaze_status yaze_init | ( | yaze_editor_context * | yaze_ctx, |
char * | rom_filename ) |
Definition at line 59 of file yaze.cc.
References yaze_editor_context::error_message, yaze_editor_context::rom, and yaze_load_rom().
yaze_status yaze_shutdown | ( | yaze_editor_context * | yaze_ctx | ) |
Definition at line 69 of file yaze.cc.
References yaze_editor_context::rom, and yaze_unload_rom().
zelda3_rom * yaze_load_rom | ( | const char * | filename | ) |
Definition at line 76 of file yaze.cc.
References yaze::Rom::data(), zelda3_rom::data, zelda3_rom::filename, zelda3_rom::impl, yaze::Rom::LoadFromFile(), yaze::Rom::size(), and zelda3_rom::size.
Referenced by yaze_init().
void yaze_unload_rom | ( | zelda3_rom * | rom | ) |
void yaze_save_rom | ( | zelda3_rom * | rom, |
const char * | filename ) |
Definition at line 102 of file yaze.cc.
References zelda3_rom::impl, and yaze::Rom::SaveToFile().
yaze_bitmap yaze_load_bitmap | ( | const char * | filename | ) |
Definition at line 113 of file yaze.cc.
References yaze_bitmap::bpp, yaze_bitmap::data, yaze_bitmap::height, and yaze_bitmap::width.
snes_color yaze_get_color_from_paletteset | ( | const zelda3_rom * | rom, |
int | palette_set, | ||
int | palette, | ||
int | color ) |
Get a color from a palette set.
This function gets a color from a palette set and returns it as a snes_color object.
rom | The ROM to get the color from. |
palette_set | The palette set to get the color from. |
palette | The palette to get the color from. |
color | The color to get from the palette. |
Definition at line 122 of file yaze.cc.
References snes_color::blue, snes_color::green, zelda3_rom::impl, yaze::gfx::kPaletteGroupAddressesKeys, yaze::Rom::palette_group(), and snes_color::red.
zelda3_overworld * yaze_load_overworld | ( | const zelda3_rom * | rom | ) |
Load the overworld from the ROM.
rom | The ROM to load the overworld from. |
Definition at line 144 of file yaze.cc.
References zelda3_overworld_map::id, zelda3_overworld::impl, zelda3_rom::impl, and zelda3_overworld::maps.
zelda3_dungeon_room * yaze_load_all_rooms | ( | const zelda3_rom * | rom | ) |
Load all rooms from the ROM.
This function loads all rooms from the ROM and returns them as an array of rooms.
rom | The ROM to load rooms from. |
Definition at line 166 of file yaze.cc.
References zelda3_rom::impl.
yaze_status yaze_load_messages | ( | zelda3_rom * | rom, |
zelda3_message ** | messages ) |
Load all messages from the ROM.
This function loads all messages from the ROM and returns them as an array of messages.
rom | The ROM to load messages from. |
messages | Pointer to an array of messages. |
Definition at line 175 of file yaze.cc.
References zelda3_message::address, zelda3_message::contents_parsed, zelda3_message::data, zelda3_rom::data, zelda3_message::data_parsed, zelda3_message::id, zelda3_rom::impl, zelda3_message::raw_string, and yaze::editor::ReadAllTextData().