From ebadaa21a7b1c528bbd8886ed952ae5f49ff5b38 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Wed, 2 Jul 2008 05:58:29 +0000 Subject: [PATCH] gfceu now supports autoscaling --- gfceu | 21 +++-- gfceu.glade | 243 ++++++++++++++++++++++++++++------------------------ gfceu.xml | 223 +++++++++++++++++++++++++---------------------- 3 files changed, 262 insertions(+), 225 deletions(-) diff --git a/gfceu b/gfceu index 8ab336d0..abfc1b54 100644 --- a/gfceu +++ b/gfceu @@ -44,7 +44,7 @@ except ImportError: -class game_options: +class GameOptions: # sound sound_check = True soundq_check = True @@ -59,6 +59,7 @@ class game_options: extra_entry = '' romfile = '' opengl_check = False + autoscale_check = True # network join_radio = False @@ -107,6 +108,7 @@ def give_widgets(): # video widgets.get_object("fullscreen_check").set_active(options.fullscreen_check) widgets.get_object("opengl_check").set_active(options.opengl_check) + widgets.get_object("autoscale_check").set_active(options.autoscale_check) widgets.get_object("xscale_spin").set_value(options.xscale_spin) widgets.get_object("yscale_spin").set_value(options.yscale_spin) @@ -126,10 +128,8 @@ def give_widgets(): except AttributeError: # When new widgets are added, old pickle files might break. - options = game_options() - give_widgets() - except RuntimeError: - print "shit" + options = GameOptions() + give_widgets() def set_options(): """ @@ -149,6 +149,8 @@ def set_options(): # video options.fullscreen_check = widgets.get_object("fullscreen_check").get_active() options.opengl_check = widgets.get_object("opengl_check").get_active() + options.autoscale_check = widgets.get_object("autoscale_check").get_active() + options.xscale_spin = widgets.get_object("xscale_spin").get_value() options.yscale_spin = widgets.get_object("yscale_spin").get_value() @@ -194,7 +196,7 @@ def find_binary(file): # # # # # # # # # # # # # # # # # # Globals options = None -optionsfile = os.getenv('HOME') + '/gfceu_options.dat' +optionsfile = os.getenv('HOME') + '/.gfceu_options.dat' widgets = None class GfceuApp: @@ -202,7 +204,7 @@ class GfceuApp: self.fceux_binary = self.find_fceu() self.load_ui() - options = game_options() + options = GameOptions() load_options() give_widgets() try: @@ -311,6 +313,11 @@ class GfceuApp: video_options += '--opengl 1 ' else: video_options += '--opengl 0 ' + + if options.autoscale_check: + video_options += '--autoscale 1 ' + else: + video_options += '--autoscale 0 ' video_options += ' --xscale ' + str(options.xscale_spin) video_options += ' --yscale ' + str(options.yscale_spin) diff --git a/gfceu.glade b/gfceu.glade index c3478d33..d2a3582a 100644 --- a/gfceu.glade +++ b/gfceu.glade @@ -1,6 +1,7 @@ - + + + - @@ -35,16 +36,27 @@ - + True True True - Right + Up + 0 + + + 1 + 2 + + + + + True + True + True + Left 0 - 2 - 3 1 2 @@ -65,31 +77,20 @@ - + True True True - Left + Right 0 + 2 + 3 1 2 - - - True - True - True - Up - 0 - - - 1 - 2 - - @@ -337,8 +338,8 @@ Artwork for old versions (< 0.2.7): Main - False tab + False @@ -386,30 +387,17 @@ Artwork for old versions (< 0.2.7): 5 5 - + True True - Gamepad _1 + Gamepad _3 True 0 - - - - - - True - True - Gamepad _2 - True - 0 - - - - 1 - 2 + 1 + 2 @@ -431,17 +419,30 @@ Artwork for old versions (< 0.2.7): - + True True - Gamepad _3 + Gamepad _2 + True + 0 + + + + 1 + 2 + + + + + + True + True + Gamepad _1 True 0 - 1 - 2 @@ -480,9 +481,9 @@ Artwork for old versions (< 0.2.7): Input + tab 1 False - tab @@ -519,6 +520,20 @@ Artwork for old versions (< 0.2.7): 1 + + + True + True + _Autoscale Fullscreen + True + 0 + True + + + False + 2 + + True @@ -548,7 +563,7 @@ Artwork for old versions (< 0.2.7): False - 2 + 3 @@ -581,7 +596,7 @@ Artwork for old versions (< 0.2.7): False - 3 + 4 @@ -609,7 +624,7 @@ Artwork for old versions (< 0.2.7): False - 4 + 5 @@ -622,7 +637,7 @@ Artwork for old versions (< 0.2.7): False False - 5 + 6 @@ -636,9 +651,9 @@ Artwork for old versions (< 0.2.7): Video + tab 2 False - tab @@ -722,9 +737,9 @@ Invalid options may cause GFCE Ultra to perform incorrectly. Advanced + tab 3 False - tab @@ -839,9 +854,9 @@ Invalid options may cause GFCE Ultra to perform incorrectly. Sound + tab 4 False - tab @@ -882,26 +897,15 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 5 5 - + True - 0 - Port: - - - GTK_FILL - - - - - - True - 0 - Password: + True + 1 + 2 1 2 - GTK_FILL @@ -919,15 +923,26 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - + True - True + 0 + Password: - 1 - 2 1 2 + GTK_FILL + + + + + + True + 0 + Port: + + + GTK_FILL @@ -978,13 +993,54 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 3 5 - + True True + 4046 1 65536 1 10 10 + 1 1 2 + 1 + 2 + + + + + + True + 0 + Password: + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + Server Port: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Server Address: + + + GTK_FILL @@ -1004,54 +1060,13 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - - True - 0 - Server Address: - - - GTK_FILL - - - - - - True - 0 - Server Port: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - + True True - 4046 1 65536 1 10 10 - 1 1 2 - 1 - 2 @@ -1096,9 +1111,9 @@ Invalid options may cause GFCE Ultra to perform incorrectly. Network + tab 5 False - tab diff --git a/gfceu.xml b/gfceu.xml index 671b14b8..496f7fbe 100644 --- a/gfceu.xml +++ b/gfceu.xml @@ -1,3 +1,5 @@ + + 10 @@ -65,15 +67,25 @@ - + True True True - Right + Up + + + 1 + 2 + + + + + True + True + True + Left - 2 - 3 1 2 @@ -93,29 +105,19 @@ - + True True True - Left + Right + 2 + 3 1 2 - - - True - True - True - Up - - - 1 - 2 - - @@ -397,28 +399,16 @@ Artwork for old versions (< 0.2.7): 5 5 - + True True - Gamepad _1 + Gamepad _3 True - - - - - - True - True - Gamepad _2 - True - - - - 1 - 2 + 1 + 2 @@ -439,16 +429,28 @@ Artwork for old versions (< 0.2.7): - + True True - Gamepad _3 + Gamepad _2 + True + + + + 1 + 2 + + + + + + True + True + Gamepad _1 True - 1 - 2 @@ -519,6 +521,19 @@ Artwork for old versions (< 0.2.7): 1 + + + True + True + _Autoscale Fullscreen + True + True + + + False + 2 + + True @@ -548,7 +563,7 @@ Artwork for old versions (< 0.2.7): False - 2 + 3 @@ -581,7 +596,7 @@ Artwork for old versions (< 0.2.7): False - 3 + 4 @@ -609,7 +624,7 @@ Artwork for old versions (< 0.2.7): False - 4 + 5 @@ -622,7 +637,7 @@ Artwork for old versions (< 0.2.7): False False - 5 + 6 @@ -870,26 +885,15 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 5 5 - + True - 0 - Port: - - - GTK_FILL - - - - - - True - 0 - Password: + True + 1 + 2 1 2 - GTK_FILL @@ -907,15 +911,26 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - + True - True + 0 + Password: - 1 - 2 1 2 + GTK_FILL + + + + + + True + 0 + Port: + + + GTK_FILL @@ -965,13 +980,54 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 3 5 - + True True + adjustment4 + 1 1 2 + 1 + 2 + + + + + + True + 0 + Password: + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + Server Port: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Server Address: + + + GTK_FILL @@ -991,54 +1047,13 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - - True - 0 - Server Address: - - - GTK_FILL - - - - - - True - 0 - Server Port: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - + True True - adjustment4 - 1 1 2 - 1 - 2