Skip to content

Commit

Permalink
Merge branch 'Android-trash' since it is no longer quite so trashy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonicadvance1 committed Apr 15, 2013
2 parents 8a9fcd3 + 44bbb54 commit 7772f0d
Show file tree
Hide file tree
Showing 52 changed files with 4,185 additions and 146 deletions.
73 changes: 59 additions & 14 deletions CMakeLists.txt
Expand Up @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 2.6)

option(ANDROID "Enables a build for Android" OFF)
option(USE_EGL "Enables EGL OpenGL Interface" OFF)
option(USE_X11 "Enables X11 Support" ON)
option(USE_WAYLAND "Enables Wayland Support" OFF)
option(USE_GLES "Enables GLES And EGL, disables OGL" OFF)
option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF)

Expand Down Expand Up @@ -265,16 +267,28 @@ if(USE_GLES)
add_definitions(-DUSE_EGL=1)
set(USE_EGL True)
endif()
# For now Wayland and EGL are tied to each other.
# The alternative would be an shm path
if(USE_WAYLAND)
add_definitions(-DUSE_EGL)
set(USE_EGL 1)
endif()

if(USE_EGL)
message("EGL OpenGL interface enabled")
add_definitions(-DUSE_EGL=1)
else()
# Using GLX
set(USE_X11 1)
set(USE_WAYLAND 0)
endif()
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE)

if(ANDROID)
message("Building for Android")
add_definitions(-DANDROID)
set(USE_X11 0)
set(USE_WAYLAND 0)
endif()
########################################
# Dependency checking
Expand Down Expand Up @@ -350,29 +364,53 @@ if(NOT ANDROID)
message("OpenAL NOT found, disabling OpenAL sound backend")
endif(OPENAL_FOUND)

if(UNIX AND NOT APPLE)
# Note: The convention is to check USE_X11 or USE_WAYLAND where needed.
# This is where we detect platforms and set the variables accordingly.
pkg_check_modules(WAYLAND wayland-egl wayland-client wayland-cursor)
if(USE_WAYLAND AND WAYLAND_FOUND)
pkg_check_modules(XKBCOMMON xkbcommon)
if(XKBCOMMON_FOUND)
set(USE_WAYLAND 1)
add_definitions(-DHAVE_WAYLAND)
include_directories(${WAYLAND_INCLUDE_DIR})
message("Wayland support enabled")
endif(XKBCOMMON_FOUND)
else()
set(USE_WAYLAND 0)
message("Wayland support disabled")
add_definitions(-DHAVE_WAYLAND=0)
endif(USE_WAYLAND AND WAYLAND_FOUND)

# Note: We do not need to explicitly check for X11 as it is done in the cmake
# FindOpenGL module on linux.
if(UNIX AND NOT APPLE)
if(X11_FOUND)
if(USE_X11 AND X11_FOUND)
set(USE_X11 1)
add_definitions(-DHAVE_X11=1)
include_directories(${X11_INCLUDE_DIR})
message("X11 found")
message("X11 support enabled")
else()
message(FATAL_ERROR "X11 is required but not found")
endif(X11_FOUND)
else()
add_definitions(-DHAVE_X11=0)
set(USE_X11 0)
SET(X11_FOUND "")
message("X11 support disabled")
add_definitions(-DHAVE_X11=0)
endif(USE_X11 AND X11_FOUND)

if (NOT USE_WAYLAND AND NOT USE_X11)
message(FATAL_ERROR "\n"
"No suitable display platform found\n"
"Requires wayland or x11 to run")
endif()
endif()

if(X11_FOUND)
if(USE_X11)
check_lib(XRANDR Xrandr)
if(XRANDR_FOUND)
add_definitions(-DHAVE_XRANDR=1)
else()
add_definitions(-DHAVE_XRANDR=0)
endif(XRANDR_FOUND)
endif()
if(XRANDR_FOUND)
add_definitions(-DHAVE_XRANDR=1)
else()
add_definitions(-DHAVE_XRANDR=0)
endif(XRANDR_FOUND)

if(ENCODE_FRAMEDUMPS)
check_libav()
endif()
Expand Down Expand Up @@ -444,6 +482,13 @@ else()
set(LZO lzo2)
endif()

if(ANDROID)
message("Using static libpng from Externals")
add_subdirectory(Externals/libpng)
include_directories(Externals/libpng)
set(PNG libpng)
endif()

if(OPENAL_FOUND)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
check_lib(SOUNDTOUCH SoundTouch soundtouch/soundtouch.h QUIET)
Expand Down
8 changes: 8 additions & 0 deletions Source/Android/.classpath
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
7 changes: 7 additions & 0 deletions Source/Android/.gitignore
@@ -0,0 +1,7 @@
gen
obj
#ui_atlas.zim
ui_atlas.zim.png
#assets/ui_atlas.zim
#jni/ui_atlas.cpp
#jni/ui_atlas.h
33 changes: 33 additions & 0 deletions Source/Android/.project
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ppsspp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
4 changes: 4 additions & 0 deletions Source/Android/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5
35 changes: 35 additions & 0 deletions Source/Android/AndroidManifest.xml
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.dolphinemu.dolphinemu"
android:versionCode="1"
android:versionName="0.1" >

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14"/>

<uses-feature android:glEsVersion="0x00020000"></uses-feature>
<uses-feature android:name="android.hardware.screen.landscape" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<application
android:icon="@drawable/launcher"
android:label="@string/app_name">
<activity
android:name=".DolphinEmulator"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|locale|keyboard|keyboardHidden|navigation|fontScale|uiMode" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".NativeListView"
android:label="@string/app_name"
android:theme="@android:style/Theme"
android:configChanges="orientation|locale|keyboard|keyboardHidden|navigation|fontScale|uiMode" >
</activity>
</application>

</manifest>

0 comments on commit 7772f0d

Please sign in to comment.