Remove EmuState

This commit is contained in:
Shawn Hoffman 2017-06-15 19:29:26 -07:00 committed by JosJuice
parent 180eb35876
commit 6a0c15491b
98 changed files with 6 additions and 310 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 901 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -228,7 +228,6 @@ void SConfig::SaveGameListSettings(IniFile& ini)
gamelist->Set("ColumnID", m_showIDColumn);
gamelist->Set("ColumnRegion", m_showRegionColumn);
gamelist->Set("ColumnSize", m_showSizeColumn);
gamelist->Set("ColumnState", m_showStateColumn);
}
void SConfig::SaveCoreSettings(IniFile& ini)
@ -517,7 +516,6 @@ void SConfig::LoadGameListSettings(IniFile& ini)
gamelist->Get("ColumnID", &m_showIDColumn, false);
gamelist->Get("ColumnRegion", &m_showRegionColumn, true);
gamelist->Get("ColumnSize", &m_showSizeColumn, true);
gamelist->Get("ColumnState", &m_showStateColumn, true);
}
void SConfig::LoadCoreSettings(IniFile& ini)

View File

@ -276,7 +276,6 @@ struct SConfig
bool m_showIDColumn;
bool m_showRegionColumn;
bool m_showSizeColumn;
bool m_showStateColumn;
std::string m_WirelessMac;
bool m_PauseMovie;

View File

