Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' into jit_exit_addresses
  • Loading branch information
Sonicadvance1 committed Nov 22, 2013
2 parents 1aa06b8 + ff91789 commit ea9ac07
Show file tree
Hide file tree
Showing 143 changed files with 1,770 additions and 1,090 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions Externals/wxWidgets3/CMakeLists.txt
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions Source/Android/res/menu/emuwindow_overlay.xml
@@ -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"
Expand All @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions Source/Android/res/values-ja/strings.xml
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions Source/Android/res/values/strings.xml
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
41 changes: 14 additions & 27 deletions Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java
Expand Up @@ -6,7 +6,6 @@

package org.dolphinemu.dolphinemu;

import android.app.Activity;
import android.app.ListFragment;
import android.content.Context;
import android.os.Bundle;
Expand All @@ -27,35 +26,24 @@
*/
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.

return mMainList;
}

@Override
public void onAttach(Activity activity)
{
super.onAttach(activity);
AboutFragmentAdapter adapter = new AboutFragmentAdapter(getActivity(), R.layout.about_layout, Input);
rootView.setAdapter(adapter);
rootView.setEnabled(false); // Makes the list view non-clickable.

// Cache the activity instance.
m_activity = activity;
return rootView;
}

// Represents an item in the AboutFragment.
Expand Down Expand Up @@ -106,18 +94,17 @@ public AboutFragmentItem getItem(int index)
@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());
Expand All @@ -126,7 +113,7 @@ public View getView(int position, View convertView, ViewGroup parent)
subtitle.setText(item.getSubTitle());
}

return v;
return convertView;
}
}
}
Expand Up @@ -86,4 +86,9 @@ public void onCreate(Bundle savedInstanceState)
UserPreferences.LoadIniToPrefs(this);
}
}
protected void onRestart()
{
super.onRestart();
finish(); // If we are ever returning to this activity then we are exiting.
}
}
13 changes: 13 additions & 0 deletions Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java
Expand Up @@ -104,6 +104,19 @@
*/
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.
*
Expand Down
Expand Up @@ -68,12 +68,14 @@ public void onCreate(Bundle savedInstanceState)

// 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);
Expand Down Expand Up @@ -173,6 +175,11 @@ public boolean onMenuItemSelected(int itemId, MenuItem item)
{
switch(item.getItemId())
{
// Screenshot capturing
case R.id.takeScreenshot:
NativeLibrary.SaveScreenShot();
return true;

// Save state slots
case R.id.saveSlot1:
NativeLibrary.SaveState(0);
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -37,16 +36,18 @@
*/
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>();
Expand Down Expand Up @@ -96,9 +97,9 @@ else if (entry.isFile() && hasExtension)
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
Expand All @@ -122,22 +123,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
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;
}

@Override
public void onAttach(Activity activity)
{
super.onAttach(activity);

// Cache the activity instance.
m_activity = activity;
return rootView;
}


private void FolderSelected()
{
String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0");
Expand Down Expand Up @@ -168,6 +161,6 @@ private void FolderSelected()
NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(intDirectories), currentDir.getPath());
}

((GameListActivity)m_activity).SwitchPage(0);
((GameListActivity)getActivity()).SwitchPage(0);
}
}

0 comments on commit ea9ac07

Please sign in to comment.