mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Merge branch 'master' into jit_exit_addresses
This commit is contained in:
+7
-2
@@ -524,11 +524,16 @@ else()
|
||||
set(LZO lzo2)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
|
||||
check_lib(PNG png png.h QUIET)
|
||||
endif()
|
||||
if (PNG_FOUND)
|
||||
message("Using shared libpng")
|
||||
else()
|
||||
message("Using static libpng from Externals")
|
||||
add_subdirectory(Externals/libpng)
|
||||
include_directories(Externals/libpng)
|
||||
set(PNG libpng)
|
||||
set(PNG png)
|
||||
endif()
|
||||
|
||||
if(OPENAL_FOUND)
|
||||
|
||||
Vendored
-2
@@ -868,8 +868,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
${SRCS_GENERICOSX}
|
||||
${SRCS_OSX}
|
||||
${SRCS_UNIX})
|
||||
include_directories(../libpng)
|
||||
add_subdirectory(../libpng ../libpng)
|
||||
set(LIBS
|
||||
png
|
||||
iconv
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/saveStateRoot"
|
||||
android:id="@+id/takeScreenshot"
|
||||
android:showAsAction="ifRoom"
|
||||
android:title="@string/overlay_screenshot"/>
|
||||
<item
|
||||
android:id="@+id/saveStateRoot"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/overlay_savestate">
|
||||
<menu>
|
||||
<item android:id="@+id/saveSlot1"
|
||||
@@ -23,7 +27,7 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/loadStateRoot"
|
||||
android:showAsAction="ifRoom"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/overlay_loadstate">
|
||||
<menu>
|
||||
<item android:id="@+id/loadSlot1"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<!-- About Fragment -->
|
||||
<string name="build_revision">ビルドのバージョン</string>
|
||||
<string name="supports_gles3">サポートのOpenGL ES 3</string>
|
||||
<string name="supports_neon">サポートのNEON</string>
|
||||
|
||||
<!-- Folder Browser -->
|
||||
<string name="current_dir">現在のディレクトリ: %1$s</string>
|
||||
@@ -25,10 +26,15 @@
|
||||
<string name="settings">設定</string>
|
||||
<string name="about">について</string>
|
||||
|
||||
<!-- Game List Activity - Device Compatibility AlertDialog -->
|
||||
<string name="device_compat_warning">デバイスの互換性の警告</string>
|
||||
<string name="device_compat_warning_msg">この電話は、NEON拡張をサポートしていません。 おそらくDolphinを実行することはできません。\nあなたはとにかくそれを実行してみますか?</string>
|
||||
|
||||
<!-- Game List Fragment -->
|
||||
<string name="file_clicked">クリックされたファイル: %1$s</string>
|
||||
|
||||
<!-- Emulation Window Overlay -->
|
||||
<string name="overlay_screenshot">スクリーンショットを撮る</string>
|
||||
<string name="overlay_savestate">ステートセーブ</string>
|
||||
<string name="overlay_loadstate">ステートロード</string>
|
||||
<string name="overlay_exit_emulation">終了</string>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<!-- About Fragment -->
|
||||
<string name="build_revision">Build Revision</string>
|
||||
<string name="supports_gles3">Supports OpenGL ES 3</string>
|
||||
<string name="supports_neon">Supports NEON</string>
|
||||
|
||||
<!-- Folder Browser -->
|
||||
<string name="current_dir">Current Dir: %1$s</string>
|
||||
@@ -25,10 +26,15 @@
|
||||
<string name="settings">Settings</string>
|
||||
<string name="about">About</string>
|
||||
|
||||
<!-- Game List Activity - Device Compatibility AlertDialog -->
|
||||
<string name="device_compat_warning">Device Compatibility Warning</string>
|
||||
<string name="device_compat_warning_msg">Your phone doesn\'t support NEON which makes it incapable of running Dolphin Mobile?\nDo you want to try anyway?</string>
|
||||
|
||||
<!-- Game List Fragment -->
|
||||
<string name="file_clicked">File clicked: %1$s</string>
|
||||
|
||||
<!-- Emulation Overlay -->
|
||||
<string name="overlay_screenshot">Take Screenshot</string>
|
||||
<string name="overlay_savestate">Save State</string>
|
||||
<string name="overlay_loadstate">Load State</string>
|
||||
<string name="overlay_exit_emulation">Exit</string>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ListFragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
@@ -27,35 +26,24 @@ import org.dolphinemu.dolphinemu.settings.VideoSettingsFragment;
|
||||
*/
|
||||
public final class AboutFragment extends ListFragment
|
||||
{
|
||||
private static Activity m_activity;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
View rootView = inflater.inflate(R.layout.gamelist_listview, container, false);
|
||||
ListView mMainList = (ListView) rootView.findViewById(R.id.gamelist);
|
||||
ListView rootView = (ListView) inflater.inflate(R.layout.gamelist_listview, container, false);
|
||||
|
||||
String yes = getString(R.string.yes);
|
||||
String no = getString(R.string.no);
|
||||
final String yes = getString(R.string.yes);
|
||||
final String no = getString(R.string.no);
|
||||
|
||||
List<AboutFragmentItem> Input = new ArrayList<AboutFragmentItem>();
|
||||
Input.add(new AboutFragmentItem(getString(R.string.build_revision), NativeLibrary.GetVersionString()));
|
||||
Input.add(new AboutFragmentItem(getString(R.string.supports_gles3), VideoSettingsFragment.SupportsGLES3() ? yes : no));
|
||||
Input.add(new AboutFragmentItem(getString(R.string.supports_neon), NativeLibrary.SupportsNEON() ? yes : no));
|
||||
|
||||
AboutFragmentAdapter adapter = new AboutFragmentAdapter(m_activity, R.layout.about_layout, Input);
|
||||
mMainList.setAdapter(adapter);
|
||||
mMainList.setEnabled(false); // Makes the list view non-clickable.
|
||||
AboutFragmentAdapter adapter = new AboutFragmentAdapter(getActivity(), R.layout.about_layout, Input);
|
||||
rootView.setAdapter(adapter);
|
||||
rootView.setEnabled(false); // Makes the list view non-clickable.
|
||||
|
||||
return mMainList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity)
|
||||
{
|
||||
super.onAttach(activity);
|
||||
|
||||
// Cache the activity instance.
|
||||
m_activity = activity;
|
||||
return rootView;
|
||||
}
|
||||
|
||||
// Represents an item in the AboutFragment.
|
||||
@@ -106,18 +94,17 @@ public final class AboutFragment extends ListFragment
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent)
|
||||
{
|
||||
View v = convertView;
|
||||
if (v == null)
|
||||
if (convertView == null)
|
||||
{
|
||||
LayoutInflater vi = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
v = vi.inflate(id, parent, false);
|
||||
LayoutInflater vi = LayoutInflater.from(ctx);
|
||||
convertView = vi.inflate(id, parent, false);
|
||||
}
|
||||
|
||||
final AboutFragmentItem item = items.get(position);
|
||||
if (item != null)
|
||||
{
|
||||
TextView title = (TextView) v.findViewById(R.id.AboutItemTitle);
|
||||
TextView subtitle = (TextView) v.findViewById(R.id.AboutItemSubTitle);
|
||||
TextView title = (TextView) convertView.findViewById(R.id.AboutItemTitle);
|
||||
TextView subtitle = (TextView) convertView.findViewById(R.id.AboutItemSubTitle);
|
||||
|
||||
if (title != null)
|
||||
title.setText(item.getTitle());
|
||||
@@ -126,7 +113,7 @@ public final class AboutFragment extends ListFragment
|
||||
subtitle.setText(item.getSubTitle());
|
||||
}
|
||||
|
||||
return v;
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,4 +86,9 @@ public final class DolphinEmulator extends Activity
|
||||
UserPreferences.LoadIniToPrefs(this);
|
||||
}
|
||||
}
|
||||
protected void onRestart()
|
||||
{
|
||||
super.onRestart();
|
||||
finish(); // If we are ever returning to this activity then we are exiting.
|
||||
}
|
||||
}
|
||||
@@ -104,6 +104,19 @@ public final class NativeLibrary
|
||||
*/
|
||||
public static native String GetVersionString();
|
||||
|
||||
/**
|
||||
* Returns if the phone supports NEON or not
|
||||
*
|
||||
* @return true if it supports NEON, false otherwise.
|
||||
*/
|
||||
public static native boolean SupportsNEON();
|
||||
|
||||
/**
|
||||
* Saves a screen capture of the game
|
||||
*
|
||||
*/
|
||||
public static native void SaveScreenShot();
|
||||
|
||||
/**
|
||||
* Saves a game state to the slot number.
|
||||
*
|
||||
|
||||
@@ -68,12 +68,14 @@ public final class EmulationActivity extends Activity
|
||||
|
||||
// Due to a bug in Adreno, it renders the screen rotated 90 degrees when using OpenGL
|
||||
// Flip the width and height when on Adreno to work around this.
|
||||
// This bug is fixed in Qualcomm driver v53
|
||||
// Mali isn't affected by this bug.
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
if (prefs.getString("gpuPref", "Software Rendering").equals("OGL")
|
||||
&& VideoSettingsFragment.SupportsGLES3()
|
||||
&& VideoSettingsFragment.m_GLVendor != null
|
||||
&& VideoSettingsFragment.m_GLVendor.equals("Qualcomm"))
|
||||
&& VideoSettingsFragment.m_GLVendor.equals("Qualcomm")
|
||||
&& VideoSettingsFragment.m_QualcommVersion < 53.0f)
|
||||
NativeLibrary.SetDimensions((int)screenHeight, (int)screenWidth);
|
||||
else
|
||||
NativeLibrary.SetDimensions((int)screenWidth, (int)screenHeight);
|
||||
@@ -173,6 +175,11 @@ public final class EmulationActivity extends Activity
|
||||
{
|
||||
switch(item.getItemId())
|
||||
{
|
||||
// Screenshot capturing
|
||||
case R.id.takeScreenshot:
|
||||
NativeLibrary.SaveScreenShot();
|
||||
return true;
|
||||
|
||||
// Save state slots
|
||||
case R.id.saveSlot1:
|
||||
NativeLibrary.SaveState(0);
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
package org.dolphinemu.dolphinemu.folderbrowser;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ListFragment;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
@@ -37,16 +36,18 @@ import org.dolphinemu.dolphinemu.gamelist.GameListActivity;
|
||||
*/
|
||||
public final class FolderBrowser extends ListFragment
|
||||
{
|
||||
private Activity m_activity;
|
||||
private FolderBrowserAdapter adapter;
|
||||
private ListView mFolderBrowserList;
|
||||
private ListView rootView;
|
||||
private static File currentDir = null;
|
||||
|
||||
// Populates the FolderView with the given currDir's contents.
|
||||
private void Fill(File currDir)
|
||||
{
|
||||
m_activity.setTitle(String.format(getString(R.string.current_dir), currDir.getName()));
|
||||
// Clear the adapter of previous items.
|
||||
adapter.clear();
|
||||
|
||||
// Set the activity title to the current directory the FolderBrowser is in.
|
||||
getActivity().setTitle(String.format(getString(R.string.current_dir), currDir.getName()));
|
||||
|
||||
File[] dirs = currDir.listFiles();
|
||||
List<FolderBrowserItem> dir = new ArrayList<FolderBrowserItem>();
|
||||
List<FolderBrowserItem> fls = new ArrayList<FolderBrowserItem>();
|
||||
@@ -96,9 +97,9 @@ public final class FolderBrowser extends ListFragment
|
||||
if (!currDir.getPath().equalsIgnoreCase("/"))
|
||||
dir.add(0, new FolderBrowserItem("..", getString(R.string.parent_directory), currDir.getParent()));
|
||||
|
||||
adapter = new FolderBrowserAdapter(m_activity, R.layout.gamelist_folderbrowser_list, dir);
|
||||
mFolderBrowserList = (ListView) rootView.findViewById(R.id.gamelist);
|
||||
mFolderBrowserList.setAdapter(adapter);
|
||||
// Add the items to the adapter and notify the adapter users of its new contents.
|
||||
adapter.addAll(dir);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,22 +123,14 @@ public final class FolderBrowser extends ListFragment
|
||||
if(currentDir == null)
|
||||
currentDir = new File(Environment.getExternalStorageDirectory().getPath());
|
||||
|
||||
rootView = (ListView) inflater.inflate(R.layout.gamelist_listview, container, false);
|
||||
ListView rootView = (ListView) inflater.inflate(R.layout.gamelist_listview, container, false);
|
||||
adapter = new FolderBrowserAdapter(getActivity(), R.layout.gamelist_folderbrowser_list_item);
|
||||
rootView.setAdapter(adapter);
|
||||
|
||||
Fill(currentDir);
|
||||
return mFolderBrowserList;
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity)
|
||||
{
|
||||
super.onAttach(activity);
|
||||
|
||||
// Cache the activity instance.
|
||||
m_activity = activity;
|
||||
}
|
||||
|
||||
|
||||
private void FolderSelected()
|
||||
{
|
||||
String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0");
|
||||
@@ -168,6 +161,6 @@ public final class FolderBrowser extends ListFragment
|
||||
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(intDirectories), currentDir.getPath());
|
||||
}
|
||||
|
||||
((GameListActivity)m_activity).SwitchPage(0);
|
||||
((GameListActivity)getActivity()).SwitchPage(0);
|
||||
}
|
||||
}
|
||||
|
||||
+38
-31
@@ -6,15 +6,12 @@
|
||||
|
||||
package org.dolphinemu.dolphinemu.folderbrowser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
@@ -27,79 +24,89 @@ import org.dolphinemu.dolphinemu.R;
|
||||
*/
|
||||
public final class FolderBrowserAdapter extends ArrayAdapter<FolderBrowserItem>
|
||||
{
|
||||
// ViewHolder which is used to hold onto
|
||||
// items within a listview. This is done
|
||||
// so that findViewById is not needed to
|
||||
// be excessively called over and over.
|
||||
private static final class ViewHolder
|
||||
{
|
||||
TextView title;
|
||||
TextView subtitle;
|
||||
ImageView icon;
|
||||
}
|
||||
|
||||
private final Context context;
|
||||
private final int id;
|
||||
private final List<FolderBrowserItem> items;
|
||||
private ViewHolder viewHolder;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param context The current {@link Context}.
|
||||
* @param resourceId The resource ID for a layout file containing a layout to use when instantiating views.
|
||||
* @param objects The objects to represent in the {@link ListView}.
|
||||
*/
|
||||
public FolderBrowserAdapter(Context context, int resourceId, List<FolderBrowserItem> objects)
|
||||
public FolderBrowserAdapter(Context context, int resourceId)
|
||||
{
|
||||
super(context, resourceId, objects);
|
||||
super(context, resourceId);
|
||||
|
||||
this.context = context;
|
||||
this.id = resourceId;
|
||||
this.items = objects;
|
||||
}
|
||||
|
||||
@Override
|
||||
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)
|
||||
if (convertView == null)
|
||||
{
|
||||
LayoutInflater vi = LayoutInflater.from(context);
|
||||
v = vi.inflate(id, parent, false);
|
||||
convertView = vi.inflate(id, parent, false);
|
||||
|
||||
// Initialize the ViewHolder and store it.
|
||||
viewHolder = new ViewHolder();
|
||||
viewHolder.title = (TextView) convertView.findViewById(R.id.ListItemTitle);
|
||||
viewHolder.subtitle = (TextView) convertView.findViewById(R.id.ListItemSubTitle);
|
||||
viewHolder.icon = (ImageView) convertView.findViewById(R.id.ListItemIcon);
|
||||
convertView.setTag(viewHolder);
|
||||
}
|
||||
else // Can recover the holder.
|
||||
{
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
final FolderBrowserItem item = items.get(position);
|
||||
final FolderBrowserItem item = getItem(position);
|
||||
if (item != null)
|
||||
{
|
||||
ImageView icon = (ImageView) v.findViewById(R.id.ListItemIcon);
|
||||
TextView title = (TextView) v.findViewById(R.id.ListItemTitle);
|
||||
TextView subtitle = (TextView) v.findViewById(R.id.ListItemSubTitle);
|
||||
|
||||
if(title != null)
|
||||
if (viewHolder.title != null)
|
||||
{
|
||||
title.setText(item.getName());
|
||||
viewHolder.title.setText(item.getName());
|
||||
}
|
||||
|
||||
if(subtitle != null)
|
||||
if (viewHolder.subtitle != null)
|
||||
{
|
||||
// Remove the subtitle for all folders, except for the parent directory folder.
|
||||
if (item.isDirectory() && !item.getSubtitle().equals(context.getString(R.string.parent_directory)))
|
||||
{
|
||||
subtitle.setVisibility(View.GONE);
|
||||
viewHolder.subtitle.setVisibility(View.GONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
subtitle.setText(item.getSubtitle());
|
||||
viewHolder.subtitle.setVisibility(View.VISIBLE);
|
||||
viewHolder.subtitle.setText(item.getSubtitle());
|
||||
}
|
||||
}
|
||||
|
||||
if (icon != null)
|
||||
if (viewHolder.icon != null)
|
||||
{
|
||||
if (item.isDirectory())
|
||||
{
|
||||
icon.setImageResource(R.drawable.ic_menu_folder);
|
||||
viewHolder.icon.setImageResource(R.drawable.ic_menu_folder);
|
||||
}
|
||||
else
|
||||
{
|
||||
icon.setImageResource(R.drawable.ic_menu_file);
|
||||
viewHolder.icon.setImageResource(R.drawable.ic_menu_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
return v;
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,20 +9,21 @@ package org.dolphinemu.dolphinemu.gamelist;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.ActionBarDrawerToggle;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.view.*;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ListView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.dolphinemu.dolphinemu.AboutFragment;
|
||||
import org.dolphinemu.dolphinemu.NativeLibrary;
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
@@ -31,6 +32,9 @@ import org.dolphinemu.dolphinemu.settings.PrefsActivity;
|
||||
import org.dolphinemu.dolphinemu.sidemenu.SideMenuAdapter;
|
||||
import org.dolphinemu.dolphinemu.sidemenu.SideMenuItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The activity that implements all of the functions
|
||||
* for the game list.
|
||||
@@ -39,7 +43,6 @@ public final class GameListActivity extends Activity
|
||||
implements GameListFragment.OnGameListZeroListener
|
||||
{
|
||||
private int mCurFragmentNum = 0;
|
||||
private Fragment mCurFragment;
|
||||
|
||||
private ActionBarDrawerToggle mDrawerToggle;
|
||||
private DrawerLayout mDrawerLayout;
|
||||
@@ -100,10 +103,36 @@ public final class GameListActivity extends Activity
|
||||
};
|
||||
mDrawerLayout.setDrawerListener(mDrawerToggle);
|
||||
|
||||
// Display the game list fragment.
|
||||
mCurFragment = new GameListFragment();
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
fragmentManager.beginTransaction().replace(R.id.content_frame, mCurFragment).commit();
|
||||
// Display the game list fragment on activity creation,
|
||||
// but only if no previous states have been saved.
|
||||
if (savedInstanceState == null)
|
||||
{
|
||||
final GameListFragment gameList = new GameListFragment();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.replace(R.id.content_frame, gameList);
|
||||
ft.commit();
|
||||
}
|
||||
|
||||
|
||||
// Create an alert telling them that their phone sucks
|
||||
if (Build.CPU_ABI.contains("arm") && !NativeLibrary.SupportsNEON())
|
||||
{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.device_compat_warning);
|
||||
builder.setMessage(R.string.device_compat_warning_msg);
|
||||
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// Do Nothing. Just create the Yes button
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
finish();
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,9 +156,10 @@ public final class GameListActivity extends Activity
|
||||
setTitle(R.string.app_name);
|
||||
|
||||
mCurFragmentNum = 0;
|
||||
mCurFragment = new GameListFragment();
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
fragmentManager.beginTransaction().replace(R.id.content_frame, mCurFragment).commit();
|
||||
final GameListFragment gameList = new GameListFragment();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.replace(R.id.content_frame, gameList);
|
||||
ft.commit();
|
||||
invalidateOptionsMenu();
|
||||
}
|
||||
break;
|
||||
@@ -137,9 +167,11 @@ public final class GameListActivity extends Activity
|
||||
case 1: // Folder Browser
|
||||
{
|
||||
mCurFragmentNum = 1;
|
||||
mCurFragment = new FolderBrowser();
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
fragmentManager.beginTransaction().replace(R.id.content_frame, mCurFragment).commit();
|
||||
final FolderBrowser folderBrowser = new FolderBrowser();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.replace(R.id.content_frame, folderBrowser);
|
||||
ft.addToBackStack(null);
|
||||
ft.commit();
|
||||
invalidateOptionsMenu();
|
||||
}
|
||||
break;
|
||||
@@ -154,9 +186,11 @@ public final class GameListActivity extends Activity
|
||||
case 3: // About
|
||||
{
|
||||
mCurFragmentNum = 3;
|
||||
mCurFragment = new AboutFragment();
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
fragmentManager.beginTransaction().replace(R.id.content_frame, mCurFragment).commit();
|
||||
final AboutFragment aboutFragment = new AboutFragment();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.replace(R.id.content_frame, aboutFragment);
|
||||
ft.addToBackStack(null);
|
||||
ft.commit();
|
||||
invalidateOptionsMenu();
|
||||
}
|
||||
break;
|
||||
@@ -243,7 +277,7 @@ public final class GameListActivity extends Activity
|
||||
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", "0");
|
||||
|
||||
// Now finally, clear the game list.
|
||||
((GameListFragment) mCurFragment).clearGameList();
|
||||
((GameListFragment) getFragmentManager().findFragmentById(R.id.content_frame)).clearGameList();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@@ -258,7 +292,23 @@ public final class GameListActivity extends Activity
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState)
|
||||
{
|
||||
super.onSaveInstanceState(outState);
|
||||
|
||||
outState.putInt("currentFragmentNum", mCurFragmentNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestoreInstanceState(Bundle savedInstanceState)
|
||||
{
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
|
||||
mCurFragmentNum = savedInstanceState.getInt("currentFragmentNum");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed()
|
||||
{
|
||||
|
||||
@@ -12,11 +12,8 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
|
||||
/**
|
||||
@@ -28,46 +25,36 @@ public final class GameListAdapter extends ArrayAdapter<GameListItem>
|
||||
{
|
||||
private final Context context;
|
||||
private final int id;
|
||||
private final List<GameListItem>items;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param context The current {@link Context}.
|
||||
* @param resourceId The resource ID for a layout file containing a layout to use when instantiating views.
|
||||
* @param objects The objects to represent in the {@link ListView}.
|
||||
*/
|
||||
public GameListAdapter(Context context, int resourceId, List<GameListItem> objects)
|
||||
public GameListAdapter(Context context, int resourceId)
|
||||
{
|
||||
super(context, resourceId, objects);
|
||||
super(context, resourceId);
|
||||
|
||||
this.context = context;
|
||||
this.id = resourceId;
|
||||
this.items = objects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameListItem getItem(int i)
|
||||
{
|
||||
return items.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent)
|
||||
{
|
||||
View v = convertView;
|
||||
if (v == null)
|
||||
if (convertView == null)
|
||||
{
|
||||
LayoutInflater vi = LayoutInflater.from(context);
|
||||
v = vi.inflate(id, parent, false);
|
||||
convertView = vi.inflate(id, parent, false);
|
||||
}
|
||||
|
||||
final GameListItem item = items.get(position);
|
||||
final GameListItem item = getItem(position);
|
||||
if (item != null)
|
||||
{
|
||||
TextView title = (TextView) v.findViewById(R.id.ListItemTitle);
|
||||
TextView subtitle = (TextView) v.findViewById(R.id.ListItemSubTitle);
|
||||
ImageView icon = (ImageView) v.findViewById(R.id.ListItemIcon);
|
||||
TextView title = (TextView) convertView.findViewById(R.id.ListItemTitle);
|
||||
TextView subtitle = (TextView) convertView.findViewById(R.id.ListItemSubTitle);
|
||||
ImageView icon = (ImageView) convertView.findViewById(R.id.ListItemIcon);
|
||||
|
||||
if (title != null)
|
||||
title.setText(item.getName());
|
||||
@@ -83,7 +70,7 @@ public final class GameListAdapter extends ArrayAdapter<GameListItem>
|
||||
}
|
||||
}
|
||||
|
||||
return v;
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.dolphinemu.dolphinemu.emulation.EmulationActivity;
|
||||
public final class GameListFragment extends ListFragment
|
||||
{
|
||||
private GameListAdapter mGameAdapter;
|
||||
private static GameListActivity mMe;
|
||||
private OnGameListZeroListener mCallback;
|
||||
|
||||
/**
|
||||
@@ -84,7 +83,7 @@ public final class GameListFragment extends ListFragment
|
||||
if (!entry.isHidden() && !entry.isDirectory())
|
||||
{
|
||||
if (exts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.'))))
|
||||
fls.add(new GameListItem(mMe, entryName, String.format(getString(R.string.file_size), entry.length()), entry.getAbsolutePath()));
|
||||
fls.add(new GameListItem(getActivity(), entryName, String.format(getString(R.string.file_size), entry.length()), entry.getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,8 +93,9 @@ public final class GameListFragment extends ListFragment
|
||||
}
|
||||
Collections.sort(fls);
|
||||
|
||||
mGameAdapter = new GameListAdapter(mMe, R.layout.gamelist_folderbrowser_list, fls);
|
||||
setListAdapter(mGameAdapter);
|
||||
// Add all the items to the adapter
|
||||
mGameAdapter.addAll(fls);
|
||||
mGameAdapter.notifyDataSetChanged();
|
||||
|
||||
if (fls.isEmpty())
|
||||
{
|
||||
@@ -106,12 +106,13 @@ public final class GameListFragment extends ListFragment
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
View rootView = inflater.inflate(R.layout.gamelist_listview, container, false);
|
||||
ListView mMainList = (ListView) rootView.findViewById(R.id.gamelist);
|
||||
ListView rootView = (ListView) inflater.inflate(R.layout.gamelist_listview, container, false);
|
||||
mGameAdapter = new GameListAdapter(getActivity(), R.layout.gamelist_folderbrowser_list_item);
|
||||
rootView.setAdapter(mGameAdapter);
|
||||
|
||||
Fill();
|
||||
|
||||
return mMainList;
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,12 +121,12 @@ public final class GameListFragment extends ListFragment
|
||||
GameListItem item = mGameAdapter.getItem(position);
|
||||
|
||||
// Show a toast indicating which game was clicked.
|
||||
Toast.makeText(mMe, String.format(getString(R.string.file_clicked), item.getPath()), Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), String.format(getString(R.string.file_clicked), item.getPath()), Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Start the emulation activity and send the path of the clicked ROM to it.
|
||||
Intent intent = new Intent(mMe, EmulationActivity.class);
|
||||
Intent intent = new Intent(getActivity(), EmulationActivity.class);
|
||||
intent.putExtra("SelectedGame", item.getPath());
|
||||
mMe.startActivity(intent);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,7 +139,6 @@ public final class GameListFragment extends ListFragment
|
||||
try
|
||||
{
|
||||
mCallback = (OnGameListZeroListener) activity;
|
||||
mMe = (GameListActivity) activity;
|
||||
}
|
||||
catch (ClassCastException e)
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ public final class VideoSettingsFragment extends PreferenceFragment
|
||||
public static String m_GLVendor;
|
||||
public static String m_GLRenderer;
|
||||
public static String m_GLExtensions;
|
||||
public static float m_QualcommVersion;
|
||||
private Activity m_activity;
|
||||
|
||||
/**
|
||||
@@ -165,7 +166,6 @@ public final class VideoSettingsFragment extends PreferenceFragment
|
||||
{
|
||||
int mVStart = m_GLVersion.indexOf("V@") + 2;
|
||||
int mVEnd = 0;
|
||||
float mVersion;
|
||||
|
||||
for (int a = mVStart; a < m_GLVersion.length(); ++a)
|
||||
{
|
||||
@@ -176,9 +176,9 @@ public final class VideoSettingsFragment extends PreferenceFragment
|
||||
}
|
||||
}
|
||||
|
||||
mVersion = Float.parseFloat(m_GLVersion.substring(mVStart, mVEnd));
|
||||
m_QualcommVersion = Float.parseFloat(m_GLVersion.substring(mVStart, mVEnd));
|
||||
|
||||
if (mVersion >= 14.0f)
|
||||
if (m_QualcommVersion >= 14.0f)
|
||||
mSupportsGLES3 = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,23 +54,22 @@ public final class SideMenuAdapter extends ArrayAdapter<SideMenuItem>
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent)
|
||||
{
|
||||
View v = convertView;
|
||||
if (v == null)
|
||||
if (convertView == null)
|
||||
{
|
||||
LayoutInflater vi = LayoutInflater.from(context);
|
||||
v = vi.inflate(id, null);
|
||||
convertView = vi.inflate(id, null);
|
||||
}
|
||||
|
||||
final SideMenuItem item = items.get(position);
|
||||
if (item != null)
|
||||
{
|
||||
TextView title = (TextView) v.findViewById(R.id.SideMenuTitle);
|
||||
TextView title = (TextView) convertView.findViewById(R.id.SideMenuTitle);
|
||||
|
||||
if (title != null)
|
||||
title.setText(item.getName());
|
||||
}
|
||||
|
||||
return v;
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ SoundStream *soundStream = nullptr;
|
||||
|
||||
namespace AudioCommon
|
||||
{
|
||||
SoundStream *InitSoundStream(CMixer *mixer)
|
||||
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd)
|
||||
{
|
||||
// TODO: possible memleak with mixer
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace AudioCommon
|
||||
else if (backend == BACKEND_NULLSOUND && NullSound::isValid())
|
||||
soundStream = new NullSound(mixer);
|
||||
else if (backend == BACKEND_DIRECTSOUND && DSound::isValid())
|
||||
soundStream = new DSound(mixer);
|
||||
soundStream = new DSound(mixer, hWnd);
|
||||
else if (backend == BACKEND_XAUDIO2)
|
||||
{
|
||||
if (XAudio2::isValid())
|
||||
|
||||
@@ -40,7 +40,7 @@ union UDSPControl
|
||||
|
||||
namespace AudioCommon
|
||||
{
|
||||
SoundStream *InitSoundStream(CMixer *mixer);
|
||||
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd);
|
||||
void ShutdownSoundStream();
|
||||
std::vector<std::string> GetSoundBackends();
|
||||
bool UseJIT();
|
||||
|
||||
@@ -48,7 +48,7 @@ class DSound : public SoundStream
|
||||
bool WriteDataToBuffer(DWORD dwOffset, char* soundData, DWORD dwSoundBytes);
|
||||
|
||||
public:
|
||||
DSound(CMixer *mixer, void *_hWnd = NULL)
|
||||
DSound(CMixer *mixer, void *_hWnd)
|
||||
: SoundStream(mixer)
|
||||
, bufferSize(0)
|
||||
, currentPos(0)
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
#else
|
||||
public:
|
||||
DSound(CMixer *mixer)
|
||||
DSound(CMixer *mixer, void *_hWnd)
|
||||
: SoundStream(mixer)
|
||||
{}
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user