@ -127,27 +127,14 @@ void GameConfigWidget::CreateWidgets()
settings_layout->addWidget(core_box);
settings_layout->addWidget(stereoscopy_box);
m_state_combo = new QComboBox;
for (const auto& item :
{tr("Not Set"), tr("Broken"), tr("Intro"), tr("In Game"), tr("Playable"), tr("Perfect")})
m_state_combo->addItem(item);
m_state_comment_edit = new QLineEdit;
auto* layout = new QGridLayout;
auto* emulation_state = new QLabel(tr("Emulation State:"));
layout->addWidget(settings_box, 0, 0, 1, -1);
layout->addWidget(emulation_state, 1, 0);
layout->addWidget(m_state_combo, 1, 1);
layout->addWidget(m_state_comment_edit, 1, 2, 1, -1);
auto* button_layout = new QHBoxLayout;
button_layout->setMargin(0);
layout->addLayout(button_layout, 2, 0, 1, -1);
layout->addLayout(button_layout, 1, 0, 1, -1);
button_layout->addWidget(m_refresh_config);
button_layout->addWidget(m_edit_user_config);
@ -157,9 +144,6 @@ void GameConfigWidget::CreateWidgets()
m_enable_fast_disc, m_use_dsp_hle, m_use_monoscopic_shadows})
item->setTristate(true);
emulation_state->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
m_state_combo->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setLayout(layout);
}
@ -170,11 +154,6 @@ void GameConfigWidget::ConnectWidgets()
connect(m_edit_user_config, &QPushButton::pressed, this, &GameConfigWidget::EditUserConfig);
connect(m_view_default_config, &QPushButton::pressed, this, &GameConfigWidget::ViewDefaultConfig);
// Settings
connect(m_state_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &GameConfigWidget::SaveSettings);
connect(m_state_comment_edit, &QLineEdit::editingFinished, this, &GameConfigWidget::SaveSettings);
for (QCheckBox* box : {m_enable_dual_core, m_enable_mmu, m_enable_fprf, m_sync_gpu,
m_enable_fast_disc, m_use_dsp_hle, m_use_monoscopic_shadows})
connect(box, &QCheckBox::toggled, this, &GameConfigWidget::SaveSettings);
@ -237,10 +216,6 @@ void GameConfigWidget::SaveCheckBox(QCheckBox* checkbox, const std::string& sect
void GameConfigWidget::LoadSettings()
{
// Load state information
m_state_combo->setCurrentIndex(m_game.GetEmuState());
m_state_comment_edit->setText(QString::fromStdString(m_game.GetIssues()));
// Load game-specific settings
// Core
@ -293,18 +268,6 @@ void GameConfigWidget::LoadSettings()
void GameConfigWidget::SaveSettings()
{
// Save state information
QString comment = m_state_comment_edit->text();
int state = m_state_combo->currentIndex();
if (comment != QString::fromStdString(m_game.GetIssues()))
m_gameini_local.GetOrCreateSection("EmuState")->Set("EmulationIssues", comment.toStdString());
if (state != m_game.GetEmuState())
m_gameini_local.GetOrCreateSection("EmuState")->Set("EmulationStateId", state);
// Save game-specific settings
// Core
SaveCheckBox(m_enable_dual_core, "Core", "CPUThread");
SaveCheckBox(m_enable_mmu, "Core", "MMU");

View File

@ -43,8 +43,6 @@ private:
void LoadCheckBox(QCheckBox* checkbox, const std::string& section, const std::string& key);
void SaveCheckBox(QCheckBox* checkbox, const std::string& section, const std::string& key);
QComboBox* m_state_combo;
QLineEdit* m_state_comment_edit;
QPushButton* m_refresh_config;
QPushButton* m_edit_user_config;
QPushButton* m_view_default_config;

View File

@ -93,7 +93,6 @@ void GameList::MakeListView()
m_list->setColumnHidden(GameListModel::COL_ID, !SConfig::GetInstance().m_showIDColumn);
m_list->setColumnHidden(GameListModel::COL_COUNTRY, !SConfig::GetInstance().m_showRegionColumn);
m_list->setColumnHidden(GameListModel::COL_SIZE, !SConfig::GetInstance().m_showSizeColumn);
m_list->setColumnHidden(GameListModel::COL_RATING, !SConfig::GetInstance().m_showStateColumn);
m_list->setColumnHidden(GameListModel::COL_FILE_NAME,
!SConfig::GetInstance().m_showFileNameColumn);
@ -116,7 +115,6 @@ void GameList::MakeListView()
hor_header->setSectionResizeMode(GameListModel::COL_ID, QHeaderView::ResizeToContents);
hor_header->setSectionResizeMode(GameListModel::COL_COUNTRY, QHeaderView::ResizeToContents);
hor_header->setSectionResizeMode(GameListModel::COL_SIZE, QHeaderView::ResizeToContents);
hor_header->setSectionResizeMode(GameListModel::COL_RATING, QHeaderView::ResizeToContents);
hor_header->setSectionResizeMode(GameListModel::COL_FILE_NAME, QHeaderView::Interactive);
m_list->verticalHeader()->hide();
@ -494,7 +492,6 @@ void GameList::OnColumnVisibilityToggled(const QString& row, bool visible)
{tr("Platform"), GameListModel::COL_PLATFORM},
{tr("Size"), GameListModel::COL_SIZE},
{tr("Title"), GameListModel::COL_TITLE},
{tr("State"), GameListModel::COL_RATING},
{tr("File Name"), GameListModel::COL_FILE_NAME}};
m_list->setColumnHidden(rowname_to_col_index[row], !visible);

View File

@ -55,12 +55,6 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
if (role == Qt::InitialSortOrderRole)
return static_cast<int>(game.GetCountry());
break;
case COL_RATING:
if (role == Qt::DecorationRole)
return Resources::GetRating(game.GetEmuState());
if (role == Qt::InitialSortOrderRole)
return game.GetEmuState();
break;
case COL_BANNER:
if (role == Qt::DecorationRole)
{
@ -128,8 +122,6 @@ QVariant GameListModel::headerData(int section, Qt::Orientation orientation, int
return tr("File Name");
case COL_SIZE:
return tr("Size");
case COL_RATING:
return tr("State");
}
return QVariant();
}

View File

@ -48,7 +48,6 @@ public:
COL_ID,
COL_COUNTRY,
COL_SIZE,
COL_RATING,
COL_FILE_NAME,
NUM_COLS
};

View File

@ -471,8 +471,7 @@ void MenuBar::AddListColumnsMenu(QMenu* view_menu)
{tr("File Name"), &SConfig::GetInstance().m_showFileNameColumn},
{tr("Game ID"), &SConfig::GetInstance().m_showIDColumn},
{tr("Region"), &SConfig::GetInstance().m_showRegionColumn},
{tr("File Size"), &SConfig::GetInstance().m_showSizeColumn},
{tr("State"), &SConfig::GetInstance().m_showStateColumn}};
{tr("File Size"), &SConfig::GetInstance().m_showSizeColumn}};
QActionGroup* column_group = new QActionGroup(this);
QMenu* cols_menu = view_menu->addMenu(tr("List Columns"));

View File

