Skip to content

Commit

Permalink
Merge branch 'xenia-canary:canary_experimental' into Custom
Browse files Browse the repository at this point in the history
  • Loading branch information
backgamon authored Sep 20, 2024
2 parents b07a550 + 2709a5d commit 330b0da
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,5 @@ node_modules/.bin/
/cache
/cache1
/cache0
/devkit
recent.toml
26 changes: 19 additions & 7 deletions src/xenia/app/emulator_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1902,15 +1902,27 @@ std::string EmulatorWindow::CanonicalizeFileExtension(
return xe::utf8::lower_ascii(xe::path_to_utf8(path.extension()));
}

xe::X_STATUS EmulatorWindow::RunTitle(std::filesystem::path path_to_file) {
bool titleExists = !std::filesystem::exists(path_to_file);
xe::X_STATUS EmulatorWindow::RunTitle(
const std::filesystem::path& path_to_file) {
std::error_code ec = {};
bool titleExists = std::filesystem::exists(path_to_file, ec);

if (path_to_file.empty() || !titleExists) {
std::string log_msg =
fmt::format("Failed to launch title path is {}.",
path_to_file.empty() ? "empty" : "invalid");

if (!path_to_file.empty() && !titleExists) {
log_msg.append(
fmt::format("\nProvided Path: {}", xe::path_to_utf8(path_to_file)));
}

if (path_to_file.empty() || titleExists) {
char* log_msg = path_to_file.empty()
? "Failed to launch title path is empty."
: "Failed to launch title path is invalid.";
if (ec) {
log_msg.append(fmt::format("\nExtended message info: {} ({:08X})",
ec.message(), ec.value()));
}

XELOGE(log_msg);
XELOGE("{}", log_msg);

imgui_drawer_.get()->ClearDialogs();

Expand Down
2 changes: 1 addition & 1 deletion src/xenia/app/emulator_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class EmulatorWindow {

void OnEmulatorInitialized();

xe::X_STATUS RunTitle(std::filesystem::path path_to_file);
xe::X_STATUS RunTitle(const std::filesystem::path& path_to_file);
void UpdateTitle();
void SetFullscreen(bool fullscreen);
void ToggleFullscreen();
Expand Down
2 changes: 1 addition & 1 deletion third_party/catch
Submodule catch updated 752 files

0 comments on commit 330b0da

Please sign in to comment.