mirror of
https://github.com/astromaddie/lambda1-vr.git
synced 2026-10-23 07:00:12 +02:00
Implement clean shutdown
- increase version number to 1.6.1
This commit is contained in:
1 parent
ae567ebd9b
commit
cb3000f57f
6 files changed
+49
-15
No files matched your search
@@ -62,3 +62,6 @@ Projects/Android/jni/SupportLibs/liboggvorbis/libs/mips/libvorbis.so
|
||||
Projects/Android/jni/SupportLibs/liboggvorbis/libs/x86/libogg.so
|
||||
Projects/Android/jni/SupportLibs/liboggvorbis/libs/x86/libvorbis-jni.so
|
||||
Projects/Android/jni/SupportLibs/liboggvorbis/libs/x86/libvorbis.so
|
||||
build/intermediates/lint-cache/maven.google/com/android/support/group-index.xml
|
||||
build/intermediates/lint-cache/maven.google/master-index.xml
|
||||
build/intermediates/lint-cache/sdk-registry.xml/sdk-registry.xml
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.drbeef.lambda1vr"
|
||||
android:versionCode="30"
|
||||
android:versionName="1.6.0" android:installLocation="auto" >
|
||||
android:versionCode="31"
|
||||
android:versionName="1.6.1" android:installLocation="auto" >
|
||||
|
||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>
|
||||
|
||||
@@ -297,10 +297,6 @@ void VR_FrameSetup()
|
||||
vr_hmd_fov_x = Cvar_Set2("vr_hmd_fov_x", buffer, true);
|
||||
}
|
||||
|
||||
void VR_Shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
static inline bool isHostAlive()
|
||||
{
|
||||
return (host.state != HOST_SHUTDOWN &&
|
||||
@@ -372,7 +368,7 @@ void VR_Init()
|
||||
vr_snapturn_angle = Cvar_Get( "vr_snapturn_angle", "45", CVAR_ARCHIVE, "Sets the angle for snap-turn, set to < 10.0 to enable smooth turning" );
|
||||
vr_reloadtimeoutms = Cvar_Get( "vr_reloadtimeoutms", "200", CVAR_ARCHIVE, "How quickly the grip trigger needs to be release to initiate a reload" );
|
||||
vr_positional_factor = Cvar_Get( "vr_positional_factor", "3000", CVAR_ARCHIVE, "Number that makes positional tracking work" );
|
||||
vr_walkdirection = Cvar_Get( "vr_walkdirection", "0", CVAR_ARCHIVE, "1 - Use HMD for direction, 0 - Use off-hand controller for direction" );
|
||||
vr_walkdirection = Cvar_Get( "vr_walkdirection", "1", CVAR_ARCHIVE, "1 - Use HMD for direction, 0 - Use off-hand controller for direction" );
|
||||
vr_weapon_pitchadjust = Cvar_Get( "vr_weapon_pitchadjust", "-20.0", CVAR_ARCHIVE, "gun pitch angle adjust" );
|
||||
vr_crowbar_pitchadjust = Cvar_Get( "vr_crowbar_pitchadjust", "-25.0", CVAR_ARCHIVE, "crowbar pitch angle adjust" );
|
||||
vr_weapon_recoil = Cvar_Get( "vr_weapon_recoil", "0", CVAR_ARCHIVE, "Enables weapon recoil in VR, default is disabled, warning could make you sick" );
|
||||
@@ -382,13 +378,14 @@ void VR_Init()
|
||||
if (strstr(gAppState.OpenXRHMD, "pico") != NULL)
|
||||
{
|
||||
vr_hud_yoffset = Cvar_Get("vr_hud_yoffset", "60", CVAR_ARCHIVE, "y offset for the HUD" );
|
||||
vr_refresh = Cvar_Get("vr_refresh", "72", CVAR_ARCHIVE, "Refresh Rate");
|
||||
}
|
||||
else
|
||||
else // Meta / Quest / Default
|
||||
{
|
||||
vr_hud_yoffset = Cvar_Get("vr_hud_yoffset", "0", CVAR_ARCHIVE, "y offset for the HUD" );
|
||||
vr_refresh = Cvar_Get("vr_refresh", "80", CVAR_ARCHIVE, "Refresh Rate");
|
||||
}
|
||||
|
||||
vr_refresh = Cvar_Get("vr_refresh", "72", CVAR_ARCHIVE, "Refresh Rate" );
|
||||
vr_control_scheme = Cvar_Get( "vr_control_scheme", "0", CVAR_ARCHIVE, "Controller Layout scheme" );
|
||||
vr_enable_crouching = Cvar_Get( "vr_enable_crouching", "0.85", CVAR_ARCHIVE, "To enable real-world crouching trigger, set this to a value that multiplied by the user's height will trigger crouch mechanic" );
|
||||
vr_height_adjust = Cvar_Get( "vr_height_adjust", "0.0", CVAR_ARCHIVE, "Additional height adjustment for in-game player (in metres)" );
|
||||
@@ -610,11 +607,15 @@ void * AppThreadFunction( void * parm )
|
||||
}
|
||||
|
||||
{
|
||||
//Make sure we actually shutdown
|
||||
Host_Shutdown( );
|
||||
|
||||
TBXR_LeaveVR();
|
||||
|
||||
//Ask Java to shut down
|
||||
VR_Shutdown();
|
||||
|
||||
// exit(0); // in case Java doesn't do the job
|
||||
exit(0); // in case Java doesn't do the job
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -628,6 +629,11 @@ Activity lifecycle
|
||||
================================================================================
|
||||
*/
|
||||
|
||||
|
||||
jmethodID android_shutdown;
|
||||
static JavaVM *jVM;
|
||||
static jobject jniCallbackObj=0;
|
||||
|
||||
int JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
{
|
||||
JNIEnv *env;
|
||||
@@ -640,6 +646,23 @@ int JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
return JNI_VERSION_1_4;
|
||||
}
|
||||
|
||||
void jni_shutdown()
|
||||
{
|
||||
ALOGV("Calling: jni_shutdown");
|
||||
JNIEnv *env;
|
||||
jobject tmp;
|
||||
if (((*jVM)->GetEnv(jVM, (void**) &env, JNI_VERSION_1_4))<0)
|
||||
{
|
||||
(*jVM)->AttachCurrentThread( jVM, &env, NULL );
|
||||
}
|
||||
return (*env)->CallVoidMethod(env, jniCallbackObj, android_shutdown);
|
||||
}
|
||||
|
||||
void VR_Shutdown()
|
||||
{
|
||||
jni_shutdown();
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_com_drbeef_lambda1vr_GLES3JNILib_onCreate( JNIEnv * env, jclass activityClass, jobject activity,
|
||||
jstring commandLineParams)
|
||||
{
|
||||
@@ -694,10 +717,14 @@ JNIEXPORT jlong JNICALL Java_com_drbeef_lambda1vr_GLES3JNILib_onCreate( JNIEnv *
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_drbeef_lambda1vr_GLES3JNILib_onStart( JNIEnv * env, jobject obj, jlong handle)
|
||||
JNIEXPORT void JNICALL Java_com_drbeef_lambda1vr_GLES3JNILib_onStart( JNIEnv * env, jobject obj, jlong handle, jobject obj1)
|
||||
{
|
||||
ALOGV( " GLES3JNILib::onStart()" );
|
||||
|
||||
jniCallbackObj = (jobject)((*env)->NewGlobalRef(env, obj1));
|
||||
jclass callbackClass = (*env)->GetObjectClass(env, jniCallbackObj);
|
||||
android_shutdown = (*env)->GetMethodID(env, callbackClass,"shutdown","()V");
|
||||
|
||||
ovrAppThread * appThread = (ovrAppThread *)((size_t)handle);
|
||||
surfaceMessage message;
|
||||
surfaceMessage_Init( &message, MESSAGE_ON_START, MQ_WAIT_PROCESSED );
|
||||
|
||||
@@ -139,7 +139,7 @@ Q_buildcommit will identify this build as release or "notset"
|
||||
*/
|
||||
const char *Q_buildcommit( void )
|
||||
{
|
||||
return "Lambda1VR-v1.6.0";
|
||||
return "Lambda1VR-v1.6.1";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -67,7 +67,11 @@ import static android.system.Os.setenv;
|
||||
private SurfaceView mView;
|
||||
private SurfaceHolder mSurfaceHolder;
|
||||
private long mNativeHandle;
|
||||
|
||||
|
||||
public void shutdown() {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@Override protected void onCreate( Bundle icicle )
|
||||
{
|
||||
Log.v( TAG, "----------------------------------------------------------------" );
|
||||
@@ -578,7 +582,7 @@ import static android.system.Os.setenv;
|
||||
Log.v( TAG, "GLES3JNIActivity::onStart()" );
|
||||
super.onStart();
|
||||
|
||||
GLES3JNILib.onStart( mNativeHandle );
|
||||
GLES3JNILib.onStart( mNativeHandle, this );
|
||||
}
|
||||
|
||||
@Override protected void onResume()
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GLES3JNILib
|
||||
{
|
||||
// Activity lifecycle
|
||||
public static native long onCreate( Activity obj, String commandLineParams );
|
||||
public static native void onStart( long handle );
|
||||
public static native void onStart( long handle, Object obj );
|
||||
public static native void onResume( long handle );
|
||||
public static native void onPause( long handle );
|
||||
public static native void onStop( long handle );
|
||||
|
||||
Reference in new issue
Block a user