Jelajahi Sumber

Deprecated a couple of variables and functions for the old acceleration only fallback (reimplementing this smarter)

Joey Ferwerda 9 tahun lalu
induk
melakukan
4ea7aac59c
2 mengubah file dengan 1 tambahan dan 55 penghapusan
  1. 1 47
      src/drv_android/android.c
  2. 0 8
      src/openhmd.c

+ 1 - 47
src/drv_android/android.c

@@ -184,50 +184,6 @@ static int getf(ohmd_device* device, ohmd_float_value type, float* out)
 	return 0;
 }
 
-static int setf(ohmd_device* device, ohmd_float_value type, float* in)
-{
-	android_priv* priv = (android_priv*)device;
-
-	switch(type){
-		case OHMD_EXTERNAL_SENSOR_FUSION: {
-				if (priv->base.properties.accel_only == 1)
-					nofusion_update(&priv->sensor_fusion, *in, (vec3f*)(in + 4));
-				else
-					ofusion_update(&priv->sensor_fusion, *in, (vec3f*)(in + 1), (vec3f*)(in + 4), (vec3f*)(in + 7));
-			}
-			break;
-
-		default:
-			ohmd_set_error(priv->base.ctx, "invalid type given to setf (%d)", type);
-			return -1;
-			break;
-	}
-
-	return 0;
-}
-
-static int seti(ohmd_device* device, ohmd_int_value type, int* in)
-{
-	android_priv* priv = (android_priv*)device;
-
-	switch(type){
-		case OHMD_ACCELERATION_ONLY_FALLBACK: {
-			priv->base.properties.accel_only = in[0];
-
-			if(priv->base.properties.accel_only = 1)
-				nofusion_init(&priv->sensor_fusion); //re-init with different smoothing
-		}
-		break;
-
-		default:
-			ohmd_set_error(priv->base.ctx, "invalid type given to seti (%i)", type);
-			return -1;
-			break;
-		}
-
-		return 0;
-}
-
 static int set_data(ohmd_device* device, ohmd_data_value type, void* in)
 {
 	android_priv* priv = (android_priv*)device;
@@ -281,8 +237,6 @@ static ohmd_device* open_device(ohmd_driver* driver, ohmd_device_desc* desc)
 	priv->base.update = update_device;
 	priv->base.close = close_device;
 	priv->base.getf = getf;
-	priv->base.setf = setf;
-	priv->base.seti = seti;
 	priv->base.set_data = set_data;
 
     //init Android sensors
@@ -292,7 +246,7 @@ static ohmd_device* open_device(ohmd_driver* driver, ohmd_device_desc* desc)
     priv->gyroscopeSensor = ASensorManager_getDefaultSensor(priv->sensorManager,
             ASENSOR_TYPE_GYROSCOPE);
 
-    priv->firstRun = 1; //need this since ASensorManager_createEventQueue requires a set android_app
+    priv->firstRun = 1; //need this since ASensorManager_createEventQueue requires a set android_app*
 
     ///TODO: Use ASensorManager_getSensorList to set accel only fallback
     //if (!priv->gyroscopeSensor)

+ 0 - 8
src/openhmd.c

@@ -288,9 +288,6 @@ int OHMD_APIENTRY ohmd_device_geti(ohmd_device* device, ohmd_int_value type, int
 	case OHMD_SCREEN_VERTICAL_RESOLUTION:
 		*out = device->properties.vres;
 		return OHMD_S_OK;
-	case OHMD_ACCELERATION_ONLY_FALLBACK:
-		*out = device->properties.accel_only;
-		return OHMD_S_OK;
 	default:
 		return OHMD_S_INVALID_PARAMETER;
 	}
@@ -299,11 +296,6 @@ int OHMD_APIENTRY ohmd_device_geti(ohmd_device* device, ohmd_int_value type, int
 int OHMD_APIENTRY ohmd_device_seti(ohmd_device* device, ohmd_int_value type, int* in)
 {
 	switch(type){
-	case OHMD_ACCELERATION_ONLY_FALLBACK: {
-		device->properties.accel_only = in[0];
-		return OHMD_S_OK;
-	}
-	break;
 	default:
 		return OHMD_S_INVALID_PARAMETER;
 	}