Refactor yaze_init to accept ROM filename as a parameter and remove unused project loading function
This commit is contained in:
15
src/yaze.cc
15
src/yaze.cc
@@ -56,13 +56,8 @@ void yaze_check_version(const char *version) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
yaze_status yaze_init(yaze_editor_context *yaze_ctx) {
|
yaze_status yaze_init(yaze_editor_context *yaze_ctx, char *rom_filename) {
|
||||||
if (yaze_ctx->project->rom_filename == nullptr) {
|
yaze_ctx->rom = yaze_load_rom(rom_filename);
|
||||||
yaze_ctx->error_message = "ROM filename is null";
|
|
||||||
return yaze_status::YAZE_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
yaze_ctx->rom = yaze_load_rom(yaze_ctx->project->rom_filename);
|
|
||||||
if (yaze_ctx->rom == nullptr) {
|
if (yaze_ctx->rom == nullptr) {
|
||||||
yaze_ctx->error_message = "Failed to load ROM";
|
yaze_ctx->error_message = "Failed to load ROM";
|
||||||
return yaze_status::YAZE_ERROR;
|
return yaze_status::YAZE_ERROR;
|
||||||
@@ -78,12 +73,6 @@ yaze_status yaze_shutdown(yaze_editor_context *yaze_ctx) {
|
|||||||
return yaze_status::YAZE_OK;
|
return yaze_status::YAZE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
yaze_project yaze_load_project(const char *filename) {
|
|
||||||
yaze_project project;
|
|
||||||
project.filepath = filename;
|
|
||||||
return project;
|
|
||||||
}
|
|
||||||
|
|
||||||
zelda3_rom *yaze_load_rom(const char *filename) {
|
zelda3_rom *yaze_load_rom(const char *filename) {
|
||||||
yaze::Rom *internal_rom;
|
yaze::Rom *internal_rom;
|
||||||
internal_rom = new yaze::Rom();
|
internal_rom = new yaze::Rom();
|
||||||
|
|||||||
Reference in New Issue
Block a user