ZeroGS: Change the OpenGL conf screen to have radio buttons for No interlacing, Interlace 0, and Interlace 1, and save all 3 values properly. (Issue 26)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@479 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-02-12 11:46:53 +00:00
parent 0e9629b01e
commit 6170ca7e00
3 changed files with 192 additions and 42 deletions

View File

@ -34,8 +34,17 @@ extern "C" {
#include <map>
GtkWidget *Conf;
GtkWidget *Logging;
GList *fresl;
GList *wresl;
GList *cachesizel;
GList *codecl;
GList *filtersl;
static int prevbilinearfilter;
//static map<string, int> mapConfOpts;
struct confOptsStruct
{
int value;
@ -93,14 +102,6 @@ void CALLBACK GSkeyEvent(keyEvent *ev)
}
}
GtkWidget *Conf;
GtkWidget *Logging;
GList *fresl;
GList *wresl;
GList *cachesizel;
GList *codecl;
GList *filtersl;
void OnConf_Ok(GtkButton *button, gpointer user_data)
{
GtkWidget *Btn;
@ -112,14 +113,6 @@ void OnConf_Ok(GtkButton *button, gpointer user_data)
char *str;
int i;
// fixme; This doesn't look right; conf.interlace is a u8.
u32 newinterlace = is_checked(Conf, "checkInterlace");
if (!conf.interlace )
conf.interlace = newinterlace;
else if (!newinterlace )
conf.interlace = 2; // off
conf.bilinear = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(Conf, "checkBilinear")));
// restore
if (conf.bilinear && prevbilinearfilter)
@ -143,6 +136,13 @@ void OnConf_Ok(GtkButton *button, gpointer user_data)
conf.options |= is_checked(Conf, "checkWireframe") ? GSOPTION_WIREFRAME : 0;
conf.options |= is_checked(Conf, "checkfullscreen") ? GSOPTION_FULLSCREEN : 0;
conf.options |= is_checked(Conf, "checkTGA") ? GSOPTION_TGASNAP : 0;
if is_checked(Conf, "radiointerlace0")
conf.interlace = 0;
else if is_checked(Conf, "radiointerlace1")
conf.interlace = 1;
else
conf.interlace = 2;
//------- get advanced options from the treeview model -------//
treeview = lookup_widget(Conf,"treeview1");
@ -178,7 +178,7 @@ void OnConf_Ok(GtkButton *button, gpointer user_data)
gtk_main_quit();
}
void OnConf_Cancel(GtkButton *button, gpointer user_data)
void OnConf_Cancel(GtkButton *button, gpointer user_data)
{
gtk_widget_destroy(Conf);
gtk_main_quit();
@ -200,6 +200,13 @@ void CALLBACK GSconfigure()
Conf = create_Config();
// fixme; Need to check "checkInterlace" as well.
if (conf.interlace == 0)
set_checked(Conf, "radiointerlace0", true);
else if (conf.interlace == 1)
set_checked(Conf, "radiointerlace1", true);
else
set_checked(Conf, "radionointerlace", true);
set_checked(Conf, "checkBilinear", !!conf.bilinear);
//set_checked(Conf, "checkbutton6", conf.mrtdepth);
set_checked(Conf, "radioAANone", (conf.aa==0));

View File

@ -31,7 +31,14 @@ create_Config (void)
{
GtkWidget *Config;
GtkWidget *vbox4;
GtkWidget *checkInterlace;
GtkWidget *frame7;
GtkWidget *alignment4;
GtkWidget *hbox8;
GtkWidget *radionointerlace;
GSList *radionointerlace_group = NULL;
GtkWidget *radiointerlace0;
GtkWidget *radiointerlace1;
GtkWidget *label13;
GtkWidget *checkBilinear;
GtkWidget *frame4;
GtkWidget *alignment1;
@ -74,9 +81,41 @@ create_Config (void)
gtk_widget_show (vbox4);
gtk_container_add (GTK_CONTAINER (Config), vbox4);
checkInterlace = gtk_check_button_new_with_mnemonic (_("Interlace Enable (toggle with F5)\n there are 2 modes + interlace off"));
gtk_widget_show (checkInterlace);
gtk_box_pack_start (GTK_BOX (vbox4), checkInterlace, FALSE, FALSE, 0);
frame7 = gtk_frame_new (NULL);
gtk_widget_show (frame7);
gtk_box_pack_start (GTK_BOX (vbox4), frame7, FALSE, FALSE, 0);
alignment4 = gtk_alignment_new (0.5, 0.5, 1, 1);
gtk_widget_show (alignment4);
gtk_container_add (GTK_CONTAINER (frame7), alignment4);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment4), 0, 0, 12, 0);
hbox8 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox8);
gtk_container_add (GTK_CONTAINER (alignment4), hbox8);
radionointerlace = gtk_radio_button_new_with_mnemonic (NULL, _("Interlace Off"));
gtk_widget_show (radionointerlace);
gtk_box_pack_start (GTK_BOX (hbox8), radionointerlace, FALSE, FALSE, 0);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radionointerlace), radionointerlace_group);
radionointerlace_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radionointerlace));
radiointerlace0 = gtk_radio_button_new_with_mnemonic (NULL, _("Interlace 0"));
gtk_widget_show (radiointerlace0);
gtk_box_pack_start (GTK_BOX (hbox8), radiointerlace0, FALSE, FALSE, 0);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiointerlace0), radionointerlace_group);
radionointerlace_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiointerlace0));
radiointerlace1 = gtk_radio_button_new_with_mnemonic (NULL, _("Interlace 1"));
gtk_widget_show (radiointerlace1);
gtk_box_pack_start (GTK_BOX (hbox8), radiointerlace1, FALSE, FALSE, 0);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiointerlace1), radionointerlace_group);
radionointerlace_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiointerlace1));
label13 = gtk_label_new (_("<b>Interlacing (F5 to toggle)</b>"));
gtk_widget_show (label13);
gtk_frame_set_label_widget (GTK_FRAME (frame7), label13);
gtk_label_set_use_markup (GTK_LABEL (label13), TRUE);
checkBilinear = gtk_check_button_new_with_mnemonic (_("Bilinear Filtering (Shift+F5)\n Best quality is on, turn off for speed"));
gtk_widget_show (checkBilinear);
@ -84,7 +123,7 @@ create_Config (void)
frame4 = gtk_frame_new (NULL);
gtk_widget_show (frame4);
gtk_box_pack_start (GTK_BOX (vbox4), frame4, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox4), frame4, FALSE, FALSE, 0);
alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
gtk_widget_show (alignment1);
@ -149,7 +188,7 @@ create_Config (void)
frame5 = gtk_frame_new (NULL);
gtk_widget_show (frame5);
gtk_box_pack_start (GTK_BOX (vbox4), frame5, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox4), frame5, FALSE, FALSE, 0);
alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1);
gtk_widget_show (alignment2);
@ -220,7 +259,7 @@ create_Config (void)
hbuttonbox1 = gtk_hbutton_box_new ();
gtk_widget_show (hbuttonbox1);
gtk_box_pack_start (GTK_BOX (vbox4), hbuttonbox1, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox4), hbuttonbox1, FALSE, FALSE, 0);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD);
gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 30);
@ -244,7 +283,13 @@ create_Config (void)
/* Store pointers to all widgets, for use by lookup_widget(). */
GLADE_HOOKUP_OBJECT_NO_REF (Config, Config, "Config");
GLADE_HOOKUP_OBJECT (Config, vbox4, "vbox4");
GLADE_HOOKUP_OBJECT (Config, checkInterlace, "checkInterlace");
GLADE_HOOKUP_OBJECT (Config, frame7, "frame7");
GLADE_HOOKUP_OBJECT (Config, alignment4, "alignment4");
GLADE_HOOKUP_OBJECT (Config, hbox8, "hbox8");
GLADE_HOOKUP_OBJECT (Config, radionointerlace, "radionointerlace");
GLADE_HOOKUP_OBJECT (Config, radiointerlace0, "radiointerlace0");
GLADE_HOOKUP_OBJECT (Config, radiointerlace1, "radiointerlace1");
GLADE_HOOKUP_OBJECT (Config, label13, "label13");
GLADE_HOOKUP_OBJECT (Config, checkBilinear, "checkBilinear");
GLADE_HOOKUP_OBJECT (Config, frame4, "frame4");
GLADE_HOOKUP_OBJECT (Config, alignment1, "alignment1");

View File

@ -27,17 +27,115 @@
<property name="spacing">0</property>
<child>
<widget class="GtkCheckButton" id="checkInterlace">
<widget class="GtkFrame" id="frame7">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Interlace Enable (toggle with F5)
there are 2 modes + interlace off</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
<widget class="GtkAlignment" id="alignment4">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">12</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox8">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkRadioButton" id="radionointerlace">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Interlace Off</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="radiointerlace0">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Interlace 0</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">radionointerlace</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="radiointerlace1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Interlace 1</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">radionointerlace</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Interlacing (F5 to toggle)&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
@ -219,8 +317,8 @@
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
@ -434,8 +532,8 @@
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
@ -575,8 +673,8 @@
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>