From f008b22e3b2baa7720ea65c320fe49929a53bad7 Mon Sep 17 00:00:00 2001 From: TheKoopaKingdom Date: Fri, 2 Jun 2017 17:03:38 -0400 Subject: Addressed Bunnei's review comments, and made some other tweaks: - Deleted GetStatus() because it wasn't used anywhere outside of Core::System. - Fixed design flaw where the message bar status could be set despite the game being stopped. --- src/core/core.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/core/core.cpp') diff --git a/src/core/core.cpp b/src/core/core.cpp index 2456d8aa2..5429bcb26 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -26,7 +26,7 @@ namespace Core { /*static*/ System System::s_instance; System::ResultStatus System::RunLoop(int tight_loop) { - this->status = ResultStatus::Success; + status = ResultStatus::Success; if (!cpu_core) { return ResultStatus::ErrorNotInitialized; } @@ -60,7 +60,7 @@ System::ResultStatus System::RunLoop(int tight_loop) { HW::Update(); Reschedule(); - return GetStatus(); + return status; } System::ResultStatus System::SingleStep() { @@ -99,8 +99,8 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file return init_result; } - Loader::ResultStatus load_result = app_loader->Load(); - if (load_result != Loader::ResultStatus::Success) { + const Loader::ResultStatus load_result{app_loader->Load()}; + if (Loader::ResultStatus::Success != load_result) { LOG_CRITICAL(Core, "Failed to load ROM (Error %i)!", load_result); System::Shutdown(); @@ -113,9 +113,8 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file return ResultStatus::ErrorLoader; } } - // this->status will be used for errors while actually running the game status = ResultStatus::Success; - return ResultStatus::Success; + return status; } void System::PrepareReschedule() { -- cgit v1.2.3