From 0656b44a396515aea5b009721acd0895a37d3798 Mon Sep 17 00:00:00 2001 From: bgk Date: Mon, 27 Oct 2008 19:48:33 +0000 Subject: [PATCH] GTK : WIP display config dialog --- CMakeLists.txt | 1 + src/gtk/directoriesconfig.h | 2 - src/gtk/displayconfig.cpp | 163 ++++++++++++++++++++++++++++ src/gtk/displayconfig.h | 57 ++++++++++ src/gtk/ui/display.ui | 211 ++++++++++++++++++++++++++++++++++++ src/gtk/vba.glade | 179 +----------------------------- src/gtk/window.cpp | 129 ++++++---------------- src/gtk/window.h | 24 ++-- src/gtk/windowcallbacks.cpp | 56 +++------- 9 files changed, 492 insertions(+), 330 deletions(-) create mode 100644 src/gtk/displayconfig.cpp create mode 100644 src/gtk/displayconfig.h create mode 100644 src/gtk/ui/display.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index 16ed83a2..68313cfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,6 +207,7 @@ SET(SRC_GTK src/gtk/filters.cpp src/gtk/joypadconfig.cpp src/gtk/directoriesconfig.cpp + src/gtk/displayconfig.cpp src/gtk/screenarea.cpp src/gtk/screenarea-cairo.cpp src/gtk/screenarea-xvideo.cpp diff --git a/src/gtk/directoriesconfig.h b/src/gtk/directoriesconfig.h index d98ba1da..454e787f 100644 --- a/src/gtk/directoriesconfig.h +++ b/src/gtk/directoriesconfig.h @@ -19,8 +19,6 @@ #ifndef __VBA_DIRECTORIESCONFIG_H__ #define __VBA_DIRECTORIESCONFIG_H__ -#include - #include #include #include diff --git a/src/gtk/displayconfig.cpp b/src/gtk/displayconfig.cpp new file mode 100644 index 00000000..25216640 --- /dev/null +++ b/src/gtk/displayconfig.cpp @@ -0,0 +1,163 @@ +// -*- C++ -*- +// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. +// Copyright (C) 2008 VBA-M development team + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or(at your option) +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include "displayconfig.h" + +#include +#include +#include +#include + +#include "intl.h" +#include "filters.h" + +namespace VBA +{ + +DisplayConfigDialog::DisplayConfigDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder) : + Gtk::Dialog(_pstDialog), + m_poConfig(0) +{ + //TODO Move to filters.h + struct + { + const char * m_csName; + const EFilter2x m_eFilter; + } + astFilter[] = + { + { "None", FilterNone }, + { "2xSaI", Filter2xSaI }, + { "Super 2xSaI", FilterSuper2xSaI }, + { "Super Eagle", FilterSuperEagle }, + { "Pixelate", FilterPixelate }, + { "AdvanceMAME Scale2x", FilterAdMame2x }, + { "Bilinear", FilterBilinear }, + { "Bilinear Plus", FilterBilinearPlus }, + { "Scanlines", FilterScanlines }, + { "TV Mode", FilterScanlinesTV }, + { "hq2x", FilterHq2x }, + { "lq2x", FilterLq2x } + }; + + struct + { + const char * m_csName; + const EFilterIB m_eFilterIB; + } + astFilterIB[] = + { + { "None", FilterIBNone }, + { "Smart interframe blending", FilterIBSmart }, + { "Interframe motion blur", FilterIBMotionBlur } + }; + + refBuilder->get_widget("FiltersComboBox", m_poFiltersComboBox); + refBuilder->get_widget("IBFiltersComboBox", m_poIBFiltersComboBox); + refBuilder->get_widget("OutputOpenGL", m_poOutputOpenGLRadioButton); + refBuilder->get_widget("OutputCairo", m_poOutputCairoRadioButton); + refBuilder->get_widget("OutputXv", m_poOutputXvRadioButton); + + m_poFiltersComboBox->signal_changed().connect(sigc::mem_fun(*this, &DisplayConfigDialog::vOnFilterChanged)); + m_poIBFiltersComboBox->signal_changed().connect(sigc::mem_fun(*this, &DisplayConfigDialog::vOnFilterIBChanged)); + m_poOutputOpenGLRadioButton->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &DisplayConfigDialog::vOnOutputChanged), VBA::Window::OutputOpenGL)); + m_poOutputCairoRadioButton->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &DisplayConfigDialog::vOnOutputChanged), VBA::Window::OutputCairo)); + m_poOutputXvRadioButton->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &DisplayConfigDialog::vOnOutputChanged), VBA::Window::OutputXvideo)); + + + // Populate the filters combobox + Glib::RefPtr poFiltersListStore; + poFiltersListStore = Glib::RefPtr::cast_static(refBuilder->get_object("FiltersListStore")); + + for (guint i = 0; i < G_N_ELEMENTS(astFilter); i++) + { + Gtk::TreeModel::Row row = *(poFiltersListStore->append()); + row->set_value(0, std::string(astFilter[i].m_csName)); + } + + // Populate the interframe blending filters combobox + Glib::RefPtr poIBFiltersListStore; + poIBFiltersListStore = Glib::RefPtr::cast_static(refBuilder->get_object("IBFiltersListStore")); + + for (guint i = 0; i < G_N_ELEMENTS(astFilterIB); i++) + { + Gtk::TreeModel::Row row = *(poIBFiltersListStore->append()); + row->set_value(0, std::string(astFilterIB[i].m_csName)); + } +} + +void DisplayConfigDialog::vSetConfig(Config::Section * _poConfig, VBA::Window * _poWindow) +{ + m_poConfig = _poConfig; + m_poWindow = _poWindow; + + int iDefaultFilter = m_poConfig->oGetKey("filter2x"); + m_poFiltersComboBox->set_active(iDefaultFilter); + + int iDefaultFilterIB = m_poConfig->oGetKey("filterIB"); + m_poIBFiltersComboBox->set_active(iDefaultFilterIB); + + // Set the default output module + VBA::Window::EVideoOutput _eOutput = (VBA::Window::EVideoOutput)m_poConfig->oGetKey("output"); + switch (_eOutput) + { + case VBA::Window::OutputOpenGL: + m_poOutputOpenGLRadioButton->set_active(); + break; + case VBA::Window::OutputXvideo: + m_poOutputXvRadioButton->set_active(); + break; + default: + m_poOutputCairoRadioButton->set_active(); + break; + } +} + +void DisplayConfigDialog::vOnFilterChanged() +{ + int iFilter = m_poFiltersComboBox->get_active_row_number(); + if (iFilter >= 0) + { + m_poConfig->vSetKey("filter2x", iFilter); + m_poWindow->vApplyConfigFilter(); + } +} + +void DisplayConfigDialog::vOnFilterIBChanged() +{ + int iFilterIB = m_poIBFiltersComboBox->get_active_row_number(); + if (iFilterIB >= 0) + { + m_poConfig->vSetKey("filterIB", iFilterIB); + m_poWindow->vApplyConfigFilterIB(); + } +} + +void DisplayConfigDialog::vOnOutputChanged(VBA::Window::EVideoOutput _eOutput) +{ + if (_eOutput == VBA::Window::OutputOpenGL && m_poOutputOpenGLRadioButton->get_active()) + m_poConfig->vSetKey("output", VBA::Window::OutputOpenGL); + else if (_eOutput == VBA::Window::OutputCairo && m_poOutputCairoRadioButton->get_active()) + m_poConfig->vSetKey("output", VBA::Window::OutputCairo); + else if (_eOutput == VBA::Window::OutputXvideo && m_poOutputXvRadioButton->get_active()) + m_poConfig->vSetKey("output", VBA::Window::OutputXvideo); + + m_poWindow->vApplyConfigScreenArea(); +} + +} // namespace VBA diff --git a/src/gtk/displayconfig.h b/src/gtk/displayconfig.h new file mode 100644 index 00000000..851cda46 --- /dev/null +++ b/src/gtk/displayconfig.h @@ -0,0 +1,57 @@ +// -*- C++ -*- +// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. +// Copyright (C) 2008 VBA-M development team + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or(at your option) +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#ifndef __VBA_DISPLAYCONFIG_H__ +#define __VBA_DISPLAYCONFIG_H__ + +#include +#include +#include + +#include "configfile.h" +#include "window.h" + +namespace VBA +{ + +class DisplayConfigDialog : public Gtk::Dialog +{ +public: + DisplayConfigDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder); + + void vSetConfig(Config::Section * _poConfig, VBA::Window * _poWindow); + +private: + void vOnFilterChanged(); + void vOnFilterIBChanged(); + void vOnOutputChanged(VBA::Window::EVideoOutput _eOutput); + + VBA::Window * m_poWindow; + + Config::Section * m_poConfig; + Gtk::ComboBox * m_poFiltersComboBox; + Gtk::ComboBox * m_poIBFiltersComboBox; + Gtk::RadioButton * m_poOutputOpenGLRadioButton; + Gtk::RadioButton * m_poOutputCairoRadioButton; + Gtk::RadioButton * m_poOutputXvRadioButton; +}; + +} // namespace VBA + + +#endif // __VBA_DISPLAYCONFIG_H__ diff --git a/src/gtk/ui/display.ui b/src/gtk/ui/display.ui new file mode 100644 index 00000000..a56d96f0 --- /dev/null +++ b/src/gtk/ui/display.ui @@ -0,0 +1,211 @@ + + + + 600 + 100 + 10 + 100 + 10 + 100 + + + + + + + + + + + + + 5 + GTK_WIN_POS_CENTER_ON_PARENT + GDK_WINDOW_TYPE_HINT_DIALOG + False + + + True + 2 + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + + + True + True + OpenGL + True + True + + + + + True + True + Cairo + True + True + OutputOpenGL + + + 1 + + + + + True + True + XVideo + True + True + OutputOpenGL + + + 2 + + + + + + + + + True + <b>Module de sortie</b> + True + + + + + False + 1 + + + + + True + 0 + GTK_SHADOW_NONE + + + True + 12 + + + True + 2 + 2 + + + True + 1 + Interframe blending : + + + 1 + 2 + GTK_FILL + + + + + True + 1 + Fullscreen filter : + + + GTK_FILL + + + + + True + IBFiltersListStore + + + + 0 + + + + + 1 + 2 + 1 + 2 + + + + + True + FiltersListStore + + + + 0 + + + + + 1 + 2 + + + + + + + + + True + <b>Filters</b> + True + + + + + 3 + + + + + True + GTK_BUTTONBOX_END + + + + + + True + True + True + gtk-close + True + + + 1 + + + + + False + GTK_PACK_END + + + + + + button1 + + + diff --git a/src/gtk/vba.glade b/src/gtk/vba.glade index 37080b7b..e4135848 100644 --- a/src/gtk/vba.glade +++ b/src/gtk/vba.glade @@ -459,41 +459,6 @@ True - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _OpenGL - True - True - True - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _Cairo - True - True - VideoOpenGL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _Xvideo - True - True - VideoOpenGL - - - - - True - - True @@ -872,150 +837,10 @@ - + True - F_ilter + _Display ... True - - - - - True - Interframe _blending - True - - - - - True - _None - True - True - - - - - True - _Smart - True - IFBNone - - - - - True - _Motion Blur - True - IFBNone - - - - - - - - - True - - - - - True - _None - True - True - - - - - True - _TV Mode - True - FilterNone - - - - - True - _2xSaI - True - FilterNone - - - - - True - _Super 2xSaI - True - FilterNone - - - - - True - Super _Eagle - True - FilterNone - - - - - True - _Pixelate - True - FilterNone - - - - - True - _AdvanceMAME 2x - True - FilterNone - - - - - True - Bilinea_r - True - FilterNone - - - - - True - Bilinear Pl_us - True - FilterNone - - - - - True - S_canlines - True - FilterNone - - - - - True - h_q2x - True - FilterNone - - - - - True - _lq2x - True - FilterNone - - - - diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 75ae61b4..b6e77cdc 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -140,7 +140,10 @@ Window::Window(GtkWindow * _pstWindow, const Glib::RefPtr & _poXml) : } vCreateFileOpenDialog(); - vLoadJoypadsFromConfig(); + vApplyConfigJoypads(); + vApplyConfigScreenArea(); + vApplyConfigFilter(); + vApplyConfigFilterIB(); Gtk::MenuItem * poMI; Gtk::CheckMenuItem * poCMI; @@ -148,33 +151,6 @@ Window::Window(GtkWindow * _pstWindow, const Glib::RefPtr & _poXml) : // Menu bar m_poMenuBar = dynamic_cast(_poXml->get_widget("MenuBar")); - // Video output menu - // - struct - { - const char * m_csName; - const EVideoOutput m_eVideoOutput; - } - astVideoOutput[] = - { - { "VideoOpenGL", OutputOpenGL }, - { "VideoCairo", OutputCairo }, - { "VideoXv", OutputXvideo } - }; - EVideoOutput eDefaultVideoOutput = (EVideoOutput)m_poDisplayConfig->oGetKey("output"); - for (guint i = 0; i < G_N_ELEMENTS(astVideoOutput); i++) - { - poCMI = dynamic_cast(_poXml->get_widget(astVideoOutput[i].m_csName)); - if (astVideoOutput[i].m_eVideoOutput == eDefaultVideoOutput) - { - poCMI->set_active(); - vOnVideoOutputToggled(poCMI, eDefaultVideoOutput); - } - poCMI->signal_toggled().connect(sigc::bind( - sigc::mem_fun(*this, &Window::vOnVideoOutputToggled), - poCMI, astVideoOutput[i].m_eVideoOutput)); - } - // File menu // poMI = dynamic_cast(_poXml->get_widget("FileOpen")); @@ -549,68 +525,9 @@ Window::Window(GtkWindow * _pstWindow, const Glib::RefPtr & _poXml) : poCMI, astEmulatorType[i].m_eEmulatorType)); } - // Filter menu - // - struct - { - const char * m_csName; - const EFilter2x m_eFilter2x; - } - astFilter2x[] = - { - { "FilterNone", FilterNone }, - { "FilterTVMode", FilterScanlinesTV }, - { "Filter2xSaI", Filter2xSaI }, - { "FilterSuper2xSaI", FilterSuper2xSaI }, - { "FilterSuperEagle", FilterSuperEagle }, - { "FilterPixelate", FilterPixelate }, - { "FilterAdvanceMame2x", FilterAdMame2x }, - { "FilterBilinear", FilterBilinear }, - { "FilterBilinearPlus", FilterBilinearPlus }, - { "FilterScanlines", FilterScanlines }, - { "FilterHq2x", FilterHq2x }, - { "FilterLq2x", FilterLq2x } - }; - EFilter2x eDefaultFilter2x = (EFilter2x)m_poDisplayConfig->oGetKey("filter2x"); - for (guint i = 0; i < G_N_ELEMENTS(astFilter2x); i++) - { - poCMI = dynamic_cast(_poXml->get_widget(astFilter2x[i].m_csName)); - if (astFilter2x[i].m_eFilter2x == eDefaultFilter2x) - { - poCMI->set_active(); - vOnFilter2xToggled(poCMI, eDefaultFilter2x); - } - poCMI->signal_toggled().connect(sigc::bind( - sigc::mem_fun(*this, &Window::vOnFilter2xToggled), - poCMI, astFilter2x[i].m_eFilter2x)); - } - - // Interframe blending menu - // - struct - { - const char * m_csName; - const EFilterIB m_eFilterIB; - } - astFilterIB[] = - { - { "IFBNone", FilterIBNone }, - { "IFBSmart", FilterIBSmart }, - { "IFBMotionBlur", FilterIBMotionBlur } - }; - EFilterIB eDefaultFilterIB = (EFilterIB)m_poDisplayConfig->oGetKey("filterIB"); - for (guint i = 0; i < G_N_ELEMENTS(astFilterIB); i++) - { - poCMI = dynamic_cast(_poXml->get_widget(astFilterIB[i].m_csName)); - if (astFilterIB[i].m_eFilterIB == eDefaultFilterIB) - { - poCMI->set_active(); - vOnFilterIBToggled(poCMI, eDefaultFilterIB); - } - poCMI->signal_toggled().connect(sigc::bind( - sigc::mem_fun(*this, &Window::vOnFilterIBToggled), - poCMI, astFilterIB[i].m_eFilterIB)); - } + // Display menu + poMI = dynamic_cast(_poXml->get_widget("DisplayConfigure")); + poMI->signal_activate().connect(sigc::mem_fun(*this, &Window::vOnDisplayConfigure)); // Joypad menu // @@ -713,8 +630,10 @@ void Window::vInitColors(EColorFormat _eColorFormat) Init_2xSaI(32); } -void Window::vInitScreenArea(EVideoOutput _eVideoOutput) +void Window::vApplyConfigScreenArea() { + EVideoOutput eVideoOutput = (EVideoOutput)m_poDisplayConfig->oGetKey("output");; + Gtk::Alignment * poC; poC = dynamic_cast(m_poXml->get_widget("ScreenContainer")); @@ -723,7 +642,7 @@ void Window::vInitScreenArea(EVideoOutput _eVideoOutput) try { - switch (_eVideoOutput) + switch (eVideoOutput) { #ifdef USE_OPENGL case OutputOpenGL: @@ -879,10 +798,6 @@ void Window::vInitConfig() inputGetKeymap(PAD_DEFAULT, m_astJoypad[j].m_eKeyFlag)); } } - m_poInputConfig->vSetKey("autofire_A", false ); - m_poInputConfig->vSetKey("autofire_B", false ); - m_poInputConfig->vSetKey("autofire_L", false ); - m_poInputConfig->vSetKey("autofire_R", false ); } void Window::vCheckConfig() @@ -1053,6 +968,26 @@ void Window::vSaveConfig(const std::string & _rsFile) } } +void Window::vApplyConfigFilter() +{ + int iFilter = m_poDisplayConfig->oGetKey("filter2x"); + m_poScreenArea->vSetFilter2x((EFilter2x)iFilter); + if (emulating) + { + vDrawScreen(); + } +} + +void Window::vApplyConfigFilterIB() +{ + int iFilter = m_poDisplayConfig->oGetKey("filterIB"); + m_poScreenArea->vSetFilterIB((EFilterIB)iFilter); + if (emulating) + { + vDrawScreen(); + } +} + void Window::vHistoryAdd(const std::string & _rsFile) { std::string sURL = "file://" + _rsFile; @@ -1060,7 +995,7 @@ void Window::vHistoryAdd(const std::string & _rsFile) m_poRecentManager->add_item(sURL); } -void Window::vLoadJoypadsFromConfig() +void Window::vApplyConfigJoypads() { for (int i = m_iJoypadMin; i <= m_iJoypadMax; i++) { diff --git a/src/gtk/window.h b/src/gtk/window.h index bb75b0e7..64187a88 100644 --- a/src/gtk/window.h +++ b/src/gtk/window.h @@ -53,6 +53,13 @@ public: CartridgeGBA }; + enum EVideoOutput + { + OutputCairo, + OutputOpenGL, + OutputXvideo + }; + // GB/GBA screen sizes const int m_iGBScreenWidth; const int m_iGBScreenHeight; @@ -68,6 +75,9 @@ public: void vComputeFrameskip(int _iRate); void vShowSpeed(int _iSpeed); void vCaptureScreen(int _iNum); + void vApplyConfigFilter(); + void vApplyConfigFilterIB(); + void vApplyConfigScreenArea(); inline ECartridge eGetCartridge() const { return m_eCartridge; } @@ -122,13 +132,6 @@ protected: ColorFormatBGR }; - enum EVideoOutput - { - OutputCairo, - OutputOpenGL, - OutputXvideo - }; - virtual void vOnFileOpen(); virtual void vOnFileLoad(); virtual void vOnFileSave(); @@ -145,7 +148,6 @@ protected: virtual void vOnFileExit(); virtual void vOnFrameskipToggled(Gtk::CheckMenuItem * _poCMI, int _iValue); virtual void vOnVideoFullscreen(); - virtual void vOnVideoOutputToggled(Gtk::CheckMenuItem * _poCMI, int _iOutput); virtual void vOnVideoScaleToggled(Gtk::CheckMenuItem * _poCMI, int _iScale); virtual void vOnDirectories(); virtual void vOnPauseWhenInactiveToggled(Gtk::CheckMenuItem * _poCMI); @@ -160,9 +162,8 @@ protected: virtual void vOnGBBorderToggled(Gtk::CheckMenuItem * _poCMI); virtual void vOnGBPrinterToggled(Gtk::CheckMenuItem * _poCMI); virtual void vOnEmulatorTypeToggled(Gtk::CheckMenuItem * _poCMI, int _iEmulatorType); - virtual void vOnFilter2xToggled(Gtk::CheckMenuItem * _poCMI, int _iFilter2x); - virtual void vOnFilterIBToggled(Gtk::CheckMenuItem * _poCMI, int _iFilterIB); virtual void vOnJoypadConfigure(); + virtual void vOnDisplayConfigure(); virtual void vOnHelpAbout(); virtual bool bOnEmuIdle(); @@ -264,11 +265,10 @@ private: void vInitConfig(); void vCheckConfig(); void vInitColors(EColorFormat _eColorFormat); - void vInitScreenArea(EVideoOutput _eVideoOutput); void vLoadConfig(const std::string & _rsFile); void vSaveConfig(const std::string & _rsFile); void vHistoryAdd(const std::string & _rsFile); - void vLoadJoypadsFromConfig(); + void vApplyConfigJoypads(); void vSaveJoypadsToConfig(); void vUpdateScreen(); void vDrawDefaultScreen(); diff --git a/src/gtk/windowcallbacks.cpp b/src/gtk/windowcallbacks.cpp index e26a6941..d0744f81 100644 --- a/src/gtk/windowcallbacks.cpp +++ b/src/gtk/windowcallbacks.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -37,6 +38,7 @@ #include "intl.h" #include "joypadconfig.h" #include "directoriesconfig.h" +#include "displayconfig.h" namespace VBA { @@ -361,18 +363,6 @@ void Window::vOnVideoFullscreen() vToggleFullscreen(); } -void Window::vOnVideoOutputToggled(Gtk::CheckMenuItem * _poCMI, int _iOutput) -{ - if (! _poCMI->get_active()) - { - return; - } - - m_poDisplayConfig->vSetKey("output", _iOutput); - - vInitScreenArea((EVideoOutput)_iOutput); -} - void Window::vOnVideoScaleToggled(Gtk::CheckMenuItem * _poCMI, int _iScale) { if (! _poCMI->get_active()) @@ -566,36 +556,6 @@ void Window::vOnEmulatorTypeToggled(Gtk::CheckMenuItem * _poCMI, int _iEmulatorT m_poCoreConfig->vSetKey("emulator_type", _iEmulatorType); } -void Window::vOnFilter2xToggled(Gtk::CheckMenuItem * _poCMI, int _iFilter2x) -{ - if (! _poCMI->get_active()) - { - return; - } - - m_poScreenArea->vSetFilter2x((EFilter2x)_iFilter2x); - if (emulating) - { - vDrawScreen(); - } - m_poDisplayConfig->vSetKey("filter2x", _iFilter2x); -} - -void Window::vOnFilterIBToggled(Gtk::CheckMenuItem * _poCMI, int _iFilterIB) -{ - if (! _poCMI->get_active()) - { - return; - } - - m_poScreenArea->vSetFilterIB((EFilterIB)_iFilterIB); - if (emulating) - { - vDrawScreen(); - } - m_poDisplayConfig->vSetKey("filterIB", _iFilterIB); -} - void Window::vOnJoypadConfigure() { JoypadConfigDialog oDialog(m_poInputConfig); @@ -603,6 +563,18 @@ void Window::vOnJoypadConfigure() oDialog.run(); } +void Window::vOnDisplayConfigure() +{ + Glib::RefPtr poBuilder = Gtk::Builder::create_from_file("src/gtk/ui/display.ui"); + + DisplayConfigDialog * poDialog = 0; + poBuilder->get_widget_derived("dialog1", poDialog); + poDialog->vSetConfig(m_poDisplayConfig, this); + poDialog->set_transient_for(*this); + poDialog->run(); + poDialog->hide(); +} + void Window::vOnHelpAbout() { Gtk::AboutDialog oAboutDialog;