@ -18,7 +18,6 @@
QList<QPixmap> Resources::m_platforms;
QList<QPixmap> Resources::m_countries;
QList<QPixmap> Resources::m_ratings;
QList<QPixmap> Resources::m_misc;
QIcon Resources::GetIcon(const QString& name, const QString& dir)
@ -73,11 +72,6 @@ QPixmap Resources::GetScaledPixmap(const std::string& name)
return GetPixmap(QString::fromStdString(name), GetResourcesDir());
}
QPixmap Resources::GetScaledThemePixmap(const std::string& name)
{
return GetPixmap(QString::fromStdString(name), GetCurrentThemeDir());
}
void Resources::Init()
{
for (const std::string& platform :
@ -97,16 +91,6 @@ void Resources::Init()
m_misc.append(GetScaledPixmap("nobanner"));
m_misc.append(GetScaledPixmap("dolphin_logo"));
m_misc.append(GetScaledPixmap("Dolphin"));
QObject::connect(&Settings::Instance(), &Settings::ThemeChanged, Resources::InitThemeIcons);
InitThemeIcons();
}
void Resources::InitThemeIcons()
{
m_ratings = {GetScaledThemePixmap("rating0"), GetScaledThemePixmap("rating1"),
GetScaledThemePixmap("rating2"), GetScaledThemePixmap("rating3"),
GetScaledThemePixmap("rating4"), GetScaledThemePixmap("rating5")};
}
QPixmap Resources::GetPlatform(int platform)
@ -119,11 +103,6 @@ QPixmap Resources::GetCountry(int country)
return m_countries[country];
}
QPixmap Resources::GetRating(int rating)
{
return m_ratings[rating];
}
QPixmap Resources::GetMisc(int id)
{
return m_misc[id];

View File

@ -15,7 +15,6 @@ public:
static QPixmap GetPlatform(int platform);
static QPixmap GetCountry(int country);
static QPixmap GetRating(int rating);
static QPixmap GetMisc(int id);
@ -31,16 +30,13 @@ public:
static QIcon GetAppIcon();
static QPixmap GetScaledPixmap(const std::string& name);
static QPixmap GetScaledThemePixmap(const std::string& name);
private:
Resources() {}
static void InitThemeIcons();
static QIcon GetIcon(const QString& name, const QString& dir);
static QPixmap GetPixmap(const QString& name, const QString& dir);
static QList<QPixmap> m_platforms;
static QList<QPixmap> m_countries;
static QList<QPixmap> m_ratings;
static QList<QPixmap> m_misc;
};

View File

@ -204,7 +204,7 @@ void CFrame::BindMenuBarEvents()
Bind(wxEVT_MENU, &CFrame::OnToggleWindow, this, IDM_LOG_WINDOW, IDM_VIDEO_WINDOW);
Bind(wxEVT_MENU, &CFrame::GameListChanged, this, IDM_LIST_WAD, IDM_LIST_DRIVES);
Bind(wxEVT_MENU, &CFrame::GameListChanged, this, IDM_PURGE_GAME_LIST_CACHE);
Bind(wxEVT_MENU, &CFrame::OnChangeColumnsVisible, this, IDM_SHOW_SYSTEM, IDM_SHOW_STATE);
Bind(wxEVT_MENU, &CFrame::OnChangeColumnsVisible, this, IDM_SHOW_SYSTEM, IDM_SHOW_SIZE);
// Help menu
Bind(wxEVT_MENU, &CFrame::OnHelp, this, IDM_HELP_WEBSITE);
@ -1918,9 +1918,6 @@ void CFrame::OnChangeColumnsVisible(wxCommandEvent& event)
case IDM_SHOW_SIZE:
SConfig::GetInstance().m_showSizeColumn = !SConfig::GetInstance().m_showSizeColumn;
break;
case IDM_SHOW_STATE:
SConfig::GetInstance().m_showStateColumn = !SConfig::GetInstance().m_showStateColumn;
break;
default:
return;
}

View File

