Merge branch 'master' of https://code.google.com/p/dolphin-emu into dx9-ssaa-fix

This commit is contained in:
Rodolfo Bogado 2013-08-13 17:30:22 -03:00
commit 85f91d66ba
27 changed files with 621 additions and 232 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/FolderTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginTop="5dip"
android:singleLine="true"
android:text="Title"
android:textStyle="bold" />
<TextView
android:id="@+id/FolderSubTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:text="Subtitle" />
</LinearLayout>
</LinearLayout>

View file

@ -1,29 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="3dip">
<TextView
android:id="@+id/FolderTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginTop="5dip"
android:singleLine="true"
android:text="Title"
android:textStyle="bold" />
<ImageView
android:id="@+id/ImageIcon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
<TextView
android:id="@+id/FolderSubTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:text="Subtitle" />
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="6dip"/>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/FolderSubTitle"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:layout_toRightOf="@id/ImageIcon"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:singleLine="true"
android:ellipsize="marquee"
android:text="Subtitle" />
<TextView
android:id="@+id/FolderTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/ImageIcon"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_above="@id/FolderSubTitle"
android:layout_alignWithParentIfMissing="true"
android:gravity="center_vertical"
android:text="Title"
android:textStyle="bold" />/>
</RelativeLayout>

View file

@ -2,23 +2,23 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
>
<PreferenceCategory
android:summary="Settings"
android:title="CPU Settings"
android:summary="@string/settings"
android:title="@string/cpu_settings"
android:key="cpuprefcat">
<CheckBoxPreference
android:key="dualcorepref"
android:summary="On/Off"
android:title="Dual Core" />
android:summary="@string/on_off"
android:title="@string/dual_core" />
</PreferenceCategory>
<PreferenceCategory
android:summary="Settings"
android:title="Video Settings"
android:summary="@string/settings"
android:title="@string/video_settings"
android:key="videoprefcat">
<ListPreference
android:entries="@array/gpuOptions"
android:entryValues="@array/gpuValues"
android:key="gpupref"
android:summary="Video backend to use"
android:title="Video Backend" />
android:summary="@string/video_backend_to_use"
android:title="@string/video_backend" />
</PreferenceCategory>
</PreferenceScreen>

View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Title of the app -->
<string name="app_name">Dolphin Emulator</string>
<!-- Navigation-related Strings -->
<string name="drawer_open">ナビゲーションウィンドウを開く</string>
<string name="drawer_close">ナビゲーションウィンドウを閉じる</string>
<!-- About Fragment -->
<string name="build_revision">ビルドのバージョン:</string>
<string name="supports_gles3">サポートのOpenGL ES 3</string>
<!-- Folder Browser -->
<string name="current_dir">現在のディレクトリ: </string>
<string name="parent_directory">親ディレクトリ</string>
<string name="folder">フォルダ</string>
<string name="file_size">ファイルサイズ: </string>
<string name="cant_use_compressed_filetypes">圧縮ファイル形式はサポートされていません</string>
<!-- Game List Activity -->
<string name="game_list">ゲームリスト</string>
<string name="browse_folder">フォルダの参照</string>
<string name="settings">設定</string>
<string name="gamepad_config">ゲームパッド設定</string>
<string name="about">について</string>
<string name="loading_browser">ファイルブラウザのロード</string>
<string name="loading_settings">設定のロード</string>
<string name="loading_gamepad">ゲームパッド設定のロード</string>
<string name="loading_about">メニューについてのロード</string>
<!-- Game List Fragment -->
<string name="file_clicked">クリックされたファイル: </string>
<!-- Input Config Fragment -->
<string name="draw_onscreen_controls">画面上のコントロールを描画</string>
<string name="button_a">Aボタン</string>
<string name="button_b">Bボタン</string>
<string name="button_start">スタートボタン</string>
<string name="button_x">Xボタン</string>
<string name="button_y">Yボタン</string>
<string name="button_z">Zボタン</string>
<string name="dpad_up">D-Pad: ↑</string>
<string name="dpad_down">D-Pad: ↓</string>
<string name="dpad_left">D-Pad: ←</string>
<string name="dpad_right">D-Pad: →</string>
<string name="main_stick_up">コントロールスティック: ↑</string>
<string name="main_stick_down">コントロールスティック: ↓</string>
<string name="main_stick_left">コントロールスティック: ←</string>
<string name="main_stick_right">コントロールスティック: →</string>
<string name="c_stick_up">C-スティック: ↑</string>
<string name="c_stick_down">C-スティック: ↓</string>
<string name="c_stick_left">C-スティック: ←</string>
<string name="c_stick_right">C-スティック: →</string>
<string name="trigger_left">左のトリガー</string>
<string name="trigger_right">右のトリガー</string>
<string name="not_drawing_onscreen_controls">コントロールは画面上に描画されていない</string>
<string name="drawing_onscreen_controls">コントロールは画面上に描画されています</string>
<string name="press_button_to_config">%1$sを設定するにはボタンを押して</string>
<!-- Prefs Fragment -->
<string name="interpreter">Interpreter</string>
<string name="jit64_recompiler">JIT64 Recompiler</string>
<string name="jitil_recompiler">JITIL Recompiler</string>
<string name="jit_arm_recompiler">JIT ARM Recompiler</string>
<string name="cpu_core">CPUコア</string>
<string name="cpu_settings">CPU設定</string>
<string name="emu_core_to_use">使用するエミュレーションコア</string>
<string name="dual_core">デュアルコア</string>
<string name="on_off">有効/無効</string>
<string name="video_settings">ビデオ設定</string>
<string name="software_renderer">Software Renderer</string>
<string name="video_backend">ビデオレンダラ</string>
<string name="video_backend_to_use">使用するビデオレンダラー</string>
<!-- Miscellaneous -->
<string name="yes">はい</string>
<string name="no">いいえ</string>
</resources>

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="gpuOptions">
<string-array name="gpuOptions" translatable="false">
<item>Software Renderer</item>
<item>OpenGL ES 3</item>
</string-array>
<string-array name="gpuValues">
<string-array name="gpuValues" translatable="false">
<item>Software Renderer</item>
<item>OGL</item>
</string-array>

