Fix and rework launch
This commit is contained in:
parent
126433c42c
commit
aeee1419a2
7 changed files with 25 additions and 39 deletions
|
@ -52,7 +52,7 @@
|
|||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!--
|
||||
<activity android:name="org.libsdl.app.SDLActivity"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:configChanges="orientation|screenSize"
|
||||
|
@ -63,15 +63,13 @@
|
|||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
-->
|
||||
<activity android:name="in.celest.xash3d.XashActivity"
|
||||
android:screenOrientation="landscape"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
|
||||
<action android:name="in.celest.xash3d.XashActivity"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<action android:name="in.celest.xash3d.START" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="in.celest.xash3d.FPicker"></activity>
|
||||
|
|
|
@ -8,7 +8,7 @@ sh gen-version.sh test build
|
|||
rm assets/extras.pak
|
||||
python2.7 makepak.py xash-extras assets/extras.pak
|
||||
$AAPT package -m -J gen/ --rename-manifest-package in.celest.xash3d.hl -M AndroidManifest.xml -S test/res -I $ANDROID_JAR
|
||||
$JAVA_HOME/bin/javac -d bin/classes -s bin/classes -cp $ANDROID_JAR src/org/libsdl/app/SDLActivity.java gen/in/celest/xash3d/hl/R.java src/in/celest/xash3d/*
|
||||
$JAVA_HOME/bin/javac -d bin/classes -s bin/classes -cp $ANDROID_JAR src/org/libsdl/app/SDLActivity.java gen/in/celest/xash3d/hl/R.java src/in/celest/xash3d/*.java
|
||||
$DX --dex --output=bin/classes.dex bin/classes/
|
||||
/mnt/app/apktool/aapt package -f -M test/AndroidManifest.xml -S test/res -I $ANDROID_JAR -F bin/xash3d.apk.unaligned
|
||||
zip bin/xash3d.apk.unaligned assets/*
|
||||
|
|
|
@ -4,15 +4,10 @@
|
|||
#APP_STL := stlport_static
|
||||
|
||||
XASH_SDL ?= 0
|
||||
XASH_LEGACY ?= 0
|
||||
ifeq ($(XASH_SDL),1)
|
||||
APP_PLATFORM := android-12
|
||||
else
|
||||
ifneq ($(XASH_LEGACY),1)
|
||||
APP_PLATFORM := android-8
|
||||
else
|
||||
APP_PLATFORM := android-3
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b0de40024992fb7f7ecb40e4bacc5cb7484e06bc
|
||||
Subproject commit ed8b3ea3a6eb80a20a43326c1ccb805f07ba28db
|
|
@ -105,7 +105,7 @@ public class LauncherActivity extends Activity {
|
|||
|
||||
public void startXash(View view)
|
||||
{
|
||||
Intent intent = new Intent(this, org.libsdl.app.SDLActivity.class);
|
||||
Intent intent = new Intent(this, XashActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
SharedPreferences.Editor editor = mPref.edit();
|
||||
|
|
|
@ -28,7 +28,7 @@ public class XashActivity extends Activity {
|
|||
// Main components
|
||||
protected static XashActivity mSingleton;
|
||||
private static EngineSurface mSurface;
|
||||
private static String mArgv[];
|
||||
public static String mArgv[];
|
||||
public static final int sdk = Integer.valueOf(Build.VERSION.SDK);
|
||||
|
||||
// Preferences
|
||||
|
@ -44,18 +44,18 @@ public class XashActivity extends Activity {
|
|||
|
||||
// Setup
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
//Log.v("SDL", "onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
//Log.v("SDL", "onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// So we can call stuff from static callbacks
|
||||
mSingleton = this;
|
||||
Intent intent = getIntent();
|
||||
// mArgv = intent.getStringExtra(in.celest.xash3d.LauncherActivity.ARGV);
|
||||
// Set up the surface
|
||||
mSurface = new EngineSurface(getApplication());
|
||||
setContentView(mSurface);
|
||||
SurfaceHolder holder = mSurface.getHolder();
|
||||
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
|
||||
// So we can call stuff from static callbacks
|
||||
mSingleton = this;
|
||||
Intent intent = getIntent();
|
||||
// mArgv = intent.getStringExtra(in.celest.xash3d.LauncherActivity.ARGV);
|
||||
// Set up the surface
|
||||
mSurface = new EngineSurface(getApplication());
|
||||
setContentView(mSurface);
|
||||
SurfaceHolder holder = mSurface.getHolder();
|
||||
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
|
||||
mPref = this.getSharedPreferences("engine", 0);
|
||||
String argv = intent.getStringExtra("argv");
|
||||
if(argv == null) argv = mPref.getString("argv", "-dev 3 -log");
|
||||
|
@ -126,12 +126,6 @@ public class XashActivity extends Activity {
|
|||
msg.obj = data;
|
||||
commandHandler.sendMessage(msg);
|
||||
}
|
||||
public static String[] getArguments()
|
||||
{
|
||||
|
||||
|
||||
return "-dev 5 -log +map crossfire -noch +deathmatch 1 +map crossfire".split(" ");
|
||||
}
|
||||
// C functions we call
|
||||
public static native int nativeInit(Object arguments);
|
||||
public static native void nativeQuit();
|
||||
|
@ -274,7 +268,7 @@ class XashMain implements Runnable {
|
|||
|
||||
XashActivity.createGLContext();
|
||||
|
||||
XashActivity.nativeInit(XashActivity.getArguments());
|
||||
XashActivity.nativeInit(XashActivity.mArgv);
|
||||
|
||||
//Log.v("SDL", "SDL thread terminated");
|
||||
}
|
||||
|
@ -310,7 +304,7 @@ View.OnKeyListener {
|
|||
requestFocus();
|
||||
setOnKeyListener(this);
|
||||
if( XashActivity.sdk >= 5 )
|
||||
setOnTouchListener(new EngineTouchListener_v5());
|
||||
setOnTouchListener(new EngineTouchListener_v5());
|
||||
else
|
||||
setOnTouchListener(new EngineTouchListener_v1());
|
||||
}
|
||||
|
|
|
@ -76,11 +76,10 @@
|
|||
<activity android:name="in.celest.xash3d.XashActivity"
|
||||
android:screenOrientation="landscape"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
<action android:name="org.libsdl.app.SDLActivity"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="in.celest.xash3d.START" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<receiver android:name="in.celest.xash3d.InstallReceiver">
|
||||
<intent-filter android:priority="100">
|
||||
|
|
Loading…
Add table
Reference in a new issue