early-access version 1618

This commit is contained in:
pineappleEA 2021-04-21 01:55:32 +02:00
parent f46563104f
commit e7450c06b4
3 changed files with 13 additions and 11 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 1617. This is the source code for early-access 1618.
## Legal Notice ## Legal Notice

View File

@ -56,10 +56,10 @@ public:
void RemoveBackend(std::string_view backend_name) { void RemoveBackend(std::string_view backend_name) {
std::lock_guard lock{writing_mutex}; std::lock_guard lock{writing_mutex};
const auto it =
std::remove_if(backends.begin(), backends.end(), std::erase_if(backends, [&backend_name](const auto& backend) {
[&backend_name](const auto& i) { return backend_name == i->GetName(); }); return backend_name == backend->GetName();
backends.erase(it, backends.end()); });
} }
const Filter& GetGlobalFilter() const { const Filter& GetGlobalFilter() const {
@ -148,12 +148,14 @@ void ColorConsoleBackend::Write(const Entry& entry) {
PrintColoredMessage(entry); PrintColoredMessage(entry);
} }
FileBackend::FileBackend(const std::string& filename) : bytes_written(0) { FileBackend::FileBackend(const std::string& filename) {
if (FS::Exists(filename + ".old.txt")) { const auto old_filename = filename + ".old.txt";
FS::Delete(filename + ".old.txt");
if (FS::Exists(old_filename)) {
FS::Delete(old_filename);
} }
if (FS::Exists(filename)) { if (FS::Exists(filename)) {
FS::Rename(filename, filename + ".old.txt"); FS::Rename(filename, old_filename);
} }
// _SH_DENYWR allows read only access to the file for other programs. // _SH_DENYWR allows read only access to the file for other programs.

View File

@ -94,8 +94,8 @@ public:
void Write(const Entry& entry) override; void Write(const Entry& entry) override;
private: private:
Common::FS::IOFile file; FS::IOFile file;
std::size_t bytes_written; std::size_t bytes_written = 0;
}; };
/** /**