Merge pull request #900 from O1L/master

High rescale quality for icons, fixed removing of games in GameViewer
This commit is contained in:
B1ackDaemon 2014-12-15 21:15:31 +02:00
commit 9ca6bb9296
2 changed files with 8 additions and 14 deletions

View file

@ -245,26 +245,20 @@ void GameViewer::RightClick(wxListEvent& event)
void GameViewer::RemoveGame(wxCommandEvent& event) void GameViewer::RemoveGame(wxCommandEvent& event)
{ {
wxString GameName = this->GetItemText(event.GetId(), 5); Emu.GetVFS().Init("/");
// TODO: VFS is only available at emulation time, this is a temporary solution to locate the game // get local path from VFS
Emu.GetVFS().Init(m_path); std::string local_path;
Emu.GetVFS().GetDevice(m_path, local_path);
vfsDir dir(m_path); std::string del_path = local_path + "/" + this->GetItemText(event.GetId(), 6).ToStdString();
if (!dir.IsOpened())
return;
const std::string sPath = dir.GetPath().erase(0, 1);
const std::string sGameFolder = GameName.mb_str().data();
const std::string localPath = sPath + sGameFolder;
Emu.GetVFS().UnMountAll(); Emu.GetVFS().UnMountAll();
if (!rExists(localPath))
return;
//TODO: Replace wxWidgetsSpecific filesystem stuff? //TODO: Replace wxWidgetsSpecific filesystem stuff?
WxDirDeleteTraverser deleter; WxDirDeleteTraverser deleter;
wxDir localDir(localPath); wxDir localDir(del_path);
localDir.Traverse(deleter); localDir.Traverse(deleter);
wxRmdir(del_path); // delete empty directory
Refresh(); Refresh();
} }

View file

@ -134,7 +134,7 @@ public:
{ {
wxLogNull logNo; // temporary disable wx warnings ("iCCP: known incorrect sRGB profile" spamming) wxLogNull logNo; // temporary disable wx warnings ("iCCP: known incorrect sRGB profile" spamming)
if (game_icon.LoadFile(fmt::FromUTF8(path), wxBITMAP_TYPE_PNG)) if (game_icon.LoadFile(fmt::FromUTF8(path), wxBITMAP_TYPE_PNG))
game_icon.Rescale(58, 32); game_icon.Rescale(58, 32, wxIMAGE_QUALITY_HIGH);
} }
m_icon_indexes.push_back(m_img_list->Add(game_icon)); m_icon_indexes.push_back(m_img_list->Add(game_icon));