@ -131,17 +131,6 @@ static int CompareGameListItems(const UICommon::GameFile* iso1, const UICommon::
if (iso1->GetPlatform() < iso2->GetPlatform())
return -1 * t;
break;
case GameListCtrl::COLUMN_EMULATION_STATE:
{
const int nState1 = iso1->GetEmuState(), nState2 = iso2->GetEmuState();
if (nState1 > nState2)
return 1 * t;
if (nState1 < nState2)
return -1 * t;
break;
}
}
if (sortData != GameListCtrl::COLUMN_TITLE)
@ -235,7 +224,7 @@ struct GameListCtrl::ColumnInfo
GameListCtrl::GameListCtrl(bool disable_scanning, wxWindow* parent, const wxWindowID id,
const wxPoint& pos, const wxSize& size, long style)
: wxListCtrl(parent, id, pos, size, style), m_tooltip(nullptr),
: wxListCtrl(parent, id, pos, size, style),
m_columns({// {COLUMN, {default_width (without platform padding), resizability, visibility}}
{COLUMN_PLATFORM, 32 + 1 /* icon padding */, false,
SConfig::GetInstance().m_showSystemColumn},
@ -245,13 +234,11 @@ GameListCtrl::GameListCtrl(bool disable_scanning, wxWindow* parent, const wxWind
{COLUMN_FILENAME, 100, true, SConfig::GetInstance().m_showFileNameColumn},
{COLUMN_ID, 75, false, SConfig::GetInstance().m_showIDColumn},
{COLUMN_COUNTRY, 32, false, SConfig::GetInstance().m_showRegionColumn},
{COLUMN_EMULATION_STATE, 48, false, SConfig::GetInstance().m_showStateColumn},
{COLUMN_SIZE, wxLIST_AUTOSIZE, false, SConfig::GetInstance().m_showSizeColumn}})
{
Bind(wxEVT_SIZE, &GameListCtrl::OnSize, this);
Bind(wxEVT_RIGHT_DOWN, &GameListCtrl::OnRightClick, this);
Bind(wxEVT_LEFT_DOWN, &GameListCtrl::OnLeftClick, this);
Bind(wxEVT_MOTION, &GameListCtrl::OnMouseMotion, this);
Bind(wxEVT_LIST_KEY_DOWN, &GameListCtrl::OnKeyPress, this);
Bind(wxEVT_LIST_COL_BEGIN_DRAG, &GameListCtrl::OnColBeginDrag, this);
Bind(wxEVT_LIST_COL_CLICK, &GameListCtrl::OnColumnClick, this);
@ -323,7 +310,6 @@ void GameListCtrl::InitBitmaps()
const wxSize size = FromDIP(wxSize(96, 32));
const wxSize flag_bmp_size = FromDIP(wxSize(32, 32));
const wxSize platform_bmp_size = flag_bmp_size;
const wxSize rating_bmp_size = FromDIP(wxSize(48, 32));
wxImageList* img_list = new wxImageList(size.GetWidth(), size.GetHeight());
AssignImageList(img_list, wxIMAGE_LIST_SMALL);
@ -360,15 +346,6 @@ void GameListCtrl::InitBitmaps()
InitBitmap(img_list, &platform_indexes, this, platform_bmp_size, DiscIO::Platform::ELFOrDOL,
"Platform_File");
auto& emu_state_indexes = m_image_indexes.emu_state;
emu_state_indexes.resize(6);
InitBitmap(img_list, &emu_state_indexes, this, rating_bmp_size, 0, "rating0", true);
InitBitmap(img_list, &emu_state_indexes, this, rating_bmp_size, 1, "rating1", true);
InitBitmap(img_list, &emu_state_indexes, this, rating_bmp_size, 2, "rating2", true);
InitBitmap(img_list, &emu_state_indexes, this, rating_bmp_size, 3, "rating3", true);
InitBitmap(img_list, &emu_state_indexes, this, rating_bmp_size, 4, "rating4", true);
InitBitmap(img_list, &emu_state_indexes, this, rating_bmp_size, 5, "rating5", true);
auto& utility_banner_indexes = m_image_indexes.utility_banner;
utility_banner_indexes.resize(1);
InitBitmap(img_list, &utility_banner_indexes, this, size, 0, "nobanner");
@ -425,8 +402,6 @@ void GameListCtrl::RefreshList()
auto file = std::make_shared<UICommon::GameFile>(drive);
if (file->IsValid())
{
if (file->EmuStateChanged())
file->EmuStateCommit();
if (file->CustomNameChanged(m_title_database))
file->CustomNameCommit();
m_shown_files.push_back(file);
@ -453,7 +428,6 @@ void GameListCtrl::RefreshList()
InsertColumn(COLUMN_ID, _("ID"));
InsertColumn(COLUMN_COUNTRY, "");
InsertColumn(COLUMN_SIZE, _("Size"));
InsertColumn(COLUMN_EMULATION_STATE, _("State"));
#ifdef __WXMSW__
const int platform_padding = 0;
@ -572,10 +546,6 @@ void GameListCtrl::UpdateItemAtColumn(long index, int column)
case COLUMN_FILENAME:
SetItem(index, COLUMN_FILENAME, wxFileNameFromPath(StrToWxStr(iso_file.GetFilePath())), -1);
break;
case COLUMN_EMULATION_STATE:
SetItemColumnImage(index, COLUMN_EMULATION_STATE,
m_image_indexes.emu_state[iso_file.GetEmuState()]);
break;
case COLUMN_COUNTRY:
SetItemColumnImage(index, COLUMN_COUNTRY,
m_image_indexes.flag[static_cast<size_t>(iso_file.GetCountry())]);
@ -829,84 +799,6 @@ void GameListCtrl::OnKeyPress(wxListEvent& event)
event.Skip();
}
// This shows a little tooltip with the current Game's emulation state
void GameListCtrl::OnMouseMotion(wxMouseEvent& event)
{
int flags;
long subitem = 0;
const long item = HitTest(event.GetPosition(), flags, &subitem);
static int lastItem = -1;
if (GetColumnCount() <= 1)
return;
if (item != wxNOT_FOUND)
{
wxRect Rect;
#ifdef __WXMSW__
if (subitem == COLUMN_EMULATION_STATE)
#else
// The subitem parameter of HitTest is only implemented for wxMSW. On
// all other platforms it will always be -1. Check the x position
// instead.
GetItemRect(item, Rect);
if (Rect.GetX() + Rect.GetWidth() - GetColumnWidth(COLUMN_EMULATION_STATE) < event.GetX())
#endif
{
if (m_tooltip || lastItem == item || this != FindFocus())
{
if (lastItem != item)
lastItem = -1;
event.Skip();
return;
}
// Emulation status
static const char* const emuState[] = {"Broken", "Intro", "In-Game", "Playable", "Perfect"};
const UICommon::GameFile* iso = GetISO(GetItemData(item));
const int emu_state = iso->GetEmuState();
const std::string& issues = iso->GetIssues();
// Show a tooltip containing the EmuState and the state description
if (emu_state > 0 && emu_state < 6)
{
char temp[2048];
sprintf(temp, "^ %s%s%s", emuState[emu_state - 1], issues.size() > 0 ? " :\n" : "",
issues.c_str());
m_tooltip = new wxEmuStateTip(this, StrToWxStr(temp), &m_tooltip);
}
else
{
m_tooltip = new wxEmuStateTip(this, _("Not Set"), &m_tooltip);
}
// Get item Coords
GetItemRect(item, Rect);
int mx = Rect.GetWidth();
int my = Rect.GetY();
#if !defined(__WXMSW__) && !defined(__WXOSX__)
// For some reason the y position does not account for the header
// row, so subtract the y position of the first visible item.
GetItemRect(GetTopItem(), Rect);
my -= Rect.GetY();
#endif
// Convert to screen coordinates
ClientToScreen(&mx, &my);
m_tooltip->SetBoundingRect(wxRect(mx - GetColumnWidth(COLUMN_EMULATION_STATE), my,
GetColumnWidth(COLUMN_EMULATION_STATE), Rect.GetHeight()));
m_tooltip->SetPosition(
wxPoint(mx - GetColumnWidth(COLUMN_EMULATION_STATE), my - 5 + Rect.GetHeight()));
lastItem = item;
}
}
if (!m_tooltip)
lastItem = -1;
event.Skip();
}
void GameListCtrl::OnLeftClick(wxMouseEvent& event)
{
// Focus the clicked item.

View File

@ -23,23 +23,6 @@ namespace UICommon
class GameFile;
}
class wxEmuStateTip : public wxTipWindow
{
public:
wxEmuStateTip(wxWindow* parent, const wxString& text, wxEmuStateTip** windowPtr)
: wxTipWindow(parent, text, 70, (wxTipWindow**)windowPtr)
{
Bind(wxEVT_KEY_DOWN, &wxEmuStateTip::OnKeyDown, this);
}
// wxTipWindow doesn't correctly handle KeyEvents and crashes... we must overload that.
void OnKeyDown(wxKeyEvent& event)
{
event.StopPropagation();
Close();
}
};
wxDECLARE_EVENT(DOLPHIN_EVT_REFRESH_GAMELIST, wxCommandEvent);
wxDECLARE_EVENT(DOLPHIN_EVT_RESCAN_GAMELIST, wxCommandEvent);
@ -68,7 +51,6 @@ public:
COLUMN_ID,
COLUMN_COUNTRY,
COLUMN_SIZE,
COLUMN_EMULATION_STATE,
NUMBER_OF_COLUMN
};
@ -92,7 +74,6 @@ private:
void OnRescanGameList(wxCommandEvent& event);
void OnLeftClick(wxMouseEvent& event);
void OnRightClick(wxMouseEvent& event);
void OnMouseMotion(wxMouseEvent& event);
void OnColumnClick(wxListEvent& event);
void OnColBeginDrag(wxListEvent& event);
void OnKeyPress(wxListEvent& event);
@ -124,7 +105,6 @@ private:
std::vector<int> flag;
std::vector<int> platform;
std::vector<int> utility_banner;
std::vector<int> emu_state;
} m_image_indexes;
// Actual backing GameFiles are maintained in a background thread and cached to file
@ -142,7 +122,6 @@ private:
int m_last_column;
int m_last_sort;
wxSize m_lastpos;
wxEmuStateTip* m_tooltip;
std::vector<ColumnInfo> m_columns;
};

