Merge pull request #351 from ThePlayground/master

This pull is any last minute changes and fixes
This commit is contained in:
TwistedUmbrella 2014-02-26 22:03:00 -05:00
commit 21a8a54f88
3 changed files with 62 additions and 58 deletions

View File

@ -33,8 +33,6 @@ public class Config {
/**
* Load the user configuration from preferences
*
* @param sharedpreferences
* The preference instance to load values from
*/
public void getConfigurationPrefs() {
Config.dynarecopt = mPrefs.getBoolean("dynarec_opt", dynarecopt);

View File

@ -376,8 +376,8 @@ public class InputModFragment extends Fragment {
/**
* Retrieve an image to serve as a visual representation
*
* @param int The x start value of the image within the atlas
* @param int The y start value of the image within the atlas
* @param x The x start value of the image within the atlas
* @param y The y start value of the image within the atlas
*/
private Drawable getButtonImage(int x, int y) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
@ -462,9 +462,9 @@ public class InputModFragment extends Fragment {
/**
* Prompt the user for the button to be assigned
*
* @param string
* @param button
* The name of the emulator button being defined
* @param textview
* @param output
* The output display for the assigned button value
*/
public void intiateSearch(final String button, final TextView output) {
@ -499,8 +499,8 @@ public class InputModFragment extends Fragment {
/**
* Assign the user button to the emulator button
*
* @param int The keycode generated by the button being assigned
* @param keyevent
* @param keyCode The keycode generated by the button being assigned
* @param event
* The keyevent generated by the button being assigned
*/
private int mapButton(int keyCode, KeyEvent event) {

View File

@ -215,22 +215,26 @@ public class OnScreenMenu {
fdown = addbut(R.drawable.frames_down, new OnClickListener() {
public void onClick(View v) {
if (frames > 0) {
frames--;
}
JNIdc.frameskip(frames);
enableState(fup, fdown, frames);
enableState(fdown, fup);
}
});
fup = addbut(R.drawable.frames_up, new OnClickListener() {
public void onClick(View v) {
if (frames < 5) {
frames++;
}
JNIdc.frameskip(frames);
enableState(fup, fdown, frames);
enableState(fdown, fup);
}
});
hlay.addView(fdown, params);
hlay.addView(fup, params);
enableState(fdown, fup, frames);
enableState(fdown, fup);
framelimit = addbut(R.drawable.frames_limit_on,
new OnClickListener() {
@ -285,45 +289,39 @@ public class OnScreenMenu {
}
hlay.addView(audiosetting, params);
fastforward = addbut(R.drawable.star,
new OnClickListener() {
fastforward = addbut(R.drawable.star, new OnClickListener() {
public void onClick(View v) {
if (boosted) {
if (audio) {
if (mContext instanceof GL2JNIActivity) {
((GL2JNIActivity) mContext).mView
.audioDisable(false);
}
.audioDisable(!audio);
}
audiosetting.setEnabled(true);
if (limit) {
JNIdc.limitfps(1);
}
JNIdc.limitfps(limit ? 1 : 0);
framelimit.setEnabled(true);
JNIdc.frameskip(frames);
enableState(fdown, fup);
if (mContext instanceof GL2JNIActivity) {
((GL2JNIActivity) mContext).mView
.fastForward(true);
((GL2JNIActivity) mContext).mView.fastForward(false);
}
boosted = true;
boosted = false;
((ImageButton) fastforward)
.setImageResource(R.drawable.star);
} else {
if (audio) {
if (mContext instanceof GL2JNIActivity) {
((GL2JNIActivity) mContext).mView
.audioDisable(true);
}
}
if (limit) {
JNIdc.limitfps(0);
}
audiosetting.setEnabled(false);
if (mContext instanceof GL2JNIActivity) {
((GL2JNIActivity) mContext).mView
.fastForward(false);
}
JNIdc.limitfps(0);
framelimit.setEnabled(false);
boosted = false;
JNIdc.frameskip(5);
fdown.setEnabled(false);
fup.setEnabled(false);
if (mContext instanceof GL2JNIActivity) {
((GL2JNIActivity) mContext).mView.fastForward(true);
}
boosted = true;
((ImageButton) fastforward)
.setImageResource(R.drawable.reset);
}
@ -347,13 +345,21 @@ public class OnScreenMenu {
}
}
private void enableState(View fdown, View fup, int frames) {
if (frames <= 0) {
/**
* Toggle the frameskip button visibility by current value
*
* @param fdown
* The frameskip reduction button view
* @param fup
* The frameskip increase button view
*/
private void enableState(View fdown, View fup) {
if (frames == 0) {
fdown.setEnabled(false);
} else {
fdown.setEnabled(true);
}
if (frames >= 5) {
if (frames == 5) {
fup.setEnabled(false);
} else {
fup.setEnabled(true);