View file

@ -1,8 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Title of the app -->
<string name="app_name">Dolphin Emulator</string>
<!-- Navigation-related Strings -->
<string name="drawer_open">Open navigation drawer</string>
<string name="drawer_close">Close navigation drawer</string>
<!-- About Fragment -->
<string name="build_revision">Build Revision:</string>
<string name="supports_gles3">Supports OpenGL ES 3:</string>
<!-- Folder Browser -->
<string name="current_dir">Current Dir: </string>
<string name="parent_directory">Parent Directory</string>
<string name="folder">Folder</string>
<string name="file_size">File Size: </string>
<string name="cant_use_compressed_filetypes">Can not use compressed file types</string>
<!-- Game List Activity -->
<string name="game_list">Game List</string>
<string name="browse_folder">Browse Folder</string>
<string name="settings">Settings</string>
<string name="gamepad_config">Gamepad Config</string>
<string name="about">About</string>
<string name="loading_browser">Loading up the browser</string>
<string name="loading_settings">Loading up settings</string>
<string name="loading_gamepad">Loading up gamepad config</string>
<string name="loading_about">Loading about menu</string>
<!-- Game List Fragment -->
<string name="file_clicked">File clicked: </string>
<!-- Input Config Fragment -->
<string name="draw_onscreen_controls">Draw on-screen controls</string>
<string name="button_a">Button A</string>
<string name="button_b">Button B</string>
<string name="button_start">Button Start</string>
<string name="button_x">Button X</string>
<string name="button_y">Button Y</string>
<string name="button_z">Button Z</string>
<string name="dpad_up">D-Pad Up</string>
<string name="dpad_down">D-Pad Down</string>
<string name="dpad_left">D-Pad Left</string>
<string name="dpad_right">D-Pad Right</string>
<string name="main_stick_up">Main Stick Up</string>
<string name="main_stick_down">Main Stick Down</string>
<string name="main_stick_left">Main Stick Left</string>
<string name="main_stick_right">Main Stick Right</string>
<string name="c_stick_up">C Stick Up</string>
<string name="c_stick_down">C Stick Down</string>
<string name="c_stick_left">C Stick Left</string>
<string name="c_stick_right">C Stick Right</string>
<string name="trigger_left">Trigger L</string>
<string name="trigger_right">Trigger R</string>
<string name="not_drawing_onscreen_controls">Not drawing on-screen controls</string>
<string name="drawing_onscreen_controls">Drawing on-screen controls</string>
<string name="press_button_to_config">Press button to configure %1$s</string>
<!-- Prefs Fragment -->
<string name="interpreter">Interpreter</string>
<string name="jit64_recompiler">JIT64 Recompiler</string>
<string name="jitil_recompiler">JITIL Recompiler</string>
<string name="jit_arm_recompiler">JIT ARM Recompiler</string>
<string name="cpu_core">CPU Core</string>
<string name="cpu_settings">CPU Settings</string>
<string name="emu_core_to_use">Emulation core to use</string>
<string name="dual_core">Dual Core</string>
<string name="on_off">On/Off</string>
<string name="video_settings">Video Settings</string>
<string name="software_renderer">Software Renderer</string>
<string name="video_backend">Video Backend</string>
<string name="video_backend_to_use">Video backend to use</string>
<!-- Miscellaneous -->
<string name="yes">Yes</string>
<string name="no">No</string>
</resources>

View file

