Integrated Michi's changes to accelerometer joystick and to video aspect ratio

This commit is contained in:
pelya
2010-10-15 16:04:42 +03:00
parent ebaff58990
commit a8f3d8b6b7
19 changed files with 152 additions and 65 deletions

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import android.app.Activity;
import android.content.Context;
@@ -52,16 +52,19 @@ class AccelerometerReader implements SensorEventListener {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER)
{
if( Globals.HorizontalOrientation )
nativeAccelerometer(event.values[1], -event.values[0], event.values[2]);
// TODO: it feels better for me to use tilt as X value instead of intuitive horizontal phone orientation
// because then I can hold device comfortably, we need another user-configurable option for that
// nativeOrientation(event.values[1], -event.values[2], event.values[0]); // Comfortable setting
nativeAccelerometer(event.values[1], -event.values[0], event.values[2]); // Intuitive setting
else
nativeAccelerometer(event.values[0], event.values[1], event.values[2]);
}
else
{
if( Globals.HorizontalOrientation )
nativeOrientation(event.values[1], -event.values[0], event.values[2]);
nativeOrientation(event.values[1], -event.values[2], event.values[0]);
else
nativeOrientation(event.values[0], event.values[1], event.values[2]);
nativeOrientation(event.values[2], event.values[1], event.values[0]);
}
}