mirror of
https://github.com/izzy2lost/ppsspp.git
synced 2026-03-10 12:43:04 -07:00
Android: Combine the two Java Eclipse projects into one.
Should make it easier to get ndk-gdb going, which I've always had crazy issues with with library projects.
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "android/app-android.h"
|
||||
#include "input/input_state.h"
|
||||
#include "ui/ui.h"
|
||||
#include "util/text/utf8.h"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "android/app-android.h"
|
||||
#include "android/jni/app-android.h"
|
||||
#include "base/display.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/timeutil.h"
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
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
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
||||
@@ -325,7 +325,9 @@ LOCAL_STATIC_LIBRARIES += ppsspp_core
|
||||
# These are the files just for ppsspp_jni
|
||||
LOCAL_MODULE := ppsspp_jni
|
||||
LOCAL_SRC_FILES := \
|
||||
$(NATIVE)/android/app-android.cpp \
|
||||
$(SRC)/android/jni/app-android.cpp \
|
||||
$(SRC)/android/jni/native_audio.cpp \
|
||||
$(SRC)/android/jni/native-audio-so.cpp \
|
||||
$(SRC)/UI/BackgroundAudio.cpp \
|
||||
$(SRC)/UI/DevScreens.cpp \
|
||||
$(SRC)/UI/EmuScreen.cpp \
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "audio/mixer.h"
|
||||
#include "math/math_util.h"
|
||||
#include "net/resolve.h"
|
||||
#include "android/native_audio.h"
|
||||
#include "android/jni/native_audio.h"
|
||||
#include "gfx/gl_common.h"
|
||||
|
||||
#include "app-android.h"
|
||||
@@ -162,7 +162,7 @@ std::string GetJavaString(JNIEnv *env, jstring jstr) {
|
||||
|
||||
// This is now only used as a trigger for GetAppInfo as a function to all before Init.
|
||||
// On Android we don't use any of the values it returns.
|
||||
extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_isLandscape(JNIEnv *env, jclass) {
|
||||
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_isLandscape(JNIEnv *env, jclass) {
|
||||
std::string app_name, app_nice_name, version;
|
||||
bool landscape;
|
||||
NativeGetAppInfo(&app_name, &app_nice_name, &landscape, &version);
|
||||
@@ -170,17 +170,17 @@ extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_isLandscape(JNIEn
|
||||
}
|
||||
|
||||
// Allow the app to intercept the back button.
|
||||
extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_isAtTopLevel(JNIEnv *env, jclass) {
|
||||
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_isAtTopLevel(JNIEnv *env, jclass) {
|
||||
return NativeIsAtTopLevel();
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_audioConfig
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_audioConfig
|
||||
(JNIEnv *env, jclass, jint optimalFPB, jint optimalSR) {
|
||||
optimalFramesPerBuffer = optimalFPB;
|
||||
optimalSampleRate = optimalSR;
|
||||
}
|
||||
|
||||
extern "C" jstring Java_com_henrikrydgard_libnative_NativeApp_queryConfig
|
||||
extern "C" jstring Java_org_ppsspp_ppsspp_NativeApp_queryConfig
|
||||
(JNIEnv *env, jclass, jstring jquery) {
|
||||
std::string query = GetJavaString(env, jquery);
|
||||
std::string result = NativeQueryConfig(query);
|
||||
@@ -188,7 +188,7 @@ extern "C" jstring Java_com_henrikrydgard_libnative_NativeApp_queryConfig
|
||||
return jresult;
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_init
|
||||
(JNIEnv *env, jclass, jstring jmodel, jint jdeviceType, jint jxres, jint jyres, jstring jlangRegion, jstring japkpath,
|
||||
jstring jdataDir, jstring jexternalDir, jstring jlibraryDir, jstring jshortcutParam,
|
||||
jstring jinstallID, jint jAndroidVersion) {
|
||||
@@ -256,7 +256,7 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
|
||||
ILOG("NativeApp.init() -- end");
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_audioInit(JNIEnv *, jclass) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_audioInit(JNIEnv *, jclass) {
|
||||
sampleRate = optimalSampleRate;
|
||||
if (NativeQueryConfig("force44khz") != "0" || optimalSampleRate == 0) {
|
||||
sampleRate = 44100;
|
||||
@@ -278,21 +278,21 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_audioInit(JNIEnv *, j
|
||||
AndroidAudio_Init(&NativeMix, library_path, framesPerBuffer, sampleRate);
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_audioShutdown(JNIEnv *, jclass) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_audioShutdown(JNIEnv *, jclass) {
|
||||
AndroidAudio_Shutdown();
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_resume(JNIEnv *, jclass) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_resume(JNIEnv *, jclass) {
|
||||
ILOG("NativeApp.resume() - resuming audio");
|
||||
AndroidAudio_Resume();
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_pause(JNIEnv *, jclass) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_pause(JNIEnv *, jclass) {
|
||||
ILOG("NativeApp.pause() - pausing audio");
|
||||
AndroidAudio_Pause();
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_shutdown(JNIEnv *, jclass) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) {
|
||||
ILOG("NativeApp.shutdown() -- begin");
|
||||
NativeShutdown();
|
||||
VFSShutdown();
|
||||
@@ -302,7 +302,7 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_shutdown(JNIEnv *, jc
|
||||
|
||||
static jmethodID postCommand;
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayInit(JNIEnv * env, jobject obj) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayInit(JNIEnv * env, jobject obj) {
|
||||
ILOG("NativeApp.displayInit()");
|
||||
if (!renderer_inited) {
|
||||
NativeInitGraphics();
|
||||
@@ -316,7 +316,7 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayInit(JNIE
|
||||
postCommand = env->GetMethodID(env->GetObjectClass(obj), "postCommand", "(Ljava/lang/String;Ljava/lang/String;)V");
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayResize(JNIEnv *, jobject clazz, jint w, jint h, jint dpi, jfloat refreshRate) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayResize(JNIEnv *, jobject clazz, jint w, jint h, jint dpi, jfloat refreshRate) {
|
||||
ILOG("NativeApp.displayResize(%i x %i, dpi=%i, refresh=%0.2f)", w, h, dpi, refreshRate);
|
||||
|
||||
g_dpi = dpi;
|
||||
@@ -333,7 +333,7 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayResize(JN
|
||||
NativeResized();
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayRender(JNIEnv *env, jobject obj) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayRender(JNIEnv *env, jobject obj) {
|
||||
static bool hasSetThreadName = false;
|
||||
if (!hasSetThreadName) {
|
||||
hasSetThreadName = true;
|
||||
@@ -386,7 +386,7 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayRender(JN
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayShutdown(JNIEnv *env, jobject obj) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayShutdown(JNIEnv *env, jobject obj) {
|
||||
if (renderer_inited) {
|
||||
NativeDeviceLost();
|
||||
ILOG("NativeDeviceLost completed.");
|
||||
@@ -396,7 +396,7 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayShutdown(
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" jboolean JNICALL Java_com_henrikrydgard_libnative_NativeApp_touch
|
||||
extern "C" jboolean JNICALL Java_org_ppsspp_ppsspp_NativeApp_touch
|
||||
(JNIEnv *, jclass, float x, float y, int code, int pointerId) {
|
||||
float scaledX = x * dp_xscale;
|
||||
float scaledY = y * dp_yscale;
|
||||
@@ -426,7 +426,7 @@ extern "C" jboolean JNICALL Java_com_henrikrydgard_libnative_NativeApp_touch
|
||||
return retval;
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_keyDown(JNIEnv *, jclass, jint deviceId, jint key, jboolean isRepeat) {
|
||||
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_keyDown(JNIEnv *, jclass, jint deviceId, jint key, jboolean isRepeat) {
|
||||
KeyInput keyInput;
|
||||
keyInput.deviceId = deviceId;
|
||||
keyInput.keyCode = key;
|
||||
@@ -437,7 +437,7 @@ extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_keyDown(JNIEnv *,
|
||||
return NativeKey(keyInput);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_keyUp(JNIEnv *, jclass, jint deviceId, jint key) {
|
||||
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_keyUp(JNIEnv *, jclass, jint deviceId, jint key) {
|
||||
KeyInput keyInput;
|
||||
keyInput.deviceId = deviceId;
|
||||
keyInput.keyCode = key;
|
||||
@@ -445,12 +445,12 @@ extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_keyUp(JNIEnv *, j
|
||||
return NativeKey(keyInput);
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_beginJoystickEvent(
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_beginJoystickEvent(
|
||||
JNIEnv *env, jclass) {
|
||||
// mutex lock?
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_joystickAxis(
|
||||
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_joystickAxis(
|
||||
JNIEnv *env, jclass, jint deviceId, jint axisId, jfloat value) {
|
||||
if (!renderer_inited)
|
||||
return false;
|
||||
@@ -482,19 +482,19 @@ extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_joystickAxis(
|
||||
return NativeAxis(axis);
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_endJoystickEvent(
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_endJoystickEvent(
|
||||
JNIEnv *env, jclass) {
|
||||
// mutex unlock?
|
||||
}
|
||||
|
||||
|
||||
extern "C" jboolean Java_com_henrikrydgard_libnative_NativeApp_mouseWheelEvent(
|
||||
extern "C" jboolean Java_org_ppsspp_ppsspp_NativeApp_mouseWheelEvent(
|
||||
JNIEnv *env, jclass, jint stick, jfloat x, jfloat y) {
|
||||
// TODO: Support mousewheel for android
|
||||
return true;
|
||||
}
|
||||
|
||||
extern "C" jboolean JNICALL Java_com_henrikrydgard_libnative_NativeApp_accelerometer(JNIEnv *, jclass, float x, float y, float z) {
|
||||
extern "C" jboolean JNICALL Java_org_ppsspp_ppsspp_NativeApp_accelerometer(JNIEnv *, jclass, float x, float y, float z) {
|
||||
if (!renderer_inited)
|
||||
return false;
|
||||
|
||||
@@ -525,7 +525,7 @@ extern "C" jboolean JNICALL Java_com_henrikrydgard_libnative_NativeApp_accelerom
|
||||
return retvalX || retvalY || retvalZ;
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_sendMessage(JNIEnv *env, jclass, jstring message, jstring param) {
|
||||
extern "C" void Java_org_ppsspp_ppsspp_NativeApp_sendMessage(JNIEnv *env, jclass, jstring message, jstring param) {
|
||||
std::string msg = GetJavaString(env, message);
|
||||
std::string prm = GetJavaString(env, param);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "base/logging.h"
|
||||
#include "android/native_audio.h"
|
||||
#include "android/native-audio-so.h"
|
||||
#include "android/jni/native_audio.h"
|
||||
#include "android/jni/native-audio-so.h"
|
||||
|
||||
struct AudioState {
|
||||
void *so;
|
||||
@@ -12,4 +12,3 @@
|
||||
|
||||
# Project target.
|
||||
target=android-22
|
||||
android.library.reference.1=../ext/native/android
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.henrikrydgard.libnative;
|
||||
package org.ppsspp.ppsspp;
|
||||
import android.media.AudioManager;
|
||||
import android.media.AudioManager.OnAudioFocusChangeListener;
|
||||
|
||||
@@ -7,6 +7,7 @@ public class AudioFocusChangeListener implements OnAudioFocusChangeListener{
|
||||
// for now.
|
||||
private boolean hasAudioFocus = false;
|
||||
|
||||
|
||||
@Override
|
||||
public void onAudioFocusChange(int focusChange) {
|
||||
switch (focusChange){
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.henrikrydgard.libnative;
|
||||
package org.ppsspp.ppsspp;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.os.Build;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.henrikrydgard.libnative;
|
||||
package org.ppsspp.ppsspp;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -18,7 +18,7 @@
|
||||
*
|
||||
* Authors: Paul Lamb
|
||||
*/
|
||||
package com.henrikrydgard.libnative;
|
||||
package org.ppsspp.ppsspp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.henrikrydgard.libnative;
|
||||
package org.ppsspp.ppsspp;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.henrikrydgard.libnative;
|
||||
package org.ppsspp.ppsspp;
|
||||
|
||||
|
||||
// Note that the display* methods are in NativeRenderer.java
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.henrikrydgard.libnative;
|
||||
package org.ppsspp.ppsspp;
|
||||
|
||||
import javax.microedition.khronos.egl.EGL10;
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
@@ -60,7 +60,6 @@ public class NativeEGLConfigChooser implements EGLConfigChooser {
|
||||
return attr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
|
||||
// The absolute minimum. We will do our best to choose a better config though.
|
||||
int[] configSpec = {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.henrikrydgard.libnative;
|
||||
package org.ppsspp.ppsspp;
|
||||
|
||||
// Touch- and sensor-enabled GLSurfaceView.
|
||||
// Supports simple multitouch and pressure.
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.henrikrydgard.libnative;
|
||||
package org.ppsspp.ppsspp;
|
||||
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
@@ -48,7 +48,6 @@ public class NativeRenderer implements GLSurfaceView.Renderer {
|
||||
surfaceView.getHolder().setFixedSize(xres, yres);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrawFrame(GL10 unused /*use GLES20*/) {
|
||||
if (isDark) {
|
||||
GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
|
||||
@@ -59,14 +58,12 @@ public class NativeRenderer implements GLSurfaceView.Renderer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
|
||||
// Log.i(TAG, "onSurfaceCreated - EGL context is new or was lost");
|
||||
// Actually, it seems that it is here we should recreate lost GL objects.
|
||||
displayInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfaceChanged(GL10 unused, int width, int height) {
|
||||
Point sz = new Point();
|
||||
mActivity.GetScreenSize(sz);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user