diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 48e8d8c2..1a68e001 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="49" + android:versionName="0.31.4"> @@ -17,6 +17,7 @@ diff --git a/android/app/src/main/assets/pak66.pk3 b/android/app/src/main/assets/pak66.pk3 deleted file mode 100644 index dfcd27b7..00000000 Binary files a/android/app/src/main/assets/pak66.pk3 and /dev/null differ diff --git a/android/app/src/main/cpp/code/cgame/cg_event.c b/android/app/src/main/cpp/code/cgame/cg_event.c index 1bd655d0..adf2ee9c 100644 --- a/android/app/src/main/cpp/code/cgame/cg_event.c +++ b/android/app/src/main/cpp/code/cgame/cg_event.c @@ -1217,6 +1217,10 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) { trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, va("*death%i.wav", event - EV_DEATH1 + 1))); } + if(es->clientNum == cg.snap->ps.clientNum) + { + trap_HapticEvent("fireball", 0, 0, 100, 0, 0); + } break; diff --git a/android/app/src/main/cpp/code/cgame/cg_playerstate.c b/android/app/src/main/cpp/code/cgame/cg_playerstate.c index 969261d7..e8e0c2c2 100644 --- a/android/app/src/main/cpp/code/cgame/cg_playerstate.c +++ b/android/app/src/main/cpp/code/cgame/cg_playerstate.c @@ -97,7 +97,7 @@ void CG_DamageFeedback( int yawByte, int pitchByte, int damage ) { vec3_t dir; vec3_t angles; float dist; - float yaw, pitch; + float yaw=0, pitch=0; // show the attacking player's head and name in corner cg.attackerTime = cg.time; diff --git a/android/app/src/main/cpp/code/renderergles3/tr_backend.c b/android/app/src/main/cpp/code/renderergles3/tr_backend.c index 9fe411be..bc4b086b 100644 --- a/android/app/src/main/cpp/code/renderergles3/tr_backend.c +++ b/android/app/src/main/cpp/code/renderergles3/tr_backend.c @@ -391,26 +391,6 @@ void RB_BeginDrawingView (void) { // we will only draw a sun if there was sky rendered in this view backEnd.skyRenderedThisView = qfalse; - - // clip to the plane of the portal - if ( backEnd.viewParms.isPortal ) { -#if 0 - float plane[4]; - GLdouble plane2[4]; - - plane[0] = backEnd.viewParms.portalPlane.normal[0]; - plane[1] = backEnd.viewParms.portalPlane.normal[1]; - plane[2] = backEnd.viewParms.portalPlane.normal[2]; - plane[3] = backEnd.viewParms.portalPlane.dist; - - plane2[0] = DotProduct (backEnd.viewParms.or.axis[0], plane); - plane2[1] = DotProduct (backEnd.viewParms.or.axis[1], plane); - plane2[2] = DotProduct (backEnd.viewParms.or.axis[2], plane); - plane2[3] = DotProduct (plane, backEnd.viewParms.or.origin) - plane[3]; -#endif - - GL_SetModelMatrix( s_flipMatrix ); - } } diff --git a/android/app/src/main/cpp/code/renderergles3/tr_glsl.c b/android/app/src/main/cpp/code/renderergles3/tr_glsl.c index 739259b3..a795f5ae 100644 --- a/android/app/src/main/cpp/code/renderergles3/tr_glsl.c +++ b/android/app/src/main/cpp/code/renderergles3/tr_glsl.c @@ -68,6 +68,7 @@ typedef enum { HUDBUFFER_ORTHO_PROJECTION, // Orthographic projection and no stereo view for the HUD buffer STEREO_ORTHO_PROJECTION, // Orthographic projection with a slight stereo offset per eye for the static hud VR_PROJECTION, + MIRROR_VR_PROJECTION, // For mirrors etc MONO_VR_PROJECTION, PROJECTION_COUNT @@ -226,6 +227,7 @@ static void GLSL_ViewMatricesUniformBuffer(const float eyeView[32], const float Mat4Translation( translate, viewMatrices + 16 ); } break; + case MIRROR_VR_PROJECTION: case VR_PROJECTION: { Mat4Copy(eyeView, viewMatrices); @@ -1683,7 +1685,6 @@ void GLSL_ShutdownGPUShaders(void) qglDeleteBuffers(PROJECTION_COUNT, projectionMatricesBuffer); } - void GLSL_PrepareUniformBuffers(void) { int width, height; @@ -1715,6 +1716,10 @@ void GLSL_PrepareUniformBuffers(void) GLSL_ProjectionMatricesUniformBuffer(projectionMatricesBuffer[VR_PROJECTION], tr.vrParms.projection); + //Mirror VR projection matrix + GLSL_ProjectionMatricesUniformBuffer(projectionMatricesBuffer[MIRROR_VR_PROJECTION], + tr.vrParms.mirrorProjection); + //Used for drawing models GLSL_ProjectionMatricesUniformBuffer(projectionMatricesBuffer[MONO_VR_PROJECTION], tr.vrParms.monoVRProjection); @@ -1741,6 +1746,11 @@ void GLSL_BindProgram(shaderProgram_t * program) static GLuint GLSL_CalculateProjection() { GLuint result = glState.isDrawingHUD ? MONO_VR_PROJECTION : VR_PROJECTION; + if (backEnd.viewParms.isPortal) + { + result = MIRROR_VR_PROJECTION; + } + if (Mat4Compare(&orthoProjectionMatrix, glState.projection)) { if (glState.isDrawingHUD) diff --git a/android/app/src/main/cpp/code/renderergles3/tr_local.h b/android/app/src/main/cpp/code/renderergles3/tr_local.h index a197ce2e..349214f9 100644 --- a/android/app/src/main/cpp/code/renderergles3/tr_local.h +++ b/android/app/src/main/cpp/code/renderergles3/tr_local.h @@ -851,6 +851,7 @@ typedef struct { typedef struct { qboolean valid; float projection[16]; + float mirrorProjection[16]; float monoVRProjection[16]; int renderBuffer; int renderBufferOriginal; diff --git a/android/app/src/main/cpp/code/renderergles3/tr_main.c b/android/app/src/main/cpp/code/renderergles3/tr_main.c index 8e6e542b..fad979ce 100644 --- a/android/app/src/main/cpp/code/renderergles3/tr_main.c +++ b/android/app/src/main/cpp/code/renderergles3/tr_main.c @@ -783,6 +783,8 @@ void R_SetupProjectionZ(viewParms_t *dest) float plane2[4]; vec4_t q, c; + Mat4Copy(tr.vrParms.projection, tr.vrParms.mirrorProjection); + // transform portal plane into camera space plane[0] = dest->portalPlane.normal[0]; plane[1] = dest->portalPlane.normal[1]; @@ -803,11 +805,10 @@ void R_SetupProjectionZ(viewParms_t *dest) VectorScale4(plane2, 2.0f / DotProduct4(plane2, q), c); - dest->projectionMatrix[2] = c[0]; - dest->projectionMatrix[6] = c[1]; - dest->projectionMatrix[10] = c[2] + 1.0f; - dest->projectionMatrix[14] = c[3]; - + tr.vrParms.mirrorProjection[2] = c[0]; + tr.vrParms.mirrorProjection[6] = c[1]; + tr.vrParms.mirrorProjection[10] = c[2] + 1.0f; + tr.vrParms.mirrorProjection[14] = c[3]; } } diff --git a/android/app/src/main/cpp/code/vr/vr_base.c b/android/app/src/main/cpp/code/vr/vr_base.c index ff6f4c76..1e019a31 100644 --- a/android/app/src/main/cpp/code/vr/vr_base.c +++ b/android/app/src/main/cpp/code/vr/vr_base.c @@ -320,6 +320,11 @@ engine_t* VR_GetEngine( void ) { return &vr_engine; } +int VR_isPauseable( void ) +{ + return ( clc.state == CA_ACTIVE) && !Cvar_VariableValue ("cl_paused"); +} + int VR_useScreenLayer( void ) { //intermission is never full screen diff --git a/android/app/src/main/cpp/code/vr/vr_base.h b/android/app/src/main/cpp/code/vr/vr_base.h index 2f4d5d3b..aeef0054 100644 --- a/android/app/src/main/cpp/code/vr/vr_base.h +++ b/android/app/src/main/cpp/code/vr/vr_base.h @@ -13,6 +13,7 @@ void VR_LeaveVR( engine_t* engine ); engine_t* VR_GetEngine( void ); int VR_useScreenLayer( void ); +int VR_isPauseable( void ); float radians(float deg); diff --git a/android/app/src/main/cpp/code/vr/vr_input.c b/android/app/src/main/cpp/code/vr/vr_input.c index 2700efa9..753ee96a 100644 --- a/android/app/src/main/cpp/code/vr/vr_input.c +++ b/android/app/src/main/cpp/code/vr/vr_input.c @@ -471,7 +471,7 @@ void VR_HapticEvent(const char* event, int position, int flags, int intensity, f engine_t* engine = VR_GetEngine(); jstring StringArg1 = (*(engine->java.Env))->NewStringUTF(engine->java.Env, event); - (*(engine->java.Env))->CallVoidMethod(engine->java.Env, engine->java.ActivityObject, android_haptic_event, StringArg1, position, flags, intensity * vr_hapticIntensity->value, angle, yHeight); + (*(engine->java.Env))->CallVoidMethod(engine->java.Env, engine->java.ActivityObject, android_haptic_event, StringArg1, position, flags, (int)(intensity * vr_hapticIntensity->value), angle, yHeight); //Controller Haptic Support int weaponFireChannel = vr.weapon_stabilised ? 3 : (vr_righthanded->integer ? 2 : 1); diff --git a/android/app/src/main/cpp/main.c b/android/app/src/main/cpp/main.c index a45db358..e733f357 100644 --- a/android/app/src/main/cpp/main.c +++ b/android/app/src/main/cpp/main.c @@ -85,7 +85,7 @@ int main(int argc, char* argv[]) { while (1) { if (hasFocus != g_HasFocus) { hasFocus = g_HasFocus; - if (!hasFocus && !Cvar_VariableValue ("cl_paused")) { + if (!hasFocus && VR_isPauseable()) { Com_QueueEvent( Sys_Milliseconds(), SE_KEY, K_ESCAPE, qtrue, 0, NULL ); //Com_QueueEvent( Sys_Milliseconds(), SE_KEY, K_CONSOLE, qtrue, 0, NULL ); paused = qtrue; diff --git a/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java b/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java index 21b57285..6aaa683a 100644 --- a/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java +++ b/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java @@ -104,9 +104,6 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback copy_asset("/sdcard/ioquake3Quest/baseq3", "pakQ3Q.pk3", true); copy_asset("/sdcard/ioquake3Quest/missionpack", "pakQ3Q.pk3", true); - //Copy omarlego's background image pak - copy_asset("/sdcard/ioquake3Quest/baseq3", "pak66.pk3", false); - //If open arena is installed then copy necessary stuff if (new File("/sdcard/ioquake3Quest/baseoa").exists()) { copy_asset("/sdcard/ioquake3Quest/baseoa", "autoexec_oa.cfg", "autoexec.cfg", false); diff --git a/android/run.bat b/android/run.bat index 14c4f3b0..0e57fd72 100644 --- a/android/run.bat +++ b/android/run.bat @@ -3,7 +3,7 @@ setlocal set BUILD_TYPE=release -set VERSION=0.31.2-multiview +set VERSION=0.31.4-multiview @REM Define the following environment variables to sign a release build @REM set KEYSTORE=