diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2016-01-06 13:37:03 -0500 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2016-01-06 13:37:03 -0500 |
| commit | b49683b2e8b85be57221c5643376ef2d7da16bb9 (patch) | |
| tree | fbd6fd7b8b9566ad068ade21522e804892e52d8b /Source/Core/DolphinWX/GameListCtrl.cpp | |
| parent | adffa5fbeca45aa32c7b60f73517f0aa4e5b7838 (diff) | |
| parent | fd2d50535fad32facc95f2e8a35bb2f10742e83b (diff) | |
Merge pull request #3357 from JosJuice/no-xpm
DolphinWX: Stop using XPM images
Diffstat (limited to 'Source/Core/DolphinWX/GameListCtrl.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/GameListCtrl.cpp | 73 |
1 files changed, 29 insertions, 44 deletions
diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index e2db47d6bd..6f9d297d1a 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -18,6 +18,7 @@ #include <wx/filedlg.h> #include <wx/filefn.h> #include <wx/filename.h> +#include <wx/gdicmn.h> #include <wx/imaglist.h> #include <wx/listctrl.h> #include <wx/menu.h> @@ -51,23 +52,6 @@ #include "DolphinWX/ISOProperties.h" #include "DolphinWX/Main.h" #include "DolphinWX/WxUtils.h" -#include "DolphinWX/resources/Flag_Australia.xpm" -#include "DolphinWX/resources/Flag_Europe.xpm" -#include "DolphinWX/resources/Flag_France.xpm" -#include "DolphinWX/resources/Flag_Germany.xpm" -#include "DolphinWX/resources/Flag_Italy.xpm" -#include "DolphinWX/resources/Flag_Japan.xpm" -#include "DolphinWX/resources/Flag_Korea.xpm" -#include "DolphinWX/resources/Flag_Netherlands.xpm" -#include "DolphinWX/resources/Flag_Russia.xpm" -#include "DolphinWX/resources/Flag_Spain.xpm" -#include "DolphinWX/resources/Flag_Taiwan.xpm" -#include "DolphinWX/resources/Flag_Unknown.xpm" -#include "DolphinWX/resources/Flag_USA.xpm" -#include "DolphinWX/resources/Platform_Gamecube.xpm" -#include "DolphinWX/resources/Platform_Wad.xpm" -#include "DolphinWX/resources/Platform_Wii.xpm" -#include "DolphinWX/resources/rating_gamelist.h" size_t CGameListCtrl::m_currentItem = 0; size_t CGameListCtrl::m_numberItem = 0; @@ -184,38 +168,39 @@ CGameListCtrl::~CGameListCtrl() void CGameListCtrl::InitBitmaps() { + wxSize size(96, 32); m_imageListSmall = new wxImageList(96, 32); SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL); m_FlagImageIndex.resize(DiscIO::IVolume::NUMBER_OF_COUNTRIES); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_JAPAN] = m_imageListSmall->Add(wxBitmap(Flag_Japan_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_EUROPE] = m_imageListSmall->Add(wxBitmap(Flag_Europe_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_USA] = m_imageListSmall->Add(wxBitmap(Flag_USA_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_AUSTRALIA] = m_imageListSmall->Add(wxBitmap(Flag_Australia_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_FRANCE] = m_imageListSmall->Add(wxBitmap(Flag_France_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_GERMANY] = m_imageListSmall->Add(wxBitmap(Flag_Germany_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_ITALY] = m_imageListSmall->Add(wxBitmap(Flag_Italy_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_KOREA] = m_imageListSmall->Add(wxBitmap(Flag_Korea_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_NETHERLANDS] = m_imageListSmall->Add(wxBitmap(Flag_Netherlands_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_RUSSIA] = m_imageListSmall->Add(wxBitmap(Flag_Russia_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_SPAIN] = m_imageListSmall->Add(wxBitmap(Flag_Spain_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_TAIWAN] = m_imageListSmall->Add(wxBitmap(Flag_Taiwan_xpm)); - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_WORLD] = m_imageListSmall->Add(wxBitmap(Flag_Europe_xpm)); // Uses European flag as a placeholder - m_FlagImageIndex[DiscIO::IVolume::COUNTRY_UNKNOWN] = m_imageListSmall->Add(wxBitmap(Flag_Unknown_xpm)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_JAPAN] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Japan", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_EUROPE] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Europe", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_USA] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_USA", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_AUSTRALIA] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Australia", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_FRANCE] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_France", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_GERMANY] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Germany", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_ITALY] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Italy", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_KOREA] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Korea", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_NETHERLANDS] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Netherlands", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_RUSSIA] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Russia", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_SPAIN] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Spain", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_TAIWAN] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Taiwan", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_WORLD] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_International", size)); + m_FlagImageIndex[DiscIO::IVolume::COUNTRY_UNKNOWN] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Flag_Unknown", size)); m_PlatformImageIndex.resize(4); - m_PlatformImageIndex[0] = m_imageListSmall->Add(wxBitmap(Platform_Gamecube_xpm)); - m_PlatformImageIndex[1] = m_imageListSmall->Add(wxBitmap(Platform_Wii_xpm)); - m_PlatformImageIndex[2] = m_imageListSmall->Add(wxBitmap(Platform_Wad_xpm)); - m_PlatformImageIndex[3] = m_imageListSmall->Add(wxBitmap(StrToWxStr(File::GetSysDirectory() + RESOURCES_DIR + DIR_SEP + "Platform_File.png"), wxBITMAP_TYPE_PNG)); + m_PlatformImageIndex[DiscIO::IVolume::GAMECUBE_DISC] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Platform_Gamecube", size)); + m_PlatformImageIndex[DiscIO::IVolume::WII_DISC] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Platform_Wii", size)); + m_PlatformImageIndex[DiscIO::IVolume::WII_WAD] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Platform_Wad", size)); + m_PlatformImageIndex[DiscIO::IVolume::ELF_DOL] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("Platform_File", size)); m_EmuStateImageIndex.resize(6); - m_EmuStateImageIndex[0] = m_imageListSmall->Add(wxBitmap(rating_0)); - m_EmuStateImageIndex[1] = m_imageListSmall->Add(wxBitmap(rating_1)); - m_EmuStateImageIndex[2] = m_imageListSmall->Add(wxBitmap(rating_2)); - m_EmuStateImageIndex[3] = m_imageListSmall->Add(wxBitmap(rating_3)); - m_EmuStateImageIndex[4] = m_imageListSmall->Add(wxBitmap(rating_4)); - m_EmuStateImageIndex[5] = m_imageListSmall->Add(wxBitmap(rating_5)); + m_EmuStateImageIndex[0] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("rating0", size)); + m_EmuStateImageIndex[1] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("rating1", size)); + m_EmuStateImageIndex[2] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("rating2", size)); + m_EmuStateImageIndex[3] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("rating3", size)); + m_EmuStateImageIndex[4] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("rating4", size)); + m_EmuStateImageIndex[5] = m_imageListSmall->Add(WxUtils::LoadResourceBitmapPadded("rating5", size)); } void CGameListCtrl::BrowseForDirectory() @@ -288,15 +273,15 @@ void CGameListCtrl::Update() #endif // set initial sizes for columns - SetColumnWidth(COLUMN_DUMMY,0); - SetColumnWidth(COLUMN_PLATFORM, SConfig::GetInstance().m_showSystemColumn ? 35 + platform_padding : 0); + SetColumnWidth(COLUMN_DUMMY, 0); + SetColumnWidth(COLUMN_PLATFORM, SConfig::GetInstance().m_showSystemColumn ? 32 + platform_padding : 0); SetColumnWidth(COLUMN_BANNER, SConfig::GetInstance().m_showBannerColumn ? 96 + platform_padding : 0); SetColumnWidth(COLUMN_TITLE, 175 + platform_padding); SetColumnWidth(COLUMN_MAKER, SConfig::GetInstance().m_showMakerColumn ? 150 + platform_padding : 0); SetColumnWidth(COLUMN_FILENAME, SConfig::GetInstance().m_showFileNameColumn ? 100 + platform_padding : 0); SetColumnWidth(COLUMN_ID, SConfig::GetInstance().m_showIDColumn ? 75 + platform_padding : 0); SetColumnWidth(COLUMN_COUNTRY, SConfig::GetInstance().m_showRegionColumn ? 32 + platform_padding : 0); - SetColumnWidth(COLUMN_EMULATION_STATE, SConfig::GetInstance().m_showStateColumn ? 50 + platform_padding : 0); + SetColumnWidth(COLUMN_EMULATION_STATE, SConfig::GetInstance().m_showStateColumn ? 48 + platform_padding : 0); // add all items for (int i = 0; i < (int)m_ISOFiles.size(); i++) |