View File

@ -180,7 +180,6 @@ enum
IDM_SHOW_ID,
IDM_SHOW_REGION,
IDM_SHOW_SIZE,
IDM_SHOW_STATE,
// Float Window IDs
IDM_LOG_WINDOW_PARENT,

View File

@ -183,7 +183,6 @@ EVT_CLOSE(CISOProperties::OnClose)
EVT_BUTTON(wxID_OK, CISOProperties::OnCloseClick)
EVT_BUTTON(ID_EDITCONFIG, CISOProperties::OnEditConfig)
EVT_BUTTON(ID_SHOWDEFAULTCONFIG, CISOProperties::OnShowDefaultConfig)
EVT_CHOICE(ID_EMUSTATE, CISOProperties::OnEmustateChanged)
EVT_LISTBOX(ID_PATCHES_LIST, CISOProperties::PatchListSelectionChanged)
EVT_BUTTON(ID_EDITPATCH, CISOProperties::PatchButtonClicked)
EVT_BUTTON(ID_ADDPATCH, CISOProperties::PatchButtonClicked)
@ -333,22 +332,6 @@ void CISOProperties::CreateGUIControls()
wxDefaultSize, GetElementStyle("Video_Stereoscopy", "StereoEFBMonoDepth"));
m_mono_depth->SetToolTip(_("Use a single depth buffer for both eyes. Needed for a few games."));
wxBoxSizer* const emustate_sizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticText* const emustate_text =
new wxStaticText(m_GameConfig, wxID_ANY, _("Emulation State:"));
m_emustate_string.Add(_("Not Set"));
m_emustate_string.Add(_("Broken"));
m_emustate_string.Add(_("Intro"));
m_emustate_string.Add(_("In Game"));
m_emustate_string.Add(_("Playable"));
m_emustate_string.Add(_("Perfect"));
m_emustate_choice =
new wxChoice(m_GameConfig, ID_EMUSTATE, wxDefaultPosition, wxDefaultSize, m_emustate_string);
m_emu_issues = new wxTextCtrl(m_GameConfig, ID_EMU_ISSUES, wxEmptyString);
emustate_sizer->Add(emustate_text, 0, wxALIGN_CENTER_VERTICAL);
emustate_sizer->Add(m_emustate_choice, 0, wxALIGN_CENTER_VERTICAL);
emustate_sizer->Add(m_emu_issues, 1, wxEXPAND);
wxStaticBoxSizer* const core_overrides_sizer =
new wxStaticBoxSizer(wxVERTICAL, m_GameConfig, _("Core"));
core_overrides_sizer->Add(m_cpu_thread, 0, wxLEFT | wxRIGHT, space5);
@ -390,8 +373,6 @@ void CISOProperties::CreateGUIControls()
config_page_sizer->AddSpacer(space5);
config_page_sizer->Add(game_config_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
config_page_sizer->AddSpacer(space5);
config_page_sizer->Add(emustate_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
config_page_sizer->AddSpacer(space5);
m_GameConfig->SetSizer(config_page_sizer);
// Patches
@ -489,11 +470,6 @@ void CISOProperties::OnCloseClick(wxCommandEvent& WXUNUSED(event))
Close();
}
void CISOProperties::OnEmustateChanged(wxCommandEvent& event)
{
m_emu_issues->Enable(event.GetSelection() != 0);
}
void CISOProperties::SetCheckboxValueFromGameini(const char* section, const char* key,
wxCheckBox* checkbox)
{
@ -538,20 +514,6 @@ void CISOProperties::LoadGameConfig()
if (m_gameini_local.GetIfExists("Video", "PH_ZFar", &sTemp))
m_phack_data.PHZFar = sTemp;
IniFile::Section* default_emustate = m_gameini_default.GetOrCreateSection("EmuState");
default_emustate->Get("EmulationStateId", &iTemp, 0 /*Not Set*/);
m_emustate_choice->SetSelection(iTemp);
if (m_gameini_local.GetIfExists("EmuState", "EmulationStateId", &iTemp))
m_emustate_choice->SetSelection(iTemp);
default_emustate->Get("EmulationIssues", &sTemp);
if (!sTemp.empty())
m_emu_issues->SetValue(StrToWxStr(sTemp));
if (m_gameini_local.GetIfExists("EmuState", "EmulationIssues", &sTemp))
m_emu_issues->SetValue(StrToWxStr(sTemp));
m_emu_issues->Enable(m_emustate_choice->GetSelection() != 0);
sTemp = "";
if (!m_gameini_local.GetIfExists("Core", "GPUDeterminismMode", &sTemp))
m_gameini_default.GetIfExists("Core", "GPUDeterminismMode", &sTemp);
@ -637,10 +599,6 @@ bool CISOProperties::SaveGameConfig()
SAVE_IF_NOT_DEFAULT("Video", "PH_SZFar", (m_phack_data.PHackSZFar ? 1 : 0), 0);
SAVE_IF_NOT_DEFAULT("Video", "PH_ZNear", m_phack_data.PHZNear, "");
SAVE_IF_NOT_DEFAULT("Video", "PH_ZFar", m_phack_data.PHZFar, "");
SAVE_IF_NOT_DEFAULT("EmuState", "EmulationStateId", m_emustate_choice->GetSelection(), 0);
std::string emu_issues = m_emu_issues->GetValue().ToStdString();
SAVE_IF_NOT_DEFAULT("EmuState", "EmulationIssues", emu_issues, "");
std::string tmp;
if (m_gpu_determinism->GetSelection() == 0)

View File

@ -80,10 +80,6 @@ private:
wxSpinCtrl* m_convergence;
wxCheckBox* m_mono_depth;
wxArrayString m_emustate_string;
wxChoice* m_emustate_choice;
wxTextCtrl* m_emu_issues;
wxCheckListBox* m_patches;
wxButton* m_edit_patch;
wxButton* m_remove_patch;
@ -116,8 +112,6 @@ private:
ID_ENABLEWIDESCREEN,
ID_EDITCONFIG,
ID_SHOWDEFAULTCONFIG,
ID_EMUSTATE,
ID_EMU_ISSUES,
ID_PATCHES_LIST,
ID_EDITPATCH,
ID_ADDPATCH,
@ -137,7 +131,6 @@ private:
void OnShowDefaultConfig(wxCommandEvent& event);
void PatchListSelectionChanged(wxCommandEvent& event);
void PatchButtonClicked(wxCommandEvent& event);
void OnEmustateChanged(wxCommandEvent& event);
void OnCheatCodeToggled(wxCommandEvent& event);
void OnChangeTitle(wxCommandEvent& event);

View File

@ -319,8 +319,6 @@ wxMenu* MainMenuBar::CreateViewMenu() const
columns_menu->Check(IDM_SHOW_REGION, config_instance.m_showRegionColumn);
columns_menu->AppendCheckItem(IDM_SHOW_SIZE, _("File Size"));
columns_menu->Check(IDM_SHOW_SIZE, config_instance.m_showSizeColumn);
columns_menu->AppendCheckItem(IDM_SHOW_STATE, _("State"));
columns_menu->Check(IDM_SHOW_STATE, config_instance.m_showStateColumn);
auto* const view_menu = new wxMenu;
view_menu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _("Show &Toolbar"));

View File

@ -142,25 +142,6 @@ void GameFile::CustomNameCommit()
m_custom_name = std::move(m_pending.custom_name);
}
bool GameFile::EmuStateChanged()
{
IniFile ini = SConfig::LoadGameIni(m_game_id, m_revision);
ini.GetIfExists("EmuState", "EmulationStateId", &m_pending.emu_state.rating, 0);
ini.GetIfExists("EmuState", "EmulationIssues", &m_pending.emu_state.issues, std::string());
return m_emu_state != m_pending.emu_state;
}
void GameFile::EmuStateCommit()
{
m_emu_state = std::move(m_pending.emu_state);
}
void GameFile::EmuState::DoState(PointerWrap& p)
{
p.Do(rating);
p.Do(issues);
}
void GameBanner::DoState(PointerWrap& p)
{
p.Do(buffer);
@ -196,7 +177,6 @@ void GameFile::DoState(PointerWrap& p)
p.Do(m_apploader_date);
m_volume_banner.DoState(p);
m_emu_state.DoState(p);
p.Do(m_custom_name);
}

