Browse Source

re-enable joystick for android builds; fix config bug when scalequality and aspectratio both exist

Pal Lockheart 6 years ago
parent
commit
f614f540a3
2 changed files with 6 additions and 2 deletions
  1. 2 0
      android/app/src/main/cpp/pal_config.h
  2. 4 2
      palcfg.c

+ 2 - 0
android/app/src/main/cpp/pal_config.h

@@ -51,6 +51,8 @@
 
 #define PAL_FILESYSTEM_IGNORE_CASE 1
 
+#define PAL_HAS_JOYSTICKS 1
+
 # define PAL_IS_VALID_JOYSTICK(s)  (strcmp((s), "Android Accelerometer") != 0)
 
 PAL_C_LINKAGE_BEGIN

+ 4 - 2
palcfg.c

@@ -423,13 +423,15 @@ PAL_LoadConfig(
                     break;
                 case PALCFG_ASPECTRATIO:
                 {
-                    char *aspectRatio = ParseStringValue(value.sValue, gConfig.pszScaleQuality);
+                    char *origAspectRatio = strdup(value.sValue);
+                    char *aspectRatio = ParseStringValue(value.sValue, origAspectRatio);
                     char *lasts;
 					if( strchr(aspectRatio,':') == NULL ) {
-						aspectRatio = ParseStringValue(item->DefaultValue.sValue, gConfig.pszScaleQuality);
+						aspectRatio = ParseStringValue(item->DefaultValue.sValue, origAspectRatio);
 					}
 					dwAspectX = atoi(strtok_r(aspectRatio,":",&lasts));
 					dwAspectY = atoi(strtok_r(NULL,       ":",&lasts));
+                    free(origAspectRatio);
                     break;
                 }
 				default: