diff --git a/pcsx2/gui/AppRes.cpp b/pcsx2/gui/AppRes.cpp index aa651b4f52..b5430ea45f 100644 --- a/pcsx2/gui/AppRes.cpp +++ b/pcsx2/gui/AppRes.cpp @@ -43,12 +43,12 @@ RecentIsoList::RecentIsoList(int firstIdForMenuItems_or_wxID_ANY) { Menu = std::unique_ptr(new wxMenu()); - Menu->Append( MenuId_IsoBrowse, _("Browse..."), _("Browse for an ISO that is not in your recent history.")); + Menu->Append(MenuId_IsoBrowse, _("Browse..."), _("Browse for an ISO that is not in your recent history.")); Menu->AppendSeparator(); - Menu->AppendCheckItem( MenuId_Ask_On_Booting, _("Always ask when booting"), _("Manually select an ISO upon boot ignoring the selection from recent ISO list.") ); - Menu->Check( MenuId_Ask_On_Booting, g_Conf->AskOnBoot ); + Menu->AppendCheckItem(MenuId_Ask_On_Booting, _("Always ask when booting"), _("Manually select an ISO upon boot ignoring the selection from recent ISO list.")); + Menu->Check(MenuId_Ask_On_Booting, g_Conf->AskOnBoot); - Manager = std::unique_ptr(new RecentIsoManager( Menu.get(), firstIdForMenuItems_or_wxID_ANY )); + Manager = std::unique_ptr(new RecentIsoManager(Menu.get(), firstIdForMenuItems_or_wxID_ANY)); } pxAppResources::pxAppResources() @@ -59,19 +59,21 @@ pxAppResources::~pxAppResources() = default; wxMenu& Pcsx2App::GetRecentIsoMenu() { - if (!m_RecentIsoList) m_RecentIsoList = std::unique_ptr(new RecentIsoList( MenuId_RecentIsos_reservedStart )); + if (!m_RecentIsoList) + m_RecentIsoList = std::unique_ptr(new RecentIsoList(MenuId_RecentIsos_reservedStart)); return *m_RecentIsoList->Menu; } RecentIsoManager& Pcsx2App::GetRecentIsoManager() { - if (!m_RecentIsoList) m_RecentIsoList = std::unique_ptr(new RecentIsoList( MenuId_RecentIsos_reservedStart )); + if (!m_RecentIsoList) + m_RecentIsoList = std::unique_ptr(new RecentIsoList(MenuId_RecentIsos_reservedStart)); return *m_RecentIsoList->Manager; } wxMenu& Pcsx2App::GetDriveListMenu() { - if( !m_DriveList ) + if (!m_DriveList) { m_DriveList = std::unique_ptr(new DriveList()); } @@ -81,8 +83,8 @@ wxMenu& Pcsx2App::GetDriveListMenu() pxAppResources& Pcsx2App::GetResourceCache() { - ScopedLock lock( m_mtx_Resources ); - if( !m_Resources ) + ScopedLock lock(m_mtx_Resources); + if (!m_Resources) m_Resources = std::unique_ptr(new pxAppResources()); return *m_Resources; @@ -90,13 +92,13 @@ pxAppResources& Pcsx2App::GetResourceCache() const wxIconBundle& Pcsx2App::GetIconBundle() { - std::unique_ptr& bundle( GetResourceCache().IconBundle ); - if( !bundle ) + std::unique_ptr& bundle(GetResourceCache().IconBundle); + if (!bundle) { bundle = std::unique_ptr(new wxIconBundle()); - bundle->AddIcon( EmbeddedImage().GetIcon() ); - bundle->AddIcon( EmbeddedImage().GetIcon() ); - bundle->AddIcon( EmbeddedImage().GetIcon() ); + bundle->AddIcon(EmbeddedImage().GetIcon()); + bundle->AddIcon(EmbeddedImage().GetIcon()); + bundle->AddIcon(EmbeddedImage().GetIcon()); } return *bundle; @@ -104,8 +106,9 @@ const wxIconBundle& Pcsx2App::GetIconBundle() const wxBitmap& Pcsx2App::GetLogoBitmap() { - std::unique_ptr & logo(GetResourceCache().Bitmap_Logo); - if( logo ) return *logo; + std::unique_ptr& logo(GetResourceCache().Bitmap_Logo); + if (logo) + return *logo; wxImage img = EmbeddedImage().Get(); float scale = MSW_GetDPIScale(); // 1.0 for non-Windows @@ -117,7 +120,8 @@ const wxBitmap& Pcsx2App::GetLogoBitmap() const wxBitmap& Pcsx2App::GetScreenshotBitmap() { std::unique_ptr& screenshot(GetResourceCache().ScreenshotBitmap); - if (screenshot) return *screenshot; + if (screenshot) + return *screenshot; wxImage img = EmbeddedImage().Get(); float scale = MSW_GetDPIScale(); // 1.0 for non-Windows @@ -128,27 +132,27 @@ const wxBitmap& Pcsx2App::GetScreenshotBitmap() wxImageList& Pcsx2App::GetImgList_Config() { - std::unique_ptr& images( GetResourceCache().ConfigImages ); - if( !images ) + std::unique_ptr& images(GetResourceCache().ConfigImages); + if (!images) { int image_size = MSW_GetDPIScale() * g_Conf->Listbook_ImageSize; images = std::unique_ptr(new wxImageList(image_size, image_size)); - #undef FancyLoadMacro - #define FancyLoadMacro( name ) \ - { \ - wxImage img = EmbeddedImage().Get(); \ - img.Rescale(image_size, image_size, wxIMAGE_QUALITY_HIGH); \ - m_Resources->ImageId.Config.name = images->Add(img); \ - } +#undef FancyLoadMacro +#define FancyLoadMacro(name) \ + { \ + wxImage img = EmbeddedImage().Get(); \ + 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(Paths); + FancyLoadMacro(Plugins); + FancyLoadMacro(Gamefixes); + FancyLoadMacro(Speedhacks); + FancyLoadMacro(MemoryCard); + FancyLoadMacro(Video); + FancyLoadMacro(Cpu); } return *images; } @@ -156,20 +160,19 @@ wxImageList& Pcsx2App::GetImgList_Config() // This stuff seems unused? wxImageList& Pcsx2App::GetImgList_Toolbars() { - std::unique_ptr& images( GetResourceCache().ToolbarImages ); + std::unique_ptr& images(GetResourceCache().ToolbarImages); - if( !images ) + if (!images) { const int imgSize = g_Conf->Toolbar_ImageSize ? 64 : 32; images = std::unique_ptr(new wxImageList(imgSize, imgSize)); - #undef FancyLoadMacro - #define FancyLoadMacro( name ) \ - { \ - wxImage img = EmbeddedImage(imgSize, imgSize).Get(); \ - m_Resources.ImageId.Toolbars.name = images->Add(img); \ - } - +#undef FancyLoadMacro +#define FancyLoadMacro(name) \ + { \ + wxImage img = EmbeddedImage(imgSize, imgSize).Get(); \ + m_Resources.ImageId.Toolbars.name = images->Add(img); \ + } } return *images; }