View File

@ -75,31 +75,16 @@ public:
DiscIO::Platform GetPlatform() const { return m_platform; }
DiscIO::BlobType GetBlobType() const { return m_blob_type; }
const std::string& GetApploaderDate() const { return m_apploader_date; }
const std::string& GetIssues() const { return m_emu_state.issues; }
int GetEmuState() const { return m_emu_state.rating; }
u64 GetFileSize() const { return m_file_size; }
u64 GetVolumeSize() const { return m_volume_size; }
const GameBanner& GetBannerImage() const { return m_volume_banner; }
void DoState(PointerWrap& p);
bool BannerChanged();
void BannerCommit();
bool EmuStateChanged();
void EmuStateCommit();
bool CustomNameChanged(const Core::TitleDatabase& title_database);
void CustomNameCommit();
private:
struct EmuState
{
int rating{};
std::string issues{};
bool operator!=(const EmuState& rhs) const
{
return rating != rhs.rating || issues != rhs.issues;
}
void DoState(PointerWrap& p);
};
static const std::string& Lookup(DiscIO::Language language,
const std::map<DiscIO::Language, std::string>& strings);
const std::string&
@ -136,7 +121,6 @@ private:
std::string m_apploader_date{};
GameBanner m_volume_banner{};
EmuState m_emu_state{};
// Overridden name from TitleDatabase
std::string m_custom_name{};
@ -144,7 +128,6 @@ private:
// of GameFiles in a threadsafe way. They should not be handled in DoState.
struct
{
EmuState emu_state;
GameBanner volume_banner;
std::string custom_name;
} m_pending{};

