display-framerate and mappings options in gconf
authorJavier S. Pedro <maemo@javispedro.com>
Sat, 29 Aug 2009 01:14:27 +0000 (03:14 +0200)
committerJavier S. Pedro <maemo@javispedro.com>
Sat, 29 Aug 2009 01:15:21 +0000 (03:15 +0200)
debian/changelog
platform/hgw.cpp
platform/hgw.h

index 771ea0d..63491e5 100644 (file)
@@ -1,8 +1,11 @@
 drnoksnes (0.9.5) unstable; urgency=low
 
   * Icon in packaging
+  * Fixing GUI bugs and improved ROM compatibility.
+  * Touchscreen controls.
+  * Mouse/Touchscreen options in GUI.
 
- -- Javier S. Pedro <maemo@javispedro.com>  Wed, 26 Aug 2009 00:02:31 +0200
+ -- Javier S. Pedro <maemo@javispedro.com>  Sat, 29 Aug 2009 03:12:42 +0200
 
 drnoksnes (0.9.4) unstable; urgency=low
 
index dee9427..d1c813d 100644 (file)
@@ -15,6 +15,7 @@
 bool hgwLaunched;
 static HgwContext *hgw;
 
+static void createActionMappingsOnly();
 static void parseGConfKeyMappings();
 
 void HgwInit()
@@ -82,6 +83,11 @@ void HgwConfig()
        if (hgw_conf_request_bool(hgw, kGConfTransparency, &transparency) == HGW_ERR_NONE) {
                Settings.Transparency = transparency ? TRUE : FALSE;
        }
+       
+       char displayFramerate = FALSE;
+       if (hgw_conf_request_bool(hgw, kGConfDisplayFramerate, &displayFramerate) == HGW_ERR_NONE) {
+               Settings.DisplayFrameRate = displayFramerate ? TRUE : FALSE;
+       }
 
        int speedhacks = 0;
        if (hgw_conf_request_int(hgw, kGConfFrameskip, &speedhacks) == HGW_ERR_NONE) {
@@ -100,7 +106,27 @@ void HgwConfig()
        int mappings = 0;
        if (hgw_conf_request_int(hgw, kGConfMapping, &mappings) == HGW_ERR_NONE) {
                switch (mappings) {
-                       case 1:
+                       case 0:
+                               // Do nothing, leave mappings as is.
+                               break;
+                       case 1: // Keys
+                               parseGConfKeyMappings();
+                               break;
+                       case 2: // Touchscreen
+                               Config.touchscreenInput = true;
+                               createActionMappingsOnly();
+                               break;
+                       case 3: // Touchscreen + keys
+                               Config.touchscreenInput = true;
+                               parseGConfKeyMappings();
+                               break;
+                       case 4: // Mouse
+                               Settings.Mouse = TRUE;
+                               Settings.ControllerOption = SNES_MOUSE_SWAPPED;
+                               break;
+                       case 5: // Mouse + keys
+                               Settings.Mouse = TRUE;
+                               Settings.ControllerOption = SNES_MOUSE;
                                parseGConfKeyMappings();
                                break;
                }
@@ -192,6 +218,17 @@ static const ButtonEntry buttons[] = {
        BUTTON_LAST
 };
 
+static void createActionMappingsOnly()
+{
+       // Discard any other mapping
+       ZeroMemory(Config.joypad1Mapping, sizeof(Config.joypad1Mapping));
+       ZeroMemory(Config.action, sizeof(Config.action));
+       
+       // Map quit to fullscreen and escape
+       Config.action[72] = kActionQuit;
+       Config.action[9] = kActionQuit;
+}
+
 static void parseGConfKeyMappings()
 {
        // Discard any other mapping
index 47200f5..21832f9 100644 (file)
@@ -16,6 +16,7 @@ void HgwPollEvents();
 #define kGConfTurboMode kGConfPath "/" "turbo"
 #define kGConfFrameskip kGConfPath "/" "frameskip"
 #define kGConfTransparency kGConfPath "/" "transparency"
+#define kGConfDisplayFramerate kGConfPath "/" "display-framerate"
 #define kGConfSpeedhacks kGConfPath "/" "speedhacks"
 #define kGConfMapping kGConfPath "/" "mapping"
 #define kGConfKeysPath kGConfPath "/" "keys"