Fix incorrect streamout buffer index in GS + refactor various code (#258)

This commit is contained in:
Herman Semenov 2022-09-17 04:45:18 +03:00 committed by GitHub
parent 4a3d02db55
commit 03f5967408
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 70 additions and 92 deletions

View file

@ -168,7 +168,6 @@ GameProfileWindow::GameProfileWindow(wxWindow* parent, uint64_t title_id)
{
profile_sizer->Add(new wxStaticText(panel, wxID_ANY, fmt::format("{} {}", _("Controller").ToStdString(), (i + 1))), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
wxArrayString m_controller_profileChoices;
m_controller_profile[i] = new wxComboBox(panel, wxID_ANY,"", wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_DROPDOWN| wxCB_READONLY);
m_controller_profile[i]->SetMinSize(wxSize(250, -1));
m_controller_profile[i]->Bind(wxEVT_COMBOBOX_DROPDOWN, &GameProfileWindow::OnControllerProfileDropdown, this);

View file

@ -213,7 +213,6 @@ void GameUpdateWindow::ThreadWork()
create_directories(targetDir);
}
const auto target_path = fs::path(m_target_path);
for (auto& path : m_source_paths)
{
if (m_thread_state == ThreadCanceled)

View file

@ -843,7 +843,7 @@ void GeneralSettings2::StoreConfig()
config.tv_volume = m_tv_volume->GetValue();
config.pad_volume = m_pad_volume->GetValue();
config.tv_device = L"";
config.tv_device.clear();
const auto tv_device = m_tv_device->GetSelection();
if (tv_device != wxNOT_FOUND && tv_device != 0 && m_tv_device->HasClientObjectData())
{
@ -852,7 +852,7 @@ void GeneralSettings2::StoreConfig()
config.tv_device = device_description->GetDescription()->GetIdentifier();
}
config.pad_device = L"";
config.pad_device.clear();
const auto pad_device = m_pad_device->GetSelection();
if (pad_device != wxNOT_FOUND && pad_device != 0 && m_pad_device->HasClientObjectData())
{

View file

@ -343,7 +343,7 @@ void wxTitleManagerList::OnConvertToCompressedFormat(uint64 titleId)
if (!GetConfig().game_paths.empty())
defaultDir = GetConfig().game_paths.front();
// get the short name, which we will use as a suggested default file name
std::string defaultFileName = shortName;
std::string defaultFileName = std::move(shortName);
boost::replace_all(defaultFileName, "/", "");
boost::replace_all(defaultFileName, "\\", "");
@ -474,7 +474,7 @@ void wxTitleManagerList::OnConvertToCompressedFormat(uint64 titleId)
{
std::string temporaryMountPath = TitleInfo::GetUniqueTempMountingPath();
titleInfo->Mount(temporaryMountPath.c_str(), "", FSC_PRIORITY_BASE);
bool r = RecursivelyAddFiles(fmt::format("{:016x}_v{}/", titleInfo->GetAppTitleId(), titleInfo->GetAppTitleVersion()), temporaryMountPath.c_str());
bool r = RecursivelyAddFiles(fmt::format("{:016x}_v{}/", titleInfo->GetAppTitleId(), titleInfo->GetAppTitleVersion()), temporaryMountPath);
titleInfo->Unmount(temporaryMountPath.c_str());
return r;
}

View file

@ -251,7 +251,7 @@ void DumpCtrl::GoToAddressDialog()
m_lastGotoOffset = result;
CenterOffset(result);
}
catch (const std::exception ex)
catch (const std::exception& ex)
{
wxMessageBox(ex.what(), _("Error"), wxOK | wxCENTRE | wxICON_ERROR, this);
}

View file

@ -36,7 +36,7 @@ SymbolListCtrl::SymbolListCtrl(wxWindow* parent, const wxWindowID& id, const wxP
Bind(wxEVT_LIST_ITEM_ACTIVATED, &SymbolListCtrl::OnLeftDClick, this);
Bind(wxEVT_LIST_ITEM_RIGHT_CLICK, &SymbolListCtrl::OnRightClick, this);
m_list_filter = "";
m_list_filter.Clear();
OnGameLoaded();
@ -65,7 +65,7 @@ void SymbolListCtrl::OnGameLoaded()
new_entry.first->second.searchName += new_entry.first->second.libName;
new_entry.first->second.searchName.MakeLower();
if (m_list_filter == "")
if (m_list_filter.IsEmpty())
new_entry.first->second.visible = true;
else if (new_entry.first->second.searchName.Contains(m_list_filter))
new_entry.first->second.visible = true;
@ -149,7 +149,7 @@ void SymbolListCtrl::ChangeListFilter(std::string filter)
size_t visible_entries = m_data.size();
for (auto& [address, symbol] : m_data)
{
if (m_list_filter == "")
if (m_list_filter.IsEmpty())
symbol.visible = true;
else if (symbol.searchName.Contains(m_list_filter))
symbol.visible = true;

View file

@ -11,7 +11,7 @@ public:
void ChangeListFilter(std::string filter);
private:
struct SymbolItem {
SymbolItem() {}
SymbolItem() = default;
SymbolItem(wxString name, wxString libName, wxString searchName, bool visible) : name(name), libName(libName), searchName(searchName), visible(visible) {}

View file

@ -568,8 +568,6 @@ void InputSettings2::on_profile_text_changed(wxCommandEvent& event)
auto& page_data = get_current_page_data();
const auto selection = page_data.m_emulated_controller->GetStringSelection();
// load_bttn, save_bttn, delete_bttn, profile_status
const auto text = event.GetString();
const auto text_str = from_wxString(text);