[Android] Update code to compile with updated libs

This commit is contained in:
zilmar 2016-07-07 18:05:47 +10:00
parent e257ac1050
commit bbaa6eca7e
3 changed files with 4 additions and 6 deletions

View File

@ -14,7 +14,7 @@ import emu.project64.R;
import android.app.Activity;
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.DisplayMetrics;
import android.view.LayoutInflater;

View File

@ -18,7 +18,6 @@ import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.graphics.Point;
import android.os.Vibrator;
import android.util.FloatMath;
import android.util.SparseIntArray;
import android.view.MotionEvent;
import android.view.View;
@ -501,7 +500,7 @@ public class TouchController extends AbstractController implements OnTouchListen
// Compute the pythagorean displacement of the stick
int dX = point.x;
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
if( mTouchMap.isInCaptureRange( displacement ) )
@ -515,7 +514,7 @@ public class TouchController extends AbstractController implements OnTouchListen
point = mTouchMap.getConstrainedDisplacement( dX, dY );
dX = point.x;
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
float p = mTouchMap.getAnalogStrength( displacement );

View File

@ -23,7 +23,6 @@ import android.annotation.SuppressLint;
import android.content.res.Resources;
import android.graphics.Point;
import android.graphics.Rect;
import android.util.FloatMath;
import android.util.Log;
import android.util.SparseArray;
@ -364,7 +363,7 @@ public class TouchMap
public Point getConstrainedDisplacement( int dX, int dY )
{
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 signY = (dY < 0) ? -1 : 1;