mirror of https://github.com/snes9xgit/snes9x.git
GTK+: Use std::string for some config options.
This commit is contained in:
parent
fcdead0028
commit
e632740be3
|
@ -107,17 +107,17 @@ int Snes9xConfig::load_defaults ()
|
|||
sound_playback_rate = 5;
|
||||
sound_input_rate = 31950;
|
||||
auto_input_rate = true;
|
||||
last_directory[0] = '\0';
|
||||
last_shader_directory[0] = '\0';
|
||||
last_directory.clear ();
|
||||
last_shader_directory.clear ();
|
||||
window_width = -1;
|
||||
window_height = -1;
|
||||
preferences_width = -1;
|
||||
preferences_height = -1;
|
||||
sram_directory[0] = '\0';
|
||||
export_directory[0] = '\0';
|
||||
savestate_directory[0] = '\0';
|
||||
cheat_directory[0] = '\0';
|
||||
patch_directory[0] = '\0';
|
||||
sram_directory.clear ();
|
||||
export_directory.clear ();
|
||||
savestate_directory.clear ();
|
||||
cheat_directory.clear ();
|
||||
patch_directory.clear ();
|
||||
screensaver_needs_reset = false;
|
||||
ntsc_setup = snes_ntsc_composite;
|
||||
ntsc_scanline_intensity = 1;
|
||||
|
@ -130,8 +130,8 @@ int Snes9xConfig::load_defaults ()
|
|||
netplay_send_rom = false;
|
||||
netplay_default_port = 6096;
|
||||
netplay_max_frame_loss = 10;
|
||||
netplay_last_rom [0] = '\0';
|
||||
netplay_last_host [0] = '\0';
|
||||
netplay_last_rom.clear ();
|
||||
netplay_last_host.clear ();
|
||||
netplay_last_port = 6096;
|
||||
modal_dialogs = true;
|
||||
current_save_slot = 0;
|
||||
|
@ -147,7 +147,7 @@ int Snes9xConfig::load_defaults ()
|
|||
pbo_format = 0;
|
||||
npot_textures = false;
|
||||
use_shaders = false;
|
||||
shader_filename[0] = '\0';
|
||||
shader_filename.clear ();
|
||||
sync_every_frame = false;
|
||||
use_fences = false;
|
||||
#endif
|
||||
|
@ -421,7 +421,6 @@ int Snes9xConfig::load_config_file ()
|
|||
std::string path;
|
||||
ConfigFile cf;
|
||||
char key[PATH_MAX];
|
||||
char buffer[PATH_MAX];
|
||||
|
||||
load_defaults ();
|
||||
|
||||
|
@ -456,7 +455,7 @@ int Snes9xConfig::load_config_file ()
|
|||
#define inbool(key, var) { if (cf.Exists (key)) var = cf.GetBool (key); }
|
||||
#define inint(key, var) { if (cf.Exists(key)) var = cf.GetInt (key); }
|
||||
#define infloat(key, var) { if (cf.Exists(key)) var = atof (cf.GetString (key, none).c_str()); }
|
||||
#define instr(key, var) strcpy (var, cf.GetString (key, none).c_str())
|
||||
#define instr(key, var) var = cf.GetString (key, none);
|
||||
|
||||
#undef z
|
||||
#define z "Display::"
|
||||
|
@ -586,8 +585,8 @@ int Snes9xConfig::load_config_file ()
|
|||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
snprintf (buffer, PATH_MAX, z"ControllerPort%d", i);
|
||||
std::string tmp = cf.GetString (buffer, "");
|
||||
snprintf (key, PATH_MAX, z"ControllerPort%d", i);
|
||||
std::string tmp = cf.GetString (key, "");
|
||||
|
||||
if (tmp.find ("joypad") != std::string::npos)
|
||||
S9xSetController (i, CTL_JOYPAD, i, 0, 0, 0);
|
||||
|
@ -605,6 +604,8 @@ int Snes9xConfig::load_config_file ()
|
|||
|
||||
#undef z
|
||||
|
||||
std::string buffer;
|
||||
|
||||
for (int i = 0; i < NUM_JOYPADS; i++)
|
||||
{
|
||||
Binding *joypad = (Binding *) &pad[i];
|
||||
|
@ -613,7 +614,7 @@ int Snes9xConfig::load_config_file ()
|
|||
{
|
||||
snprintf (key, PATH_MAX, "Joypad %d::%s", i, b_links[j].snes9x_name);
|
||||
instr (key, buffer);
|
||||
joypad[j] = Binding (buffer);
|
||||
joypad[j] = Binding (buffer.c_str ());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -621,7 +622,7 @@ int Snes9xConfig::load_config_file ()
|
|||
{
|
||||
snprintf (key, PATH_MAX, "Shortcuts::%s", b_links[i].snes9x_name);
|
||||
instr (key, buffer);
|
||||
shortcut[i - NUM_JOYPAD_LINKS] = Binding (buffer);
|
||||
shortcut[i - NUM_JOYPAD_LINKS] = Binding (buffer.c_str ());
|
||||
}
|
||||
|
||||
/* Validation */
|
||||
|
|
|
@ -91,13 +91,13 @@ class Snes9xConfig
|
|||
|
||||
/* Data options */
|
||||
int save_sram_after_secs;
|
||||
char sram_directory [PATH_MAX];
|
||||
char savestate_directory [PATH_MAX];
|
||||
char cheat_directory [PATH_MAX];
|
||||
char patch_directory [PATH_MAX];
|
||||
char export_directory [PATH_MAX];
|
||||
char last_directory [PATH_MAX];
|
||||
char last_shader_directory [PATH_MAX];
|
||||
std::string sram_directory;
|
||||
std::string savestate_directory;
|
||||
std::string cheat_directory;
|
||||
std::string patch_directory;
|
||||
std::string export_directory;
|
||||
std::string last_directory;
|
||||
std::string last_shader_directory;
|
||||
|
||||
/* Controls */
|
||||
JoypadBinding pad[NUM_JOYPADS];
|
||||
|
@ -109,8 +109,8 @@ class Snes9xConfig
|
|||
bool netplay_send_rom;
|
||||
int netplay_default_port;
|
||||
int netplay_max_frame_loss;
|
||||
char netplay_last_rom [PATH_MAX];
|
||||
char netplay_last_host [PATH_MAX];
|
||||
std::string netplay_last_rom;
|
||||
std::string netplay_last_host;
|
||||
int netplay_last_port;
|
||||
bool netplay_activated;
|
||||
bool netplay_server_up;
|
||||
|
@ -148,7 +148,7 @@ class Snes9xConfig
|
|||
int pbo_format;
|
||||
bool npot_textures;
|
||||
bool use_shaders;
|
||||
char shader_filename[PATH_MAX];
|
||||
std::string shader_filename;
|
||||
bool sync_every_frame;
|
||||
bool use_fences;
|
||||
#endif
|
||||
|
|
|
@ -405,7 +405,7 @@ bool S9xOpenGLDisplayDriver::opengl_defaults()
|
|||
|
||||
if (config->use_shaders)
|
||||
{
|
||||
if (legacy || !load_shaders (config->shader_filename))
|
||||
if (legacy || !load_shaders (config->shader_filename.c_str ()))
|
||||
{
|
||||
config->use_shaders = false;
|
||||
}
|
||||
|
|
|
@ -144,24 +144,24 @@ S9xGetDirectory (enum s9x_getdirtype dirtype)
|
|||
break;
|
||||
|
||||
case SNAPSHOT_DIR:
|
||||
sprintf (path, "%s", gui_config->savestate_directory);
|
||||
sstrncpy (path, gui_config->savestate_directory.c_str (), PATH_MAX + 1);
|
||||
break;
|
||||
|
||||
case PATCH_DIR:
|
||||
sprintf (path, "%s", gui_config->patch_directory);
|
||||
sstrncpy (path, gui_config->patch_directory.c_str (), PATH_MAX + 1);
|
||||
break;
|
||||
|
||||
case CHEAT_DIR:
|
||||
sprintf (path, "%s", gui_config->cheat_directory);
|
||||
sstrncpy (path, gui_config->cheat_directory.c_str (), PATH_MAX + 1);
|
||||
break;
|
||||
|
||||
case SRAM_DIR:
|
||||
sprintf (path, "%s", gui_config->sram_directory);
|
||||
sstrncpy (path, gui_config->sram_directory.c_str (), PATH_MAX + 1);
|
||||
break;
|
||||
|
||||
case SCREENSHOT_DIR:
|
||||
case SPC_DIR:
|
||||
sprintf (path, "%s", gui_config->export_directory);
|
||||
sstrncpy (path, gui_config->export_directory.c_str (), PATH_MAX + 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -435,10 +435,10 @@ S9xOpenROMDialog ()
|
|||
gtk_file_filter_add_pattern (filter, "*");
|
||||
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
||||
|
||||
if (strcmp (gui_config->last_directory, ""))
|
||||
if (!gui_config->last_directory.empty ())
|
||||
{
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
|
||||
gui_config->last_directory);
|
||||
gui_config->last_directory.c_str ());
|
||||
}
|
||||
|
||||
result = gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
|
@ -453,7 +453,7 @@ S9xOpenROMDialog ()
|
|||
gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog));
|
||||
if (directory)
|
||||
{
|
||||
sstrncpy (gui_config->last_directory, directory, PATH_MAX);
|
||||
gui_config->last_directory = directory;
|
||||
g_free (directory);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,13 +42,13 @@ S9xNetplayConnect ()
|
|||
|
||||
uint32 flags = CPU.Flags;
|
||||
|
||||
if (*(gui_config->netplay_last_rom) &&
|
||||
!top_level->try_open_rom (gui_config->netplay_last_rom))
|
||||
if (!gui_config->netplay_last_rom.empty () &&
|
||||
!top_level->try_open_rom (gui_config->netplay_last_rom.c_str ()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!S9xNPConnectToServer (gui_config->netplay_last_host,
|
||||
if (!S9xNPConnectToServer (gui_config->netplay_last_host.c_str (),
|
||||
gui_config->netplay_last_port,
|
||||
Memory.ROMName))
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ S9xNetplayConnect ()
|
|||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Couldn't connect to server: %s:%d",
|
||||
gui_config->netplay_last_host,
|
||||
gui_config->netplay_last_host.c_str (),
|
||||
gui_config->netplay_last_port);
|
||||
gtk_window_set_title (GTK_WINDOW (msg), _("Connection Error"));
|
||||
|
||||
|
@ -68,7 +68,7 @@ S9xNetplayConnect ()
|
|||
gui_config->netplay_activated = true;
|
||||
|
||||
/* If no rom is specified, assume we'll get it from the server */
|
||||
if (*(gui_config->netplay_last_rom) == 0)
|
||||
if (gui_config->netplay_last_rom.empty ())
|
||||
{
|
||||
Settings.StopEmulation = false;
|
||||
S9xROMLoaded ();
|
||||
|
@ -135,8 +135,8 @@ S9xNetplayStartServer ()
|
|||
|
||||
flags = CPU.Flags;
|
||||
|
||||
if (*(gui_config->netplay_last_rom) == 0 ||
|
||||
!top_level->try_open_rom (gui_config->netplay_last_rom))
|
||||
if (gui_config->netplay_last_rom.empty () ||
|
||||
!top_level->try_open_rom (gui_config->netplay_last_rom.c_str ()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -80,8 +80,8 @@ Snes9xNetplayDialog::update_state ()
|
|||
void
|
||||
Snes9xNetplayDialog::settings_to_dialog ()
|
||||
{
|
||||
set_entry_text ("rom_image", config->netplay_last_rom);
|
||||
set_entry_text ("ip_entry", config->netplay_last_host);
|
||||
set_entry_text ("rom_image", config->netplay_last_rom.c_str ());
|
||||
set_entry_text ("ip_entry", config->netplay_last_host.c_str ());
|
||||
set_check ("sync_reset", config->netplay_sync_reset);
|
||||
set_check ("send_image", config->netplay_send_rom);
|
||||
set_spin ("port", config->netplay_last_port);
|
||||
|
@ -96,8 +96,8 @@ Snes9xNetplayDialog::settings_to_dialog ()
|
|||
void
|
||||
Snes9xNetplayDialog::settings_from_dialog ()
|
||||
{
|
||||
sstrncpy (config->netplay_last_rom, get_entry_text ("rom_image"), PATH_MAX);
|
||||
sstrncpy (config->netplay_last_host, get_entry_text ("ip_entry"), PATH_MAX);
|
||||
config->netplay_last_rom = get_entry_text ("rom_image");
|
||||
config->netplay_last_host = get_entry_text ("ip_entry");
|
||||
config->netplay_sync_reset = get_check ("sync_reset");
|
||||
config->netplay_send_rom = get_check ("send_image");
|
||||
config->netplay_last_port = get_spin ("port");
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "gtk_display.h"
|
||||
#include "gtk_binding.h"
|
||||
|
||||
#define SAME_GAME _("Same location as current game")
|
||||
#define SAME_AS_GAME _("Same location as current game")
|
||||
|
||||
gboolean
|
||||
snes9x_preferences_open (GtkWidget *widget,
|
||||
|
@ -194,7 +194,6 @@ event_shader_select (GtkButton *widget, gpointer data)
|
|||
#ifdef USE_OPENGL
|
||||
Snes9xPreferences *window = (Snes9xPreferences *) data;
|
||||
GtkWidget *dialog;
|
||||
char *filename = NULL;
|
||||
gint result;
|
||||
GtkEntry *entry;
|
||||
|
||||
|
@ -207,10 +206,10 @@ event_shader_select (GtkButton *widget, gpointer data)
|
|||
"gtk-open", GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
|
||||
if (strcmp (gui_config->last_shader_directory, ""))
|
||||
if (!gui_config->last_shader_directory.empty ())
|
||||
{
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
|
||||
gui_config->last_shader_directory);
|
||||
gui_config->last_shader_directory.c_str ());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -225,15 +224,16 @@ event_shader_select (GtkButton *widget, gpointer data)
|
|||
|
||||
if (result == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
|
||||
strcpy (gui_config->last_shader_directory,
|
||||
gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER (dialog)));
|
||||
char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
|
||||
char *folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog));
|
||||
|
||||
if (filename != NULL)
|
||||
{
|
||||
if (folder)
|
||||
gui_config->last_shader_directory = folder;
|
||||
if (filename)
|
||||
gtk_entry_set_text (entry, filename);
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
g_free (filename);
|
||||
g_free (folder);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
|
@ -246,7 +246,7 @@ event_game_data_clear (GtkEntry *entry,
|
|||
GdkEvent *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
gtk_entry_set_text (entry, SAME_GAME);
|
||||
gtk_entry_set_text (entry, SAME_AS_GAME);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -271,13 +271,13 @@ event_game_data_browse (GtkButton *widget, gpointer data)
|
|||
"gtk-open", GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
|
||||
if (strcmp (gui_config->last_directory, ""))
|
||||
if (!gui_config->last_directory.empty ())
|
||||
{
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
|
||||
gui_config->last_directory);
|
||||
gui_config->last_directory.c_str ());
|
||||
}
|
||||
|
||||
if (strcmp (gtk_entry_get_text (entry), SAME_GAME))
|
||||
if (strcmp (gtk_entry_get_text (entry), SAME_AS_GAME))
|
||||
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog),
|
||||
gtk_entry_get_text (entry));
|
||||
|
||||
|
@ -604,26 +604,26 @@ Snes9xPreferences::move_settings_to_dialog ()
|
|||
set_combo ("hires_effect", config->hires_effect);
|
||||
set_check ("maintain_aspect_ratio", config->maintain_aspect_ratio);
|
||||
set_combo ("aspect_ratio", config->aspect_ratio);
|
||||
if (config->sram_directory[0] == '\0')
|
||||
set_entry_text ("sram_directory", SAME_GAME);
|
||||
if (config->sram_directory.empty ())
|
||||
set_entry_text ("sram_directory", SAME_AS_GAME);
|
||||
else
|
||||
set_entry_text ("sram_directory", config->sram_directory);
|
||||
if (config->savestate_directory[0] == '\0')
|
||||
set_entry_text ("savestate_directory", SAME_GAME);
|
||||
set_entry_text ("sram_directory", config->sram_directory.c_str ());
|
||||
if (config->savestate_directory.empty ())
|
||||
set_entry_text ("savestate_directory", SAME_AS_GAME);
|
||||
else
|
||||
set_entry_text ("savestate_directory", config->savestate_directory);
|
||||
if (config->patch_directory[0] == '\0')
|
||||
set_entry_text ("patch_directory", SAME_GAME);
|
||||
set_entry_text ("savestate_directory", config->savestate_directory.c_str ());
|
||||
if (config->patch_directory.empty ())
|
||||
set_entry_text ("patch_directory", SAME_AS_GAME);
|
||||
else
|
||||
set_entry_text ("patch_directory", config->patch_directory);
|
||||
if (config->cheat_directory[0] == '\0')
|
||||
set_entry_text ("cheat_directory", SAME_GAME);
|
||||
set_entry_text ("patch_directory", config->patch_directory.c_str ());
|
||||
if (config->cheat_directory.empty ())
|
||||
set_entry_text ("cheat_directory", SAME_AS_GAME);
|
||||
else
|
||||
set_entry_text ("cheat_directory", config->cheat_directory);
|
||||
if (config->export_directory[0] == '\0')
|
||||
set_entry_text ("export_directory", SAME_GAME);
|
||||
set_entry_text ("cheat_directory", config->cheat_directory.c_str ());
|
||||
if (config->export_directory.empty ())
|
||||
set_entry_text ("export_directory", SAME_AS_GAME);
|
||||
else
|
||||
set_entry_text ("export_directory", config->export_directory);
|
||||
set_entry_text ("export_directory", config->export_directory.c_str ());
|
||||
|
||||
set_combo ("resolution_combo", config->xrr_index);
|
||||
set_combo ("scale_method_combo", config->scale_method);
|
||||
|
@ -713,7 +713,7 @@ Snes9xPreferences::move_settings_to_dialog ()
|
|||
set_combo ("pixel_format", config->pbo_format == 16 ? 0 : 1);
|
||||
set_check ("npot_textures", config->npot_textures);
|
||||
set_check ("use_shaders", config->use_shaders);
|
||||
set_entry_text ("fragment_shader", config->shader_filename);
|
||||
set_entry_text ("fragment_shader", config->shader_filename.c_str ());
|
||||
#endif
|
||||
set_spin ("joystick_threshold", config->joystick_threshold);
|
||||
|
||||
|
@ -868,30 +868,28 @@ Snes9xPreferences::get_settings_from_dialog ()
|
|||
config->sync_every_frame = get_check ("sync_every_frame");
|
||||
config->use_fences = get_check ("use_fences");
|
||||
|
||||
sstrncpy (config->shader_filename, get_entry_text ("fragment_shader"), PATH_MAX);
|
||||
config->shader_filename = get_entry_text ("fragment_shader");
|
||||
|
||||
config->pbo_format = pbo_format;
|
||||
#endif
|
||||
char safety_sram_directory [PATH_MAX];
|
||||
|
||||
sstrncpy (safety_sram_directory, get_entry_text ("sram_directory"), PATH_MAX);
|
||||
sstrncpy (config->savestate_directory, get_entry_text ("savestate_directory"), PATH_MAX);
|
||||
sstrncpy (config->patch_directory, get_entry_text ("patch_directory"), PATH_MAX);
|
||||
sstrncpy (config->cheat_directory, get_entry_text ("cheat_directory"), PATH_MAX);
|
||||
sstrncpy (config->export_directory, get_entry_text ("export_directory"), PATH_MAX);
|
||||
std::string new_sram_directory = get_entry_text ("sram_directory");
|
||||
config->savestate_directory = get_entry_text ("savestate_directory");
|
||||
config->patch_directory = get_entry_text ("patch_directory");
|
||||
config->cheat_directory = get_entry_text ("cheat_directory");
|
||||
config->export_directory = get_entry_text ("export_directory");
|
||||
|
||||
if (!strcmp (safety_sram_directory, SAME_GAME))
|
||||
safety_sram_directory[0] = '\0';
|
||||
if (!strcmp (config->savestate_directory, SAME_GAME))
|
||||
config->savestate_directory[0] = '\0';
|
||||
if (!strcmp (config->patch_directory, SAME_GAME))
|
||||
config->patch_directory[0] = '\0';
|
||||
if (!strcmp (config->cheat_directory, SAME_GAME))
|
||||
config->cheat_directory[0] = '\0';
|
||||
if (!strcmp (config->export_directory, SAME_GAME))
|
||||
config->export_directory[0] = '\0';
|
||||
for (auto &i: { &new_sram_directory,
|
||||
&config->savestate_directory,
|
||||
&config->patch_directory,
|
||||
&config->cheat_directory,
|
||||
&config->export_directory })
|
||||
{
|
||||
if (!i->compare (SAME_AS_GAME))
|
||||
i->clear ();
|
||||
}
|
||||
|
||||
if (strcmp (safety_sram_directory, config->sram_directory) && config->rom_loaded)
|
||||
if (new_sram_directory.compare (config->sram_directory) && config->rom_loaded)
|
||||
{
|
||||
GtkWidget *msg;
|
||||
int responseid;
|
||||
|
@ -907,21 +905,21 @@ Snes9xPreferences::get_settings_from_dialog ()
|
|||
|
||||
if (responseid == GTK_RESPONSE_OK)
|
||||
{
|
||||
strncpy (config->sram_directory, safety_sram_directory, PATH_MAX);
|
||||
config->sram_directory = new_sram_directory;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (config->sram_directory[0] == '\0')
|
||||
set_entry_text ("sram_directory", SAME_GAME);
|
||||
if (config->sram_directory.empty ())
|
||||
set_entry_text ("sram_directory", SAME_AS_GAME);
|
||||
else
|
||||
set_entry_text ("sram_directory", config->sram_directory);
|
||||
set_entry_text ("sram_directory", config->sram_directory.c_str ());
|
||||
}
|
||||
|
||||
gtk_widget_destroy (msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy (config->sram_directory, safety_sram_directory, PATH_MAX);
|
||||
config->sram_directory = new_sram_directory;
|
||||
}
|
||||
|
||||
memcpy (config->pad, pad, (sizeof (JoypadBinding)) * NUM_JOYPADS);
|
||||
|
|
|
@ -768,8 +768,8 @@ Snes9xWindow::open_multicart_dialog ()
|
|||
slota = GTK_FILE_CHOOSER (dialog->get_widget ("multicart_slota"));
|
||||
slotb = GTK_FILE_CHOOSER (dialog->get_widget ("multicart_slotb"));
|
||||
|
||||
gtk_file_chooser_set_current_folder (slota, config->last_directory);
|
||||
gtk_file_chooser_set_current_folder (slotb, config->last_directory);
|
||||
gtk_file_chooser_set_current_folder (slota, config->last_directory.c_str ());
|
||||
gtk_file_chooser_set_current_folder (slotb, config->last_directory.c_str ());
|
||||
|
||||
result = gtk_dialog_run (GTK_DIALOG (multicart_dialog));
|
||||
|
||||
|
|
|
@ -62,9 +62,11 @@ static void dialog_response (GtkDialog *pdialog, gint response_id, gpointer user
|
|||
{
|
||||
case GTK_RESPONSE_OK:
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
std::string config_file = get_config_dir() + "/snes9x.glslp";
|
||||
S9xDisplayGetDriver ()->save (config_file.c_str ());
|
||||
realpath (config_file.c_str (), gui_config->shader_filename);
|
||||
realpath (config_file.c_str (), path);
|
||||
gui_config->shader_filename = path;
|
||||
|
||||
if (dialog)
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
|
|
Loading…
Reference in New Issue