const wxBitmap& Pcsx2App::GetLogoBitmap() { std::unique_ptr <wxBitmap>& logo(GetResourceCache().Bitmap_Logo); if( logo ) return *logo; wxFileName themeDirectory; bool useTheme = (g_Conf->DeskTheme != L"default"); if( useTheme ) { themeDirectory.Assign(wxFileName(PathDefs::GetThemes().ToString()).GetFullPath(), g_Conf->DeskTheme); #if 0 wxFileName zipped(themeDirectory); zipped.SetExt( L"zip" ); if( zipped.FileExists() ) { // loading theme from zipfile. //wxFileInputStream stream( zipped.ToString() ) //wxZipInputStream zstream( stream ); Console.Error( "Loading themes from zipfile is not supported yet.\nFalling back on default theme." ); } #endif } wxImage img; EmbeddedImage<res_BackgroundLogo> temp; // because gcc can't allow non-const temporaries. LoadImageAny(img, useTheme, themeDirectory, L"BackgroundLogo", temp); float scale = MSW_GetDPIScale(); // 1.0 for non-Windows logo = std::unique_ptr<wxBitmap>(new wxBitmap(img.Scale(img.GetWidth() * scale, img.GetHeight() * scale, wxIMAGE_QUALITY_HIGH))); return *logo; }
const wxBitmap& Pcsx2App::GetLogoBitmap() { ScopedPtr<wxBitmap>& logo( GetResourceCache().Bitmap_Logo ); if( logo ) return *logo; wxFileName mess; bool useTheme = (g_Conf->DeskTheme != L"default"); if( useTheme ) { wxDirName theme( PathDefs::GetThemes() + g_Conf->DeskTheme ); wxFileName zipped( theme.GetFilename() ); zipped.SetExt( L"zip" ); if( zipped.FileExists() ) { // loading theme from zipfile. //wxFileInputStream stream( zipped.ToString() ) //wxZipInputStream zstream( stream ); Console.Error( "Loading themes from zipfile is not supported yet.\nFalling back on default theme." ); } // Overrides zipfile settings (fix when zipfile support added) mess = theme.ToString(); } wxImage img; EmbeddedImage<res_BackgroundLogo> temp; // because gcc can't allow non-const temporaries. LoadImageAny( img, useTheme, mess, L"BackgroundLogo", temp ); float scale = MSW_GetDPIScale(); // 1.0 for non-Windows logo = new wxBitmap(img.Scale(img.GetWidth() * scale, img.GetHeight() * scale, wxIMAGE_QUALITY_HIGH)); return *logo; }
Dialogs::ConvertMemoryCardDialog::ConvertMemoryCardDialog( wxWindow* parent, const wxDirName& mcdPath, const AppConfig::McdOptions& mcdSourceConfig ) : wxDialogWithHelpers( parent, _( "Convert a memory card to a different format" ) ) , m_mcdPath( mcdPath ) , m_mcdSourceFilename( mcdSourceConfig.Filename.GetFullName() ) { SetMinWidth( 472 * MSW_GetDPIScale()); CreateControls( mcdSourceConfig.Type ); if ( m_radio_CardType ) m_radio_CardType->Realize(); wxBoxSizer& s_buttons( *new wxBoxSizer( wxHORIZONTAL ) ); s_buttons += new wxButton( this, wxID_OK, _( "Convert" ) ) | pxProportion( 2 ); s_buttons += pxStretchSpacer( 3 ); s_buttons += new wxButton( this, wxID_CANCEL ) | pxProportion( 2 ); wxBoxSizer& s_padding( *new wxBoxSizer( wxVERTICAL ) ); s_padding += Heading( wxString( _( "Convert: " ) ) + ( mcdPath + m_mcdSourceFilename ).GetFullPath() ).Unwrapped() | pxSizerFlags::StdExpand(); wxBoxSizer& s_filename( *new wxBoxSizer( wxHORIZONTAL ) ); s_filename += Heading( _( "To: " ) ).Unwrapped().Align(wxALIGN_RIGHT) | pxProportion(1); m_text_filenameInput->SetValue( wxFileName( m_mcdSourceFilename ).GetName() + L"_converted" ); s_filename += m_text_filenameInput | pxProportion(2); s_filename += Heading( L".ps2" ).Align(wxALIGN_LEFT) | pxProportion(1); s_padding += s_filename | pxSizerFlags::StdExpand(); s_padding += m_radio_CardType | pxSizerFlags::StdExpand(); if ( mcdSourceConfig.Type != MemoryCardType::MemoryCard_File ) { s_padding += Heading( pxE( L"Please note that the resulting file may not actually contain all saves, depending on how many are in the source memory card." ) ); } s_padding += Heading( pxE( L"WARNING: Converting a memory card may take a while! Please do not close the emulator during the conversion process, even if the emulator is no longer responding to input." ) ); s_padding += 12; s_padding += s_buttons | pxSizerFlags::StdCenter(); *this += s_padding | pxSizerFlags::StdExpand(); Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConvertMemoryCardDialog::OnOk_Click ) ); Connect( m_text_filenameInput->GetId(), wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( ConvertMemoryCardDialog::OnOk_Click ) ); SetSizerAndFit(GetSizer()); m_text_filenameInput->SetFocus(); m_text_filenameInput->SelectAll(); }
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; }
const wxBitmap& Pcsx2App::GetScreenshotBitmap() { std::unique_ptr<wxBitmap>& screenshot(GetResourceCache().ScreenshotBitmap); if (screenshot) return *screenshot; wxFileName themeDirectory; bool useTheme = (g_Conf->DeskTheme != L"default"); if (useTheme) { themeDirectory.Assign(wxFileName(PathDefs::GetThemes().ToString()).GetFullPath(), g_Conf->DeskTheme); } wxImage img; EmbeddedImage<res_ButtonIcon_Camera> temp; // because gcc can't allow non-const temporaries. LoadImageAny(img, useTheme, themeDirectory, L"ButtonIcon_Camera", temp); float scale = MSW_GetDPIScale(); // 1.0 for non-Windows screenshot = std::unique_ptr<wxBitmap>(new wxBitmap(img.Scale(img.GetWidth() * scale, img.GetHeight() * scale, wxIMAGE_QUALITY_HIGH))); return *screenshot; }
const wxBitmap& Pcsx2App::GetScreenshotBitmap() { ScopedPtr<wxBitmap>& screenshot(GetResourceCache().ScreenshotBitmap); if (screenshot) return *screenshot; wxFileName mess; bool useTheme = (g_Conf->DeskTheme != L"default"); if (useTheme) { wxDirName theme(PathDefs::GetThemes() + g_Conf->DeskTheme); mess = theme.ToString(); } wxImage img; EmbeddedImage<res_ButtonIcon_Camera> temp; // because gcc can't allow non-const temporaries. LoadImageAny(img, useTheme, mess, L"ButtonIcon_Camera", temp); float scale = MSW_GetDPIScale(); // 1.0 for non-Windows screenshot = new wxBitmap(img.Scale(img.GetWidth() * scale, img.GetHeight() * scale, wxIMAGE_QUALITY_HIGH)); return *screenshot; }