2011-02-20 01:57:43 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007-2009 Gabest
|
|
|
|
* http://www.gabest.org
|
|
|
|
*
|
|
|
|
* 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 GNU Make; see the file COPYING. If not, write to
|
2012-09-09 18:16:11 +00:00
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
|
2011-02-20 01:57:43 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
*/
|
2011-02-22 23:39:02 +00:00
|
|
|
|
2011-02-20 01:57:43 +00:00
|
|
|
#include "stdafx.h"
|
2011-02-22 23:39:02 +00:00
|
|
|
#include <gtk/gtk.h>
|
2015-10-26 21:30:34 +00:00
|
|
|
#include "GS.h"
|
2011-02-22 23:39:02 +00:00
|
|
|
#include "GSdx.h"
|
2017-01-29 09:35:02 +00:00
|
|
|
#include "GSdxResources.h"
|
2015-04-16 17:21:32 +00:00
|
|
|
#include "GSSetting.h"
|
2011-02-20 01:57:43 +00:00
|
|
|
|
2017-04-23 08:50:03 +00:00
|
|
|
// Port of deprecated GTK2 API to recent GTK3. Those defines
|
|
|
|
// could prove handy for testing
|
2018-07-31 22:58:39 +00:00
|
|
|
#define GTK3_MONITOR_API GTK_CHECK_VERSION(3, 22, 0)
|
2018-07-31 23:32:37 +00:00
|
|
|
#define GTK3_GRID_API GTK_CHECK_VERSION(3, 12, 0)
|
2017-04-23 08:50:03 +00:00
|
|
|
|
2016-05-29 16:09:22 +00:00
|
|
|
static GtkWidget* s_hack_frame;
|
|
|
|
|
2017-03-31 21:29:59 +00:00
|
|
|
bool BigEnough()
|
|
|
|
{
|
2017-04-23 08:50:03 +00:00
|
|
|
#if GTK3_MONITOR_API
|
2018-08-07 22:49:45 +00:00
|
|
|
GdkDisplay *display = gdk_display_get_default();
|
|
|
|
GdkSeat *seat = gdk_display_get_default_seat(display);
|
|
|
|
GdkDevice *pointer = gdk_seat_get_pointer(seat);
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
gdk_device_get_position(pointer, nullptr, &x, &y);
|
|
|
|
GdkMonitor *monitor = gdk_display_get_monitor_at_point(display, x, y);
|
|
|
|
GdkRectangle my_geometry{};
|
2017-04-23 08:50:03 +00:00
|
|
|
gdk_monitor_get_geometry(monitor, &my_geometry);
|
|
|
|
return my_geometry.height > 1000;
|
|
|
|
#else
|
2017-03-31 21:29:59 +00:00
|
|
|
return (gdk_screen_get_height(gdk_screen_get_default()) > 1000);
|
2017-04-23 08:50:03 +00:00
|
|
|
#endif
|
2017-03-31 21:29:59 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 16:35:18 +00:00
|
|
|
void AddTooltip(GtkWidget* w, int idc)
|
|
|
|
{
|
2015-07-19 21:27:45 +00:00
|
|
|
gtk_widget_set_tooltip_text(w, dialog_message(idc));
|
|
|
|
}
|
|
|
|
|
2015-11-20 16:35:18 +00:00
|
|
|
void AddTooltip(GtkWidget* w1, GtkWidget* w2, int idc)
|
|
|
|
{
|
2015-07-19 21:27:45 +00:00
|
|
|
AddTooltip(w1, idc);
|
|
|
|
AddTooltip(w2, idc);
|
|
|
|
}
|
|
|
|
|
2017-04-23 08:50:03 +00:00
|
|
|
GtkWidget* CreateVbox()
|
|
|
|
{
|
|
|
|
#if GTK_CHECK_VERSION(3, 0, 0)
|
|
|
|
return gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
|
|
|
|
#else
|
|
|
|
return gtk_vbox_new(false, 5);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* left_label(const char* lbl)
|
|
|
|
{
|
|
|
|
GtkWidget* w = gtk_label_new(lbl);
|
2017-04-01 10:07:11 +00:00
|
|
|
#if GTK_CHECK_VERSION(3, 0, 0)
|
2015-11-20 16:35:18 +00:00
|
|
|
gtk_widget_set_halign(w, GTK_ALIGN_START);
|
|
|
|
#else
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(w),0.0,0.5);
|
|
|
|
#endif
|
|
|
|
return w;
|
|
|
|
}
|
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
void CB_ChangedComboBox(GtkComboBox *combo, gpointer user_data)
|
|
|
|
{
|
|
|
|
int p = gtk_combo_box_get_active(combo);
|
2017-05-26 15:57:49 +00:00
|
|
|
auto s = reinterpret_cast<std::vector<GSSetting>*>(g_object_get_data(G_OBJECT(combo), "Settings"));
|
2011-02-22 23:39:02 +00:00
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
try {
|
2016-01-18 22:59:27 +00:00
|
|
|
theApp.SetConfig((char*)user_data, s->at(p).value);
|
2015-05-07 18:32:46 +00:00
|
|
|
} catch (...) {
|
2011-02-22 23:39:02 +00:00
|
|
|
}
|
2012-01-08 01:18:23 +00:00
|
|
|
}
|
2011-04-07 12:30:29 +00:00
|
|
|
|
2017-05-26 15:57:49 +00:00
|
|
|
GtkWidget* CreateComboBoxFromVector(const std::vector<GSSetting>& s, const char* opt_name)
|
2014-11-09 15:39:49 +00:00
|
|
|
{
|
2015-05-07 18:32:46 +00:00
|
|
|
GtkWidget* combo_box = gtk_combo_box_text_new();
|
2016-05-24 19:52:06 +00:00
|
|
|
int32_t opt_value = theApp.GetConfigI(opt_name);
|
2015-05-07 18:32:46 +00:00
|
|
|
int opt_position = 0;
|
2012-01-08 02:32:56 +00:00
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
for(size_t i = 0; i < s.size(); i++)
|
|
|
|
{
|
2017-05-26 15:26:46 +00:00
|
|
|
std::string label = s[i].name;
|
2014-11-09 15:39:49 +00:00
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
if(!s[i].note.empty()) label += format(" (%s)", s[i].note.c_str());
|
2012-01-08 05:54:48 +00:00
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box), label.c_str());
|
2015-05-03 12:23:50 +00:00
|
|
|
|
2016-01-18 22:59:27 +00:00
|
|
|
if (s[i].value == opt_value)
|
2015-05-07 18:32:46 +00:00
|
|
|
opt_position = i;
|
|
|
|
}
|
2015-05-03 12:23:50 +00:00
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), opt_position);
|
2015-05-03 12:23:50 +00:00
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
g_signal_connect(combo_box, "changed", G_CALLBACK(CB_ChangedComboBox), const_cast<char*>(opt_name));
|
|
|
|
g_object_set_data(G_OBJECT(combo_box), "Settings", (void*)&s);
|
2015-05-03 12:23:50 +00:00
|
|
|
|
2012-01-08 06:24:10 +00:00
|
|
|
return combo_box;
|
|
|
|
}
|
2012-01-08 05:54:48 +00:00
|
|
|
|
2015-05-07 19:47:33 +00:00
|
|
|
void CB_EntryActived(GtkEntry *entry, gpointer user_data)
|
|
|
|
{
|
2013-02-23 15:35:56 +00:00
|
|
|
int hex_value = 0;
|
2015-05-07 19:47:33 +00:00
|
|
|
const gchar *data = gtk_entry_get_text(entry);
|
2013-02-23 15:35:56 +00:00
|
|
|
|
2016-11-08 19:27:42 +00:00
|
|
|
if (sscanf(data,"%X",&hex_value) == 1)
|
|
|
|
theApp.SetConfig((char*)user_data, hex_value);
|
2015-05-07 19:47:33 +00:00
|
|
|
}
|
|
|
|
|
2016-05-29 16:09:22 +00:00
|
|
|
GtkWidget* CreateTextBox(const char* opt_name)
|
|
|
|
{
|
2015-05-07 19:47:33 +00:00
|
|
|
GtkWidget* entry = gtk_entry_new();
|
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
int hex_value = theApp.GetConfigI(opt_name);
|
2015-05-07 19:47:33 +00:00
|
|
|
|
|
|
|
gchar* data=(gchar *)g_malloc(sizeof(gchar)*40);
|
|
|
|
sprintf(data,"%X", hex_value);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(entry),data);
|
|
|
|
g_free(data);
|
|
|
|
|
|
|
|
g_signal_connect(entry, "activate", G_CALLBACK(CB_EntryActived), const_cast<char*>(opt_name));
|
2016-11-08 19:27:42 +00:00
|
|
|
g_signal_connect(entry, "changed", G_CALLBACK(CB_EntryActived), const_cast<char*>(opt_name));
|
2015-05-07 19:47:33 +00:00
|
|
|
|
|
|
|
return entry;
|
2013-02-23 15:35:56 +00:00
|
|
|
}
|
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
void CB_ToggleCheckBox(GtkToggleButton *togglebutton, gpointer user_data)
|
|
|
|
{
|
2016-05-29 16:09:22 +00:00
|
|
|
char* opt = (char*)user_data;
|
|
|
|
theApp.SetConfig(opt, (int)gtk_toggle_button_get_active(togglebutton));
|
|
|
|
if (strcmp(opt, "UserHacks") == 0) {
|
|
|
|
gtk_widget_set_sensitive(s_hack_frame, gtk_toggle_button_get_active(togglebutton));
|
|
|
|
}
|
2015-05-07 18:32:46 +00:00
|
|
|
}
|
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* CreateCheckBox(const char* label, const char* opt_name)
|
2015-05-07 18:32:46 +00:00
|
|
|
{
|
|
|
|
GtkWidget* check = gtk_check_button_new_with_label(label);
|
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), theApp.GetConfigB(opt_name));
|
2015-05-07 18:32:46 +00:00
|
|
|
|
|
|
|
g_signal_connect(check, "toggled", G_CALLBACK(CB_ToggleCheckBox), const_cast<char*>(opt_name));
|
|
|
|
|
|
|
|
return check;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CB_SpinButton(GtkSpinButton *spin, gpointer user_data)
|
|
|
|
{
|
|
|
|
theApp.SetConfig((char*)user_data, (int)gtk_spin_button_get_value(spin));
|
|
|
|
}
|
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* CreateSpinButton(double min, double max, const char* opt_name)
|
2013-12-30 09:30:10 +00:00
|
|
|
{
|
2015-05-07 18:32:46 +00:00
|
|
|
GtkWidget* spin = gtk_spin_button_new_with_range(min, max, 1);
|
2013-12-30 09:30:10 +00:00
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), theApp.GetConfigI(opt_name));
|
2013-12-30 09:30:10 +00:00
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
g_signal_connect(spin, "value-changed", G_CALLBACK(CB_SpinButton), const_cast<char*>(opt_name));
|
|
|
|
|
|
|
|
return spin;
|
2013-12-30 09:30:10 +00:00
|
|
|
}
|
|
|
|
|
2015-05-07 19:47:33 +00:00
|
|
|
void CB_RangeChanged(GtkRange* range, gpointer user_data)
|
|
|
|
{
|
|
|
|
theApp.SetConfig((char*)user_data, (int)gtk_range_get_value(range));
|
|
|
|
}
|
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* CreateScale(const char* opt_name)
|
2015-05-07 19:47:33 +00:00
|
|
|
{
|
2017-04-01 10:07:11 +00:00
|
|
|
#if GTK_CHECK_VERSION(3, 0, 0)
|
2017-01-10 20:47:33 +00:00
|
|
|
GtkWidget* scale = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 100, 10);
|
2017-04-01 10:07:11 +00:00
|
|
|
#else
|
|
|
|
GtkWidget* scale = gtk_hscale_new_with_range(0, 100, 10);
|
2015-05-07 19:47:33 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
gtk_scale_set_value_pos(GTK_SCALE(scale), GTK_POS_RIGHT);
|
2016-05-24 19:52:06 +00:00
|
|
|
gtk_range_set_value(GTK_RANGE(scale), theApp.GetConfigI(opt_name));
|
2015-05-07 19:47:33 +00:00
|
|
|
|
|
|
|
g_signal_connect(scale, "value-changed", G_CALLBACK(CB_RangeChanged), const_cast<char*>(opt_name));
|
|
|
|
|
|
|
|
return scale;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CB_PickFile(GtkFileChooserButton *chooser, gpointer user_data)
|
|
|
|
{
|
|
|
|
theApp.SetConfig((char*)user_data, gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser)));
|
|
|
|
}
|
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* CreateFileChooser(GtkFileChooserAction action, const char* label, const char* opt_name)
|
2015-05-07 19:47:33 +00:00
|
|
|
{
|
2015-05-18 17:57:21 +00:00
|
|
|
GtkWidget* chooser = gtk_file_chooser_button_new(label, action);
|
2015-05-07 19:47:33 +00:00
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(chooser), theApp.GetConfigS(opt_name).c_str());
|
2015-05-07 19:47:33 +00:00
|
|
|
|
|
|
|
g_signal_connect(chooser, "file-set", G_CALLBACK(CB_PickFile), const_cast<char*>(opt_name));
|
|
|
|
|
|
|
|
return chooser;
|
|
|
|
}
|
|
|
|
|
2015-05-03 12:23:50 +00:00
|
|
|
static int s_table_line = 0;
|
2017-04-23 08:50:03 +00:00
|
|
|
|
|
|
|
void AttachInTable(GtkWidget* table, GtkWidget *w, int pos, int pad = 0, int size = 1)
|
|
|
|
{
|
|
|
|
#if GTK3_GRID_API
|
2018-07-31 23:32:37 +00:00
|
|
|
gtk_widget_set_margin_start(w, pad);
|
|
|
|
gtk_widget_set_hexpand(w, true);
|
2017-04-23 08:50:03 +00:00
|
|
|
gtk_grid_attach(GTK_GRID(table), w, pos, s_table_line, size, 1);
|
|
|
|
#else
|
2015-11-28 12:22:38 +00:00
|
|
|
GtkAttachOptions opt = (GtkAttachOptions)(GTK_EXPAND | GTK_FILL); // default
|
2017-04-23 08:50:03 +00:00
|
|
|
gtk_table_attach(GTK_TABLE(table), w, pos, pos + size, s_table_line, s_table_line+1, opt, opt, pad, 0);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void InsertWidgetInTable(GtkWidget* table, GtkWidget *left, GtkWidget *right = NULL, GtkWidget *third = NULL)
|
|
|
|
{
|
2015-11-28 12:22:38 +00:00
|
|
|
guint l_xpad = GTK_IS_CHECK_BUTTON(left) ? 0 : 22;
|
2017-04-23 08:50:03 +00:00
|
|
|
|
2015-05-03 12:23:50 +00:00
|
|
|
if (!left) {
|
2017-04-23 08:50:03 +00:00
|
|
|
AttachInTable(table, right, 1);
|
2015-05-03 12:23:50 +00:00
|
|
|
} else if (!right) {
|
2017-04-23 08:50:03 +00:00
|
|
|
AttachInTable(table, left, 0, l_xpad);
|
2015-05-03 12:23:50 +00:00
|
|
|
} else if (right == left) {
|
2017-04-23 08:50:03 +00:00
|
|
|
AttachInTable(table, right, 0, 0, 2);
|
2015-05-03 12:23:50 +00:00
|
|
|
} else {
|
2017-04-23 08:50:03 +00:00
|
|
|
AttachInTable(table, left, 0, l_xpad);
|
|
|
|
AttachInTable(table, right, 1);
|
2015-05-03 12:23:50 +00:00
|
|
|
}
|
|
|
|
if (third) {
|
2017-04-23 08:50:03 +00:00
|
|
|
AttachInTable(table, third, 2);
|
2015-05-03 12:23:50 +00:00
|
|
|
}
|
2017-04-23 08:50:03 +00:00
|
|
|
|
2015-05-03 12:23:50 +00:00
|
|
|
s_table_line++;
|
|
|
|
}
|
2014-11-09 15:39:49 +00:00
|
|
|
|
2015-05-03 12:23:50 +00:00
|
|
|
GtkWidget* CreateTableInBox(GtkWidget* parent_box, const char* frame_title, int row, int col) {
|
2017-04-23 08:50:03 +00:00
|
|
|
#if GTK3_GRID_API
|
|
|
|
GtkWidget* table = gtk_grid_new();
|
2018-07-31 23:32:37 +00:00
|
|
|
gtk_widget_set_hexpand(table, true);
|
2017-04-23 08:50:03 +00:00
|
|
|
#else
|
2015-05-28 17:19:46 +00:00
|
|
|
GtkWidget* table = gtk_table_new(row, col, false);
|
2017-04-23 08:50:03 +00:00
|
|
|
#endif
|
|
|
|
GtkWidget* container = (frame_title) ? gtk_frame_new (frame_title) : CreateVbox();
|
2015-05-03 12:23:50 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(container), table);
|
|
|
|
gtk_container_add(GTK_CONTAINER(parent_box), container);
|
2013-02-23 15:35:56 +00:00
|
|
|
|
2015-05-03 12:23:50 +00:00
|
|
|
return table;
|
|
|
|
}
|
2014-02-01 11:11:14 +00:00
|
|
|
|
2015-05-07 18:55:24 +00:00
|
|
|
void populate_hw_table(GtkWidget* hw_table)
|
|
|
|
{
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* fsaa_label = left_label("Internal Resolution:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* fsaa_combo_box = CreateComboBoxFromVector(theApp.m_gs_upscale_multiplier, "upscale_multiplier");
|
2015-09-09 17:06:14 +00:00
|
|
|
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* af_label = left_label("Anisotropic Filtering:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* af_combo_box = CreateComboBoxFromVector(theApp.m_gs_max_anisotropy, "MaxAnisotropy");
|
2015-05-07 18:55:24 +00:00
|
|
|
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* crc_label = left_label("Automatic CRC level:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* crc_combo_box = CreateComboBoxFromVector(theApp.m_gs_crc_level, "crc_hack_level");
|
2015-06-04 16:52:58 +00:00
|
|
|
|
2015-05-07 18:55:24 +00:00
|
|
|
GtkWidget* paltex_check = CreateCheckBox("Allow 8 bits textures", "paltex");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* acc_date_check = CreateCheckBox("Accurate Date", "accurate_date");
|
|
|
|
GtkWidget* large_fb_check = CreateCheckBox("Large Framebuffer", "large_framebuffer");
|
2015-05-16 13:22:20 +00:00
|
|
|
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* acc_bld_label = left_label("Blending Unit Accuracy:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* acc_bld_combo_box = CreateComboBoxFromVector(theApp.m_gs_acc_blend_level, "accurate_blending_unit");
|
2015-07-19 07:34:06 +00:00
|
|
|
|
2016-05-29 16:09:22 +00:00
|
|
|
GtkWidget* hack_enable_check = CreateCheckBox("Enable User Hacks", "UserHacks");
|
|
|
|
|
2016-11-06 15:39:40 +00:00
|
|
|
GtkWidget* mipmap_label = left_label("Mipmapping (Insert):");
|
|
|
|
GtkWidget* mipmap_combo_box = CreateComboBoxFromVector(theApp.m_gs_hw_mipmapping, "mipmap_hw");
|
|
|
|
|
2015-05-11 12:12:41 +00:00
|
|
|
// Some helper string
|
2015-07-19 21:27:45 +00:00
|
|
|
AddTooltip(paltex_check, IDC_PALTEX);
|
|
|
|
AddTooltip(acc_date_check, IDC_ACCURATE_DATE);
|
2016-05-23 17:38:23 +00:00
|
|
|
AddTooltip(large_fb_check, IDC_LARGE_FB);
|
2015-07-19 21:27:45 +00:00
|
|
|
AddTooltip(crc_label, crc_combo_box, IDC_CRC_LEVEL);
|
2015-07-19 07:34:06 +00:00
|
|
|
AddTooltip(acc_bld_label, acc_bld_combo_box, IDC_ACCURATE_BLEND_UNIT);
|
gsdx: Add new tooltips and descriptions.
For Linux and Windows, add tooltip descriptions for AF, AA1, extra
rendering threads, Enable Shade Boost, FX Shader/External Shader, FXAA.
For Windows, also add Alpha Correction and Logarithmic Z tooltips.
For Linux, add software mipmap tooltip.
Thanks to tsunami2311, ssakash, gregory38 and whoever did the wiki for
helping with descriptions.
2015-08-26 22:22:36 +00:00
|
|
|
AddTooltip(af_label, af_combo_box, IDC_AFCOMBO);
|
2016-05-29 16:09:22 +00:00
|
|
|
gtk_widget_set_tooltip_text(hack_enable_check, "Enable the HW hack option panel");
|
2016-11-06 15:39:40 +00:00
|
|
|
AddTooltip(mipmap_label, IDC_MIPMAP_HW);
|
|
|
|
AddTooltip(mipmap_combo_box, IDC_MIPMAP_HW);
|
2015-05-11 12:12:41 +00:00
|
|
|
|
2015-05-07 18:55:24 +00:00
|
|
|
s_table_line = 0;
|
2016-04-10 11:22:55 +00:00
|
|
|
InsertWidgetInTable(hw_table , paltex_check , acc_date_check);
|
2016-05-29 16:09:22 +00:00
|
|
|
InsertWidgetInTable(hw_table , large_fb_check, hack_enable_check);
|
2016-04-10 11:22:55 +00:00
|
|
|
InsertWidgetInTable(hw_table , fsaa_label , fsaa_combo_box);
|
|
|
|
InsertWidgetInTable(hw_table , af_label , af_combo_box);
|
|
|
|
InsertWidgetInTable(hw_table , acc_bld_label , acc_bld_combo_box);
|
|
|
|
InsertWidgetInTable(hw_table , crc_label , crc_combo_box);
|
2016-11-06 15:39:40 +00:00
|
|
|
InsertWidgetInTable(hw_table , mipmap_label , mipmap_combo_box);
|
2015-05-07 18:55:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void populate_gl_table(GtkWidget* gl_table)
|
|
|
|
{
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* gl_gs_label = left_label("Geometry Shader:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* gl_gs_combo = CreateComboBoxFromVector(theApp.m_gs_gl_ext, "override_geometry_shader");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* gl_ils_label = left_label("Image Load Store:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* gl_ils_combo = CreateComboBoxFromVector(theApp.m_gs_gl_ext, "override_GL_ARB_shader_image_load_store");
|
2015-05-07 18:55:24 +00:00
|
|
|
|
2017-04-01 10:07:11 +00:00
|
|
|
AddTooltip(gl_gs_label, gl_gs_combo, IDC_GEOMETRY_SHADER_OVERRIDE);
|
|
|
|
AddTooltip(gl_ils_label, gl_ils_combo, IDC_IMAGE_LOAD_STORE);
|
|
|
|
|
2015-05-07 18:55:24 +00:00
|
|
|
s_table_line = 0;
|
|
|
|
InsertWidgetInTable(gl_table , gl_gs_label , gl_gs_combo);
|
|
|
|
InsertWidgetInTable(gl_table , gl_ils_label , gl_ils_combo);
|
|
|
|
}
|
|
|
|
|
|
|
|
void populate_sw_table(GtkWidget* sw_table)
|
|
|
|
{
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* threads_label = left_label("Extra rendering threads:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* threads_spin = CreateSpinButton(0, 32, "extrathreads");
|
2015-05-07 18:55:24 +00:00
|
|
|
|
|
|
|
GtkWidget* aa_check = CreateCheckBox("Edge anti-aliasing (AA1)", "aa1");
|
2016-11-06 15:39:40 +00:00
|
|
|
GtkWidget* mipmap_check = CreateCheckBox("Mipmapping", "mipmap");
|
2015-05-07 18:55:24 +00:00
|
|
|
|
gsdx: Add new tooltips and descriptions.
For Linux and Windows, add tooltip descriptions for AF, AA1, extra
rendering threads, Enable Shade Boost, FX Shader/External Shader, FXAA.
For Windows, also add Alpha Correction and Logarithmic Z tooltips.
For Linux, add software mipmap tooltip.
Thanks to tsunami2311, ssakash, gregory38 and whoever did the wiki for
helping with descriptions.
2015-08-26 22:22:36 +00:00
|
|
|
AddTooltip(aa_check, IDC_AA1);
|
2016-11-06 15:39:40 +00:00
|
|
|
AddTooltip(mipmap_check, IDC_MIPMAP_SW);
|
gsdx: Add new tooltips and descriptions.
For Linux and Windows, add tooltip descriptions for AF, AA1, extra
rendering threads, Enable Shade Boost, FX Shader/External Shader, FXAA.
For Windows, also add Alpha Correction and Logarithmic Z tooltips.
For Linux, add software mipmap tooltip.
Thanks to tsunami2311, ssakash, gregory38 and whoever did the wiki for
helping with descriptions.
2015-08-26 22:22:36 +00:00
|
|
|
AddTooltip(threads_label, threads_spin, IDC_SWTHREADS);
|
|
|
|
|
2015-05-07 18:55:24 +00:00
|
|
|
s_table_line = 0;
|
2016-11-06 15:39:40 +00:00
|
|
|
InsertWidgetInTable(sw_table , threads_label, threads_spin);
|
|
|
|
InsertWidgetInTable(sw_table , aa_check , mipmap_check);
|
2015-05-07 18:55:24 +00:00
|
|
|
}
|
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
void populate_shader_table(GtkWidget* shader_table)
|
2015-05-03 12:23:50 +00:00
|
|
|
{
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* shader = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_OPEN, "Select an external shader", "shaderfx_glsl");
|
|
|
|
GtkWidget* shader_conf = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_OPEN, "Then select a config", "shaderfx_conf");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* shader_label = left_label("External shader glsl");
|
|
|
|
GtkWidget* shader_conf_label = left_label("External shader conf");
|
2014-11-09 15:39:49 +00:00
|
|
|
|
2015-12-30 17:33:42 +00:00
|
|
|
GtkWidget* shadeboost_check = CreateCheckBox("Shade boost", "ShadeBoost");
|
2015-05-07 19:53:44 +00:00
|
|
|
GtkWidget* fxaa_check = CreateCheckBox("Fxaa shader", "fxaa");
|
|
|
|
GtkWidget* shaderfx_check = CreateCheckBox("External shader", "shaderfx");
|
2015-05-03 12:23:50 +00:00
|
|
|
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* tv_shader_label = left_label("TV shader:");
|
2015-11-20 13:59:24 +00:00
|
|
|
GtkWidget* tv_shader = CreateComboBoxFromVector(theApp.m_gs_tv_shaders, "TVShader");
|
|
|
|
|
2016-08-27 17:23:12 +00:00
|
|
|
GtkWidget* linear_check = CreateCheckBox("Texture Filtering of Display", "linear_present");
|
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
// Shadeboost scale
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* sb_brightness = CreateScale("ShadeBoost_Brightness");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* sb_brightness_label = left_label("Shade Boost Brightness:");
|
2015-05-03 12:23:50 +00:00
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* sb_contrast = CreateScale("ShadeBoost_Contrast");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* sb_contrast_label = left_label("Shade Boost Contrast:");
|
2015-05-03 12:23:50 +00:00
|
|
|
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* sb_saturation = CreateScale("ShadeBoost_Saturation");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* sb_saturation_label = left_label("Shade Boost Saturation:");
|
2015-05-03 12:23:50 +00:00
|
|
|
|
gsdx: Add new tooltips and descriptions.
For Linux and Windows, add tooltip descriptions for AF, AA1, extra
rendering threads, Enable Shade Boost, FX Shader/External Shader, FXAA.
For Windows, also add Alpha Correction and Logarithmic Z tooltips.
For Linux, add software mipmap tooltip.
Thanks to tsunami2311, ssakash, gregory38 and whoever did the wiki for
helping with descriptions.
2015-08-26 22:22:36 +00:00
|
|
|
AddTooltip(shadeboost_check, IDC_SHADEBOOST);
|
|
|
|
AddTooltip(shaderfx_check, IDC_SHADER_FX);
|
|
|
|
AddTooltip(fxaa_check, IDC_FXAA);
|
2016-08-27 17:23:12 +00:00
|
|
|
AddTooltip(linear_check, IDC_LINEAR_PRESENT);
|
gsdx: Add new tooltips and descriptions.
For Linux and Windows, add tooltip descriptions for AF, AA1, extra
rendering threads, Enable Shade Boost, FX Shader/External Shader, FXAA.
For Windows, also add Alpha Correction and Logarithmic Z tooltips.
For Linux, add software mipmap tooltip.
Thanks to tsunami2311, ssakash, gregory38 and whoever did the wiki for
helping with descriptions.
2015-08-26 22:22:36 +00:00
|
|
|
|
2015-05-03 12:23:50 +00:00
|
|
|
s_table_line = 0;
|
2016-08-27 17:23:12 +00:00
|
|
|
InsertWidgetInTable(shader_table , linear_check);
|
2015-05-07 19:53:44 +00:00
|
|
|
InsertWidgetInTable(shader_table , fxaa_check);
|
|
|
|
InsertWidgetInTable(shader_table , shadeboost_check);
|
|
|
|
InsertWidgetInTable(shader_table , sb_brightness_label , sb_brightness);
|
|
|
|
InsertWidgetInTable(shader_table , sb_contrast_label , sb_contrast);
|
|
|
|
InsertWidgetInTable(shader_table , sb_saturation_label , sb_saturation);
|
|
|
|
InsertWidgetInTable(shader_table , shaderfx_check);
|
|
|
|
InsertWidgetInTable(shader_table , shader_label , shader);
|
|
|
|
InsertWidgetInTable(shader_table , shader_conf_label , shader_conf);
|
2017-10-04 21:50:36 +00:00
|
|
|
InsertWidgetInTable(shader_table , tv_shader_label , tv_shader);
|
2015-05-07 19:53:44 +00:00
|
|
|
}
|
2014-11-09 15:39:49 +00:00
|
|
|
|
2018-08-02 19:55:14 +00:00
|
|
|
static GtkWidget* s_hack_skipdraw_offset_spin;
|
|
|
|
static GtkWidget* s_hack_skipdraw_spin;
|
|
|
|
|
|
|
|
static void CB_SkipdrawRange(GtkSpinButton*, gpointer)
|
|
|
|
{
|
|
|
|
int skipdraw_offset = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(s_hack_skipdraw_offset_spin));
|
|
|
|
int skipdraw = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(s_hack_skipdraw_spin));
|
|
|
|
|
|
|
|
bool skipdraw_offset_changed = skipdraw_offset != theApp.GetConfigI("UserHacks_SkipDraw_Offset");
|
|
|
|
bool skipdraw_changed = skipdraw != theApp.GetConfigI("UserHacks_SkipDraw");
|
|
|
|
|
|
|
|
if (skipdraw_offset == 0 && skipdraw_offset_changed || skipdraw == 0 && skipdraw_changed) {
|
|
|
|
skipdraw_offset = 0;
|
|
|
|
skipdraw = 0;
|
|
|
|
} else if (skipdraw_offset > skipdraw) {
|
|
|
|
if (skipdraw_offset_changed)
|
|
|
|
skipdraw = skipdraw_offset;
|
|
|
|
if (skipdraw_changed)
|
|
|
|
skipdraw_offset = skipdraw;
|
|
|
|
} else if (skipdraw > 0 && skipdraw_offset == 0) {
|
|
|
|
skipdraw_offset = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
theApp.SetConfig("UserHacks_SkipDraw_Offset", skipdraw_offset);
|
|
|
|
theApp.SetConfig("UserHacks_SkipDraw", skipdraw);
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(s_hack_skipdraw_offset_spin), skipdraw_offset);
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(s_hack_skipdraw_spin), skipdraw);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void CreateSkipdrawSpinButtons(double min, double max)
|
|
|
|
{
|
|
|
|
s_hack_skipdraw_offset_spin = gtk_spin_button_new_with_range(min, max, 1);
|
|
|
|
s_hack_skipdraw_spin = gtk_spin_button_new_with_range(min, max, 1);
|
|
|
|
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(s_hack_skipdraw_offset_spin), theApp.GetConfigI("UserHacks_SkipDraw_Offset"));
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(s_hack_skipdraw_spin), theApp.GetConfigI("UserHacks_SkipDraw"));
|
|
|
|
|
|
|
|
g_signal_connect(s_hack_skipdraw_offset_spin, "value-changed", G_CALLBACK(CB_SkipdrawRange), nullptr);
|
|
|
|
g_signal_connect(s_hack_skipdraw_spin, "value-changed", G_CALLBACK(CB_SkipdrawRange), nullptr);
|
|
|
|
}
|
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
void populate_hack_table(GtkWidget* hack_table)
|
|
|
|
{
|
2017-11-05 01:19:13 +00:00
|
|
|
GtkWidget* hack_offset_label = left_label("Half-pixel Offset:");
|
2017-02-26 15:06:24 +00:00
|
|
|
GtkWidget* hack_offset_box = CreateComboBoxFromVector(theApp.m_gs_offset_hack, "UserHacks_HalfPixelOffset");
|
2018-08-02 19:55:14 +00:00
|
|
|
GtkWidget* hack_skipdraw_label = left_label("Skipdraw Range:");
|
|
|
|
CreateSkipdrawSpinButtons(0, 10000);
|
2015-08-11 22:27:36 +00:00
|
|
|
GtkWidget* hack_wild_check = CreateCheckBox("Wild Arms Hack", "UserHacks_WildHack");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* hack_tco_label = left_label("Texture Offset: 0x");
|
2015-05-07 19:47:33 +00:00
|
|
|
GtkWidget* hack_tco_entry = CreateTextBox("UserHacks_TCOffset");
|
2017-11-05 01:19:13 +00:00
|
|
|
GtkWidget* align_sprite_check = CreateCheckBox("Align Sprite", "UserHacks_align_sprite_X");
|
|
|
|
GtkWidget* preload_gs_check = CreateCheckBox("Preload Frame Data", "preload_frame_with_gs_data");
|
2016-03-20 12:58:55 +00:00
|
|
|
GtkWidget* hack_fast_inv = CreateCheckBox("Fast Texture Invalidation", "UserHacks_DisablePartialInvalidation");
|
2016-04-10 11:22:55 +00:00
|
|
|
GtkWidget* hack_depth_check = CreateCheckBox("Disable Depth Emulation", "UserHacks_DisableDepthSupport");
|
2017-10-04 21:50:36 +00:00
|
|
|
GtkWidget* hack_cpu_fbcv = CreateCheckBox("Frame Buffer Conversion", "UserHacks_CPU_FB_Conversion");
|
2017-11-05 01:19:13 +00:00
|
|
|
GtkWidget* hack_auto_flush = CreateCheckBox("Auto Flush", "UserHacks_AutoFlush");
|
|
|
|
GtkWidget* hack_unscale_prim = CreateCheckBox("Unscale Point and Line", "UserHacks_unscale_point_line");
|
2017-04-01 10:07:11 +00:00
|
|
|
GtkWidget* hack_merge_sprite = CreateCheckBox("Merge Sprite", "UserHacks_merge_pp_sprite");
|
|
|
|
GtkWidget* hack_wrap_mem = CreateCheckBox("Memory Wrapping", "wrap_gs_mem");
|
2015-05-07 20:12:25 +00:00
|
|
|
|
|
|
|
GtkWidget* hack_sprite_box = CreateComboBoxFromVector(theApp.m_gs_hack, "UserHacks_SpriteHack");
|
2017-11-05 01:19:13 +00:00
|
|
|
GtkWidget* hack_sprite_label = left_label("Sprite:");
|
2015-05-07 20:12:25 +00:00
|
|
|
GtkWidget* stretch_hack_box = CreateComboBoxFromVector(theApp.m_gs_hack, "UserHacks_round_sprite_offset");
|
2017-11-05 01:19:13 +00:00
|
|
|
GtkWidget* stretch_hack_label = left_label("Round Sprite:");
|
2017-02-24 16:55:39 +00:00
|
|
|
GtkWidget* trilinear_box = CreateComboBoxFromVector(theApp.m_gs_trifilter, "UserHacks_TriFilter");
|
|
|
|
GtkWidget* trilinear_label = left_label("Trilinear Filtering:");
|
2013-02-23 15:35:56 +00:00
|
|
|
|
2015-04-16 17:21:32 +00:00
|
|
|
// Reuse windows helper string :)
|
2017-02-26 15:06:24 +00:00
|
|
|
AddTooltip(hack_offset_label, IDC_OFFSETHACK);
|
|
|
|
AddTooltip(hack_offset_box, IDC_OFFSETHACK);
|
2015-07-19 21:27:45 +00:00
|
|
|
AddTooltip(hack_skipdraw_label, IDC_SKIPDRAWHACK);
|
2018-08-02 19:55:14 +00:00
|
|
|
AddTooltip(s_hack_skipdraw_offset_spin, IDC_SKIPDRAWHACK);
|
|
|
|
AddTooltip(s_hack_skipdraw_spin, IDC_SKIPDRAWHACK);
|
2015-07-19 21:27:45 +00:00
|
|
|
AddTooltip(hack_wild_check, IDC_WILDHACK);
|
|
|
|
AddTooltip(hack_sprite_label, hack_sprite_box, IDC_SPRITEHACK);
|
|
|
|
AddTooltip(hack_tco_label, IDC_TCOFFSETX);
|
|
|
|
AddTooltip(hack_tco_entry, IDC_TCOFFSETX);
|
|
|
|
AddTooltip(align_sprite_check, IDC_ALIGN_SPRITE);
|
|
|
|
AddTooltip(stretch_hack_label, stretch_hack_box, IDC_ROUND_SPRITE);
|
2015-11-12 20:00:10 +00:00
|
|
|
AddTooltip(preload_gs_check, IDC_PRELOAD_GS);
|
2016-03-20 12:58:55 +00:00
|
|
|
AddTooltip(hack_fast_inv, IDC_FAST_TC_INV);
|
2016-04-10 11:22:55 +00:00
|
|
|
AddTooltip(hack_depth_check, IDC_TC_DEPTH);
|
2017-10-04 21:50:36 +00:00
|
|
|
AddTooltip(hack_cpu_fbcv, IDC_CPU_FB_CONVERSION);
|
2016-09-08 15:34:28 +00:00
|
|
|
AddTooltip(hack_auto_flush, IDC_AUTO_FLUSH);
|
2016-09-23 17:11:23 +00:00
|
|
|
AddTooltip(hack_unscale_prim, IDC_UNSCALE_POINT_LINE);
|
2017-04-01 10:07:11 +00:00
|
|
|
AddTooltip(hack_merge_sprite, IDC_MERGE_PP_SPRITE);
|
|
|
|
AddTooltip(hack_wrap_mem, IDC_MEMORY_WRAPPING);
|
2017-02-24 16:55:39 +00:00
|
|
|
AddTooltip(trilinear_box, IDC_TRI_FILTER);
|
|
|
|
AddTooltip(trilinear_label, IDC_TRI_FILTER);
|
2015-04-16 17:21:32 +00:00
|
|
|
|
|
|
|
|
2015-05-03 12:23:50 +00:00
|
|
|
s_table_line = 0;
|
2017-11-05 01:19:13 +00:00
|
|
|
//Hacks
|
|
|
|
// Column one and two HW Hacks
|
|
|
|
InsertWidgetInTable(hack_table , align_sprite_check , hack_wrap_mem);
|
|
|
|
InsertWidgetInTable(hack_table , hack_auto_flush , hack_merge_sprite);
|
2016-10-16 13:16:28 +00:00
|
|
|
InsertWidgetInTable(hack_table , hack_depth_check , preload_gs_check);
|
2017-11-05 01:19:13 +00:00
|
|
|
InsertWidgetInTable(hack_table , hack_fast_inv , hack_unscale_prim);
|
|
|
|
InsertWidgetInTable(hack_table , hack_cpu_fbcv , hack_wild_check);
|
|
|
|
// Other upscaling hacks
|
|
|
|
InsertWidgetInTable(hack_table , trilinear_label , trilinear_box);
|
2017-02-26 15:06:24 +00:00
|
|
|
InsertWidgetInTable(hack_table , hack_offset_label , hack_offset_box);
|
2015-05-07 20:12:25 +00:00
|
|
|
InsertWidgetInTable(hack_table , hack_sprite_label , hack_sprite_box );
|
|
|
|
InsertWidgetInTable(hack_table , stretch_hack_label , stretch_hack_box );
|
2018-08-02 19:55:14 +00:00
|
|
|
InsertWidgetInTable(hack_table , hack_skipdraw_label , s_hack_skipdraw_offset_spin, s_hack_skipdraw_spin);
|
2015-05-03 12:23:50 +00:00
|
|
|
InsertWidgetInTable(hack_table , hack_tco_label , hack_tco_entry);
|
2015-05-07 19:53:44 +00:00
|
|
|
}
|
2015-05-03 12:23:50 +00:00
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
void populate_main_table(GtkWidget* main_table)
|
|
|
|
{
|
2017-10-04 21:50:36 +00:00
|
|
|
GtkWidget* render_label = left_label("Renderer:");
|
|
|
|
GtkWidget* render_combo_box = CreateComboBoxFromVector(theApp.m_gs_renderers, "Renderer");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* interlace_label = left_label("Interlacing (F5):");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* interlace_combo_box = CreateComboBoxFromVector(theApp.m_gs_interlace, "interlace");
|
2017-10-04 21:50:36 +00:00
|
|
|
GtkWidget* filter_label = left_label("Texture Filtering:");
|
|
|
|
GtkWidget* filter_combo_box = CreateComboBoxFromVector(theApp.m_gs_bifilter, "filter");
|
2016-10-14 17:22:38 +00:00
|
|
|
|
2017-02-24 16:55:39 +00:00
|
|
|
AddTooltip(filter_label, filter_combo_box, IDC_FILTER);
|
2015-05-03 12:23:50 +00:00
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
s_table_line = 0;
|
|
|
|
InsertWidgetInTable(main_table, render_label, render_combo_box);
|
|
|
|
InsertWidgetInTable(main_table, interlace_label, interlace_combo_box);
|
2017-10-04 21:50:36 +00:00
|
|
|
InsertWidgetInTable(main_table, filter_label, filter_combo_box);
|
2015-05-07 19:53:44 +00:00
|
|
|
}
|
2012-04-28 09:19:42 +00:00
|
|
|
|
2015-05-07 21:06:43 +00:00
|
|
|
void populate_debug_table(GtkWidget* debug_table)
|
|
|
|
{
|
|
|
|
GtkWidget* glsl_debug_check = CreateCheckBox("GLSL compilation", "debug_glsl_shader");
|
|
|
|
GtkWidget* gl_debug_check = CreateCheckBox("Print GL error", "debug_opengl");
|
|
|
|
GtkWidget* gs_dump_check = CreateCheckBox("Dump GS data", "dump");
|
|
|
|
GtkWidget* gs_save_check = CreateCheckBox("Save RT", "save");
|
2015-05-31 15:38:52 +00:00
|
|
|
GtkWidget* gs_savef_check = CreateCheckBox("Save Frame", "savef");
|
2015-05-07 21:06:43 +00:00
|
|
|
GtkWidget* gs_savet_check = CreateCheckBox("Save Texture", "savet");
|
|
|
|
GtkWidget* gs_savez_check = CreateCheckBox("Save Depth", "savez");
|
|
|
|
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* gs_saven_label = left_label("Start of Dump");
|
2015-05-07 21:06:43 +00:00
|
|
|
GtkWidget* gs_saven_spin = CreateSpinButton(0, pow(10, 9), "saven");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* gs_savel_label = left_label("Length of Dump");
|
2015-05-07 21:06:43 +00:00
|
|
|
GtkWidget* gs_savel_spin = CreateSpinButton(0, pow(10, 5), "savel");
|
|
|
|
|
|
|
|
s_table_line = 0;
|
|
|
|
InsertWidgetInTable(debug_table, gl_debug_check, glsl_debug_check);
|
|
|
|
InsertWidgetInTable(debug_table, gs_dump_check);
|
2015-05-31 15:38:52 +00:00
|
|
|
InsertWidgetInTable(debug_table, gs_save_check, gs_savef_check);
|
|
|
|
InsertWidgetInTable(debug_table, gs_savet_check, gs_savez_check);
|
2015-05-07 21:06:43 +00:00
|
|
|
InsertWidgetInTable(debug_table, gs_saven_label, gs_saven_spin);
|
|
|
|
InsertWidgetInTable(debug_table, gs_savel_label, gs_savel_spin);
|
|
|
|
}
|
|
|
|
|
2015-05-18 17:57:21 +00:00
|
|
|
void populate_record_table(GtkWidget* record_table)
|
|
|
|
{
|
2015-05-19 09:53:56 +00:00
|
|
|
GtkWidget* capture_check = CreateCheckBox("Enable Recording (with F12)", "capture_enabled");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* resxy_label = left_label("Resolution:");
|
2016-05-26 16:43:11 +00:00
|
|
|
GtkWidget* resx_spin = CreateSpinButton(256, 8192, "CaptureWidth");
|
|
|
|
GtkWidget* resy_spin = CreateSpinButton(256, 8192, "CaptureHeight");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* threads_label = left_label("Saving Threads:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* threads_spin = CreateSpinButton(1, 32, "capture_threads");
|
2015-11-20 16:35:18 +00:00
|
|
|
GtkWidget* out_dir_label = left_label("Output Directory:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* out_dir = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, "Select a directory", "capture_out_dir");
|
2016-03-21 18:03:23 +00:00
|
|
|
GtkWidget* png_label = left_label("PNG Compression Level:");
|
2016-05-24 19:52:06 +00:00
|
|
|
GtkWidget* png_level = CreateSpinButton(1, 9, "png_compression_level");
|
2015-05-18 17:57:21 +00:00
|
|
|
|
2015-05-19 09:53:56 +00:00
|
|
|
InsertWidgetInTable(record_table , capture_check);
|
2015-05-18 17:57:21 +00:00
|
|
|
InsertWidgetInTable(record_table , resxy_label , resx_spin , resy_spin);
|
|
|
|
InsertWidgetInTable(record_table , threads_label , threads_spin);
|
2016-03-21 18:03:23 +00:00
|
|
|
InsertWidgetInTable(record_table , png_label , png_level);
|
2015-05-18 17:57:21 +00:00
|
|
|
InsertWidgetInTable(record_table , out_dir_label , out_dir);
|
|
|
|
}
|
|
|
|
|
2016-09-18 20:42:36 +00:00
|
|
|
void populate_osd_table(GtkWidget* osd_table)
|
|
|
|
{
|
|
|
|
GtkWidget* fontname_label = left_label("Font:");
|
|
|
|
GtkWidget* fontname_file = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_OPEN, "Select a font", "osd_fontname");
|
|
|
|
GtkWidget* fontsize_label = left_label("Size:");
|
|
|
|
GtkWidget* fontsize_text = CreateSpinButton(1, 100, "osd_fontsize");
|
|
|
|
GtkWidget* transparency_label = left_label("Transparency:");
|
|
|
|
GtkWidget* transparency_slide = CreateScale("osd_transparency");
|
|
|
|
GtkWidget* log_check = CreateCheckBox("Enable Log", "osd_log_enabled");
|
|
|
|
GtkWidget* log_speed_label = left_label("Speed:");
|
|
|
|
GtkWidget* log_speed_text = CreateSpinButton(2, 10, "osd_log_speed");
|
2017-01-10 20:47:33 +00:00
|
|
|
GtkWidget* max_messages_label = left_label("Maximum Onscreen Log Messages:");
|
|
|
|
GtkWidget* max_messages_spin = CreateSpinButton(1, 20, "osd_max_log_messages");
|
2016-09-18 20:42:36 +00:00
|
|
|
GtkWidget* monitor_check = CreateCheckBox("Enable Monitor", "osd_monitor_enabled");
|
|
|
|
GtkWidget* indicator_check = CreateCheckBox("Enable Indicator", "osd_indicator_enabled");
|
|
|
|
|
2017-01-06 15:40:31 +00:00
|
|
|
AddTooltip(log_check, IDC_OSD_LOG);
|
|
|
|
AddTooltip(monitor_check, IDC_OSD_MONITOR);
|
2017-01-10 20:47:33 +00:00
|
|
|
AddTooltip(max_messages_label, max_messages_spin, IDC_OSD_MAX_LOG);
|
2017-01-06 15:40:31 +00:00
|
|
|
|
2016-09-18 20:42:36 +00:00
|
|
|
InsertWidgetInTable(osd_table , fontname_label , fontname_file);
|
|
|
|
InsertWidgetInTable(osd_table , fontsize_label , fontsize_text);
|
|
|
|
InsertWidgetInTable(osd_table , transparency_label , transparency_slide);
|
|
|
|
InsertWidgetInTable(osd_table , log_check);
|
|
|
|
InsertWidgetInTable(osd_table , log_speed_label, log_speed_text);
|
2017-01-10 20:47:33 +00:00
|
|
|
InsertWidgetInTable(osd_table , max_messages_label, max_messages_spin);
|
2017-01-11 17:32:02 +00:00
|
|
|
InsertWidgetInTable(osd_table , monitor_check, indicator_check);
|
2016-09-18 20:42:36 +00:00
|
|
|
}
|
|
|
|
|
2017-03-31 21:29:59 +00:00
|
|
|
GtkWidget* ScrollMe(GtkWidget* w)
|
|
|
|
{
|
|
|
|
// the scrolled window add an ugly outline/border even when the scroll bar is off.
|
|
|
|
if (BigEnough())
|
|
|
|
return w;
|
|
|
|
|
|
|
|
GtkWidget* scrollbar = gtk_scrolled_window_new(NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrollbar), GTK_SHADOW_NONE);
|
|
|
|
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollbar), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
2017-04-01 10:07:11 +00:00
|
|
|
#if GTK_CHECK_VERSION(3, 22, 0)
|
|
|
|
gtk_scrolled_window_set_propagate_natural_height(GTK_SCROLLED_WINDOW(scrollbar), true);
|
|
|
|
#endif
|
2017-03-31 21:29:59 +00:00
|
|
|
|
2017-04-23 08:50:03 +00:00
|
|
|
#if GTK_CHECK_VERSION(3, 8, 0)
|
|
|
|
gtk_container_add(GTK_CONTAINER(scrollbar), w);
|
|
|
|
#else
|
2017-03-31 21:29:59 +00:00
|
|
|
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrollbar), w);
|
2017-04-23 08:50:03 +00:00
|
|
|
#endif
|
2017-03-31 21:29:59 +00:00
|
|
|
|
|
|
|
return scrollbar;
|
|
|
|
}
|
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
bool RunLinuxDialog()
|
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
|
|
|
int return_value;
|
2012-04-28 09:19:42 +00:00
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
/* Create the widgets */
|
|
|
|
dialog = gtk_dialog_new_with_buttons (
|
|
|
|
"GSdx Config",
|
|
|
|
NULL, /* parent window*/
|
|
|
|
(GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
|
|
|
|
"OK", GTK_RESPONSE_ACCEPT,
|
|
|
|
// "Cancel", GTK_RESPONSE_REJECT, // Drop because it is too annoying to support call back this way
|
|
|
|
NULL);
|
2012-04-28 09:19:42 +00:00
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
// The main area for the whole dialog box.
|
2017-04-23 08:50:03 +00:00
|
|
|
GtkWidget* main_box = CreateVbox();
|
|
|
|
GtkWidget* central_box = CreateVbox();
|
|
|
|
GtkWidget* advanced_box = CreateVbox();
|
|
|
|
GtkWidget* debug_box = CreateVbox();
|
|
|
|
GtkWidget* osd_box = CreateVbox();
|
2014-11-09 15:39:49 +00:00
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
// Grab a logo, to make things look nice.
|
2017-03-31 21:29:59 +00:00
|
|
|
if (BigEnough()) {
|
|
|
|
GResource * resources = GSdx_res_get_resource();
|
|
|
|
GInputStream * ogl_stream=g_resource_open_stream(resources,"/GSdx/res/logo-ogl.bmp",G_RESOURCE_LOOKUP_FLAGS_NONE,NULL);
|
|
|
|
GdkPixbuf * ogl_logo = gdk_pixbuf_new_from_stream(ogl_stream,NULL,NULL);
|
|
|
|
g_object_unref(ogl_stream);
|
|
|
|
GtkWidget* logo_image = gtk_image_new_from_pixbuf(ogl_logo);
|
|
|
|
gtk_box_pack_start(GTK_BOX(main_box), logo_image, true, true, 0);
|
|
|
|
}
|
2013-12-30 09:30:10 +00:00
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
GtkWidget* main_table = CreateTableInBox(main_box , NULL , 2 , 2);
|
|
|
|
|
2015-09-09 17:06:14 +00:00
|
|
|
GtkWidget* hw_table = CreateTableInBox(central_box , "Hardware Mode Settings" , 7 , 2);
|
2015-11-28 12:22:38 +00:00
|
|
|
GtkWidget* sw_table = CreateTableInBox(central_box , "Software Mode Settings" , 2 , 2);
|
2015-05-07 19:53:44 +00:00
|
|
|
|
2016-01-31 16:47:56 +00:00
|
|
|
GtkWidget* hack_table = CreateTableInBox(advanced_box, "Hacks" , 7 , 2);
|
|
|
|
GtkWidget* gl_table = CreateTableInBox(advanced_box, "OpenGL Very Advanced Custom Settings" , 6 , 2);
|
2015-05-07 19:53:44 +00:00
|
|
|
|
2015-11-28 12:22:38 +00:00
|
|
|
GtkWidget* record_table = CreateTableInBox(debug_box , "Recording Settings" , 4 , 3);
|
|
|
|
GtkWidget* debug_table = CreateTableInBox(debug_box , "OpenGL / GSdx Debug Settings" , 6 , 3);
|
2015-05-07 21:06:43 +00:00
|
|
|
|
2017-01-11 17:32:02 +00:00
|
|
|
GtkWidget* shader_table = CreateTableInBox(osd_box , "Custom Shader Settings" , 9 , 2);
|
|
|
|
GtkWidget* osd_table = CreateTableInBox(osd_box , "OSD" , 6 , 2);
|
2016-09-18 20:42:36 +00:00
|
|
|
|
2015-05-07 19:53:44 +00:00
|
|
|
// Populate all the tables
|
|
|
|
populate_main_table(main_table);
|
|
|
|
|
|
|
|
populate_shader_table(shader_table);
|
|
|
|
populate_hw_table(hw_table);
|
|
|
|
populate_sw_table(sw_table);
|
|
|
|
|
|
|
|
populate_hack_table(hack_table);
|
2015-05-07 18:55:24 +00:00
|
|
|
populate_gl_table(gl_table);
|
2014-02-01 11:11:14 +00:00
|
|
|
|
2015-05-07 21:06:43 +00:00
|
|
|
populate_debug_table(debug_table);
|
2015-05-18 17:57:21 +00:00
|
|
|
populate_record_table(record_table);
|
2015-05-07 21:06:43 +00:00
|
|
|
|
2016-09-18 20:42:36 +00:00
|
|
|
populate_osd_table(osd_table);
|
|
|
|
|
2014-02-01 11:11:14 +00:00
|
|
|
// Handle some nice tab
|
2015-05-03 12:23:50 +00:00
|
|
|
GtkWidget* notebook = gtk_notebook_new();
|
2018-08-07 22:56:26 +00:00
|
|
|
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), ScrollMe(central_box), gtk_label_new("Renderer Settings"));
|
|
|
|
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), ScrollMe(advanced_box), gtk_label_new("Advanced Settings"));
|
|
|
|
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), ScrollMe(debug_box), gtk_label_new("Debug/Recording"));
|
2017-03-31 21:29:59 +00:00
|
|
|
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), ScrollMe(osd_box), gtk_label_new("Post-Processing/OSD"));
|
2014-11-09 15:39:49 +00:00
|
|
|
|
2012-01-08 01:18:23 +00:00
|
|
|
// Put everything in the big box.
|
2014-02-01 11:11:14 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(main_box), notebook);
|
|
|
|
|
2016-05-29 16:09:22 +00:00
|
|
|
// Enable/disable hack frame based on enable option
|
|
|
|
s_hack_frame = hack_table;
|
|
|
|
gtk_widget_set_sensitive(s_hack_frame, theApp.GetConfigB("UserHacks"));
|
|
|
|
|
2012-01-08 01:18:23 +00:00
|
|
|
// Put the box in the dialog and show it to the world.
|
|
|
|
gtk_container_add (GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_box);
|
2011-02-22 23:39:02 +00:00
|
|
|
gtk_widget_show_all (dialog);
|
|
|
|
return_value = gtk_dialog_run (GTK_DIALOG (dialog));
|
|
|
|
|
2015-05-07 18:32:46 +00:00
|
|
|
// Compatibility & not supported option
|
2016-05-24 19:52:06 +00:00
|
|
|
int mode_width = theApp.GetConfigI("ModeWidth");
|
|
|
|
int mode_height = theApp.GetConfigI("ModeHeight");
|
2015-05-07 18:32:46 +00:00
|
|
|
theApp.SetConfig("ModeHeight", mode_height);
|
|
|
|
theApp.SetConfig("ModeWidth", mode_width);
|
|
|
|
theApp.SetConfig("msaa", 0);
|
|
|
|
theApp.SetConfig("windowed", 1);
|
2014-11-09 15:39:49 +00:00
|
|
|
|
2011-02-22 23:39:02 +00:00
|
|
|
gtk_widget_destroy (dialog);
|
|
|
|
|
2015-05-07 19:47:33 +00:00
|
|
|
return (return_value == GTK_RESPONSE_ACCEPT);
|
2011-02-20 01:57:43 +00:00
|
|
|
}
|