Permalink
Browse files

front: Remove some superfluous UserPrefs fields.

  • Loading branch information...
littleguy77 committed Jan 29, 2015
1 parent 3a3a9d3 commit 9c0c381854b72d10cbf28d573e8bb9eafb3ee4ea
@@ -233,7 +233,7 @@ public void onCreateEnd( Bundle savedInstanceState )
mUserPrefs.isTouchscreenAnimated, mUserPrefs.isFpsEnabled,
mUserPrefs.touchscreenScale, mUserPrefs.touchscreenTransparency );
mOverlay.initialize( mTouchscreenMap, !mGamePrefs.isTouchscreenHidden,
- mUserPrefs.displayFpsRefresh, mUserPrefs.touchscreenRefresh );
+ mUserPrefs.isFpsEnabled, mUserPrefs.isTouchscreenAnimated );
}
// Initialize user interface devices
@@ -42,14 +42,14 @@ public GameOverlay( Context context, AttributeSet attribs )
requestFocus();
}
- public void initialize( VisibleTouchMap touchMap, boolean drawingEnabled, int fpsRefreshPeriod, int hatRefreshPeriod )
+ public void initialize( VisibleTouchMap touchMap, boolean drawingEnabled, boolean fpsEnabled, boolean joystickAnimated )
{
mTouchMap = touchMap;
mDrawingEnabled = drawingEnabled;
- mFpsEnabled = fpsRefreshPeriod > 0;
- mHatRefreshPeriod = hatRefreshPeriod;
+ mFpsEnabled = fpsEnabled;
+ mHatRefreshPeriod = joystickAnimated ? 3 : 0;
- CoreInterface.setOnFpsChangedListener( this, fpsRefreshPeriod );
+ CoreInterface.setOnFpsChangedListener( this, fpsEnabled ? 15 : 0 );
}
@Override
@@ -135,9 +135,6 @@
/** True if the touchscreen joystick is animated. */
public final boolean isTouchscreenAnimated;
- /** The number of frames over which touchscreen is redrawn (0 = disabled). */
- public final int touchscreenRefresh;
-
/** The directory of the selected touchscreen skin. */
public final String touchscreenSkin;
@@ -192,9 +189,6 @@
/** True if the FPS indicator is displayed. */
public final boolean isFpsEnabled;
- /** The number of frames over which FPS is calculated (0 = disabled). */
- public final int displayFpsRefresh;
-
/** True if immersive mode should be used (KitKat only). */
public final boolean isImmersiveModeEnabled;
@@ -314,7 +308,6 @@ public UserPrefs( Context context )
// Touchscreen prefs
isTouchscreenFeedbackEnabled = mPreferences.getBoolean( "touchscreenFeedback", false );
isTouchscreenAnimated = mPreferences.getBoolean( "touchscreenAnimation", false );
- touchscreenRefresh = isTouchscreenAnimated ? 3 : 0;
touchscreenScale = ( (float) mPreferences.getInt( "touchscreenScale", 100 ) ) / 100.0f;
touchscreenTransparency = ( 255 * mPreferences.getInt( "touchscreenTransparency", 100 ) ) / 100;
touchscreenSkin = appData.touchscreenSkinsDir + "/" + mPreferences.getString( "touchscreenStyle", "Outline" );
@@ -337,7 +330,6 @@ public UserPrefs( Context context )
int transparencyPercent = mPreferences.getInt( "displayActionBarTransparency", 50 );
displayActionBarTransparency = ( 255 * transparencyPercent ) / 100;
isFpsEnabled = mPreferences.getBoolean( "displayFps", false );
- displayFpsRefresh = isFpsEnabled ? 15 : 0;
int selectedHardwareType = getSafeInt( mPreferences, "videoHardwareType", -1 );
isPolygonOffsetHackEnabled = selectedHardwareType > -2;
videoHardwareType = selectedHardwareType < 0 ? appData.hardwareInfo.hardwareType : selectedHardwareType;
@@ -168,7 +168,7 @@ protected void onCreate( Bundle savedInstanceState )
// Initialize the touchmap and overlay
mTouchscreenMap = new VisibleTouchMap( getResources() );
mOverlay.setOnTouchListener( this );
- mOverlay.initialize( mTouchscreenMap, true, 1, mUserPrefs.isTouchscreenAnimated ? 1 : 0 );
+ mOverlay.initialize( mTouchscreenMap, true, mUserPrefs.isFpsEnabled, mUserPrefs.isTouchscreenAnimated );
}
@TargetApi( 11 )

0 comments on commit 9c0c381

Please sign in to comment.