mirror of https://github.com/snes9xgit/snes9x.git
GTK+: Use lowercase true/false, bool in more places.
This commit is contained in:
parent
3eea50654f
commit
fcdead0028
|
@ -26,8 +26,8 @@
|
|||
#else // GTK+ 2.0
|
||||
|
||||
#define GDK_WINDOWING_X11
|
||||
#define GDK_IS_X11_WINDOW(window) TRUE
|
||||
#define GDK_IS_X11_DISPLAY(display) TRUE
|
||||
#define GDK_IS_X11_WINDOW(window) true
|
||||
#define GDK_IS_X11_DISPLAY(display) true
|
||||
#define gdk_x11_window_get_xid(window) GDK_WINDOW_XWINDOW (window)
|
||||
|
||||
inline void gdk_window_get_geometry (GdkWindow *window,
|
||||
|
|
|
@ -98,7 +98,7 @@ GtkBuilderWindow::signal_connect (GtkBuilderWindowCallbacks *callbacks)
|
|||
}
|
||||
|
||||
void
|
||||
GtkBuilderWindow::enable_widget (const char *name, unsigned char state)
|
||||
GtkBuilderWindow::enable_widget (const char *name, bool state)
|
||||
{
|
||||
gtk_widget_set_sensitive (get_widget (name), state);
|
||||
}
|
||||
|
@ -150,8 +150,7 @@ GtkBuilderWindow::get_check (const char *name)
|
|||
return 0;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
GtkBuilderWindow::get_entry_value (const char *name)
|
||||
int GtkBuilderWindow::get_entry_value(const char *name)
|
||||
{
|
||||
return atoi (gtk_entry_get_text (GTK_ENTRY (get_widget (name))));;
|
||||
}
|
||||
|
@ -181,7 +180,7 @@ GtkBuilderWindow::set_slider (const char *name, float value)
|
|||
}
|
||||
|
||||
void
|
||||
GtkBuilderWindow::set_check (const char *name, unsigned char value)
|
||||
GtkBuilderWindow::set_check (const char *name, bool value)
|
||||
{
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (get_widget (name)),
|
||||
value);
|
||||
|
@ -245,8 +244,7 @@ GtkBuilderWindow::get_spin (const char *name)
|
|||
return gtk_spin_button_get_value (GTK_SPIN_BUTTON (get_widget (name)));
|
||||
}
|
||||
|
||||
int
|
||||
GtkBuilderWindow::has_focus (const char *widget)
|
||||
bool GtkBuilderWindow::has_focus(const char *widget)
|
||||
{
|
||||
return gtk_widget_is_focus (get_widget (widget));
|
||||
}
|
||||
|
|
|
@ -28,23 +28,23 @@ class GtkBuilderWindow
|
|||
int get_height ();
|
||||
|
||||
void signal_connect (GtkBuilderWindowCallbacks *callbacks);
|
||||
void enable_widget (const char *name, unsigned char state);
|
||||
void enable_widget (const char *name, bool state);
|
||||
void set_button_label (const char *name, const char *label);
|
||||
unsigned char get_check (const char *name);
|
||||
unsigned int get_entry_value (const char *name);
|
||||
int get_entry_value (const char *name);
|
||||
const char *get_entry_text (const char *name);
|
||||
unsigned char get_combo (const char *name);
|
||||
void combo_box_append (const char *name, const char *value);
|
||||
void combo_box_append (GtkComboBox *combo, const char *value);
|
||||
double get_spin (const char *name);
|
||||
float get_slider (const char *name);
|
||||
void set_check (const char *name, unsigned char value);
|
||||
void set_check (const char *name, bool value);
|
||||
void set_entry_value (const char *name, unsigned int value);
|
||||
void set_entry_text (const char *name, const char *text);
|
||||
void set_combo (const char *name, unsigned char value);
|
||||
void set_spin (const char *name, double value);
|
||||
void set_slider (const char *name, float value);
|
||||
int has_focus (const char *widget);
|
||||
bool has_focus (const char *widget);
|
||||
|
||||
protected:
|
||||
static void signal_connection_func (GtkBuilder *, GObject *, const gchar *, const char *, GObject *, GConnectFlags, gpointer);
|
||||
|
|
|
@ -135,10 +135,10 @@ Snes9xCheats::Snes9xCheats ()
|
|||
|
||||
g_signal_connect (view, "row-activated", G_CALLBACK (event_row_activated), (gpointer) this);
|
||||
|
||||
gtk_tree_view_set_reorderable (view, TRUE);
|
||||
gtk_tree_view_set_reorderable (view, true);
|
||||
|
||||
renderer = gtk_cell_renderer_toggle_new ();
|
||||
gtk_cell_renderer_toggle_set_activatable (GTK_CELL_RENDERER_TOGGLE (renderer), TRUE);
|
||||
gtk_cell_renderer_toggle_set_activatable (GTK_CELL_RENDERER_TOGGLE (renderer), true);
|
||||
gtk_tree_view_insert_column_with_attributes (view,
|
||||
-1,
|
||||
"\xe2\x86\x91",
|
||||
|
@ -146,7 +146,7 @@ Snes9xCheats::Snes9xCheats ()
|
|||
"active", COLUMN_ENABLED,
|
||||
NULL);
|
||||
GtkTreeViewColumn *column = gtk_tree_view_get_column (view, 0);
|
||||
gtk_tree_view_column_set_clickable (column, TRUE);
|
||||
gtk_tree_view_column_set_clickable (column, true);
|
||||
gtk_tree_view_column_set_alignment (column, 0.5f);
|
||||
g_signal_connect (column, "clicked", G_CALLBACK (event_enabled_column_clicked), (gpointer) this);
|
||||
|
||||
|
@ -163,7 +163,7 @@ Snes9xCheats::Snes9xCheats ()
|
|||
"text", COLUMN_DESCRIPTION,
|
||||
NULL);
|
||||
column = gtk_tree_view_get_column (view, 1);
|
||||
gtk_tree_view_column_set_resizable (column, TRUE);
|
||||
gtk_tree_view_column_set_resizable (column, true);
|
||||
gtk_tree_view_column_set_min_width (column, 40);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
|
@ -174,7 +174,7 @@ Snes9xCheats::Snes9xCheats ()
|
|||
"text", COLUMN_CHEAT,
|
||||
NULL);
|
||||
column = gtk_tree_view_get_column (view, 2);
|
||||
gtk_tree_view_column_set_resizable (column, TRUE);
|
||||
gtk_tree_view_column_set_resizable (column, true);
|
||||
gtk_tree_view_column_set_min_width (column, 40);
|
||||
|
||||
store = gtk_list_store_new (NUM_COLS,
|
||||
|
|
|
@ -76,37 +76,37 @@ Snes9xConfig::Snes9xConfig ()
|
|||
|
||||
int Snes9xConfig::load_defaults ()
|
||||
{
|
||||
full_screen_on_open = 0;
|
||||
change_display_resolution = 0;
|
||||
full_screen_on_open = false;
|
||||
change_display_resolution = false;
|
||||
xrr_index = 0;
|
||||
scale_to_fit = 1;
|
||||
maintain_aspect_ratio = 1;
|
||||
scale_to_fit = true;
|
||||
maintain_aspect_ratio = true;
|
||||
aspect_ratio = 2;
|
||||
scale_method = 0;
|
||||
overscan = 0;
|
||||
overscan = false;
|
||||
save_sram_after_secs = 0;
|
||||
rom_loaded = 0;
|
||||
multithreading = 0;
|
||||
rom_loaded = false;
|
||||
multithreading = false;
|
||||
hw_accel = 0;
|
||||
allow_opengl = 0;
|
||||
allow_xv = 0;
|
||||
allow_xrandr = 0;
|
||||
force_inverted_byte_order = FALSE;
|
||||
allow_opengl = false;
|
||||
allow_xv = false;
|
||||
allow_xrandr = false;
|
||||
force_inverted_byte_order = false;
|
||||
hires_effect = HIRES_NORMAL;
|
||||
pause_emulation_on_switch = 0;
|
||||
pause_emulation_on_switch = false;
|
||||
num_threads = 2;
|
||||
mute_sound = FALSE;
|
||||
mute_sound_turbo = FALSE;
|
||||
fullscreen = FALSE;
|
||||
ui_visible = TRUE;
|
||||
statusbar_visible = FALSE;
|
||||
mute_sound = false;
|
||||
mute_sound_turbo = false;
|
||||
fullscreen = false;
|
||||
ui_visible = true;
|
||||
statusbar_visible = false;
|
||||
default_esc_behavior = 1;
|
||||
prevent_screensaver = FALSE;
|
||||
prevent_screensaver = false;
|
||||
sound_driver = 0;
|
||||
sound_buffer_size = 32;
|
||||
sound_playback_rate = 5;
|
||||
sound_input_rate = 31950;
|
||||
auto_input_rate = TRUE;
|
||||
auto_input_rate = true;
|
||||
last_directory[0] = '\0';
|
||||
last_shader_directory[0] = '\0';
|
||||
window_width = -1;
|
||||
|
@ -118,70 +118,70 @@ int Snes9xConfig::load_defaults ()
|
|||
savestate_directory[0] = '\0';
|
||||
cheat_directory[0] = '\0';
|
||||
patch_directory[0] = '\0';
|
||||
screensaver_needs_reset = FALSE;
|
||||
screensaver_needs_reset = false;
|
||||
ntsc_setup = snes_ntsc_composite;
|
||||
ntsc_scanline_intensity = 1;
|
||||
scanline_filter_intensity = 0;
|
||||
Settings.BilinearFilter = FALSE;
|
||||
netplay_activated = FALSE;
|
||||
netplay_server_up = FALSE;
|
||||
netplay_is_server = FALSE;
|
||||
netplay_sync_reset = TRUE;
|
||||
netplay_send_rom = FALSE;
|
||||
Settings.BilinearFilter = false;
|
||||
netplay_activated = false;
|
||||
netplay_server_up = false;
|
||||
netplay_is_server = false;
|
||||
netplay_sync_reset = true;
|
||||
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_port = 6096;
|
||||
modal_dialogs = 1;
|
||||
modal_dialogs = true;
|
||||
current_save_slot = 0;
|
||||
S9xCheatsEnable ();
|
||||
|
||||
rewind_granularity = 5;
|
||||
rewind_buffer_size = 0;
|
||||
Settings.Rewinding = FALSE;
|
||||
Settings.Rewinding = false;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
sync_to_vblank = 1;
|
||||
use_pbos = 1;
|
||||
sync_to_vblank = true;
|
||||
use_pbos = true;
|
||||
pbo_format = 0;
|
||||
npot_textures = FALSE;
|
||||
use_shaders = 0;
|
||||
npot_textures = false;
|
||||
use_shaders = false;
|
||||
shader_filename[0] = '\0';
|
||||
sync_every_frame = FALSE;
|
||||
use_fences = FALSE;
|
||||
sync_every_frame = false;
|
||||
use_fences = false;
|
||||
#endif
|
||||
|
||||
/* Snes9X Variables */
|
||||
Settings.MouseMaster = TRUE;
|
||||
Settings.SuperScopeMaster = TRUE;
|
||||
Settings.JustifierMaster = TRUE;
|
||||
Settings.MultiPlayer5Master = TRUE;
|
||||
Settings.UpAndDown = FALSE;
|
||||
Settings.MouseMaster = true;
|
||||
Settings.SuperScopeMaster = true;
|
||||
Settings.JustifierMaster = true;
|
||||
Settings.MultiPlayer5Master = true;
|
||||
Settings.UpAndDown = false;
|
||||
Settings.AutoSaveDelay = 0;
|
||||
Settings.SkipFrames = 0;
|
||||
Settings.Transparency = TRUE;
|
||||
Settings.DisplayFrameRate = FALSE;
|
||||
Settings.SixteenBitSound = TRUE;
|
||||
Settings.Stereo = TRUE;
|
||||
Settings.ReverseStereo = FALSE;
|
||||
Settings.Transparency = true;
|
||||
Settings.DisplayFrameRate = false;
|
||||
Settings.SixteenBitSound = true;
|
||||
Settings.Stereo = true;
|
||||
Settings.ReverseStereo = false;
|
||||
Settings.SoundPlaybackRate = 44100;
|
||||
Settings.StopEmulation = TRUE;
|
||||
Settings.StopEmulation = true;
|
||||
Settings.FrameTimeNTSC = 16666;
|
||||
Settings.FrameTimePAL = 20000;
|
||||
Settings.SupportHiRes = true;
|
||||
Settings.FrameTime = Settings.FrameTimeNTSC;
|
||||
Settings.BlockInvalidVRAMAccessMaster = TRUE;
|
||||
Settings.SoundSync = 0;
|
||||
Settings.DynamicRateControl = FALSE;
|
||||
Settings.BlockInvalidVRAMAccessMaster = true;
|
||||
Settings.SoundSync = false;
|
||||
Settings.DynamicRateControl = false;
|
||||
Settings.DynamicRateLimit = 5;
|
||||
Settings.InterpolationMethod = DSP_INTERPOLATION_GAUSSIAN;
|
||||
Settings.HDMATimingHack = 100;
|
||||
Settings.SuperFXClockMultiplier = 100;
|
||||
Settings.NetPlay = FALSE;
|
||||
NetPlay.Paused = FALSE;
|
||||
Settings.NetPlay = false;
|
||||
NetPlay.Paused = false;
|
||||
NetPlay.MaxFrameSkip = 10;
|
||||
Settings.DisplayPressedKeys = FALSE;
|
||||
Settings.DisplayPressedKeys = false;
|
||||
#ifdef ALLOW_CPU_OVERCLOCK
|
||||
Settings.MaxSpriteTilesPerLine = 34;
|
||||
Settings.OneClockCycle = 6;
|
||||
|
@ -669,9 +669,9 @@ int Snes9xConfig::load_config_file ()
|
|||
#endif
|
||||
|
||||
if (Settings.SkipFrames == THROTTLE_SOUND_SYNC)
|
||||
Settings.SoundSync = 1;
|
||||
Settings.SoundSync = true;
|
||||
else
|
||||
Settings.SoundSync = 0;
|
||||
Settings.SoundSync = false;
|
||||
|
||||
hires_effect = CLAMP (hires_effect, 0, 2);
|
||||
Settings.DynamicRateLimit = CLAMP (Settings.DynamicRateLimit, 1, 1000);
|
||||
|
@ -703,7 +703,7 @@ void Snes9xConfig::rebind_keys ()
|
|||
|
||||
cmd = S9xGetPortCommandT (buf);
|
||||
|
||||
S9xMapButton (bin[button_i].base_hex (), cmd, FALSE);
|
||||
S9xMapButton (bin[button_i].base_hex (), cmd, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -713,18 +713,18 @@ void Snes9xConfig::rebind_keys ()
|
|||
cmd = S9xGetPortCommandT (buf);
|
||||
S9xMapButton (shortcut[i - NUM_JOYPAD_LINKS].base_hex (),
|
||||
cmd,
|
||||
FALSE);
|
||||
false);
|
||||
}
|
||||
|
||||
cmd = S9xGetPortCommandT ("Pointer Mouse1+Superscope+Justifier1");
|
||||
S9xMapPointer (BINDING_MOUSE_POINTER, cmd, TRUE);
|
||||
S9xMapPointer (BINDING_MOUSE_POINTER, cmd, true);
|
||||
|
||||
cmd = S9xGetPortCommandT ("{Mouse1 L,Superscope Fire,Justifier1 Trigger}");
|
||||
S9xMapButton (BINDING_MOUSE_BUTTON0, cmd, FALSE);
|
||||
S9xMapButton (BINDING_MOUSE_BUTTON0, cmd, false);
|
||||
|
||||
cmd = S9xGetPortCommandT ("{Justifier1 AimOffscreen Trigger,Superscope AimOffscreen}");
|
||||
S9xMapButton (BINDING_MOUSE_BUTTON1, cmd, FALSE);
|
||||
S9xMapButton (BINDING_MOUSE_BUTTON1, cmd, false);
|
||||
|
||||
cmd = S9xGetPortCommandT ("{Mouse1 R,Superscope Cursor,Justifier1 Start}");
|
||||
S9xMapButton (BINDING_MOUSE_BUTTON2, cmd, FALSE);
|
||||
S9xMapButton (BINDING_MOUSE_BUTTON2, cmd, false);
|
||||
}
|
||||
|
|
|
@ -52,109 +52,109 @@ class Snes9xConfig
|
|||
void joystick_register_centers ();
|
||||
|
||||
/* Screen options */
|
||||
unsigned char full_screen_on_open;
|
||||
unsigned char change_display_resolution;
|
||||
unsigned char fullscreen;
|
||||
unsigned char ui_visible;
|
||||
unsigned char statusbar_visible;
|
||||
unsigned char default_esc_behavior;
|
||||
unsigned char prevent_screensaver;
|
||||
int xrr_index;
|
||||
unsigned char scale_to_fit;
|
||||
unsigned char maintain_aspect_ratio;
|
||||
int aspect_ratio;
|
||||
unsigned int scale_method;
|
||||
unsigned char overscan;
|
||||
unsigned char multithreading;
|
||||
int hires_effect;
|
||||
unsigned char force_inverted_byte_order;
|
||||
bool full_screen_on_open;
|
||||
bool change_display_resolution;
|
||||
bool fullscreen;
|
||||
bool ui_visible;
|
||||
bool statusbar_visible;
|
||||
int default_esc_behavior;
|
||||
bool prevent_screensaver;
|
||||
int xrr_index;
|
||||
bool scale_to_fit;
|
||||
bool maintain_aspect_ratio;
|
||||
int aspect_ratio;
|
||||
int scale_method;
|
||||
bool overscan;
|
||||
bool multithreading;
|
||||
int hires_effect;
|
||||
bool force_inverted_byte_order;
|
||||
|
||||
snes_ntsc_setup_t ntsc_setup;
|
||||
unsigned char ntsc_format;
|
||||
float ntsc_hue;
|
||||
float ntsc_saturation;
|
||||
float ntsc_contrast;
|
||||
float ntsc_brightness;
|
||||
float ntsc_sharpness;
|
||||
float ntsc_artifacts;
|
||||
float ntsc_gamma;
|
||||
float ntsc_resolution;
|
||||
float ntsc_fringing;
|
||||
float ntsc_bleed;
|
||||
float ntsc_merge_fields;
|
||||
unsigned int ntsc_scanline_intensity;
|
||||
unsigned int scanline_filter_intensity;
|
||||
unsigned char hw_accel;
|
||||
unsigned char allow_opengl;
|
||||
unsigned char allow_xv;
|
||||
unsigned char allow_xrandr;
|
||||
int ntsc_format;
|
||||
float ntsc_hue;
|
||||
float ntsc_saturation;
|
||||
float ntsc_contrast;
|
||||
float ntsc_brightness;
|
||||
float ntsc_sharpness;
|
||||
float ntsc_artifacts;
|
||||
float ntsc_gamma;
|
||||
float ntsc_resolution;
|
||||
float ntsc_fringing;
|
||||
float ntsc_bleed;
|
||||
float ntsc_merge_fields;
|
||||
int ntsc_scanline_intensity;
|
||||
int scanline_filter_intensity;
|
||||
int hw_accel;
|
||||
bool allow_opengl;
|
||||
bool allow_xv;
|
||||
bool allow_xrandr;
|
||||
|
||||
/* Data options */
|
||||
unsigned char 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];
|
||||
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];
|
||||
|
||||
/* Controls */
|
||||
JoypadBinding pad[NUM_JOYPADS];
|
||||
Binding shortcut[NUM_EMU_LINKS];
|
||||
|
||||
/* Netplay */
|
||||
int netplay_is_server;
|
||||
int netplay_sync_reset;
|
||||
int netplay_send_rom;
|
||||
int netplay_default_port;
|
||||
int netplay_max_frame_loss;
|
||||
char netplay_last_rom [PATH_MAX];
|
||||
char netplay_last_host [PATH_MAX];
|
||||
int netplay_last_port;
|
||||
int netplay_activated;
|
||||
int netplay_server_up;
|
||||
bool netplay_is_server;
|
||||
bool netplay_sync_reset;
|
||||
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];
|
||||
int netplay_last_port;
|
||||
bool netplay_activated;
|
||||
bool netplay_server_up;
|
||||
|
||||
/* Operational */
|
||||
int sound_driver;
|
||||
int mute_sound;
|
||||
int mute_sound_turbo;
|
||||
int sound_buffer_size;
|
||||
int sound_playback_rate;
|
||||
int auto_input_rate;
|
||||
int sound_input_rate;
|
||||
int rom_loaded;
|
||||
int window_width, window_height;
|
||||
int preferences_width, preferences_height;
|
||||
int pause_emulation_on_switch;
|
||||
int num_threads;
|
||||
unsigned char screensaver_needs_reset;
|
||||
int modal_dialogs;
|
||||
int sound_driver;
|
||||
bool mute_sound;
|
||||
bool mute_sound_turbo;
|
||||
int sound_buffer_size;
|
||||
int sound_playback_rate;
|
||||
bool auto_input_rate;
|
||||
int sound_input_rate;
|
||||
bool rom_loaded;
|
||||
int window_width, window_height;
|
||||
int preferences_width, preferences_height;
|
||||
bool pause_emulation_on_switch;
|
||||
int num_threads;
|
||||
bool screensaver_needs_reset;
|
||||
bool modal_dialogs;
|
||||
|
||||
int pointer_is_visible;
|
||||
gint64 pointer_timestamp;
|
||||
bool pointer_is_visible;
|
||||
gint64 pointer_timestamp;
|
||||
|
||||
unsigned int rewind_granularity;
|
||||
unsigned int rewind_buffer_size;
|
||||
unsigned int rewind_granularity;
|
||||
unsigned int rewind_buffer_size;
|
||||
|
||||
int current_save_slot;
|
||||
int current_save_slot;
|
||||
|
||||
XRRScreenResources *xrr_screen_resources;
|
||||
XRRCrtcInfo *xrr_crtc_info;
|
||||
XRRCrtcInfo *xrr_crtc_info;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
unsigned char sync_to_vblank;
|
||||
unsigned char use_pbos;
|
||||
int pbo_format;
|
||||
unsigned char npot_textures;
|
||||
unsigned char use_shaders;
|
||||
char shader_filename[PATH_MAX];
|
||||
unsigned char sync_every_frame;
|
||||
unsigned char use_fences;
|
||||
bool sync_to_vblank;
|
||||
bool use_pbos;
|
||||
int pbo_format;
|
||||
bool npot_textures;
|
||||
bool use_shaders;
|
||||
char shader_filename[PATH_MAX];
|
||||
bool sync_every_frame;
|
||||
bool use_fences;
|
||||
#endif
|
||||
|
||||
JoyDevice **joystick;
|
||||
int joystick_threshold;
|
||||
int joystick_threshold;
|
||||
};
|
||||
|
||||
std::string get_config_dir ();
|
||||
|
|
|
@ -159,11 +159,11 @@ bool S9xIsMousePluggedIn ()
|
|||
bool S9xGrabJoysticks ()
|
||||
{
|
||||
if (joystick_lock)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
joystick_lock++;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void S9xReleaseJoysticks ()
|
||||
|
@ -200,21 +200,21 @@ static void change_slot (int difference)
|
|||
|
||||
void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2)
|
||||
{
|
||||
static bool quit_binding_down = FALSE;
|
||||
static bool quit_binding_down = false;
|
||||
|
||||
if (data1 == TRUE)
|
||||
if (data1 == true)
|
||||
{
|
||||
if (cmd.port[0] == PORT_QUIT)
|
||||
quit_binding_down = TRUE;
|
||||
quit_binding_down = true;
|
||||
else if (cmd.port[0] == PORT_REWIND)
|
||||
Settings.Rewinding = TRUE;
|
||||
Settings.Rewinding = true;
|
||||
}
|
||||
|
||||
if (data1 == FALSE) /* Release */
|
||||
if (data1 == false) /* Release */
|
||||
{
|
||||
if (cmd.port[0] != PORT_QUIT)
|
||||
{
|
||||
quit_binding_down = FALSE;
|
||||
quit_binding_down = false;
|
||||
}
|
||||
|
||||
if (cmd.port[0] == PORT_COMMAND_FULLSCREEN)
|
||||
|
@ -242,7 +242,7 @@ void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2)
|
|||
|
||||
else if (cmd.port[0] == PORT_REWIND)
|
||||
{
|
||||
Settings.Rewinding = FALSE;
|
||||
Settings.Rewinding = false;
|
||||
}
|
||||
|
||||
else if (cmd.port[0] == PORT_SEEK_TO_FRAME)
|
||||
|
@ -477,7 +477,7 @@ void S9xProcessEvents (bool8 block)
|
|||
{
|
||||
binding = Binding (i, event.parameter, 0);
|
||||
S9xReportButton (binding.hex (), event.state == JOY_PRESSED ? 1 : 0);
|
||||
gui_config->screensaver_needs_reset = TRUE;
|
||||
gui_config->screensaver_needs_reset = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,30 +92,28 @@ typedef struct Calibration
|
|||
|
||||
class JoyDevice
|
||||
{
|
||||
public:
|
||||
JoyDevice (unsigned int device_num);
|
||||
~JoyDevice ();
|
||||
int get_event (JoyEvent *event);
|
||||
void flush ();
|
||||
void handle_event (SDL_Event *event);
|
||||
void register_centers ();
|
||||
public:
|
||||
JoyDevice (unsigned int device_num);
|
||||
~JoyDevice ();
|
||||
int get_event (JoyEvent *event);
|
||||
void flush ();
|
||||
void handle_event (SDL_Event *event);
|
||||
void register_centers ();
|
||||
|
||||
SDL_Joystick *filedes;
|
||||
Calibration *calibration;
|
||||
std::queue<JoyEvent> queue;
|
||||
int mode;
|
||||
int joynum;
|
||||
int num_axes;
|
||||
int num_hats;
|
||||
int *axis;
|
||||
int *hat;
|
||||
bool enabled;
|
||||
|
||||
|
||||
private:
|
||||
void poll_events ();
|
||||
void add_event (unsigned int parameter, unsigned int state);
|
||||
SDL_Joystick *filedes;
|
||||
Calibration *calibration;
|
||||
std::queue<JoyEvent> queue;
|
||||
int mode;
|
||||
int joynum;
|
||||
int num_axes;
|
||||
int num_hats;
|
||||
int *axis;
|
||||
int *hat;
|
||||
bool enabled;
|
||||
|
||||
private:
|
||||
void poll_events ();
|
||||
void add_event (unsigned int parameter, unsigned int state);
|
||||
};
|
||||
|
||||
void S9xDeinitInputDevices ();
|
||||
|
|
|
@ -1204,7 +1204,7 @@ thread_worker (gpointer data,
|
|||
break;
|
||||
}
|
||||
|
||||
job->complete = 1;
|
||||
job->complete = true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1215,7 +1215,7 @@ create_thread_pool ()
|
|||
pool = g_thread_pool_new (thread_worker,
|
||||
NULL,
|
||||
gui_config->num_threads - 1,
|
||||
TRUE,
|
||||
true,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
@ -1245,7 +1245,7 @@ internal_threaded_convert (void *src_buffer,
|
|||
job[i].width = width;
|
||||
job[i].height = height / gui_config->num_threads;
|
||||
job[i].bpp = bpp;
|
||||
job[i].complete = 0;
|
||||
job[i].complete = false;
|
||||
|
||||
g_thread_pool_push (pool, (gpointer) &(job[i]), NULL);
|
||||
}
|
||||
|
@ -1307,7 +1307,7 @@ internal_threaded_convert_mask (void *src_buffer,
|
|||
job[i].inv_rmask = inv_rmask;
|
||||
job[i].inv_gmask = inv_gmask;
|
||||
job[i].inv_bmask = inv_bmask;
|
||||
job[i].complete = 0;
|
||||
job[i].complete = false;
|
||||
|
||||
g_thread_pool_push (pool, (gpointer) &(job[i]), NULL);
|
||||
}
|
||||
|
@ -1363,7 +1363,7 @@ internal_threaded_filter (uint8 *src_buffer,
|
|||
for (i = 0; i < gui_config->num_threads - 1; i++)
|
||||
{
|
||||
job[i].operation_type = JOB_FILTER;
|
||||
job[i].complete = 0;
|
||||
job[i].complete = false;
|
||||
job[i].width = width;
|
||||
job[i].src_pitch = src_pitch;
|
||||
job[i].dst_pitch = dst_pitch;
|
||||
|
@ -1548,7 +1548,7 @@ S9xQueryDrivers ()
|
|||
{
|
||||
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (top_level->get_window()));
|
||||
|
||||
gui_config->allow_xv = 0;
|
||||
gui_config->allow_xv = false;
|
||||
#if defined(USE_XV) && defined(GDK_WINDOWING_X11)
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
gui_config->allow_xv = S9xXVDisplayDriver::query_availability ();
|
||||
|
@ -1557,17 +1557,17 @@ S9xQueryDrivers ()
|
|||
#ifdef USE_OPENGL
|
||||
gui_config->allow_opengl = S9xOpenGLDisplayDriver::query_availability ();
|
||||
#else
|
||||
gui_config->allow_opengl = 0;
|
||||
gui_config->allow_opengl = false;
|
||||
#endif
|
||||
|
||||
gui_config->allow_xrandr = 0;
|
||||
gui_config->allow_xrandr = false;
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
Display *dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (top_level->get_window())));
|
||||
Window xid = gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (top_level->get_window())));
|
||||
|
||||
gui_config->allow_xrandr = 1;
|
||||
gui_config->allow_xrandr = true;
|
||||
gui_config->xrr_screen_resources = XRRGetScreenResourcesCurrent (dpy, xid);
|
||||
gui_config->xrr_crtc_info = XRRGetCrtcInfo (dpy,
|
||||
gui_config->xrr_screen_resources,
|
||||
|
@ -1646,7 +1646,7 @@ S9xDeinitUpdate (int width, int height)
|
|||
|
||||
driver->update (width, height, yoffset);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1722,7 +1722,7 @@ S9xDeinitDisplay ()
|
|||
GFX.Screen = NULL;
|
||||
|
||||
if (pool)
|
||||
g_thread_pool_free (pool, FALSE, TRUE);
|
||||
g_thread_pool_free (pool, false, true);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1755,13 +1755,13 @@ bool8
|
|||
S9xContinueUpdate (int width, int height)
|
||||
{
|
||||
S9xDeinitUpdate (width, height);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool8
|
||||
S9xInitUpdate ()
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1894,7 +1894,7 @@ static void S9xGTKDisplayString (const char *string, int linesFromBottom,
|
|||
void
|
||||
S9xInitDisplay (int argc, char **argv)
|
||||
{
|
||||
Settings.SupportHiRes = TRUE;
|
||||
Settings.SupportHiRes = true;
|
||||
S9xBlit2xSaIFilterInit ();
|
||||
#ifdef USE_HQ2X
|
||||
S9xBlitHQ2xFilterInit ();
|
||||
|
|
|
@ -82,7 +82,7 @@ typedef struct thread_job_t
|
|||
int line_start;
|
||||
int line_end;
|
||||
|
||||
volatile int complete;
|
||||
volatile bool complete;
|
||||
}
|
||||
thread_job_t;
|
||||
|
||||
|
|
|
@ -358,7 +358,7 @@ void S9xOpenGLDisplayDriver::update_texture_size (int width, int height)
|
|||
}
|
||||
}
|
||||
|
||||
int S9xOpenGLDisplayDriver::load_shaders (const char *shader_file)
|
||||
bool S9xOpenGLDisplayDriver::load_shaders (const char *shader_file)
|
||||
{
|
||||
int length = strlen (shader_file);
|
||||
|
||||
|
@ -374,20 +374,20 @@ int S9xOpenGLDisplayDriver::load_shaders (const char *shader_file)
|
|||
npot = true;
|
||||
|
||||
if (glsl_shader->param.size () > 0)
|
||||
window->enable_widget ("shader_parameters_item", TRUE);
|
||||
window->enable_widget ("shader_parameters_item", true);
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
delete glsl_shader;
|
||||
}
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
int S9xOpenGLDisplayDriver::opengl_defaults ()
|
||||
bool S9xOpenGLDisplayDriver::opengl_defaults()
|
||||
{
|
||||
npot = false;
|
||||
using_pbos = false;
|
||||
|
@ -528,7 +528,7 @@ int S9xOpenGLDisplayDriver::opengl_defaults ()
|
|||
|
||||
glClearColor (0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
void S9xOpenGLDisplayDriver::refresh (int width, int height)
|
||||
|
@ -544,7 +544,7 @@ void S9xOpenGLDisplayDriver::resize ()
|
|||
output_window_height = context->height;
|
||||
}
|
||||
|
||||
int S9xOpenGLDisplayDriver::create_context ()
|
||||
bool S9xOpenGLDisplayDriver::create_context()
|
||||
{
|
||||
gdk_window = gtk_widget_get_window (drawing_area);
|
||||
|
||||
|
@ -562,10 +562,10 @@ int S9xOpenGLDisplayDriver::create_context ()
|
|||
#endif
|
||||
|
||||
if (!context->attach (drawing_area))
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
if (!context->create_context ())
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
output_window_width = context->width;
|
||||
output_window_height = context->height;
|
||||
|
@ -592,7 +592,7 @@ int S9xOpenGLDisplayDriver::create_context ()
|
|||
if (version >= 31 || epoxy_has_gl_extension ("GL_ARB_sync"))
|
||||
fences = true;
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
int S9xOpenGLDisplayDriver::init ()
|
||||
|
@ -666,7 +666,7 @@ void S9xOpenGLDisplayDriver::deinit ()
|
|||
|
||||
if (using_glsl_shaders)
|
||||
{
|
||||
window->enable_widget ("shader_parameters_item", FALSE);
|
||||
window->enable_widget ("shader_parameters_item", false);
|
||||
gtk_shader_parameters_dialog_close ();
|
||||
glsl_shader->destroy();
|
||||
delete glsl_shader;
|
||||
|
|
|
@ -44,11 +44,11 @@ class S9xOpenGLDisplayDriver : public S9xDisplayDriver
|
|||
bool is_ready ();
|
||||
|
||||
private:
|
||||
int opengl_defaults ();
|
||||
bool opengl_defaults ();
|
||||
void swap_buffers ();
|
||||
int load_shaders (const char *);
|
||||
bool load_shaders (const char *);
|
||||
void update_texture_size (int width, int height);
|
||||
int create_context ();
|
||||
bool create_context ();
|
||||
void resize ();
|
||||
|
||||
GLuint stock_program;
|
||||
|
|
|
@ -217,7 +217,7 @@ S9xXVDisplayDriver::update_image_size (int width, int height)
|
|||
}
|
||||
}
|
||||
|
||||
shm.readOnly = FALSE;
|
||||
shm.readOnly = false;
|
||||
|
||||
xv_image->data = shm.shmaddr;
|
||||
|
||||
|
@ -442,7 +442,7 @@ S9xXVDisplayDriver::init ()
|
|||
return -1;
|
||||
}
|
||||
|
||||
shm.readOnly = FALSE;
|
||||
shm.readOnly = false;
|
||||
|
||||
xv_image->data = shm.shmaddr;
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file)
|
|||
if (read_only)
|
||||
{
|
||||
if ((*file = OPEN_STREAM (filename, "rb")))
|
||||
return (TRUE);
|
||||
return (true);
|
||||
else
|
||||
fprintf (stderr,
|
||||
"Failed to open file stream for reading. (%s)\n",
|
||||
|
@ -316,7 +316,7 @@ S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file)
|
|||
{
|
||||
if ((*file = OPEN_STREAM (filename, "wb")))
|
||||
{
|
||||
return (TRUE);
|
||||
return (true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -335,20 +335,20 @@ S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file)
|
|||
{
|
||||
sprintf (command, "gzip -d <\"%s\"", filename);
|
||||
if (*file = popen (command, "r"))
|
||||
return (TRUE);
|
||||
return (true);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (command, "gzip --best >\"%s\"", filename);
|
||||
if (*file = popen (command, "wb"))
|
||||
return (TRUE);
|
||||
return (true);
|
||||
}
|
||||
|
||||
fprintf (stderr, "gzip: Couldn't open snapshot file:\n%s\n", filename);
|
||||
|
||||
#endif
|
||||
|
||||
return (FALSE);
|
||||
return (false);
|
||||
}
|
||||
|
||||
void S9xCloseSnapshotFile (STREAM file)
|
||||
|
|
|
@ -30,7 +30,7 @@ S9xNetplayPreconnect ()
|
|||
}
|
||||
|
||||
NetPlay.MaxBehindFrameCount = gui_config->netplay_max_frame_loss;
|
||||
NetPlay.Waiting4EmulationThread = FALSE;
|
||||
NetPlay.Waiting4EmulationThread = false;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -43,7 +43,7 @@ S9xNetplayConnect ()
|
|||
uint32 flags = CPU.Flags;
|
||||
|
||||
if (*(gui_config->netplay_last_rom) &&
|
||||
top_level->try_open_rom (gui_config->netplay_last_rom))
|
||||
!top_level->try_open_rom (gui_config->netplay_last_rom))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -65,12 +65,12 @@ S9xNetplayConnect ()
|
|||
gtk_widget_destroy (msg);
|
||||
}
|
||||
|
||||
gui_config->netplay_activated = TRUE;
|
||||
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)
|
||||
{
|
||||
Settings.StopEmulation = FALSE;
|
||||
Settings.StopEmulation = false;
|
||||
S9xROMLoaded ();
|
||||
}
|
||||
|
||||
|
@ -94,8 +94,8 @@ S9xNetplayStopServer ()
|
|||
S9xNPStopServer ();
|
||||
|
||||
g_thread_join (npthread);
|
||||
Settings.NetPlayServer = FALSE;
|
||||
gui_config->netplay_server_up = FALSE;
|
||||
Settings.NetPlayServer = false;
|
||||
gui_config->netplay_server_up = false;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -112,8 +112,8 @@ S9xNetplayDisconnect ()
|
|||
S9xNetplayStopServer ();
|
||||
}
|
||||
|
||||
gui_config->netplay_activated = FALSE;
|
||||
NetPlay.Paused = FALSE;
|
||||
gui_config->netplay_activated = false;
|
||||
NetPlay.Paused = false;
|
||||
|
||||
top_level->configure_widgets ();
|
||||
}
|
||||
|
@ -136,12 +136,12 @@ S9xNetplayStartServer ()
|
|||
flags = CPU.Flags;
|
||||
|
||||
if (*(gui_config->netplay_last_rom) == 0 ||
|
||||
top_level->try_open_rom (gui_config->netplay_last_rom))
|
||||
!top_level->try_open_rom (gui_config->netplay_last_rom))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Settings.NetPlayServer = TRUE;
|
||||
Settings.NetPlayServer = true;
|
||||
NPServer.SyncByReset = gui_config->netplay_sync_reset;
|
||||
NPServer.SendROMImageOnConnect = gui_config->netplay_send_rom;
|
||||
|
||||
|
@ -158,8 +158,8 @@ S9xNetplayStartServer ()
|
|||
|
||||
S9xROMLoaded ();
|
||||
|
||||
gui_config->netplay_activated = TRUE;
|
||||
gui_config->netplay_server_up = TRUE;
|
||||
gui_config->netplay_activated = true;
|
||||
gui_config->netplay_server_up = true;
|
||||
|
||||
CPU.Flags = flags;
|
||||
|
||||
|
@ -215,7 +215,7 @@ S9xNetplaySyncSpeed ()
|
|||
// No heartbeats already arrived, have to wait for one.
|
||||
NetPlay.PendingWait4Sync = !S9xNPWaitForHeartBeatDelay (100);
|
||||
|
||||
IPPU.RenderThisFrame = TRUE;
|
||||
IPPU.RenderThisFrame = true;
|
||||
IPPU.SkippedFrames = 0;
|
||||
}
|
||||
else
|
||||
|
@ -230,16 +230,16 @@ S9xNetplaySyncSpeed ()
|
|||
{
|
||||
if ((unsigned int) difference <= (NetPlay.MaxBehindFrameCount / 2))
|
||||
{
|
||||
NetPlay.Waiting4EmulationThread = FALSE;
|
||||
S9xNPSendPause (FALSE);
|
||||
NetPlay.Waiting4EmulationThread = false;
|
||||
S9xNPSendPause (false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((unsigned int) difference >= (NetPlay.MaxBehindFrameCount))
|
||||
{
|
||||
NetPlay.Waiting4EmulationThread = TRUE;
|
||||
S9xNPSendPause (TRUE);
|
||||
NetPlay.Waiting4EmulationThread = true;
|
||||
S9xNPSendPause (true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,11 +248,11 @@ S9xNetplaySyncSpeed ()
|
|||
if (IPPU.SkippedFrames < NetPlay.MaxFrameSkip)
|
||||
{
|
||||
IPPU.SkippedFrames++;
|
||||
IPPU.RenderThisFrame = FALSE;
|
||||
IPPU.RenderThisFrame = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
IPPU.RenderThisFrame = TRUE;
|
||||
IPPU.RenderThisFrame = true;
|
||||
IPPU.SkippedFrames = 0;
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ S9xNetplaySyncSpeed ()
|
|||
int
|
||||
S9xNetplayPush ()
|
||||
{
|
||||
static int statusbar_state = FALSE;
|
||||
static int statusbar_state = false;
|
||||
|
||||
if (gui_config->netplay_activated &&
|
||||
(!Settings.NetPlay || !NetPlay.Connected))
|
||||
|
@ -280,26 +280,26 @@ S9xNetplayPush ()
|
|||
|
||||
if (NetPlay.PendingWait4Sync && !S9xNPWaitForHeartBeatDelay (100))
|
||||
{
|
||||
S9xProcessEvents (FALSE);
|
||||
S9xProcessEvents (false);
|
||||
|
||||
S9xSoundStop ();
|
||||
NetPlay.Paused = TRUE;
|
||||
NetPlay.Paused = true;
|
||||
|
||||
if (statusbar_state == FALSE)
|
||||
if (statusbar_state == false)
|
||||
{
|
||||
top_level->update_statusbar ();
|
||||
statusbar_state = TRUE;
|
||||
statusbar_state = true;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
NetPlay.Paused = FALSE;
|
||||
NetPlay.Paused = false;
|
||||
|
||||
if (statusbar_state)
|
||||
{
|
||||
top_level->update_statusbar ();
|
||||
statusbar_state = FALSE;
|
||||
statusbar_state = false;
|
||||
}
|
||||
|
||||
S9xSoundStart ();
|
||||
|
@ -314,7 +314,7 @@ S9xNetplayPush ()
|
|||
|
||||
if (NetPlay.PendingWait4Sync)
|
||||
{
|
||||
NetPlay.PendingWait4Sync = FALSE;
|
||||
NetPlay.PendingWait4Sync = false;
|
||||
NetPlay.FrameCount++;
|
||||
S9xNPStepJoypadHistory ();
|
||||
}
|
||||
|
|
|
@ -62,18 +62,18 @@ Snes9xNetplayDialog::update_state ()
|
|||
{
|
||||
if (get_check ("host_radio"))
|
||||
{
|
||||
enable_widget ("connect_box", FALSE);
|
||||
enable_widget ("default_port_box", TRUE);
|
||||
enable_widget ("sync_reset", TRUE);
|
||||
enable_widget ("send_image", TRUE);
|
||||
enable_widget ("connect_box", false);
|
||||
enable_widget ("default_port_box", true);
|
||||
enable_widget ("sync_reset", true);
|
||||
enable_widget ("send_image", true);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
enable_widget ("connect_box", TRUE);
|
||||
enable_widget ("default_port_box", FALSE);
|
||||
enable_widget ("sync_reset", FALSE);
|
||||
enable_widget ("send_image", FALSE);
|
||||
enable_widget ("connect_box", true);
|
||||
enable_widget ("default_port_box", false);
|
||||
enable_widget ("sync_reset", false);
|
||||
enable_widget ("send_image", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,8 +108,7 @@ Snes9xNetplayDialog::settings_from_dialog ()
|
|||
config->save_config_file ();
|
||||
}
|
||||
|
||||
int
|
||||
Snes9xNetplayDialog::show ()
|
||||
bool Snes9xNetplayDialog::show()
|
||||
{
|
||||
int result;
|
||||
|
||||
|
@ -123,12 +122,12 @@ Snes9xNetplayDialog::show ()
|
|||
{
|
||||
settings_from_dialog ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ class Snes9xNetplayDialog : public GtkBuilderWindow
|
|||
public:
|
||||
Snes9xNetplayDialog (Snes9xConfig *config);
|
||||
~Snes9xNetplayDialog ();
|
||||
int show ();
|
||||
bool show ();
|
||||
void update_state ();
|
||||
|
||||
private:
|
||||
|
|
|
@ -40,7 +40,7 @@ snes9x_preferences_open (GtkWidget *widget,
|
|||
config->rebind_keys ();
|
||||
window->update_accels ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -59,7 +59,7 @@ static void
|
|||
event_control_toggle (GtkToggleButton *widget, gpointer data)
|
||||
{
|
||||
Snes9xPreferences *window = (Snes9xPreferences *) data;
|
||||
static unsigned char toggle_lock = 0;
|
||||
static bool toggle_lock = false;
|
||||
const gchar *name;
|
||||
bool state;
|
||||
|
||||
|
@ -72,7 +72,7 @@ event_control_toggle (GtkToggleButton *widget, gpointer data)
|
|||
name = gtk_buildable_get_name (GTK_BUILDABLE (widget));
|
||||
state = gtk_toggle_button_get_active (widget);
|
||||
|
||||
toggle_lock = 1;
|
||||
toggle_lock = true;
|
||||
|
||||
for (int i = 0; b_links[i].button_name; i++)
|
||||
{
|
||||
|
@ -80,13 +80,13 @@ event_control_toggle (GtkToggleButton *widget, gpointer data)
|
|||
{
|
||||
gtk_toggle_button_set_active (
|
||||
GTK_TOGGLE_BUTTON (window->get_widget (b_links[i].button_name)),
|
||||
FALSE);
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_toggle_button_set_active (widget, state);
|
||||
|
||||
toggle_lock = 0;
|
||||
toggle_lock = false;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -100,7 +100,7 @@ event_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
|
|||
|
||||
if ((focus = window->get_focused_binding ()) < 0)
|
||||
{
|
||||
return FALSE; /* Don't keep key for ourselves */
|
||||
return false; /* Don't keep key for ourselves */
|
||||
}
|
||||
|
||||
/* Allow modifier keys to be used if page is set to the joypad bindings. */
|
||||
|
@ -118,7 +118,7 @@ event_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
|
|||
event->keyval == GDK_Alt_L ||
|
||||
event->keyval == GDK_Alt_R)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,13 +134,13 @@ event_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
|
|||
else
|
||||
{
|
||||
window->focus_next ();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
window->store_binding (b_links[focus].button_name, key_binding);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -402,14 +402,14 @@ poll_joystick (gpointer data)
|
|||
binding);
|
||||
|
||||
window->config->flush_joysticks ();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -450,11 +450,11 @@ event_auto_input_rate_toggled (GtkToggleButton *togglebutton, gpointer data)
|
|||
if (gtk_toggle_button_get_active (togglebutton))
|
||||
{
|
||||
preferences->set_slider("sound_input_rate", top_level->get_auto_input_rate ());
|
||||
gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), FALSE);
|
||||
gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), TRUE);
|
||||
gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -644,11 +644,11 @@ Snes9xPreferences::move_settings_to_dialog ()
|
|||
if (top_level->get_auto_input_rate () == 0)
|
||||
{
|
||||
config->auto_input_rate = 0;
|
||||
gtk_widget_set_sensitive (get_widget ("auto_input_rate"), FALSE);
|
||||
gtk_widget_set_sensitive (get_widget ("auto_input_rate"), false);
|
||||
}
|
||||
set_check ("auto_input_rate", config->auto_input_rate);
|
||||
gtk_widget_set_sensitive (get_widget("sound_input_rate"),
|
||||
config->auto_input_rate ? FALSE : TRUE);
|
||||
config->auto_input_rate ? false : true);
|
||||
set_spin ("sound_buffer_size", config->sound_buffer_size);
|
||||
|
||||
if (Settings.SkipFrames == THROTTLE_SOUND_SYNC)
|
||||
|
@ -736,13 +736,13 @@ Snes9xPreferences::move_settings_to_dialog ()
|
|||
void
|
||||
Snes9xPreferences::get_settings_from_dialog ()
|
||||
{
|
||||
int sound_needs_restart = 0;
|
||||
int gfx_needs_restart = 0;
|
||||
int sound_sync = 0;
|
||||
bool sound_needs_restart = false;
|
||||
bool gfx_needs_restart = false;
|
||||
bool sound_sync = false;
|
||||
|
||||
Settings.SkipFrames = get_combo ("frameskip_combo");
|
||||
if (Settings.SkipFrames == THROTTLE_SOUND_SYNC)
|
||||
sound_sync = 1;
|
||||
sound_sync = true;
|
||||
|
||||
if ((config->sound_driver != get_combo ("sound_driver")) ||
|
||||
(config->mute_sound != get_check ("mute_sound_check")) ||
|
||||
|
@ -754,7 +754,7 @@ Snes9xPreferences::get_settings_from_dialog ()
|
|||
(Settings.SoundSync != sound_sync) ||
|
||||
(Settings.DynamicRateControl != get_check ("dynamic_rate_control")))
|
||||
{
|
||||
sound_needs_restart = 1;
|
||||
sound_needs_restart = true;
|
||||
}
|
||||
|
||||
if ((config->change_display_resolution != get_check ("change_display_resolution") ||
|
||||
|
@ -775,13 +775,13 @@ Snes9xPreferences::get_settings_from_dialog ()
|
|||
config->change_display_resolution = get_check ("change_display_resolution");
|
||||
|
||||
if (config->multithreading != get_check ("multithreading"))
|
||||
gfx_needs_restart = 1;
|
||||
gfx_needs_restart = true;
|
||||
|
||||
if (config->hw_accel != hw_accel_value (get_combo ("hw_accel")))
|
||||
gfx_needs_restart = 1;
|
||||
gfx_needs_restart = true;
|
||||
|
||||
if (config->force_inverted_byte_order != get_check ("force_inverted_byte_order"))
|
||||
gfx_needs_restart = 1;
|
||||
gfx_needs_restart = true;
|
||||
|
||||
config->full_screen_on_open = get_check ("full_screen_on_open");
|
||||
Settings.DisplayFrameRate = get_check ("show_frame_rate");
|
||||
|
@ -858,7 +858,7 @@ Snes9xPreferences::get_settings_from_dialog ()
|
|||
config->use_shaders != get_check ("use_shaders") ||
|
||||
get_check ("use_shaders"))
|
||||
{
|
||||
gfx_needs_restart = 1;
|
||||
gfx_needs_restart = true;
|
||||
}
|
||||
|
||||
config->sync_to_vblank = get_check ("sync_to_vblank");
|
||||
|
@ -1017,7 +1017,7 @@ Snes9xPreferences::show ()
|
|||
{
|
||||
gint result;
|
||||
GtkWidget *combo;
|
||||
int close_dialog;
|
||||
bool close_dialog;
|
||||
guint source_id = -1;
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
|
@ -1112,7 +1112,7 @@ Snes9xPreferences::show ()
|
|||
if (config->preferences_width > 0 && config->preferences_height > 0)
|
||||
resize (config->preferences_width, config->preferences_height);
|
||||
|
||||
for (close_dialog = 0; !close_dialog; )
|
||||
for (close_dialog = false; !close_dialog; )
|
||||
{
|
||||
gtk_widget_show (window);
|
||||
result = gtk_dialog_run (GTK_DIALOG (window));
|
||||
|
@ -1125,7 +1125,7 @@ Snes9xPreferences::show ()
|
|||
case GTK_RESPONSE_OK:
|
||||
get_settings_from_dialog ();
|
||||
config->save_config_file ();
|
||||
close_dialog = 1;
|
||||
close_dialog = true;
|
||||
gtk_widget_hide (window);
|
||||
break;
|
||||
|
||||
|
@ -1138,7 +1138,7 @@ Snes9xPreferences::show ()
|
|||
case GTK_RESPONSE_CLOSE:
|
||||
case GTK_RESPONSE_DELETE_EVENT:
|
||||
gtk_widget_hide (window);
|
||||
close_dialog = 1;
|
||||
close_dialog = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -35,8 +35,8 @@ class Snes9xPreferences : public GtkBuilderWindow
|
|||
|
||||
Snes9xConfig *config;
|
||||
GtkToggleButton *last_toggled;
|
||||
int awaiting_key;
|
||||
int polling_joystick;
|
||||
bool awaiting_key;
|
||||
bool polling_joystick;
|
||||
JoypadBinding pad[NUM_JOYPADS];
|
||||
Binding shortcut[NUM_EMU_LINKS];
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ int main (int argc, char *argv[])
|
|||
gui_config->rebind_keys ();
|
||||
top_level->update_accels ();
|
||||
|
||||
Settings.Paused = TRUE;
|
||||
Settings.Paused = true;
|
||||
g_timeout_add (100, S9xPauseFunc, NULL);
|
||||
g_timeout_add (10000, S9xScreenSaverCheckFunc, NULL);
|
||||
|
||||
|
@ -150,7 +150,7 @@ int main (int argc, char *argv[])
|
|||
int S9xOpenROM (const char *rom_filename)
|
||||
{
|
||||
uint32 flags;
|
||||
bool8 loaded;
|
||||
bool loaded;
|
||||
|
||||
if (gui_config->rom_loaded)
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ int S9xOpenROM (const char *rom_filename)
|
|||
|
||||
flags = CPU.Flags;
|
||||
|
||||
loaded = FALSE;
|
||||
loaded = false;
|
||||
|
||||
if (Settings.Multi)
|
||||
loaded = Memory.LoadMultiCart (Settings.CartAName, Settings.CartBName);
|
||||
|
@ -198,10 +198,10 @@ int S9xOpenROM (const char *rom_filename)
|
|||
{
|
||||
fprintf (stderr, _("Error opening: %s\n"), rom_filename);
|
||||
|
||||
loaded = FALSE;
|
||||
loaded = false;
|
||||
}
|
||||
else
|
||||
loaded = TRUE;
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
if (loaded)
|
||||
|
@ -211,7 +211,7 @@ int S9xOpenROM (const char *rom_filename)
|
|||
else
|
||||
{
|
||||
CPU.Flags = flags;
|
||||
Settings.Paused = 1;
|
||||
Settings.Paused = true;
|
||||
|
||||
S9xNoROMLoaded ();
|
||||
top_level->refresh ();
|
||||
|
@ -233,12 +233,12 @@ int S9xOpenROM (const char *rom_filename)
|
|||
|
||||
void S9xROMLoaded ()
|
||||
{
|
||||
gui_config->rom_loaded = TRUE;
|
||||
gui_config->rom_loaded = true;
|
||||
top_level->configure_widgets ();
|
||||
|
||||
if (gui_config->full_screen_on_open)
|
||||
{
|
||||
Settings.Paused = FALSE;
|
||||
Settings.Paused = false;
|
||||
top_level->enter_fullscreen_mode ();
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ void S9xROMLoaded ()
|
|||
void S9xNoROMLoaded ()
|
||||
{
|
||||
S9xSoundStop ();
|
||||
gui_config->rom_loaded = FALSE;
|
||||
gui_config->rom_loaded = false;
|
||||
S9xDisplayRefresh (-1, -1);
|
||||
top_level->configure_widgets ();
|
||||
top_level->update_statusbar ();
|
||||
|
@ -256,10 +256,10 @@ void S9xNoROMLoaded ()
|
|||
|
||||
static gboolean S9xPauseFunc (gpointer data)
|
||||
{
|
||||
S9xProcessEvents (TRUE);
|
||||
S9xProcessEvents (true);
|
||||
|
||||
if (!gui_config->rom_loaded)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (!S9xNetplayPush ())
|
||||
{
|
||||
|
@ -271,12 +271,12 @@ static gboolean S9xPauseFunc (gpointer data)
|
|||
/* Clear joystick queues */
|
||||
gui_config->flush_joysticks ();
|
||||
|
||||
S9xSetSoundMute (FALSE);
|
||||
S9xSetSoundMute (false);
|
||||
S9xSoundStart ();
|
||||
|
||||
if (Settings.NetPlay && NetPlay.Connected)
|
||||
{
|
||||
S9xNPSendPause (FALSE);
|
||||
S9xNPSendPause (false);
|
||||
}
|
||||
|
||||
/* Resume high-performance callback */
|
||||
|
@ -285,10 +285,10 @@ static gboolean S9xPauseFunc (gpointer data)
|
|||
NULL,
|
||||
NULL);
|
||||
top_level->update_statusbar ();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
gboolean S9xIdleFunc (gpointer data)
|
||||
|
@ -302,20 +302,20 @@ gboolean S9xIdleFunc (gpointer data)
|
|||
|
||||
if (Settings.NetPlay && NetPlay.Connected)
|
||||
{
|
||||
S9xNPSendPause (TRUE);
|
||||
S9xNPSendPause (true);
|
||||
}
|
||||
|
||||
/* Move to a timer-based function to use less CPU */
|
||||
g_timeout_add (100, S9xPauseFunc, NULL);
|
||||
top_level->update_statusbar ();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
S9xCheckPointerTimer ();
|
||||
S9xProcessEvents (TRUE);
|
||||
S9xProcessEvents (true);
|
||||
|
||||
if (!S9xDisplayDriverIsReady ())
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
S9xThrottle ();
|
||||
|
||||
|
@ -335,19 +335,19 @@ gboolean S9xIdleFunc (gpointer data)
|
|||
else if(IPPU.TotalEmulatedFrames % gui_config->rewind_granularity == 0)
|
||||
state_manager.push();
|
||||
|
||||
static int muted_from_turbo = FALSE;
|
||||
static int mute_saved_state = FALSE;
|
||||
static int muted_from_turbo = false;
|
||||
static int mute_saved_state = false;
|
||||
|
||||
if (Settings.TurboMode && !muted_from_turbo && gui_config->mute_sound_turbo)
|
||||
{
|
||||
muted_from_turbo = TRUE;
|
||||
muted_from_turbo = true;
|
||||
mute_saved_state = Settings.Mute;
|
||||
S9xSetSoundMute (TRUE);
|
||||
S9xSetSoundMute (true);
|
||||
}
|
||||
|
||||
if (!Settings.TurboMode && muted_from_turbo)
|
||||
{
|
||||
muted_from_turbo = FALSE;
|
||||
muted_from_turbo = false;
|
||||
Settings.Mute = mute_saved_state;
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ gboolean S9xIdleFunc (gpointer data)
|
|||
S9xNetplayPop ();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
gboolean S9xScreenSaverCheckFunc (gpointer data)
|
||||
|
@ -367,7 +367,7 @@ gboolean S9xScreenSaverCheckFunc (gpointer data)
|
|||
gui_config->prevent_screensaver))
|
||||
top_level->reset_screensaver ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Snes9x core hooks */
|
||||
|
@ -450,7 +450,7 @@ void S9xParseArg (char **argv, int &i, int argc)
|
|||
}
|
||||
else if (!strcasecmp (argv[i], "-mutesound"))
|
||||
{
|
||||
gui_config->mute_sound = TRUE;
|
||||
gui_config->mute_sound = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -466,7 +466,7 @@ static void S9xThrottle ()
|
|||
if (Settings.HighSpeedSeek > 0)
|
||||
{
|
||||
Settings.HighSpeedSeek--;
|
||||
IPPU.RenderThisFrame = FALSE;
|
||||
IPPU.RenderThisFrame = false;
|
||||
IPPU.SkippedFrames = 0;
|
||||
frame_clock = now;
|
||||
|
||||
|
@ -481,12 +481,12 @@ static void S9xThrottle ()
|
|||
{
|
||||
IPPU.FrameSkip = 0;
|
||||
IPPU.SkippedFrames = 0;
|
||||
IPPU.RenderThisFrame = TRUE;
|
||||
IPPU.RenderThisFrame = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IPPU.SkippedFrames++;
|
||||
IPPU.RenderThisFrame = FALSE;
|
||||
IPPU.RenderThisFrame = false;
|
||||
}
|
||||
|
||||
frame_clock = now;
|
||||
|
@ -494,7 +494,7 @@ static void S9xThrottle ()
|
|||
return;
|
||||
}
|
||||
|
||||
IPPU.RenderThisFrame = TRUE;
|
||||
IPPU.RenderThisFrame = true;
|
||||
|
||||
if (now - frame_clock > 500000)
|
||||
{
|
||||
|
@ -535,7 +535,7 @@ static void S9xThrottle ()
|
|||
|
||||
if (IPPU.SkippedFrames < 8)
|
||||
{
|
||||
IPPU.RenderThisFrame = FALSE;
|
||||
IPPU.RenderThisFrame = false;
|
||||
frame_clock += Settings.FrameTime;
|
||||
return;
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ static void S9xCheckPointerTimer ()
|
|||
if (g_get_monotonic_time () - gui_config->pointer_timestamp > 1000000)
|
||||
{
|
||||
top_level->hide_mouse_cursor ();
|
||||
gui_config->pointer_is_visible = FALSE;
|
||||
gui_config->pointer_is_visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -583,7 +583,7 @@ void S9xExit ()
|
|||
|
||||
S9xPortSoundDeinit ();
|
||||
|
||||
Settings.StopEmulation = TRUE;
|
||||
Settings.StopEmulation = true;
|
||||
|
||||
if (gui_config->rom_loaded)
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ event_main_window_delete (GtkWidget *widget,
|
|||
{
|
||||
S9xExit ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -50,7 +50,7 @@ event_main_window_state_event (GtkWidget *widget,
|
|||
window->fullscreen_state = event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN;
|
||||
window->maximized_state = event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -60,7 +60,7 @@ event_continue_item_activate (GtkWidget *widget, gpointer data)
|
|||
|
||||
window->unpause_from_user ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -72,7 +72,7 @@ event_open_cheats (GtkWidget *widget, gpointer data)
|
|||
cheats->show ();
|
||||
delete cheats;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -80,7 +80,7 @@ event_open_multicart (GtkWidget *widget, gpointer data)
|
|||
{
|
||||
((Snes9xWindow *) data)->open_multicart_dialog ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -90,7 +90,7 @@ event_rom_info (GtkWidget *widget, gpointer data)
|
|||
|
||||
window->show_rom_info ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -100,7 +100,7 @@ event_toggle_interface (GtkWidget *widget, gpointer data)
|
|||
|
||||
window->toggle_ui ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -108,7 +108,7 @@ event_show_statusbar (GtkWidget *widget, gpointer data)
|
|||
{
|
||||
((Snes9xWindow *) data)->toggle_statusbar ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -116,7 +116,7 @@ event_sync_clients (GtkWidget *widget, gpointer data)
|
|||
{
|
||||
S9xNetplaySyncClients ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -126,7 +126,7 @@ event_pause_item_activate (GtkWidget *widget, gpointer data)
|
|||
|
||||
window->pause_from_user ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -134,7 +134,7 @@ event_open_netplay (GtkWidget *widget, gpointer data)
|
|||
{
|
||||
S9xNetplayDialogOpen ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
|
@ -146,11 +146,11 @@ event_drawingarea_draw (GtkWidget *widget,
|
|||
|
||||
Snes9xWindow *window = (Snes9xWindow *) data;
|
||||
window->cr = cr;
|
||||
window->cairo_owned = FALSE;
|
||||
window->cairo_owned = false;
|
||||
window->expose ();
|
||||
window->cr = NULL;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -162,7 +162,7 @@ event_drawingarea_expose (GtkWidget *widget,
|
|||
{
|
||||
((Snes9xWindow *) data)->expose ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -178,7 +178,7 @@ event_key (GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||
/* Ignore multiple identical keypresses to discard repeating keys */
|
||||
if (event->keyval == keyval && event->type == type)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Provide escape key to get out of fullscreen */
|
||||
|
@ -194,7 +194,7 @@ event_key (GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||
window->toggle_ui ();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
keyval = event->keyval;
|
||||
|
@ -213,10 +213,10 @@ event_key (GtkWidget *widget, GdkEventKey *event, gpointer data)
|
|||
if (cmd.type != S9xNoMapping)
|
||||
{
|
||||
S9xReportButton (b.hex (), (event->type == GDK_KEY_PRESS));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE; /* Pass the key to GTK */
|
||||
return false; /* Pass the key to GTK */
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -230,20 +230,20 @@ event_motion_notify (GtkWidget *widget,
|
|||
window->last_width <= 0 ||
|
||||
window->last_height <= 0)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window->mouse_grabbed)
|
||||
{
|
||||
if (event->x_root == window->mouse_reported_x &&
|
||||
event->y_root == window->mouse_reported_y)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
window->mouse_loc_x += (event->x_root - window->mouse_reported_x);
|
||||
window->mouse_loc_y += (event->y_root - window->mouse_reported_y);
|
||||
window->center_mouse ();
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION(3,10,0)
|
||||
|
@ -268,7 +268,7 @@ event_motion_notify (GtkWidget *widget,
|
|||
|
||||
window->config->pointer_timestamp = g_get_monotonic_time ();
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -289,7 +289,7 @@ event_button_press (GtkWidget *widget,
|
|||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -310,7 +310,7 @@ event_button_release (GtkWidget *widget,
|
|||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -359,9 +359,9 @@ static void
|
|||
event_record_movie (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
if (S9xMovieActive ())
|
||||
S9xMovieStop (FALSE);
|
||||
S9xMovieStop (false);
|
||||
|
||||
S9xMovieCreate (S9xChooseMovieFilename (FALSE),
|
||||
S9xMovieCreate (S9xChooseMovieFilename (false),
|
||||
0xFF,
|
||||
MOVIE_OPT_FROM_RESET,
|
||||
NULL,
|
||||
|
@ -372,9 +372,9 @@ static void
|
|||
event_open_movie (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
if (S9xMovieActive ())
|
||||
S9xMovieStop (FALSE);
|
||||
S9xMovieStop (false);
|
||||
|
||||
S9xMovieOpen (S9xChooseMovieFilename (TRUE), FALSE);
|
||||
S9xMovieOpen (S9xChooseMovieFilename (true), false);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -391,7 +391,7 @@ static void
|
|||
event_stop_recording (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
if (S9xMovieActive ())
|
||||
S9xMovieStop (FALSE);
|
||||
S9xMovieStop (false);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -483,17 +483,17 @@ event_save_spc (GtkWidget *widget, gpointer data)
|
|||
static gboolean
|
||||
event_focus_in (GtkWidget *widget, GdkEventFocus *event, gpointer data)
|
||||
{
|
||||
((Snes9xWindow *) data)->focus_notify (TRUE);
|
||||
((Snes9xWindow *) data)->focus_notify (true);
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
event_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer data)
|
||||
{
|
||||
((Snes9xWindow *) data)->focus_notify (FALSE);
|
||||
((Snes9xWindow *) data)->focus_notify (false);
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -609,11 +609,11 @@ Snes9xWindow::Snes9xWindow (Snes9xConfig *config) :
|
|||
recent_menu = NULL;
|
||||
fullscreen_state = 0;
|
||||
maximized_state = 0;
|
||||
focused = 1;
|
||||
paused_from_focus_loss = 0;
|
||||
focused = true;
|
||||
paused_from_focus_loss = false;
|
||||
cr = NULL;
|
||||
cairo_owned = 0;
|
||||
mouse_grabbed = 0;
|
||||
cairo_owned = false;
|
||||
mouse_grabbed = false;
|
||||
|
||||
if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), "snes9x"))
|
||||
{
|
||||
|
@ -633,16 +633,16 @@ Snes9xWindow::Snes9xWindow (Snes9xConfig *config) :
|
|||
|
||||
drawing_area = GTK_DRAWING_AREA (get_widget ("drawingarea"));
|
||||
#if GTK_MAJOR_VERSION < 3
|
||||
gtk_widget_set_double_buffered (GTK_WIDGET (drawing_area), FALSE);
|
||||
gtk_widget_set_app_paintable (GTK_WIDGET (drawing_area), TRUE);
|
||||
gtk_widget_set_double_buffered (GTK_WIDGET (drawing_area), false);
|
||||
gtk_widget_set_app_paintable (GTK_WIDGET (drawing_area), true);
|
||||
|
||||
#endif
|
||||
|
||||
gtk_widget_realize (window);
|
||||
gtk_widget_realize (GTK_WIDGET (drawing_area));
|
||||
#if GTK_MAJOR_VERSION < 3
|
||||
gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, FALSE);
|
||||
gdk_window_set_back_pixmap (gtk_widget_get_window (GTK_WIDGET (drawing_area)), NULL, FALSE);
|
||||
gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, false);
|
||||
gdk_window_set_back_pixmap (gtk_widget_get_window (GTK_WIDGET (drawing_area)), NULL, false);
|
||||
#endif
|
||||
|
||||
gtk_check_menu_item_set_active (
|
||||
|
@ -653,7 +653,7 @@ Snes9xWindow::Snes9xWindow (Snes9xConfig *config) :
|
|||
gtk_widget_hide (get_widget ("shader_parameters_separator"));
|
||||
gtk_widget_hide (get_widget ("shader_parameters_item"));
|
||||
#else
|
||||
enable_widget ("shader_parameters_item", FALSE);
|
||||
enable_widget ("shader_parameters_item", false);
|
||||
#endif
|
||||
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
|
@ -735,21 +735,21 @@ Snes9xWindow::expose ()
|
|||
}
|
||||
|
||||
void
|
||||
Snes9xWindow::focus_notify (int state)
|
||||
Snes9xWindow::focus_notify (bool state)
|
||||
{
|
||||
focused = state ? 1 : 0;
|
||||
focused = state;
|
||||
|
||||
if (!state && config->pause_emulation_on_switch)
|
||||
{
|
||||
sys_pause++;
|
||||
propagate_pause_state ();
|
||||
paused_from_focus_loss = TRUE;
|
||||
paused_from_focus_loss = true;
|
||||
}
|
||||
|
||||
if (state && paused_from_focus_loss)
|
||||
{
|
||||
unpause_from_focus_change ();
|
||||
paused_from_focus_loss = FALSE;
|
||||
paused_from_focus_loss = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -791,7 +791,7 @@ Snes9xWindow::open_multicart_dialog ()
|
|||
else
|
||||
Settings.CartBName[0] = '\0';
|
||||
|
||||
Settings.Multi = TRUE;
|
||||
Settings.Multi = true;
|
||||
|
||||
if (S9xOpenROM (NULL))
|
||||
{
|
||||
|
@ -908,7 +908,7 @@ Snes9xWindow::open_rom_dialog ()
|
|||
|
||||
if (filename)
|
||||
{
|
||||
Settings.Multi = FALSE;
|
||||
Settings.Multi = false;
|
||||
try_open_rom (filename);
|
||||
|
||||
g_free (filename);
|
||||
|
@ -917,12 +917,11 @@ Snes9xWindow::open_rom_dialog ()
|
|||
unpause_from_focus_change ();
|
||||
}
|
||||
|
||||
int
|
||||
Snes9xWindow::try_open_rom (const char *filename)
|
||||
bool Snes9xWindow::try_open_rom(const char *filename)
|
||||
{
|
||||
pause_from_focus_change ();
|
||||
|
||||
Settings.Multi = FALSE;
|
||||
Settings.Multi = false;
|
||||
|
||||
if (S9xOpenROM (filename))
|
||||
{
|
||||
|
@ -940,7 +939,7 @@ Snes9xWindow::try_open_rom (const char *filename)
|
|||
|
||||
unpause_from_focus_change ();
|
||||
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -954,7 +953,7 @@ Snes9xWindow::try_open_rom (const char *filename)
|
|||
(gchar *) "Snes9x",
|
||||
NULL,
|
||||
(gchar **) groups,
|
||||
FALSE
|
||||
false
|
||||
};
|
||||
gchar *u_filename;
|
||||
|
||||
|
@ -978,7 +977,7 @@ Snes9xWindow::try_open_rom (const char *filename)
|
|||
|
||||
this->unpause_from_focus_change ();
|
||||
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1265,7 +1264,7 @@ statusbar_timeout (gpointer data)
|
|||
gtk_statusbar_get_context_id (GTK_STATUSBAR (data),
|
||||
"info"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1419,7 +1418,7 @@ Snes9xWindow::configure_widgets ()
|
|||
{
|
||||
enable_widget ("fullscreen_item", config->rom_loaded);
|
||||
|
||||
config->ui_visible = TRUE;
|
||||
config->ui_visible = true;
|
||||
|
||||
if (!config->fullscreen)
|
||||
{
|
||||
|
@ -1438,7 +1437,7 @@ Snes9xWindow::configure_widgets ()
|
|||
}
|
||||
else
|
||||
{
|
||||
enable_widget ("fullscreen_item", TRUE);
|
||||
enable_widget ("fullscreen_item", true);
|
||||
|
||||
gtk_widget_show (get_widget ("hide_ui"));
|
||||
|
||||
|
@ -1491,7 +1490,7 @@ Snes9xWindow::reset_screensaver ()
|
|||
}
|
||||
#endif
|
||||
|
||||
config->screensaver_needs_reset = FALSE;
|
||||
config->screensaver_needs_reset = false;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1674,7 +1673,7 @@ Snes9xWindow::enter_fullscreen_mode ()
|
|||
|
||||
/* If we're running a game, disable ui when entering fullscreen */
|
||||
if (!Settings.Paused && config->rom_loaded)
|
||||
config->ui_visible = FALSE;
|
||||
config->ui_visible = false;
|
||||
|
||||
configure_widgets ();
|
||||
}
|
||||
|
@ -1792,7 +1791,7 @@ Snes9xWindow::hide_mouse_cursor ()
|
|||
|
||||
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (drawing_area)),
|
||||
empty_cursor);
|
||||
config->pointer_is_visible = FALSE;
|
||||
config->pointer_is_visible = false;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1800,7 +1799,7 @@ Snes9xWindow::show_mouse_cursor ()
|
|||
{
|
||||
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (drawing_area)),
|
||||
NULL);
|
||||
config->pointer_is_visible = TRUE;
|
||||
config->pointer_is_visible = true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1846,7 +1845,7 @@ Snes9xWindow::toggle_grab_mouse ()
|
|||
#if GTK_MAJOR_VERSION < 3
|
||||
if (!mouse_grabbed)
|
||||
{
|
||||
gdk_pointer_grab (gdk_window, TRUE, (GdkEventMask) 1020, gdk_window, empty_cursor, GDK_CURRENT_TIME);
|
||||
gdk_pointer_grab (gdk_window, true, (GdkEventMask) 1020, gdk_window, empty_cursor, GDK_CURRENT_TIME);
|
||||
center_mouse ();
|
||||
}
|
||||
else
|
||||
|
@ -1860,7 +1859,7 @@ Snes9xWindow::toggle_grab_mouse ()
|
|||
GdkDevice *pointer = gdk_device_manager_get_client_pointer (manager);
|
||||
|
||||
if (!mouse_grabbed)
|
||||
gdk_device_grab (pointer, gdk_window, GDK_OWNERSHIP_NONE, TRUE,
|
||||
gdk_device_grab (pointer, gdk_window, GDK_OWNERSHIP_NONE, true,
|
||||
(GdkEventMask) 1020, empty_cursor, GDK_CURRENT_TIME);
|
||||
else
|
||||
gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
|
||||
|
@ -1868,7 +1867,7 @@ Snes9xWindow::toggle_grab_mouse ()
|
|||
GdkSeat *seat = gdk_display_get_default_seat (gdk_display);
|
||||
|
||||
if (!mouse_grabbed)
|
||||
gdk_seat_grab (seat, gdk_window, GDK_SEAT_CAPABILITY_ALL_POINTING, TRUE,
|
||||
gdk_seat_grab (seat, gdk_window, GDK_SEAT_CAPABILITY_ALL_POINTING, true,
|
||||
empty_cursor, NULL, NULL, NULL);
|
||||
else
|
||||
gdk_seat_ungrab (seat);
|
||||
|
@ -1876,7 +1875,7 @@ Snes9xWindow::toggle_grab_mouse ()
|
|||
|
||||
S9xReportPointer (BINDING_MOUSE_POINTER, 0, 0);
|
||||
mouse_loc_x = 0; mouse_loc_y = 0;
|
||||
mouse_grabbed ^= 1;
|
||||
mouse_grabbed = !mouse_grabbed;
|
||||
if (mouse_grabbed)
|
||||
center_mouse ();
|
||||
}
|
||||
|
@ -1896,8 +1895,8 @@ Snes9xWindow::show ()
|
|||
GtkRecentChooser *chooser = GTK_RECENT_CHOOSER (recent_menu);
|
||||
|
||||
gtk_recent_filter_add_group (filter, "cartridge");
|
||||
gtk_recent_chooser_set_local_only (chooser, TRUE);
|
||||
gtk_recent_chooser_set_show_icons (chooser, FALSE);
|
||||
gtk_recent_chooser_set_local_only (chooser, true);
|
||||
gtk_recent_chooser_set_show_icons (chooser, false);
|
||||
gtk_recent_chooser_set_sort_type (chooser, GTK_RECENT_SORT_MRU);
|
||||
gtk_recent_chooser_add_filter (chooser, filter);
|
||||
|
||||
|
@ -1927,14 +1926,14 @@ Snes9xWindow::propagate_pause_state ()
|
|||
{
|
||||
S9xSoundStart ();
|
||||
if (config->rom_loaded)
|
||||
enable_widget ("pause_item", TRUE);
|
||||
enable_widget ("pause_item", true);
|
||||
|
||||
S9xDisplayClearBuffers ();
|
||||
}
|
||||
else
|
||||
{
|
||||
S9xSoundStop ();
|
||||
enable_widget ("pause_item", FALSE);
|
||||
enable_widget ("pause_item", false);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1972,24 +1971,23 @@ Snes9xWindow::unpause_from_focus_change ()
|
|||
void
|
||||
Snes9xWindow::pause_from_user ()
|
||||
{
|
||||
user_pause = TRUE;
|
||||
user_pause = true;
|
||||
propagate_pause_state ();
|
||||
}
|
||||
|
||||
void
|
||||
Snes9xWindow::unpause_from_user ()
|
||||
{
|
||||
user_pause = FALSE;
|
||||
user_pause = false;
|
||||
propagate_pause_state ();
|
||||
}
|
||||
|
||||
unsigned char
|
||||
Snes9xWindow::is_paused ()
|
||||
bool Snes9xWindow::is_paused()
|
||||
{
|
||||
if (user_pause || sys_pause || Settings.Paused || !(config->rom_loaded))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2015,7 +2013,7 @@ Snes9xWindow::set_menu_item_accel_to_binding (const char *name,
|
|||
gtk_accel_map_change_entry (str,
|
||||
0,
|
||||
(GdkModifierType) 0,
|
||||
TRUE);
|
||||
true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2045,7 +2043,7 @@ Snes9xWindow::set_menu_item_accel_to_binding (const char *name,
|
|||
gtk_accel_map_change_entry (str,
|
||||
bin.get_key (),
|
||||
bin.get_gdk_modifiers (),
|
||||
TRUE);
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2119,7 +2117,7 @@ Snes9xWindow::get_cairo ()
|
|||
cr = gdk_drawing_context_get_cairo_context (gdk_drawing_context);
|
||||
#endif
|
||||
|
||||
cairo_owned = TRUE;
|
||||
cairo_owned = true;
|
||||
return cr;
|
||||
}
|
||||
|
||||
|
@ -2134,7 +2132,7 @@ Snes9xWindow::release_cairo ()
|
|||
gdk_window_end_draw_frame (gtk_widget_get_window (GTK_WIDGET (drawing_area)), gdk_drawing_context);
|
||||
cairo_region_destroy (cairo_region);
|
||||
#endif
|
||||
cairo_owned = FALSE;
|
||||
cairo_owned = false;
|
||||
cr = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,10 +21,10 @@ class Snes9xWindow : public GtkBuilderWindow
|
|||
/* Pause related functions */
|
||||
void pause_from_focus_change ();
|
||||
void unpause_from_focus_change ();
|
||||
void focus_notify (int state);
|
||||
void focus_notify (bool state);
|
||||
void pause_from_user ();
|
||||
void unpause_from_user ();
|
||||
unsigned char is_paused ();
|
||||
bool is_paused ();
|
||||
void propagate_pause_state ();
|
||||
|
||||
/* Fullscreen functions */
|
||||
|
@ -45,7 +45,7 @@ class Snes9xWindow : public GtkBuilderWindow
|
|||
void load_state_dialog ();
|
||||
void configure_widgets ();
|
||||
void save_spc_dialog ();
|
||||
int try_open_rom (const char *filename);
|
||||
bool try_open_rom (const char *filename);
|
||||
const char *open_movie_dialog (bool readonly);
|
||||
void movie_seek_dialog ();
|
||||
void open_multicart_dialog ();
|
||||
|
@ -80,17 +80,17 @@ class Snes9xWindow : public GtkBuilderWindow
|
|||
int nfs_width, nfs_height, nfs_x, nfs_y;
|
||||
int fullscreen_state;
|
||||
int maximized_state;
|
||||
int focused;
|
||||
int paused_from_focus_loss;
|
||||
bool focused;
|
||||
bool paused_from_focus_loss;
|
||||
uint16 mouse_loc_x, mouse_loc_y;
|
||||
uint16 mouse_reported_x, mouse_reported_y;
|
||||
int mouse_grabbed;
|
||||
bool mouse_grabbed;
|
||||
GdkPixbuf *icon, *splash;
|
||||
GdkCursor *default_cursor, *empty_cursor;
|
||||
GtkDrawingArea *drawing_area;
|
||||
GtkWidget *recent_menu;
|
||||
cairo_t *cr;
|
||||
int cairo_owned;
|
||||
bool cairo_owned;
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
GdkDrawingContext *gdk_drawing_context;
|
||||
cairo_region_t *cairo_region;
|
||||
|
|
|
@ -132,8 +132,8 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
|
|||
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
|
||||
gtk_widget_set_hexpand (scrolled_window, TRUE);
|
||||
gtk_widget_set_vexpand (scrolled_window, TRUE);
|
||||
gtk_widget_set_hexpand (scrolled_window, true);
|
||||
gtk_widget_set_vexpand (scrolled_window, true);
|
||||
gtk_widget_set_margin_start (scrolled_window, 5);
|
||||
gtk_widget_set_margin_end (scrolled_window, 5);
|
||||
gtk_widget_set_margin_top (scrolled_window, 5);
|
||||
|
@ -141,7 +141,7 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
|
|||
|
||||
GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
GtkWidget *grid = gtk_grid_new ();
|
||||
gtk_grid_set_row_homogeneous (GTK_GRID (grid), TRUE);
|
||||
gtk_grid_set_row_homogeneous (GTK_GRID (grid), true);
|
||||
gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), grid);
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_window), vbox);
|
||||
|
@ -165,10 +165,10 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
|
|||
else
|
||||
{
|
||||
GtkWidget *scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, p->min, p->max, p->step);
|
||||
gtk_widget_set_hexpand (scale, TRUE);
|
||||
gtk_widget_set_hexpand (scale, true);
|
||||
gtk_grid_attach (GTK_GRID (grid), scale, 1, i, 1, 1);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_LEFT);
|
||||
gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
|
||||
gtk_scale_set_draw_value (GTK_SCALE (scale), true);
|
||||
gtk_scale_set_digits (GTK_SCALE (scale), 3);
|
||||
gtk_range_set_value (GTK_RANGE (scale), p->val);
|
||||
g_signal_connect_data (G_OBJECT (scale),
|
||||
|
@ -180,8 +180,8 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
|
|||
}
|
||||
}
|
||||
#else
|
||||
GtkWidget *vbox = gtk_vbox_new (FALSE, 5);
|
||||
GtkWidget *table = gtk_table_new (params->size (), 2, FALSE);
|
||||
GtkWidget *vbox = gtk_vbox_new (false, 5);
|
||||
GtkWidget *table = gtk_table_new (params->size (), 2, false);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 5);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), table);
|
||||
|
@ -210,7 +210,7 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
|
|||
GtkWidget *scale = gtk_hscale_new_with_range (p->min, p->max, p->step);
|
||||
gtk_table_attach (GTK_TABLE (table), scale, 1, 2, i, i + 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), GTK_FILL, 0, 0);
|
||||
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_LEFT);
|
||||
gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE);
|
||||
gtk_scale_set_draw_value (GTK_SCALE (scale), true);
|
||||
gtk_scale_set_digits (GTK_SCALE (scale), 3);
|
||||
gtk_range_set_value (GTK_RANGE (scale), p->val);
|
||||
g_signal_connect_data (G_OBJECT (scale),
|
||||
|
|
|
@ -146,7 +146,7 @@ S9xPortSoundInit ()
|
|||
|
||||
S9xInitSound (gui_config->sound_buffer_size, 0);
|
||||
|
||||
S9xSetSoundMute (FALSE);
|
||||
S9xSetSoundMute (false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -191,7 +191,7 @@ bool8
|
|||
S9xOpenSoundDevice ()
|
||||
{
|
||||
if (gui_config->mute_sound)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
gui_config->sound_buffer_size = CLAMP (gui_config->sound_buffer_size, 2, 256);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class S9xSoundDriver
|
|||
virtual ~S9xSoundDriver () {}
|
||||
virtual void init () = 0;
|
||||
virtual void terminate () = 0;
|
||||
virtual bool8 open_device () = 0;
|
||||
virtual bool open_device () = 0;
|
||||
virtual void start () = 0;
|
||||
virtual void stop () = 0;
|
||||
};
|
||||
|
|
|
@ -60,8 +60,7 @@ S9xAlsaSoundDriver::stop ()
|
|||
{
|
||||
}
|
||||
|
||||
bool8
|
||||
S9xAlsaSoundDriver::open_device ()
|
||||
bool S9xAlsaSoundDriver::open_device()
|
||||
{
|
||||
int err;
|
||||
unsigned int periods = 8;
|
||||
|
@ -152,7 +151,7 @@ S9xAlsaSoundDriver::open_device ()
|
|||
|
||||
S9xSetSamplesAvailableCallback (alsa_samples_available, this);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
close_fail:
|
||||
snd_pcm_drain (pcm);
|
||||
|
@ -162,7 +161,7 @@ close_fail:
|
|||
fail:
|
||||
printf ("Failed: %s\n", snd_strerror (err));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -17,7 +17,7 @@ class S9xAlsaSoundDriver : public S9xSoundDriver
|
|||
S9xAlsaSoundDriver ();
|
||||
void init ();
|
||||
void terminate ();
|
||||
bool8 open_device ();
|
||||
bool open_device ();
|
||||
void start ();
|
||||
void stop ();
|
||||
void samples_available ();
|
||||
|
|
|
@ -59,8 +59,7 @@ S9xOSSSoundDriver::stop ()
|
|||
{
|
||||
}
|
||||
|
||||
bool8
|
||||
S9xOSSSoundDriver::open_device ()
|
||||
bool S9xOSSSoundDriver::open_device()
|
||||
{
|
||||
int temp;
|
||||
audio_buf_info info;
|
||||
|
@ -169,7 +168,7 @@ S9xOSSSoundDriver::open_device ()
|
|||
|
||||
S9xSetSamplesAvailableCallback (oss_samples_available, this);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
close_fail:
|
||||
|
||||
|
@ -178,7 +177,7 @@ close_fail:
|
|||
fail:
|
||||
printf ("failed\n");
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -16,7 +16,7 @@ class S9xOSSSoundDriver : public S9xSoundDriver
|
|||
S9xOSSSoundDriver ();
|
||||
void init ();
|
||||
void terminate ();
|
||||
bool8 open_device ();
|
||||
bool open_device ();
|
||||
void start ();
|
||||
void stop ();
|
||||
void samples_available ();
|
||||
|
|
|
@ -83,8 +83,7 @@ S9xPortAudioSoundDriver::stop ()
|
|||
}
|
||||
}
|
||||
|
||||
bool8
|
||||
S9xPortAudioSoundDriver::open_device ()
|
||||
bool S9xPortAudioSoundDriver::open_device()
|
||||
{
|
||||
PaStreamParameters param;
|
||||
const PaDeviceInfo *device_info;
|
||||
|
@ -101,7 +100,7 @@ S9xPortAudioSoundDriver::open_device ()
|
|||
fprintf (stderr,
|
||||
"Couldn't reset audio stream.\nError: %s\n",
|
||||
Pa_GetErrorText (err));
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
audio_stream = NULL;
|
||||
|
@ -171,7 +170,7 @@ S9xPortAudioSoundDriver::open_device ()
|
|||
{
|
||||
fprintf (stderr,
|
||||
"Couldn't initialize sound\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
S9xSetSamplesAvailableCallback (port_audio_samples_available_callback, this);
|
||||
|
@ -179,7 +178,7 @@ S9xPortAudioSoundDriver::open_device ()
|
|||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -19,7 +19,7 @@ class S9xPortAudioSoundDriver : public S9xSoundDriver
|
|||
S9xPortAudioSoundDriver ();
|
||||
void init ();
|
||||
void terminate ();
|
||||
bool8 open_device ();
|
||||
bool open_device ();
|
||||
void start ();
|
||||
void stop ();
|
||||
void samples_available ();
|
||||
|
|
|
@ -116,8 +116,7 @@ stream_state_callback (pa_stream *p, void *userdata)
|
|||
}
|
||||
}
|
||||
|
||||
bool8
|
||||
S9xPulseSoundDriver::open_device ()
|
||||
bool S9xPulseSoundDriver::open_device()
|
||||
{
|
||||
int err = PA_ERR_UNKNOWN;
|
||||
pa_sample_spec ss;
|
||||
|
@ -201,7 +200,7 @@ S9xPulseSoundDriver::open_device ()
|
|||
|
||||
unlock ();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
error3:
|
||||
pa_stream_disconnect (stream);
|
||||
|
@ -215,7 +214,7 @@ error1:
|
|||
error0:
|
||||
printf ("Failed: %s\n", pa_strerror (err));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -17,7 +17,7 @@ class S9xPulseSoundDriver : public S9xSoundDriver
|
|||
S9xPulseSoundDriver ();
|
||||
void init ();
|
||||
void terminate ();
|
||||
bool8 open_device ();
|
||||
bool open_device ();
|
||||
void start ();
|
||||
void stop ();
|
||||
void samples_available ();
|
||||
|
|
|
@ -77,8 +77,7 @@ S9xSDLSoundDriver::stop ()
|
|||
}
|
||||
}
|
||||
|
||||
bool8
|
||||
S9xSDLSoundDriver::open_device ()
|
||||
bool S9xSDLSoundDriver::open_device()
|
||||
{
|
||||
audiospec = (SDL_AudioSpec *) malloc (sizeof (SDL_AudioSpec));
|
||||
|
||||
|
@ -101,12 +100,12 @@ S9xSDLSoundDriver::open_device ()
|
|||
free (audiospec);
|
||||
audiospec = NULL;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
printf ("OK\n");
|
||||
|
||||
S9xSetSamplesAvailableCallback (samples_available, NULL);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ class S9xSDLSoundDriver : public S9xSoundDriver
|
|||
S9xSDLSoundDriver ();
|
||||
void init ();
|
||||
void terminate ();
|
||||
bool8 open_device ();
|
||||
bool open_device ();
|
||||
void start ();
|
||||
void stop ();
|
||||
void mix (unsigned char *output, int bytes);
|
||||
|
|
|
@ -169,7 +169,7 @@ bool WaylandEGLContext::create_context ()
|
|||
}
|
||||
|
||||
wl_surface_set_buffer_scale (child, scale);
|
||||
gdk_window_invalidate_rect (gdk_window, NULL, FALSE);
|
||||
gdk_window_invalidate_rect (gdk_window, NULL, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue