ANDROID: adjust Android backend files for ResidualVM
This commit is contained in:
parent
e4c76ee4cf
commit
45ca17f122
11 changed files with 111 additions and 111 deletions
|
@ -60,7 +60,7 @@
|
|||
#include "backends/platform/android/jni.h"
|
||||
#include "backends/platform/android/android.h"
|
||||
|
||||
const char *android_log_tag = "ScummVM";
|
||||
const char *android_log_tag = "ResidualVM";
|
||||
|
||||
// This replaces the bionic libc assert functions with something that
|
||||
// actually prints the assertion failure before aborting.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
# Android specific build targets
|
||||
|
||||
# These must be incremented for each market upload
|
||||
ANDROID_VERSIONCODE = 6
|
||||
ANDROID_PLUGIN_VERSIONCODE = 6
|
||||
ANDROID_VERSIONCODE = 1
|
||||
ANDROID_PLUGIN_VERSIONCODE = 1
|
||||
|
||||
JAVA_FILES = \
|
||||
ScummVM.java \
|
||||
ScummVMEvents.java \
|
||||
ScummVMApplication.java \
|
||||
ScummVMActivity.java \
|
||||
ResidualVM.java \
|
||||
ResidualVMEvents.java \
|
||||
ResidualVMApplication.java \
|
||||
ResidualVMActivity.java \
|
||||
EditableSurfaceView.java \
|
||||
Unpacker.java
|
||||
|
||||
|
@ -29,12 +29,12 @@ RESOURCES = \
|
|||
$(PATH_RESOURCES)/layout/main.xml \
|
||||
$(PATH_RESOURCES)/layout/splash.xml \
|
||||
$(PATH_RESOURCES)/drawable/gradient.xml \
|
||||
$(PATH_RESOURCES)/drawable/scummvm.png \
|
||||
$(PATH_RESOURCES)/drawable/scummvm_big.png
|
||||
$(PATH_RESOURCES)/drawable/residualvm.png \
|
||||
$(PATH_RESOURCES)/drawable/residualvm_big.png
|
||||
|
||||
PLUGIN_RESOURCES = \
|
||||
$(PATH_RESOURCES)/values/strings.xml \
|
||||
$(PATH_RESOURCES)/drawable/scummvm.png
|
||||
$(PATH_RESOURCES)/drawable/residualvm.png
|
||||
|
||||
# FIXME: find/mark plugin entry points and add all this back again:
|
||||
#LDFLAGS += -Wl,--gc-sections
|
||||
|
@ -63,7 +63,7 @@ PATH_BUILD_CLASSES_PLUGIN_TOP = $(PATH_BUILD)/classes.plugin
|
|||
PATH_STAGE_PREFIX = build.stage
|
||||
PATH_STAGE_MAIN = $(PATH_STAGE_PREFIX).main
|
||||
|
||||
PATH_REL = org/scummvm/scummvm
|
||||
PATH_REL = org/residualvm/residualvm
|
||||
PATH_SRC_TOP = $(srcdir)/backends/platform/android
|
||||
PATH_SRC = $(PATH_SRC_TOP)/$(PATH_REL)
|
||||
|
||||
|
@ -85,8 +85,8 @@ CLASSES_MAIN = $(addprefix $(PATH_CLASSES_MAIN)/, $(JAVA_FILES:%.java=%.class))
|
|||
CLASSES_GEN = $(addprefix $(PATH_CLASSES_MAIN)/, $(JAVA_FILES_GEN:%.java=%.class))
|
||||
CLASSES_PLUGIN = $(addprefix $(PATH_CLASSES_PLUGIN)/, $(JAVA_FILES_PLUGIN:%.java=%.class))
|
||||
|
||||
APK_MAIN = scummvm.apk
|
||||
APK_PLUGINS = $(patsubst plugins/lib%.so, scummvm-engine-%.apk, $(PLUGINS))
|
||||
APK_MAIN = residualvm.apk
|
||||
APK_PLUGINS = $(patsubst plugins/lib%.so, residualvm-engine-%.apk, $(PLUGINS))
|
||||
|
||||
$(FILE_MANIFEST): $(FILE_MANIFEST_SRC)
|
||||
@$(MKDIR) -p $(@D)
|
||||
|
@ -123,7 +123,7 @@ $(PATH_STAGE_PREFIX).%/res/values/strings.xml: $(PATH_DIST)/mkplugin.sh $(srcdir
|
|||
@$(MKDIR) -p $(@D)
|
||||
$(PATH_DIST)/mkplugin.sh $(srcdir)/configure $* $(PATH_DIST)/plugin-strings.xml $(ANDROID_PLUGIN_VERSIONCODE) $@
|
||||
|
||||
$(PATH_STAGE_PREFIX).%/res/drawable/scummvm.png: $(PATH_RESOURCES)/drawable/scummvm.png
|
||||
$(PATH_STAGE_PREFIX).%/res/drawable/residualvm.png: $(PATH_RESOURCES)/drawable/residualvm.png
|
||||
@$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
|
||||
|
@ -132,20 +132,20 @@ $(FILE_RESOURCES_MAIN): $(FILE_MANIFEST) $(RESOURCES) $(ANDROID_JAR8) $(DIST_FIL
|
|||
$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) $(PATH_BUILD_ASSETS)/
|
||||
$(AAPT) package -f -M $< -S $(PATH_RESOURCES) -A $(PATH_BUILD_ASSETS) -I $(ANDROID_JAR8) -F $@
|
||||
|
||||
$(PATH_BUILD)/%/$(FILE_RESOURCES): $(PATH_BUILD)/%/AndroidManifest.xml $(PATH_STAGE_PREFIX).%/res/values/strings.xml $(PATH_STAGE_PREFIX).%/res/drawable/scummvm.png plugins/lib%.so $(ANDROID_JAR8)
|
||||
$(PATH_BUILD)/%/$(FILE_RESOURCES): $(PATH_BUILD)/%/AndroidManifest.xml $(PATH_STAGE_PREFIX).%/res/values/strings.xml $(PATH_STAGE_PREFIX).%/res/drawable/residualvm.png plugins/lib%.so $(ANDROID_JAR8)
|
||||
$(AAPT) package -f -M $< -S $(PATH_STAGE_PREFIX).$*/res -I $(ANDROID_JAR8) -F $@
|
||||
|
||||
# Package installer won't delete old libscummvm.so on upgrade so
|
||||
# Package installer won't delete old libresidualvm.so on upgrade so
|
||||
# replace it with a zero size file
|
||||
$(APK_MAIN): $(EXECUTABLE) $(FILE_RESOURCES_MAIN) $(FILE_DEX)
|
||||
$(INSTALL) -d $(PATH_STAGE_MAIN)/common/lib/armeabi
|
||||
touch $(PATH_STAGE_MAIN)/common/lib/armeabi/libscummvm.so
|
||||
touch $(PATH_STAGE_MAIN)/common/lib/armeabi/libresidualvm.so
|
||||
$(INSTALL) -d $(PATH_STAGE_MAIN)/common/mylib/armeabi
|
||||
$(INSTALL) -c -m 644 libscummvm.so $(PATH_STAGE_MAIN)/common/mylib/armeabi/
|
||||
$(STRIP) $(PATH_STAGE_MAIN)/common/mylib/armeabi/libscummvm.so
|
||||
$(INSTALL) -c -m 644 libresidualvm.so $(PATH_STAGE_MAIN)/common/mylib/armeabi/
|
||||
$(STRIP) $(PATH_STAGE_MAIN)/common/mylib/armeabi/libresidualvm.so
|
||||
$(APKBUILDER) $@ -z $(FILE_RESOURCES_MAIN) -f $(FILE_DEX) -rf $(PATH_STAGE_MAIN)/common || { $(RM) $@; exit 1; }
|
||||
|
||||
scummvm-engine-%.apk: plugins/lib%.so $(PATH_BUILD)/%/$(FILE_RESOURCES) $(FILE_DEX_PLUGIN)
|
||||
residualvm-engine-%.apk: plugins/lib%.so $(PATH_BUILD)/%/$(FILE_RESOURCES) $(FILE_DEX_PLUGIN)
|
||||
$(INSTALL) -d $(PATH_STAGE_PREFIX).$*/apk/mylib/armeabi/
|
||||
$(INSTALL) -c -m 644 plugins/lib$*.so $(PATH_STAGE_PREFIX).$*/apk/mylib/armeabi/
|
||||
$(STRIP) $(PATH_STAGE_PREFIX).$*/apk/mylib/armeabi/lib$*.so
|
||||
|
@ -172,13 +172,13 @@ androidrelease: $(addprefix release/, $(APK_MAIN) $(APK_PLUGINS))
|
|||
|
||||
androidtestmain: $(APK_MAIN)
|
||||
$(ADB) install -r $(APK_MAIN)
|
||||
$(ADB) shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.scummvm.scummvm/.Unpacker
|
||||
$(ADB) shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.residualvm.residualvm/.Unpacker
|
||||
|
||||
androidtest: $(APK_MAIN) $(APK_PLUGINS)
|
||||
@set -e; for apk in $^; do \
|
||||
$(ADB) install -r $$apk; \
|
||||
done
|
||||
$(ADB) shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.scummvm.scummvm/.Unpacker
|
||||
$(ADB) shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n org.residualvm.residualvm/.Unpacker
|
||||
|
||||
# used by buildbot!
|
||||
androiddistdebug: all
|
||||
|
|
|
@ -506,7 +506,7 @@ void OSystem_Android::updateScreen() {
|
|||
|
||||
const Common::Point &mouse = getEventManager()->getMousePos();
|
||||
|
||||
// Scale up ScummVM -> OpenGL (pixel) coordinates
|
||||
// Scale up ResidualVM -> OpenGL (pixel) coordinates
|
||||
if (_show_overlay) {
|
||||
GLCALL(glScalex(xdiv(_egl_surface_width,
|
||||
_overlay_texture->width()),
|
||||
|
|
|
@ -125,7 +125,7 @@ jint JNI::onLoad(JavaVM *vm) {
|
|||
if (_vm->GetEnv((void **)&env, JNI_VERSION_1_2))
|
||||
return JNI_ERR;
|
||||
|
||||
jclass cls = env->FindClass("org/scummvm/scummvm/ScummVM");
|
||||
jclass cls = env->FindClass("org/residualvm/residualvm/ResidualVM");
|
||||
if (cls == 0)
|
||||
return JNI_ERR;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.scummvm.scummvm;
|
||||
package org.residualvm.residualvm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.InputType;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.scummvm.scummvm;
|
||||
package org.residualvm.residualvm;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
|
@ -14,13 +14,13 @@ import android.util.Log;
|
|||
import java.util.ArrayList;
|
||||
|
||||
public class PluginProvider extends BroadcastReceiver {
|
||||
private final static String LOG_TAG = "ScummVM";
|
||||
private final static String LOG_TAG = "ResidualVM";
|
||||
|
||||
public final static String META_UNPACK_LIB =
|
||||
"org.scummvm.scummvm.meta.UNPACK_LIB";
|
||||
"org.residualvm.residualvm.meta.UNPACK_LIB";
|
||||
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (!intent.getAction().equals(ScummVMApplication.ACTION_PLUGIN_QUERY))
|
||||
if (!intent.getAction().equals(ResidualVMApplication.ACTION_PLUGIN_QUERY))
|
||||
return;
|
||||
|
||||
Bundle extras = getResultExtras(true);
|
||||
|
@ -38,23 +38,23 @@ public class PluginProvider extends BroadcastReceiver {
|
|||
return;
|
||||
}
|
||||
|
||||
String host_version = extras.getString(ScummVMApplication.EXTRA_VERSION);
|
||||
String host_version = extras.getString(ResidualVMApplication.EXTRA_VERSION);
|
||||
if (!pinfo.versionName.equals(host_version)) {
|
||||
Log.e(LOG_TAG, "Plugin version " + pinfo.versionName + " is not equal to ScummVM version " + host_version);
|
||||
Log.e(LOG_TAG, "Plugin version " + pinfo.versionName + " is not equal to ResidualVM version " + host_version);
|
||||
return;
|
||||
}
|
||||
|
||||
String mylib = info.metaData.getString(META_UNPACK_LIB);
|
||||
if (mylib != null) {
|
||||
ArrayList<String> all_libs =
|
||||
extras.getStringArrayList(ScummVMApplication.EXTRA_UNPACK_LIBS);
|
||||
extras.getStringArrayList(ResidualVMApplication.EXTRA_UNPACK_LIBS);
|
||||
all_libs.add(new Uri.Builder()
|
||||
.scheme("plugin")
|
||||
.authority(context.getPackageName())
|
||||
.path(mylib)
|
||||
.toString());
|
||||
|
||||
extras.putStringArrayList(ScummVMApplication.EXTRA_UNPACK_LIBS,
|
||||
extras.putStringArrayList(ResidualVMApplication.EXTRA_UNPACK_LIBS,
|
||||
all_libs);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.scummvm.scummvm;
|
||||
package org.residualvm.residualvm;
|
||||
|
||||
import android.util.Log;
|
||||
import android.content.res.AssetManager;
|
||||
|
@ -17,8 +17,8 @@ import javax.microedition.khronos.egl.EGLSurface;
|
|||
import java.io.File;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
|
||||
final protected static String LOG_TAG = "ScummVM";
|
||||
public abstract class ResidualVM implements SurfaceHolder.Callback, Runnable {
|
||||
final protected static String LOG_TAG = "ResidualVM";
|
||||
final private AssetManager _asset_manager;
|
||||
final private Object _sem_surface;
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
|
|||
// pause the engine and all native threads
|
||||
final public native void setPause(boolean pause);
|
||||
final public native void enableZoning(boolean enable);
|
||||
// Feed an event to ScummVM. Safe to call from other threads.
|
||||
// Feed an event to ResidualVM. Safe to call from other threads.
|
||||
final public native void pushEvent(int type, int arg1, int arg2, int arg3,
|
||||
int arg4, int arg5);
|
||||
|
||||
|
@ -58,7 +58,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
|
|||
abstract protected void showVirtualKeyboard(boolean enable);
|
||||
abstract protected String[] getSysArchives();
|
||||
|
||||
public ScummVM(AssetManager asset_manager, SurfaceHolder holder) {
|
||||
public ResidualVM(AssetManager asset_manager, SurfaceHolder holder) {
|
||||
_asset_manager = asset_manager;
|
||||
_sem_surface = new Object();
|
||||
|
||||
|
@ -126,7 +126,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
|
|||
deinitEGL();
|
||||
deinitAudio();
|
||||
|
||||
throw new RuntimeException("Error preparing the ScummVM thread", e);
|
||||
throw new RuntimeException("Error preparing the ResidualVM thread", e);
|
||||
}
|
||||
|
||||
create(_asset_manager, _egl, _egl_display,
|
||||
|
@ -442,8 +442,8 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
File cache_dir = ScummVMApplication.getLastCacheDir();
|
||||
String libname = System.mapLibraryName("scummvm");
|
||||
File cache_dir = ResidualVMApplication.getLastCacheDir();
|
||||
String libname = System.mapLibraryName("residualvm");
|
||||
File libpath = new File(cache_dir, libname);
|
||||
|
||||
System.load(libpath.getPath());
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.scummvm.scummvm;
|
||||
package org.residualvm.residualvm;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
|
@ -16,9 +16,9 @@ import android.widget.Toast;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
public class ScummVMActivity extends Activity {
|
||||
public class ResidualVMActivity extends Activity {
|
||||
|
||||
private class MyScummVM extends ScummVM {
|
||||
private class MyResidualVM extends ResidualVM {
|
||||
private boolean usingSmallScreen() {
|
||||
// Multiple screen sizes came in with Android 1.6. Have
|
||||
// to use reflection in order to continue supporting 1.5
|
||||
|
@ -36,10 +36,10 @@ public class ScummVMActivity extends Activity {
|
|||
}
|
||||
}
|
||||
|
||||
public MyScummVM(SurfaceHolder holder) {
|
||||
super(ScummVMActivity.this.getAssets(), holder);
|
||||
public MyResidualVM(SurfaceHolder holder) {
|
||||
super(ResidualVMActivity.this.getAssets(), holder);
|
||||
|
||||
// Enable ScummVM zoning on 'small' screens.
|
||||
// Enable ResidualVM zoning on 'small' screens.
|
||||
// FIXME make this optional for the user
|
||||
// disabled for now since it crops too much
|
||||
//enableZoning(usingSmallScreen());
|
||||
|
@ -57,7 +57,7 @@ public class ScummVMActivity extends Activity {
|
|||
@Override
|
||||
protected void displayMessageOnOSD(String msg) {
|
||||
Log.i(LOG_TAG, "OSD: " + msg);
|
||||
Toast.makeText(ScummVMActivity.this, msg, Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ResidualVMActivity.this, msg, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -72,7 +72,7 @@ public class ScummVMActivity extends Activity {
|
|||
@Override
|
||||
protected String[] getPluginDirectories() {
|
||||
String[] dirs = new String[1];
|
||||
dirs[0] = ScummVMApplication.getLastCacheDir().getPath();
|
||||
dirs[0] = ResidualVMApplication.getLastCacheDir().getPath();
|
||||
return dirs;
|
||||
}
|
||||
|
||||
|
@ -92,9 +92,9 @@ public class ScummVMActivity extends Activity {
|
|||
|
||||
}
|
||||
|
||||
private MyScummVM _scummvm;
|
||||
private ScummVMEvents _events;
|
||||
private Thread _scummvm_thread;
|
||||
private MyResidualVM _residualvm;
|
||||
private ResidualVMEvents _events;
|
||||
private Thread _residualvm_thread;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -132,7 +132,7 @@ public class ScummVMActivity extends Activity {
|
|||
|
||||
// Store savegames on external storage if we can, which means they're
|
||||
// world-readable and don't get deleted on uninstall.
|
||||
String savePath = Environment.getExternalStorageDirectory() + "/ScummVM/Saves/";
|
||||
String savePath = Environment.getExternalStorageDirectory() + "/ResidualVM/Saves/";
|
||||
File saveDir = new File(savePath);
|
||||
saveDir.mkdirs();
|
||||
if (!saveDir.isDirectory()) {
|
||||
|
@ -140,63 +140,63 @@ public class ScummVMActivity extends Activity {
|
|||
savePath = getDir("saves", MODE_WORLD_READABLE).getPath();
|
||||
}
|
||||
|
||||
// Start ScummVM
|
||||
_scummvm = new MyScummVM(main_surface.getHolder());
|
||||
// Start ResidualVM
|
||||
_residualvm = new MyResidualVM(main_surface.getHolder());
|
||||
|
||||
_scummvm.setArgs(new String[] {
|
||||
"ScummVM",
|
||||
"--config=" + getFileStreamPath("scummvmrc").getPath(),
|
||||
_residualvm.setArgs(new String[] {
|
||||
"ResidualVM",
|
||||
"--config=" + getFileStreamPath("residualvmrc").getPath(),
|
||||
"--path=" + Environment.getExternalStorageDirectory().getPath(),
|
||||
"--gui-theme=scummmodern",
|
||||
"--gui-theme=modern",
|
||||
"--savepath=" + savePath
|
||||
});
|
||||
|
||||
_events = new ScummVMEvents(this, _scummvm);
|
||||
_events = new ResidualVMEvents(this, _residualvm);
|
||||
|
||||
main_surface.setOnKeyListener(_events);
|
||||
main_surface.setOnTouchListener(_events);
|
||||
|
||||
_scummvm_thread = new Thread(_scummvm, "ScummVM");
|
||||
_scummvm_thread.start();
|
||||
_residualvm_thread = new Thread(_residualvm, "ResidualVM");
|
||||
_residualvm_thread.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
Log.d(ScummVM.LOG_TAG, "onStart");
|
||||
Log.d(ResidualVM.LOG_TAG, "onStart");
|
||||
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
Log.d(ScummVM.LOG_TAG, "onResume");
|
||||
Log.d(ResidualVM.LOG_TAG, "onResume");
|
||||
|
||||
super.onResume();
|
||||
|
||||
if (_scummvm != null)
|
||||
_scummvm.setPause(false);
|
||||
if (_residualvm != null)
|
||||
_residualvm.setPause(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
Log.d(ScummVM.LOG_TAG, "onPause");
|
||||
Log.d(ResidualVM.LOG_TAG, "onPause");
|
||||
|
||||
super.onPause();
|
||||
|
||||
if (_scummvm != null)
|
||||
_scummvm.setPause(true);
|
||||
if (_residualvm != null)
|
||||
_residualvm.setPause(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
Log.d(ScummVM.LOG_TAG, "onStop");
|
||||
Log.d(ResidualVM.LOG_TAG, "onStop");
|
||||
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
Log.d(ScummVM.LOG_TAG, "onDestroy");
|
||||
Log.d(ResidualVM.LOG_TAG, "onDestroy");
|
||||
|
||||
super.onDestroy();
|
||||
|
||||
|
@ -205,12 +205,12 @@ public class ScummVMActivity extends Activity {
|
|||
|
||||
try {
|
||||
// 1s timeout
|
||||
_scummvm_thread.join(1000);
|
||||
_residualvm_thread.join(1000);
|
||||
} catch (InterruptedException e) {
|
||||
Log.i(ScummVM.LOG_TAG, "Error while joining ScummVM thread", e);
|
||||
Log.i(ResidualVM.LOG_TAG, "Error while joining ResidualVM thread", e);
|
||||
}
|
||||
|
||||
_scummvm = null;
|
||||
_residualvm = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package org.scummvm.scummvm;
|
||||
package org.residualvm.residualvm;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ScummVMApplication extends Application {
|
||||
public final static String ACTION_PLUGIN_QUERY = "org.scummvm.scummvm.action.PLUGIN_QUERY";
|
||||
public final static String EXTRA_UNPACK_LIBS = "org.scummvm.scummvm.extra.UNPACK_LIBS";
|
||||
public final static String EXTRA_VERSION = "org.scummvm.scummvm.extra.VERSION";
|
||||
public class ResidualVMApplication extends Application {
|
||||
public final static String ACTION_PLUGIN_QUERY = "org.residualvm.residualvm.action.PLUGIN_QUERY";
|
||||
public final static String EXTRA_UNPACK_LIBS = "org.residualvm.residualvm.extra.UNPACK_LIBS";
|
||||
public final static String EXTRA_VERSION = "org.residualvm.residualvm.extra.VERSION";
|
||||
|
||||
private static File _cache_dir;
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class ScummVMApplication extends Application {
|
|||
_cache_dir = getCacheDir();
|
||||
// This is mounted noexec :(
|
||||
//cache_dir = new File(Environment.getExternalStorageDirectory(),
|
||||
// "/.ScummVM.tmp");
|
||||
// "/.ResidualVM.tmp");
|
||||
// This is owned by download manager and requires special
|
||||
// permissions to access :(
|
||||
//cache_dir = Environment.getDownloadCacheDirectory();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.scummvm.scummvm;
|
||||
package org.residualvm.residualvm;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
@ -12,7 +12,7 @@ import android.view.ViewConfiguration;
|
|||
import android.view.GestureDetector;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
public class ScummVMEvents implements
|
||||
public class ResidualVMEvents implements
|
||||
android.view.View.OnKeyListener,
|
||||
android.view.View.OnTouchListener,
|
||||
android.view.GestureDetector.OnGestureListener,
|
||||
|
@ -30,13 +30,13 @@ public class ScummVMEvents implements
|
|||
public static final int JE_QUIT = 0x1000;
|
||||
|
||||
final protected Context _context;
|
||||
final protected ScummVM _scummvm;
|
||||
final protected ResidualVM _residualvm;
|
||||
final protected GestureDetector _gd;
|
||||
final protected int _longPress;
|
||||
|
||||
public ScummVMEvents(Context context, ScummVM scummvm) {
|
||||
public ResidualVMEvents(Context context, ResidualVM residualvm) {
|
||||
_context = context;
|
||||
_scummvm = scummvm;
|
||||
_residualvm = residualvm;
|
||||
|
||||
_gd = new GestureDetector(context, this);
|
||||
_gd.setOnDoubleTapListener(this);
|
||||
|
@ -46,11 +46,11 @@ public class ScummVMEvents implements
|
|||
}
|
||||
|
||||
final public void sendQuitEvent() {
|
||||
_scummvm.pushEvent(JE_QUIT, 0, 0, 0, 0, 0);
|
||||
_residualvm.pushEvent(JE_QUIT, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
public boolean onTrackballEvent(MotionEvent e) {
|
||||
_scummvm.pushEvent(JE_BALL, e.getAction(),
|
||||
_residualvm.pushEvent(JE_BALL, e.getAction(),
|
||||
(int)(e.getX() * e.getXPrecision() * 100),
|
||||
(int)(e.getY() * e.getYPrecision() * 100),
|
||||
0, 0);
|
||||
|
@ -117,7 +117,7 @@ public class ScummVMEvents implements
|
|||
return true;
|
||||
}
|
||||
|
||||
_scummvm.pushEvent(JE_SYS_KEY, action, keyCode, 0, 0, 0);
|
||||
_residualvm.pushEvent(JE_SYS_KEY, action, keyCode, 0, 0, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public class ScummVMEvents implements
|
|||
return true;
|
||||
|
||||
for (KeyEvent s : es) {
|
||||
_scummvm.pushEvent(JE_KEY, s.getAction(), s.getKeyCode(),
|
||||
_residualvm.pushEvent(JE_KEY, s.getAction(), s.getKeyCode(),
|
||||
s.getUnicodeChar() & KeyCharacterMap.COMBINING_ACCENT_MASK,
|
||||
s.getMetaState(), s.getRepeatCount());
|
||||
}
|
||||
|
@ -146,13 +146,13 @@ public class ScummVMEvents implements
|
|||
case KeyEvent.KEYCODE_DPAD_LEFT:
|
||||
case KeyEvent.KEYCODE_DPAD_RIGHT:
|
||||
case KeyEvent.KEYCODE_DPAD_CENTER:
|
||||
_scummvm.pushEvent(JE_DPAD, action, keyCode,
|
||||
_residualvm.pushEvent(JE_DPAD, action, keyCode,
|
||||
(int)(e.getEventTime() - e.getDownTime()),
|
||||
e.getRepeatCount(), 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
_scummvm.pushEvent(JE_KEY, action, keyCode,
|
||||
_residualvm.pushEvent(JE_KEY, action, keyCode,
|
||||
e.getUnicodeChar() & KeyCharacterMap.COMBINING_ACCENT_MASK,
|
||||
e.getMetaState(), e.getRepeatCount());
|
||||
|
||||
|
@ -168,7 +168,7 @@ public class ScummVMEvents implements
|
|||
final int pointer = (action & 0xff00) >> 8;
|
||||
|
||||
if (pointer > 0) {
|
||||
_scummvm.pushEvent(JE_MULTI, pointer, action & 0xff, // ACTION_MASK
|
||||
_residualvm.pushEvent(JE_MULTI, pointer, action & 0xff, // ACTION_MASK
|
||||
(int)e.getX(), (int)e.getY(), 0);
|
||||
return true;
|
||||
}
|
||||
|
@ -178,13 +178,13 @@ public class ScummVMEvents implements
|
|||
|
||||
// OnGestureListener
|
||||
final public boolean onDown(MotionEvent e) {
|
||||
_scummvm.pushEvent(JE_DOWN, (int)e.getX(), (int)e.getY(), 0, 0, 0);
|
||||
_residualvm.pushEvent(JE_DOWN, (int)e.getX(), (int)e.getY(), 0, 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
final public boolean onFling(MotionEvent e1, MotionEvent e2,
|
||||
float velocityX, float velocityY) {
|
||||
//Log.d(ScummVM.LOG_TAG, String.format("onFling: %s -> %s (%.3f %.3f)",
|
||||
//Log.d(ResidualVM.LOG_TAG, String.format("onFling: %s -> %s (%.3f %.3f)",
|
||||
// e1.toString(), e2.toString(),
|
||||
// velocityX, velocityY));
|
||||
|
||||
|
@ -197,7 +197,7 @@ public class ScummVMEvents implements
|
|||
|
||||
final public boolean onScroll(MotionEvent e1, MotionEvent e2,
|
||||
float distanceX, float distanceY) {
|
||||
_scummvm.pushEvent(JE_SCROLL, (int)e1.getX(), (int)e1.getY(),
|
||||
_residualvm.pushEvent(JE_SCROLL, (int)e1.getX(), (int)e1.getY(),
|
||||
(int)e2.getX(), (int)e2.getY(), 0);
|
||||
|
||||
return true;
|
||||
|
@ -207,7 +207,7 @@ public class ScummVMEvents implements
|
|||
}
|
||||
|
||||
final public boolean onSingleTapUp(MotionEvent e) {
|
||||
_scummvm.pushEvent(JE_TAP, (int)e.getX(), (int)e.getY(),
|
||||
_residualvm.pushEvent(JE_TAP, (int)e.getX(), (int)e.getY(),
|
||||
(int)(e.getEventTime() - e.getDownTime()), 0, 0);
|
||||
|
||||
return true;
|
||||
|
@ -219,7 +219,7 @@ public class ScummVMEvents implements
|
|||
}
|
||||
|
||||
final public boolean onDoubleTapEvent(MotionEvent e) {
|
||||
_scummvm.pushEvent(JE_DOUBLE_TAP, (int)e.getX(), (int)e.getY(),
|
||||
_residualvm.pushEvent(JE_DOUBLE_TAP, (int)e.getX(), (int)e.getY(),
|
||||
e.getAction(), 0, 0);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.scummvm.scummvm;
|
||||
package org.residualvm.residualvm;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
|
@ -35,11 +35,11 @@ import java.util.zip.ZipFile;
|
|||
import java.util.zip.ZipEntry;
|
||||
|
||||
public class Unpacker extends Activity {
|
||||
protected final static String LOG_TAG = "ScummVM";
|
||||
protected final static String LOG_TAG = "ResidualVM";
|
||||
// TODO don't hardcode this
|
||||
private final static boolean PLUGINS_ENABLED = false;
|
||||
private final static String META_NEXT_ACTIVITY =
|
||||
"org.scummvm.unpacker.nextActivity";
|
||||
"org.residualvm.unpacker.nextActivity";
|
||||
private ProgressBar mProgress;
|
||||
private File mUnpackDest; // location to unpack into
|
||||
private AsyncTask<String, Integer, Void> mUnpacker;
|
||||
|
@ -239,7 +239,7 @@ public class Unpacker extends Activity {
|
|||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (!intent.getAction()
|
||||
.equals(ScummVMApplication.ACTION_PLUGIN_QUERY)) {
|
||||
.equals(ResidualVMApplication.ACTION_PLUGIN_QUERY)) {
|
||||
Log.e(LOG_TAG,
|
||||
"Received unexpected action " + intent.getAction());
|
||||
return;
|
||||
|
@ -253,7 +253,7 @@ public class Unpacker extends Activity {
|
|||
}
|
||||
|
||||
ArrayList<String> unpack_libs =
|
||||
extras.getStringArrayList(ScummVMApplication.EXTRA_UNPACK_LIBS);
|
||||
extras.getStringArrayList(ResidualVMApplication.EXTRA_UNPACK_LIBS);
|
||||
|
||||
if (unpack_libs != null && !unpack_libs.isEmpty()) {
|
||||
final String[] libs =
|
||||
|
@ -267,13 +267,13 @@ public class Unpacker extends Activity {
|
|||
Bundle extras = new Bundle(1);
|
||||
|
||||
ArrayList<String> unpack_libs = new ArrayList<String>(1);
|
||||
// This is the common ScummVM code (not really a "plugin" as such)
|
||||
// This is the common ResidualVM code (not really a "plugin" as such)
|
||||
unpack_libs.add(new Uri.Builder()
|
||||
.scheme("plugin")
|
||||
.authority(getPackageName())
|
||||
.path("mylib/armeabi/libscummvm.so")
|
||||
.path("mylib/armeabi/libresidualvm.so")
|
||||
.toString());
|
||||
extras.putStringArrayList(ScummVMApplication.EXTRA_UNPACK_LIBS,
|
||||
extras.putStringArrayList(ResidualVMApplication.EXTRA_UNPACK_LIBS,
|
||||
unpack_libs);
|
||||
|
||||
final PackageInfo info;
|
||||
|
@ -283,13 +283,13 @@ public class Unpacker extends Activity {
|
|||
Log.e(LOG_TAG, "Error finding my own info?", e);
|
||||
return;
|
||||
}
|
||||
extras.putString(ScummVMApplication.EXTRA_VERSION, info.versionName);
|
||||
extras.putString(ResidualVMApplication.EXTRA_VERSION, info.versionName);
|
||||
|
||||
Intent intent = new Intent(ScummVMApplication.ACTION_PLUGIN_QUERY);
|
||||
Intent intent = new Intent(ResidualVMApplication.ACTION_PLUGIN_QUERY);
|
||||
// Android 3.1 defaults to FLAG_EXCLUDE_STOPPED_PACKAGES, and since
|
||||
// none of our plugins will ever be running, that is not helpful
|
||||
intent.setFlags(FLAG_INCLUDE_STOPPED_PACKAGES);
|
||||
sendOrderedBroadcast(intent, Manifest.permission.SCUMMVM_PLUGIN,
|
||||
sendOrderedBroadcast(intent, Manifest.permission.RESIDUALVM_PLUGIN,
|
||||
new PluginBroadcastReciever(),
|
||||
null, RESULT_OK, null, extras);
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ public class Unpacker extends Activity {
|
|||
public void onCreate(Bundle b) {
|
||||
super.onCreate(b);
|
||||
|
||||
mUnpackDest = ScummVMApplication.getLastCacheDir();
|
||||
mUnpackDest = ResidualVMApplication.getLastCacheDir();
|
||||
|
||||
setContentView(R.layout.splash);
|
||||
mProgress = (ProgressBar)findViewById(R.id.progress);
|
||||
|
@ -309,7 +309,7 @@ public class Unpacker extends Activity {
|
|||
}
|
||||
|
||||
private void tryUnpack() {
|
||||
Intent intent = new Intent(ScummVMApplication.ACTION_PLUGIN_QUERY);
|
||||
Intent intent = new Intent(ResidualVMApplication.ACTION_PLUGIN_QUERY);
|
||||
List<ResolveInfo> plugins = getPackageManager()
|
||||
.queryBroadcastReceivers(intent, 0);
|
||||
if (PLUGINS_ENABLED && plugins.isEmpty()) {
|
||||
|
@ -330,7 +330,7 @@ public class Unpacker extends Activity {
|
|||
}
|
||||
});
|
||||
|
||||
final Uri uri = Uri.parse("market://search?q=ScummVM plugin");
|
||||
final Uri uri = Uri.parse("market://search?q=ResidualVM plugin");
|
||||
final Intent market_intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||
if (getPackageManager().resolveActivity(market_intent, 0) != null) {
|
||||
alert.setPositiveButton(R.string.to_market,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue