Merge pull request #398 from 0002647302/master

This is cleanup after recent changes
This commit is contained in:
TwistedUmbrella 2014-03-06 04:08:43 -05:00
commit 4b98fe2cb5
5 changed files with 15 additions and 25 deletions

View File

@ -68,10 +68,9 @@ Translations can be submitted as a pull request or at http://reicast.loungekatt.
Beta versions
-------------
Compiled test versions are available at http://reicast.loungekatt.com/ for Android.
Automated Git builds can also be found at http://reicast.angelxwind.net/ for iOS and Android.
Automated Git builds can be found at http://reicast.angelxwind.net/ for iOS and Android.
Android updates are also available through the plugin at http://reicast.loungekatt.com/.
Donations and stuff
-------------------

View File

@ -33,7 +33,7 @@
<style name="fpsOverlayText">
<item name="android:paddingLeft">4px</item>
<item name="android:paddingBottom">4px</item>
<item name="android:textColor">#ffffffff</item>
<item name="android:textColor">#ffff00</item>
<item name="android:textSize">32sp</item>
<item name="android:shadowColor">#000000</item>
<item name="android:shadowDx">1</item>

View File

@ -57,14 +57,6 @@ public class FileUtils {
return null;
}
public File[] listFilesAsArray(File directory, FilenameFilter[] filter,
int recurse) {
Collection<File> files = listFiles(directory, filter, recurse);
File[] arr = new File[files.size()];
return files.toArray(arr);
}
public Collection<File> listFiles(File directory, FilenameFilter[] filter,
int recurse) {
@ -96,7 +88,7 @@ public class FileUtils {
File dir = new File(MainActivity.home_directory);
SimpleDateFormat s = new SimpleDateFormat("yyyyMMddHHmmss");
String timestamp = s.format(new Date());
File f = new File(dir.getPath(), timestamp+".jpeg");
File f = new File(dir.getAbsolutePath(), timestamp+".jpeg");
FileOutputStream out = new FileOutputStream(f);
savePixels(0, 0, w, h, gl).compress(Bitmap.CompressFormat.JPEG, 100, out);
out.close();

View File

@ -8,6 +8,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@ -170,7 +171,6 @@ public class FileBrowser extends Fragment {
@Override
protected List<File> doInBackground(String... paths) {
final List<File> tFileList = new ArrayList<File>();
File storage = new File(paths[0]);
Resources resources = parentActivity.getResources();
// array of valid image file extensions
@ -196,9 +196,8 @@ public class FileBrowser extends Fragment {
}
FileUtils fileUtils = new FileUtils();
File[] allMatchingFiles = fileUtils.listFilesAsArray(storage, filter, 1);
Collections.addAll(tFileList, allMatchingFiles);
return tFileList;
Collection<File> files = fileUtils.listFiles(storage, filter, 1);
return (List<File>) files;
}
@Override

View File

@ -343,14 +343,14 @@ public class GL2JNINative extends NativeActivity {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD
&& event.getSource() != Gamepad.Xperia_Touchpad) {
Integer playerNum = Arrays.asList(pad.name).indexOf(event.getDeviceId());
int playerNum = Arrays.asList(pad.name).indexOf(event.getDeviceId());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && playerNum == -1) {
playerNum = pad.deviceDescriptor_PlayerNum
.get(pad.deviceId_deviceDescriptor.get(event.getDeviceId()));
} else {
playerNum = -1;
}
if (playerNum == null || playerNum == -1) {
if (playerNum == -1) {
return false;
}
if (!pad.compat[playerNum]) {
@ -416,8 +416,8 @@ public class GL2JNINative extends NativeActivity {
}
boolean handle_key(Integer playerNum, int kc, boolean down) {
if (playerNum == null || playerNum == -1)
boolean handle_key(int playerNum, int kc, boolean down) {
if (playerNum == -1)
return false;
if (kc == pad.getSelectButtonCode()) {
return false;
@ -473,8 +473,8 @@ public class GL2JNINative extends NativeActivity {
}
public boolean OnNativeKeyPress(int device, int keyCode, int action, int metaState) {
Integer playerNum = pad.playerNumX.get(device);
if (playerNum != null && playerNum != -1) {
int playerNum = pad.playerNumX.get(device);
if (playerNum != -1) {
String id = pad.portId[playerNum];
if (action == KeyEvent.ACTION_DOWN) {
if (keyCode == prefs.getInt(Gamepad.pref_button_l + id, KeyEvent.KEYCODE_BUTTON_L1)) {
@ -504,8 +504,8 @@ public class GL2JNINative extends NativeActivity {
public boolean OnNativeMotion(int device, int source, int action, int x, int y, boolean newEvent) {
if (newEvent && source == Gamepad.Xperia_Touchpad) {
// Source is Xperia Play touchpad
Integer playerNum = pad.playerNumX.get(device);
if (playerNum != null && playerNum != -1) {
int playerNum = pad.playerNumX.get(device);
if (playerNum != -1) {
Log.d("reidc", playerNum + " - " + device + ": " + source);
if (action == MotionEvent.ACTION_UP) {
x = 0;