@ -22,7 +22,6 @@ public class AboutFragment extends Fragment {
private ListView mMainList;
private FolderBrowserAdapter adapter;
private int configPosition = 0;
boolean Configuring = false;
boolean firstEvent = true;
@ -36,11 +35,14 @@ public class AboutFragment extends Fragment {
View rootView = inflater.inflate(R.layout.gamelist_listview, container, false);
mMainList = (ListView) rootView.findViewById(R.id.gamelist);
List<GameListItem> Input = new ArrayList<GameListItem>();
Input.add(new GameListItem(m_activity, "Build Revision", NativeLibrary.GetVersionString(), "", true));
Input.add(new GameListItem(m_activity, "Supports OpenGL ES 3", PrefsFragment.SupportsGLES3() ? "Yes" : "No", "", true));
String yes = getString(R.string.yes);
String no = getString(R.string.no);
adapter = new FolderBrowserAdapter(m_activity, R.layout.folderbrowser, Input);
List<FolderBrowserItem> Input = new ArrayList<FolderBrowserItem>();
Input.add(new FolderBrowserItem(m_activity, getString(R.string.build_revision), NativeLibrary.GetVersionString(), "", true));
Input.add(new FolderBrowserItem(m_activity, getString(R.string.supports_gles3), PrefsFragment.SupportsGLES3() ? yes : no, "", true));
adapter = new FolderBrowserAdapter(m_activity, R.layout.about_layout, Input);
mMainList.setAdapter(adapter);
return mMainList;

View file

@ -33,12 +33,9 @@ public class DolphinEmulator<MainActivity> extends Activity
out = new FileOutputStream(output);
copyFile(in, out);
in.close();
in = null;
out.flush();
out.close();
out = null;
} catch(IOException e) {
Log.e("tag", "Failed to copy asset file: " + asset, e);
Log.e("DolphinEmulator", "Failed to copy asset file: " + asset, e);
}
}
@ -78,7 +75,6 @@ public class DolphinEmulator<MainActivity> extends Activity
super.onCreate(savedInstanceState);
if (savedInstanceState == null)
{
Intent ListIntent = new Intent(this, GameListActivity.class);
startActivityForResult(ListIntent, 1);
@ -96,41 +92,19 @@ public class DolphinEmulator<MainActivity> extends Activity
directory.mkdirs();
// Copy assets if needed
java.io.File file = new java.io.File(
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "GC" + File.separator + "dsp_coef.bin");
File file = new File(GCDir + File.separator + "dsp_coef.bin");
if(!file.exists())
{
CopyAsset("ButtonA.png",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "ButtonA.png");
CopyAsset("ButtonB.png",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "ButtonB.png");
CopyAsset("ButtonStart.png",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "ButtonStart.png");
CopyAsset("NoBanner.png",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "NoBanner.png");
CopyAsset("GCPadNew.ini",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "Config" + File.separator + "GCPadNew.ini");
CopyAsset("Dolphin.ini",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "Config" + File.separator + "Dolphin.ini");
CopyAsset("dsp_coef.bin",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "GC" + File.separator + "dsp_coef.bin");
CopyAsset("dsp_rom.bin",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "GC" + File.separator + "dsp_rom.bin");
CopyAsset("font_ansi.bin",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "GC" + File.separator + "font_ansi.bin");
CopyAsset("font_sjis.bin",
Environment.getExternalStorageDirectory()+File.separator+
"dolphin-emu" + File.separator + "GC" + File.separator + "font_sjis.bin");
CopyAsset("ButtonA.png", BaseDir + File.separator + "ButtonA.png");
CopyAsset("ButtonB.png", BaseDir + File.separator + "ButtonB.png");
CopyAsset("ButtonStart.png", BaseDir + File.separator + "ButtonStart.png");
CopyAsset("NoBanner.png", BaseDir + File.separator + "NoBanner.png");
CopyAsset("GCPadNew.ini", ConfigDir + File.separator + "GCPadNew.ini");
CopyAsset("Dolphin.ini", ConfigDir + File.separator + "Dolphin.ini");
CopyAsset("dsp_coef.bin", GCDir + File.separator + "dsp_coef.bin");
CopyAsset("dsp_rom.bin", GCDir + File.separator + "dsp_rom.bin");
CopyAsset("font_ansi.bin", GCDir + File.separator + "font_ansi.bin");
CopyAsset("font_sjis.bin", GCDir + File.separator + "font_sjis.bin");
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = prefs.edit();
@ -169,11 +143,9 @@ public class DolphinEmulator<MainActivity> extends Activity
@Override
public boolean onTouchEvent(MotionEvent event)
{
float X, Y;
int Action;
X = event.getX();
Y = event.getY();
Action = event.getActionMasked();
float X = event.getX();
float Y = event.getY();
int Action = event.getActionMasked();
// Converts button locations 0 - 1 to OGL screen coords -1.0 - 1.0
float ScreenX = ((X / screenWidth) * 2.0f) - 1.0f;
@ -233,11 +205,10 @@ public class DolphinEmulator<MainActivity> extends Activity
InputDevice input = event.getDevice();
List<InputDevice.MotionRange> motions = input.getMotionRanges();
for (int a = 0; a < motions.size(); ++a)
for (InputDevice.MotionRange range : motions)
{
InputDevice.MotionRange range;
range = motions.get(a);
NativeLibrary.onGamePadMoveEvent(InputConfigFragment.getInputDesc(input), range.getAxis(), event.getAxisValue(range.getAxis()));
NativeLibrary.onGamePadMoveEvent(InputConfigFragment.getInputDesc(input), range.getAxis(), event.getAxisValue(range.getAxis()));
}
return true;

View file

@ -24,14 +24,14 @@ public class FolderBrowser extends Fragment {
// Populates the FolderView with the given currDir's contents.
private void Fill(File currDir)
{
m_activity.setTitle("Current Dir: " + currDir.getName());
m_activity.setTitle(getString(R.string.current_dir) + currDir.getName());
File[] dirs = currDir.listFiles();
List<GameListItem>dir = new ArrayList<GameListItem>();
List<GameListItem>fls = new ArrayList<GameListItem>();
List<FolderBrowserItem>dir = new ArrayList<FolderBrowserItem>();
List<FolderBrowserItem>fls = new ArrayList<FolderBrowserItem>();
// Supported extensions to filter by
Set<String> validExts = new HashSet<String>(Arrays.asList(".gcm", ".iso", ".wbfs", ".gcz", ".dol", ".elf", ".dff"));
Set<String> archiveExts = new HashSet<String>(Arrays.asList(".zip", ".rar", ".7z"));
Set<String> invalidExts = new HashSet<String>(Arrays.asList(".zip", ".rar", ".7z"));
// Search for any directories or supported files within the current dir.
try
@ -44,17 +44,17 @@ public class FolderBrowser extends Fragment {
{
if(entry.isDirectory())
{
dir.add(new GameListItem(m_activity, entryName,"Folder",entry.getAbsolutePath(), true));
dir.add(new FolderBrowserItem(m_activity, entryName, getString(R.string.folder), entry.getAbsolutePath(), true));
}
else
{
if (validExts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.'))))
{
fls.add(new GameListItem(m_activity, entryName,"File Size: "+entry.length(),entry.getAbsolutePath(), true));
fls.add(new FolderBrowserItem(m_activity, entryName,getString(R.string.file_size)+entry.length(),entry.getAbsolutePath(), true));
}
else if (archiveExts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.'))))
else if (invalidExts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.'))))
{
fls.add(new GameListItem(m_activity, entryName,"File Size: "+entry.length(),entry.getAbsolutePath(), false));
fls.add(new FolderBrowserItem(m_activity, entryName,getString(R.string.file_size)+entry.length(),entry.getAbsolutePath(), false));
}
}
}
@ -70,7 +70,7 @@ public class FolderBrowser extends Fragment {
// Check for a parent directory to the one we're currently in.
if (!currDir.getPath().equalsIgnoreCase("/"))
dir.add(0, new GameListItem(m_activity, "..", "Parent Directory", currDir.getParent(), true));
dir.add(0, new FolderBrowserItem(m_activity, "..", getString(R.string.parent_directory), currDir.getParent(), true));
adapter = new FolderBrowserAdapter(m_activity, R.layout.folderbrowser, dir);
mDrawerList = (ListView) rootView.findViewById(R.id.gamelist);
@ -94,17 +94,19 @@ public class FolderBrowser extends Fragment {
{
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
GameListItem o = adapter.getItem(position);
if(o.getData().equalsIgnoreCase("folder") || o.getData().equalsIgnoreCase("parent directory"))
FolderBrowserItem o = adapter.getItem(position);
if(o.isDirectory() || o.getSubtitle().equalsIgnoreCase(getString(R.string.parent_directory)))
{
currentDir = new File(o.getPath());
Fill(currentDir);
}
else
if (o.isValid())
{
if (o.isValidItem())
FolderSelected();
else
Toast.makeText(m_activity, "Can not use compressed file types.", Toast.LENGTH_LONG).show();
Toast.makeText(m_activity, getString(R.string.cant_use_compressed_filetypes), Toast.LENGTH_LONG).show();
}
}
};

View file

@ -1,58 +1,79 @@
package org.dolphinemu.dolphinemu;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
public class FolderBrowserAdapter extends ArrayAdapter<GameListItem>{
public class FolderBrowserAdapter extends ArrayAdapter<FolderBrowserItem>{
private Context c;
private int id;
private List<GameListItem>items;
private List<FolderBrowserItem> items;
public FolderBrowserAdapter(Context context, int textViewResourceId,
List<GameListItem> objects) {
public FolderBrowserAdapter(Context context, int textViewResourceId, List<FolderBrowserItem> objects) {
super(context, textViewResourceId, objects);
c = context;
id = textViewResourceId;
items = objects;
}
public GameListItem getItem(int i)
public FolderBrowserItem getItem(int i)
{
return items.get(i);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, null);
}
final GameListItem o = items.get(position);
if (o != null) {
TextView t1 = (TextView) v.findViewById(R.id.FolderTitle);
TextView t2 = (TextView) v.findViewById(R.id.FolderSubTitle);
if(t1!=null)
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
View v = convertView;
if (v == null)
{
LayoutInflater vi = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, parent, false);
}
final FolderBrowserItem item = items.get(position);
if (item != null)
{
ImageView iconView = (ImageView) v.findViewById(R.id.ImageIcon);
TextView mainText = (TextView) v.findViewById(R.id.FolderTitle);
TextView subtitleText = (TextView) v.findViewById(R.id.FolderSubTitle);
if(mainText != null)
{
t1.setText(o.getName());
if (!o.isValid())
t1.setTextColor(0xFFFF0000);
mainText.setText(item.getName());
if (!item.isValidItem())
{
mainText.setTextColor(0xFFFF0000);
}
}
if(subtitleText != null)
{
subtitleText.setText(item.getSubtitle());
}
if (iconView != null)
{
if (item.isDirectory())
{
iconView.setImageResource(R.drawable.ic_menu_folder);
}
else
{
iconView.setImageResource(R.drawable.ic_menu_file);
}
}
if(t2!=null)
t2.setText(o.getData());
}
return v;
}
}

View file

@ -0,0 +1,113 @@
package org.dolphinemu.dolphinemu;
import java.io.File;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
/**
* Represents an item in the folder browser list.
*/
public final class FolderBrowserItem implements Comparable<FolderBrowserItem>
{
private final Context ctx;
private final String name;
private final String subtitle;
private final String path;
private final boolean isValid;
private final File underlyingFile;
/**
* Constructor
*
* @param ctx Context this FolderBrowserItem is being used in.
* @param name The name of the file/folder represented by this item.
* @param subtitle The subtitle of this FolderBrowserItem to display.
* @param path The path of the file/folder represented by this item.
* @param isValid Whether or not this item represents a file type that can be handled.
*/
public FolderBrowserItem(Context ctx, String name, String subtitle, String path, boolean isValid)
{
this.ctx = ctx;
this.name = name;
this.subtitle = subtitle;
this.path = path;
this.isValid = isValid;
this.underlyingFile = new File(path);
}
/**
* Gets the name of the file/folder represented by this FolderBrowserItem.
*
* @return the name of the file/folder represented by this FolderBrowserItem.
*/
public String getName()
{
return name;
}
/**
* Gets the subtitle text of this FolderBrowserItem.
*
* @return the subtitle text of this FolderBrowserItem.
*/
public String getSubtitle()
{
return subtitle;
}
/**
* Gets the path of the file/folder represented by this FolderBrowserItem.
*
* @return the path of the file/folder represented by this FolderBrowserItem.
*/
public String getPath()
{
return path;
}
/**
* Gets whether or not the file represented
* by this FolderBrowserItem is supported
* and can be handled correctly.
*
* @return whether or not the file represented
* by this FolderBrowserItem is supported
* and can be handled correctly.
*/
public boolean isValidItem()
{
return isValid;
}
/**
* Gets the {@link File} representation of the underlying file/folder
* represented by this FolderBrowserItem.
*
* @return the {@link File} representation of the underlying file/folder
* represented by this FolderBrowserItem.
*/
public File getUnderlyingFile()
{
return underlyingFile;
}
/**
* Gets whether or not this FolderBrowserItem represents a directory.
*
* @return true if this FolderBrowserItem represents a directory, false otherwise.
*/
public boolean isDirectory()
{
return underlyingFile.isDirectory();
}
public int compareTo(FolderBrowserItem other)
{
if(this.name != null)
return this.name.toLowerCase().compareTo(other.getName().toLowerCase());
else
throw new IllegalArgumentException();
}
}

View file

@ -52,11 +52,11 @@ public class GameListActivity extends Activity
mDrawerList = (ListView) findViewById(R.id.left_drawer);
List<SideMenuItem> dir = new ArrayList<SideMenuItem>();
dir.add(new SideMenuItem("Game List", 0));
dir.add(new SideMenuItem("Browse Folder", 1));
dir.add(new SideMenuItem("Settings", 2));
dir.add(new SideMenuItem("Gamepad Config", 3));
dir.add(new SideMenuItem("About", 4));
dir.add(new SideMenuItem(getString(R.string.game_list), 0));
dir.add(new SideMenuItem(getString(R.string.browse_folder), 1));
dir.add(new SideMenuItem(getString(R.string.settings), 2));
dir.add(new SideMenuItem(getString(R.string.gamepad_config), 3));
dir.add(new SideMenuItem(getString(R.string.about), 4));
mDrawerAdapter = new SideMenuAdapter(this, R.layout.sidemenu, dir);
mDrawerList.setAdapter(mDrawerAdapter);
@ -179,7 +179,7 @@ public class GameListActivity extends Activity
break;
case 1:
{
Toast.makeText(mMe, "Loading up the browser", Toast.LENGTH_SHORT).show();
Toast.makeText(mMe, getString(R.string.loading_browser), Toast.LENGTH_SHORT).show();
mCurFragmentNum = 1;
mCurFragment = new FolderBrowser();
FragmentManager fragmentManager = getFragmentManager();
@ -188,7 +188,7 @@ public class GameListActivity extends Activity
break;
case 2:
{
Toast.makeText(mMe, "Loading up settings", Toast.LENGTH_SHORT).show();
Toast.makeText(mMe, getString(R.string.loading_settings), Toast.LENGTH_SHORT).show();
mCurFragmentNum = 2;
mCurFragment = new PrefsFragment();
FragmentManager fragmentManager = getFragmentManager();
@ -197,7 +197,7 @@ public class GameListActivity extends Activity
break;
case 3:
{
Toast.makeText(mMe, "Loading up gamepad config", Toast.LENGTH_SHORT).show();
Toast.makeText(mMe, getString(R.string.loading_gamepad), Toast.LENGTH_SHORT).show();
mCurFragmentNum = 3;
mCurFragment = new InputConfigFragment();
FragmentManager fragmentManager = getFragmentManager();
@ -206,7 +206,7 @@ public class GameListActivity extends Activity
break;
case 4:
{
Toast.makeText(mMe, "Loading up About", Toast.LENGTH_SHORT).show();
Toast.makeText(mMe, getString(R.string.about), Toast.LENGTH_SHORT).show();
mCurFragmentNum = 4;
mCurFragment = new AboutFragment();
FragmentManager fragmentManager = getFragmentManager();

View file

@ -49,7 +49,7 @@ public class GameListFragment extends Fragment
for (int a = 0; a < intDirectories; ++a)
{
String BrowseDir = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(a), "");
String BrowseDir = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPath" + a, "");
File currentDir = new File(BrowseDir);
File[]dirs = currentDir.listFiles();
try
@ -63,7 +63,7 @@ public class GameListFragment extends Fragment
if(!entry.isDirectory())
{
if (exts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.'))))
fls.add(new GameListItem(mMe.getApplicationContext(), entryName,"File Size: "+entry.length(),entry.getAbsolutePath(), true));
fls.add(new GameListItem(mMe.getApplicationContext(), entryName, getString(R.string.file_size)+entry.length(),entry.getAbsolutePath(), true));
}
}
}
@ -96,7 +96,7 @@ public class GameListFragment extends Fragment
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
GameListItem o = mGameAdapter.getItem(position);
if(!(o.getData().equalsIgnoreCase("folder")||o.getData().equalsIgnoreCase("parent directory")))
if(!(o.getData().equalsIgnoreCase(getString(R.string.folder))||o.getData().equalsIgnoreCase(getString(R.string.parent_directory))))
{
onFileClick(o.getPath());
}
@ -104,7 +104,7 @@ public class GameListFragment extends Fragment
};
private void onFileClick(String o)
{
Toast.makeText(mMe, "File Clicked: " + o, Toast.LENGTH_SHORT).show();
Toast.makeText(mMe, getString(R.string.file_clicked) + o, Toast.LENGTH_SHORT).show();
Intent intent = new Intent();
intent.putExtra("Select", o);

View file

@ -47,27 +47,27 @@ public class InputConfigFragment extends Fragment
Bundle savedInstanceState)
{
List<InputConfigItem> Input = new ArrayList<InputConfigItem>();
Input.add(new InputConfigItem("Draw on-screen controls", "Android-ScreenControls", "True"));
Input.add(new InputConfigItem("Button A", "Android-InputA"));
Input.add(new InputConfigItem("Button B", "Android-InputB"));
Input.add(new InputConfigItem("Button Start", "Android-InputStart"));
Input.add(new InputConfigItem("Button X", "Android-InputX"));
Input.add(new InputConfigItem("Button Y", "Android-InputY"));
Input.add(new InputConfigItem("Button Z", "Android-InputZ"));
Input.add(new InputConfigItem("D-Pad Up", "Android-DPadUp"));
Input.add(new InputConfigItem("D-Pad Down", "Android-DPadDown"));
Input.add(new InputConfigItem("D-Pad Left", "Android-DPadLeft"));
Input.add(new InputConfigItem("D-Pad Right", "Android-DPadRight"));
Input.add(new InputConfigItem("Main Stick Up", "Android-MainUp"));
Input.add(new InputConfigItem("Main Stick Down", "Android-MainDown"));
Input.add(new InputConfigItem("Main Stick Left", "Android-MainLeft"));
Input.add(new InputConfigItem("Main Stick Right", "Android-MainRight"));
Input.add(new InputConfigItem("C Stick Up", "Android-CStickUp"));
Input.add(new InputConfigItem("C Stick Down", "Android-CStickDown"));
Input.add(new InputConfigItem("C Stick Left", "Android-CStickLeft"));
Input.add(new InputConfigItem("C Stick Right", "Android-CStickRight"));
Input.add(new InputConfigItem("Trigger L", "Android-InputL"));
Input.add(new InputConfigItem("Trigger R", "Android-InputR"));
Input.add(new InputConfigItem(getString(R.string.draw_onscreen_controls), "Android-ScreenControls", "True"));
Input.add(new InputConfigItem(getString(R.string.button_a), "Android-InputA"));
Input.add(new InputConfigItem(getString(R.string.button_b), "Android-InputB"));
Input.add(new InputConfigItem(getString(R.string.button_start), "Android-InputStart"));
Input.add(new InputConfigItem(getString(R.string.button_x), "Android-InputX"));
Input.add(new InputConfigItem(getString(R.string.button_y), "Android-InputY"));
Input.add(new InputConfigItem(getString(R.string.button_z), "Android-InputZ"));
Input.add(new InputConfigItem(getString(R.string.dpad_up), "Android-DPadUp"));
Input.add(new InputConfigItem(getString(R.string.dpad_down), "Android-DPadDown"));
Input.add(new InputConfigItem(getString(R.string.dpad_left), "Android-DPadLeft"));
Input.add(new InputConfigItem(getString(R.string.dpad_right), "Android-DPadRight"));
Input.add(new InputConfigItem(getString(R.string.main_stick_up), "Android-MainUp"));
Input.add(new InputConfigItem(getString(R.string.main_stick_down), "Android-MainDown"));
Input.add(new InputConfigItem(getString(R.string.main_stick_left), "Android-MainLeft"));
Input.add(new InputConfigItem(getString(R.string.main_stick_right), "Android-MainRight"));
Input.add(new InputConfigItem(getString(R.string.c_stick_up), "Android-CStickUp"));
Input.add(new InputConfigItem(getString(R.string.c_stick_down), "Android-CStickDown"));
Input.add(new InputConfigItem(getString(R.string.c_stick_left), "Android-CStickLeft"));
Input.add(new InputConfigItem(getString(R.string.c_stick_right), "Android-CStickRight"));
Input.add(new InputConfigItem(getString(R.string.trigger_left), "Android-InputL"));
Input.add(new InputConfigItem(getString(R.string.trigger_right), "Android-InputR"));
adapter = new InputConfigAdapter(m_activity, R.layout.folderbrowser, Input);
View rootView = inflater.inflate(R.layout.gamelist_listview, container, false);
@ -88,12 +88,12 @@ public class InputConfigFragment extends Fragment
String newBind;
if (o.getBind().equals("True"))
{
Toast.makeText(m_activity, "Not Drawing on screen controls", Toast.LENGTH_SHORT).show();
Toast.makeText(m_activity, getString(R.string.not_drawing_onscreen_controls), Toast.LENGTH_SHORT).show();
newBind = "False";
}
else
{
Toast.makeText(m_activity, "Drawing on screen controls", Toast.LENGTH_SHORT).show();
Toast.makeText(m_activity, getString(R.string.drawing_onscreen_controls), Toast.LENGTH_SHORT).show();
newBind = "True";
}
adapter.remove(o);
@ -101,7 +101,8 @@ public class InputConfigFragment extends Fragment
adapter.insert(o, position);
break;
default: // gamepad controls
Toast.makeText(m_activity, "Press button to configure " + o.getName(), Toast.LENGTH_SHORT).show();
Toast.makeText(m_activity, getString(R.string.press_button_to_config, o.getName()), Toast.LENGTH_SHORT).show();
configPosition = position;
Configuring = true;
firstEvent = true;
@ -136,9 +137,12 @@ public class InputConfigFragment extends Fragment
if (firstEvent)
{
m_values.clear();
for (InputDevice.MotionRange range : motions) {
for (InputDevice.MotionRange range : motions)
{
m_values.add(event.getAxisValue(range.getAxis()));
}
firstEvent = false;
}
else
@ -164,7 +168,7 @@ public class InputConfigFragment extends Fragment
}
public boolean onKeyEvent(KeyEvent event)
{
Log.w("Dolphinemu", "Got Event " + event.getAction());
Log.w("InputConfigFragment", "Got Event " + event.getAction());
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
case KeyEvent.ACTION_UP:

View file

@ -1,49 +1,91 @@
package org.dolphinemu.dolphinemu;
/**
/*
* Copyright 2013 Dolphin Emulator Project
* Licensed under GPLv2
* Refer to the license.txt file included.
*/
package org.dolphinemu.dolphinemu;
/**
* Represents a controller input item (button, stick, etc).
*/
public class InputConfigItem implements Comparable<InputConfigItem>{
private String m_name;
private String m_Config;
private String m_bind;
private void Init(String n, String c, String d)
private void Init(String name, String config, String defaultBind)
{
m_name = n;
m_Config = c;
m_name = name;
m_Config = config;
String ConfigValues[] = m_Config.split("-");
String Key = ConfigValues[0];
String Value = ConfigValues[1];
m_bind = NativeLibrary.GetConfig("Dolphin.ini", Key, Value, d);
m_bind = NativeLibrary.GetConfig("Dolphin.ini", Key, Value, defaultBind);
}
public InputConfigItem(String n, String c, String d)
/**
* Constructor
*
* @param name Name of the input config item.
* @param config Name of the key in the configuration file that this control modifies.
* @param defaultBind Default binding to fall back upon if binding fails.
*/
public InputConfigItem(String name, String config, String defaultBind)
{
Init(n, c, d);
Init(name, config, defaultBind);
}
public InputConfigItem(String n, String c)
/**
* Constructor that creates an InputConfigItem
* that has a default binding of "None"
*
* @param name Name of the input config item.
* @param config Name of the key in the configuration file that this control modifies.
*/
public InputConfigItem(String name, String config)
{
Init(n, c, "None");
Init(name, config, "None");
}
/**
* Gets the name of this InputConfigItem.
*
* @return the name of this InputConfigItem
*/
public String getName()
{
return m_name;
}
/**
* Gets the config key this InputConfigItem modifies.
*
* @return the config key this InputConfigItem modifies.
*/
public String getConfig()
{
return m_Config;
}
/**
* Gets the currently set binding of this InputConfigItem
*
* @return the currently set binding of this InputConfigItem
*/
public String getBind()
{
return m_bind;
}
public void setBind(String b)
/**
* Sets a new binding for this InputConfigItem.
*
* @param bind The new binding.
*/
public void setBind(String bind)
{
m_bind = b;
m_bind = bind;
}
public int compareTo(InputConfigItem o)

View file

@ -1,12 +1,17 @@
/*
* Copyright 2013 Dolphin Emulator Project
* Licensed under GPLv2
* Refer to the license.txt file included.
*/
package org.dolphinemu.dolphinemu;
import android.util.Log;
import android.view.Surface;
/**
* Copyright 2013 Dolphin Emulator Project
* Licensed under GPLv2
* Refer to the license.txt file included.
* Class which contains methods that interact
* with the native side of the Dolphin code.
*/
public class NativeLibrary {
public static native void onTouchEvent(int Action, float X, float Y);

View file

@ -97,33 +97,35 @@ public class PrefsFragment extends PreferenceFragment {
}
static public boolean SupportsGLES3()
{
String m_GLVersion;
String m_GLVendor;
String m_GLRenderer;
VersionCheck mbuffer = new VersionCheck();
m_GLVersion = mbuffer.getVersion();
m_GLVendor = mbuffer.getVendor();
m_GLRenderer = mbuffer.getRenderer();
String m_GLVersion = mbuffer.getVersion();
String m_GLVendor = mbuffer.getVendor();
String m_GLRenderer = mbuffer.getRenderer();
boolean mSupportsGLES3 = false;
if (m_GLVersion.contains("OpenGL ES 3.0") ||
m_GLVersion.equals("OpenGL ES 3.0")) // 3.0 support
// Check for OpenGL ES 3 support (General case).
if (m_GLVersion.contains("OpenGL ES 3.0") || m_GLVersion.equals("OpenGL ES 3.0"))
mSupportsGLES3 = true;
// Checking for OpenGL ES 3 support for certain Qualcomm devices.
if (!mSupportsGLES3 && m_GLVendor.equals("Qualcomm"))
{
if (m_GLRenderer.contains("Adreno (TM) 3"))
{
int mVStart, mVEnd = 0;
int mVStart = m_GLVersion.indexOf("V@") + 2;
int mVEnd = 0;
float mVersion;
mVStart = m_GLVersion.indexOf("V@") + 2;
for (int a = mVStart; a < m_GLVersion.length(); ++a)
{
if (m_GLVersion.charAt(a) == ' ')
{
mVEnd = a;
break;
}
}
mVersion = Float.parseFloat(m_GLVersion.substring(mVStart, mVEnd));
if (mVersion >= 14.0f)
@ -144,18 +146,18 @@ public class PrefsFragment extends PreferenceFragment {
if (Build.CPU_ABI.contains("x86"))
{
entries.put("Interpreter", "0");
entries.put("JIT64 Recompiler", "1");
entries.put("JITIL Recompiler", "2");
entries.put(getString(R.string.interpreter), "0");
entries.put(getString(R.string.jit64_recompiler), "1");
entries.put(getString(R.string.jitil_recompiler), "2");
}
else if (Build.CPU_ABI.contains("arm"))
{
entries.put("Interpreter", "0");
entries.put("JIT ARM Recompiler", "3");
entries.put(getString(R.string.interpreter), "0");
entries.put(getString(R.string.jit_arm_recompiler), "3");
}
else
{
entries.put("Interpreter", "0");
entries.put(getString(R.string.interpreter), "0");
}
// Convert the key/value sections to arrays respectively so the list can be set.
@ -163,8 +165,8 @@ public class PrefsFragment extends PreferenceFragment {
etp.setEntries(entries.keySet().toArray(new CharSequence[entries.size()]));
etp.setEntryValues(entries.values().toArray(new CharSequence[entries.size()]));
etp.setKey("cpupref");
etp.setTitle("CPU Core");
etp.setSummary("Emulation core to use");
etp.setTitle(getString(R.string.cpu_core));
etp.setSummary(getString(R.string.emu_core_to_use));
PreferenceCategory mCategory = (PreferenceCategory) findPreference("cpuprefcat");
mCategory.addPreference(etp);
@ -181,11 +183,11 @@ public class PrefsFragment extends PreferenceFragment {
// Add available graphics renderers to the hashmap to add to the list.
entries.clear();
entries.put("Software Renderer", "Software Renderer"); // TODO: I think this is a bug? The value shouldn't be the same as the key?
entries.put(getString(R.string.software_renderer), "Software Renderer");
videobackend.setKey("gpupref");
videobackend.setTitle("Video Backend");
videobackend.setSummary("Video backend to use");
videobackend.setTitle(getString(R.string.video_backend));
videobackend.setSummary(getString(R.string.video_backend_to_use));
videobackend.setEntries(entries.keySet().toArray(new CharSequence[entries.size()]));
videobackend.setEntryValues(entries.values().toArray(new CharSequence[entries.size()]));

View file

@ -16,34 +16,38 @@ public class SideMenuAdapter extends ArrayAdapter<SideMenuItem>{
private List<SideMenuItem>items;
public SideMenuAdapter(Context context, int textViewResourceId,
List<SideMenuItem> objects) {
List<SideMenuItem> objects)
{
super(context, textViewResourceId, objects);
c = context;
id = textViewResourceId;
items = objects;
}
public SideMenuItem getItem(int i)
{
{
return items.get(i);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, null);
}
final SideMenuItem o = items.get(position);
if (o != null) {
TextView t1 = (TextView) v.findViewById(R.id.SideMenuTitle);
if(t1!=null)
t1.setText(o.getName());
}
return v;
}
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
View v = convertView;
if (v == null)
{
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, null);
}
final SideMenuItem o = items.get(position);
if (o != null)
{
TextView t1 = (TextView) v.findViewById(R.id.SideMenuTitle);
if(t1!=null)
t1.setText(o.getName());
}
return v;
}
}

View file

@ -1,25 +1,47 @@
package org.dolphinemu.dolphinemu;
/**
/*
* Copyright 2013 Dolphin Emulator Project
* Licensed under GPLv2
* Refer to the license.txt file included.
*/
public class SideMenuItem implements Comparable<SideMenuItem>{
package org.dolphinemu.dolphinemu;
/**
* Represents an item that goes in the sidemenu of the app.
*/
public class SideMenuItem implements Comparable<SideMenuItem>
{
private String m_name;
private int m_id;
public SideMenuItem(String n, int id)
/**
* Constructor
*
* @param name The name of the SideMenuItem.
* @param id ID number of this specific SideMenuItem.
*/
public SideMenuItem(String name, int id)
{
m_name = n;
m_name = name;
m_id = id;
}
/**
* Gets the name of this SideMenuItem.
*
* @return the name of this SideMenuItem.
*/
public String getName()
{
return m_name;
}
/**
* Gets the ID of this SideMenuItem.
*
* @return the ID of this SideMenuItem.
*/
public int getID()
{
return m_id;

View file

@ -409,7 +409,7 @@ void NetPlayDiag::GetNetSettings(NetSettings &settings)
settings.m_Controllers[i] = SConfig::GetInstance().m_SIDevice[i];
}
const std::string& NetPlayDiag::FindGame()
std::string NetPlayDiag::FindGame()
{
// find path for selected game, sloppy..
for (u32 i = 0 ; auto game = m_game_list->GetISO(i); ++i)

View file

@ -92,7 +92,7 @@ private:
void OnAdjustBuffer(wxCommandEvent& event);
void OnConfigPads(wxCommandEvent& event);
void GetNetSettings(NetSettings &settings);
const std::string& FindGame();
std::string FindGame();
wxListBox* m_player_lbox;
wxTextCtrl* m_chat_text;