View File

@ -28,7 +28,7 @@
namespace UICommon
{
static constexpr u32 CACHE_REVISION = 8; // Last changed in PR 6560
static constexpr u32 CACHE_REVISION = 9; // Last changed in PR 6569
std::vector<std::string> FindAllGamePaths(const std::vector<std::string>& directories_to_scan,
bool recursive_scan)
@ -138,18 +138,15 @@ bool GameFileCache::UpdateAdditionalMetadata(const Core::TitleDatabase& title_da
bool GameFileCache::UpdateAdditionalMetadata(std::shared_ptr<GameFile>* game_file,
const Core::TitleDatabase& title_database)
{
const bool emu_state_changed = (*game_file)->EmuStateChanged();
const bool banner_changed = (*game_file)->BannerChanged();
const bool custom_title_changed = (*game_file)->CustomNameChanged(title_database);
if (!emu_state_changed && !banner_changed && !custom_title_changed)
if (!banner_changed && !custom_title_changed)
return false;
// If a cached file needs an update, apply the updates to a copy and delete the original.
// This makes the usage of cached files in other threads safe.
std::shared_ptr<GameFile> copy = std::make_shared<GameFile>(**game_file);
if (emu_state_changed)
copy->EmuStateCommit();
if (banner_changed)
copy->BannerCommit();
if (custom_title_changed)