wxImageList& Pcsx2App::GetImgList_Config() { ScopedPtr<wxImageList>& images( GetResourceCache().ConfigImages ); if( !images ) { int image_size = MSW_GetDPIScale() * g_Conf->Listbook_ImageSize; images = new wxImageList(image_size, image_size); wxFileName mess; bool useTheme = (g_Conf->DeskTheme != L"default"); if( useTheme ) { wxDirName theme( PathDefs::GetThemes() + g_Conf->DeskTheme ); mess = theme.ToString(); } wxImage img; // GCC Specific: wxT() macro is required when using string token pasting. For some // reason L generates syntax errors. >_< // TODO: This can be fixed with something like // #define L_STR(x) L_STR2(x) // #define L_STR2(x) L ## x // but it's probably best to do it everywhere at once. wxWidgets // recommends not to use it since v2.9.0. #undef FancyLoadMacro #define FancyLoadMacro( name ) \ { \ EmbeddedImage<res_ConfigIcon_##name> temp; \ LoadImageAny(img, useTheme, mess, L"ConfigIcon_" wxT(#name), temp); \ img.Rescale(image_size, image_size, wxIMAGE_QUALITY_HIGH); \ m_Resources->ImageId.Config.name = images->Add(img); \ } FancyLoadMacro( Paths ); FancyLoadMacro( Plugins ); FancyLoadMacro( Gamefixes ); FancyLoadMacro( Speedhacks ); FancyLoadMacro( MemoryCard ); FancyLoadMacro( Video ); FancyLoadMacro( Cpu ); FancyLoadMacro( Appearance ); } return *images; }
wxImageList& Pcsx2App::GetImgList_Config() { ScopedPtr<wxImageList>& images( GetResourceCache().ConfigImages ); if( !images ) { images = new wxImageList(32, 32); wxFileName mess; bool useTheme = (g_Conf->DeskTheme != L"default"); if( useTheme ) { wxDirName theme( PathDefs::GetThemes() + g_Conf->DeskTheme ); mess = theme.ToString(); } wxImage img; // GCC Specific: wxT() macro is required when using string token pasting. For some // reason L generates syntax errors. >_< #undef FancyLoadMacro #define FancyLoadMacro( name ) \ { \ EmbeddedImage<res_ConfigIcon_##name> temp( g_Conf->Listbook_ImageSize, g_Conf->Listbook_ImageSize ); \ m_Resources->ImageId.Config.name = images->Add( LoadImageAny( \ img, useTheme, mess, L"ConfigIcon_" wxT(#name), temp ) \ ); \ } FancyLoadMacro( Paths ); FancyLoadMacro( Plugins ); FancyLoadMacro( Gamefixes ); FancyLoadMacro( Speedhacks ); FancyLoadMacro( MemoryCard ); FancyLoadMacro( Video ); FancyLoadMacro( Cpu ); FancyLoadMacro( Appearance ); } return *images; }