[Android] Update code to compile with updated libs
This commit is contained in:
parent
e257ac1050
commit
bbaa6eca7e
|
@ -14,7 +14,7 @@ import emu.project64.R;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.v7.internal.view.menu.MenuBuilder;
|
import android.support.v7.view.menu.MenuBuilder;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
|
|
@ -18,7 +18,6 @@ import android.annotation.SuppressLint;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
import android.util.FloatMath;
|
|
||||||
import android.util.SparseIntArray;
|
import android.util.SparseIntArray;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -501,7 +500,7 @@ public class TouchController extends AbstractController implements OnTouchListen
|
||||||
// Compute the pythagorean displacement of the stick
|
// Compute the pythagorean displacement of the stick
|
||||||
int dX = point.x;
|
int dX = point.x;
|
||||||
int dY = point.y;
|
int dY = point.y;
|
||||||
float displacement = FloatMath.sqrt( ( dX * dX ) + ( dY * dY ) );
|
float displacement = (float) Math.sqrt( ( dX * dX ) + ( dY * dY ) );
|
||||||
|
|
||||||
// "Capture" the analog control
|
// "Capture" the analog control
|
||||||
if( mTouchMap.isInCaptureRange( displacement ) )
|
if( mTouchMap.isInCaptureRange( displacement ) )
|
||||||
|
@ -515,7 +514,7 @@ public class TouchController extends AbstractController implements OnTouchListen
|
||||||
point = mTouchMap.getConstrainedDisplacement( dX, dY );
|
point = mTouchMap.getConstrainedDisplacement( dX, dY );
|
||||||
dX = point.x;
|
dX = point.x;
|
||||||
dY = point.y;
|
dY = point.y;
|
||||||
displacement = FloatMath.sqrt( ( dX * dX ) + ( dY * dY ) );
|
displacement = (float) Math.sqrt( ( dX * dX ) + ( dY * dY ) );
|
||||||
|
|
||||||
// Fraction of full-throttle, between 0 and 1, inclusive
|
// Fraction of full-throttle, between 0 and 1, inclusive
|
||||||
float p = mTouchMap.getAnalogStrength( displacement );
|
float p = mTouchMap.getAnalogStrength( displacement );
|
||||||
|
|
|
@ -23,7 +23,6 @@ import android.annotation.SuppressLint;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.util.FloatMath;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
|
|
||||||
|
@ -364,7 +363,7 @@ public class TouchMap
|
||||||
public Point getConstrainedDisplacement( int dX, int dY )
|
public Point getConstrainedDisplacement( int dX, int dY )
|
||||||
{
|
{
|
||||||
final float dC = (int) ( analogMaximum * scale );
|
final float dC = (int) ( analogMaximum * scale );
|
||||||
final float dA = dC * FloatMath.sqrt( 0.5f );
|
final float dA = dC * (float)Math.sqrt( 0.5f );
|
||||||
final float signX = (dX < 0) ? -1 : 1;
|
final float signX = (dX < 0) ? -1 : 1;
|
||||||
final float signY = (dY < 0) ? -1 : 1;
|
final float signY = (dY < 0) ? -1 : 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue