This commit is contained in:
Simon 2022-09-04 23:21:31 +01:00
parent 0558c1c8bc
commit 3f79287af5
13 changed files with 203 additions and 120 deletions

View file

@ -16,7 +16,7 @@
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application android:allowBackup="false" android:icon="@drawable/ic_qquest" android:label="@string/quake2quest"> <application android:allowBackup="false" android:icon="@drawable/ic_qquest" android:label="@string/quake2quest" android:extractNativeLibs="true">
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/> <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
<meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/> <meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/>

View file

@ -17,10 +17,10 @@ android {
// override app plugin abiFilters for both 32 and 64-bit support // override app plugin abiFilters for both 32 and 64-bit support
externalNativeBuild { externalNativeBuild {
ndk { ndk {
abiFilters 'armeabi-v7a' abiFilters 'arm64-v8a'
} }
ndkBuild { ndkBuild {
abiFilters 'armeabi-v7a' abiFilters 'arm64-v8a'
} }
} }
minSdkVersion 24 minSdkVersion 24

View file

@ -1,6 +1,6 @@
#Thu Dec 10 20:38:41 GMT 2020 #Sun Sep 04 22:16:08 BST 2022
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip zipStoreBase=GRADLE_USER_HOME

View file

@ -31,6 +31,7 @@ Copyright : Copyright 2015 Oculus VR, LLC. All Rights reserved.
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include <GLES3/gl3.h> #include <GLES3/gl3.h>
#include <GLES3/gl3ext.h> #include <GLES3/gl3ext.h>
#include <GLES/gl2ext.h>
#include "VrApi.h" #include "VrApi.h"
@ -77,8 +78,8 @@ PFNEGLGETSYNCATTRIBKHRPROC eglGetSyncAttribKHR;
//Let's go to the maximum! //Let's go to the maximum!
int CPU_LEVEL = 4; int CPU_LEVEL = 4;
int GPU_LEVEL = 4; int GPU_LEVEL = 4;
int NUM_MULTI_SAMPLES = 1; int NUM_MULTI_SAMPLES = 2;
float SS_MULTIPLIER = 1.2f; float SS_MULTIPLIER = 1.1f;
vec2_t cylinderSize = {1280, 720}; vec2_t cylinderSize = {1280, 720};
@ -104,6 +105,17 @@ int argc=0;
extern cvar_t *r_lefthand; extern cvar_t *r_lefthand;
extern cvar_t *cl_paused; extern cvar_t *cl_paused;
cvar_t *vr_snapturn_angle;
cvar_t *vr_walkdirection;
cvar_t *vr_weapon_pitchadjust;
cvar_t *vr_lasersight;
cvar_t *vr_control_scheme;
cvar_t *vr_height_adjust;
cvar_t *vr_worldscale;
cvar_t *vr_weaponscale;
cvar_t *vr_weapon_stabilised;
cvar_t *vr_comfort_mask;
enum control_scheme { enum control_scheme {
RIGHT_HANDED_DEFAULT = 0, RIGHT_HANDED_DEFAULT = 0,
LEFT_HANDED_DEFAULT = 10, LEFT_HANDED_DEFAULT = 10,
@ -492,16 +504,16 @@ static void ovrFramebuffer_Clear( ovrFramebuffer * frameBuffer )
static bool ovrFramebuffer_Create( ovrFramebuffer * frameBuffer, const GLenum colorFormat, const int width, const int height, const int multisamples ) static bool ovrFramebuffer_Create( ovrFramebuffer * frameBuffer, const GLenum colorFormat, const int width, const int height, const int multisamples )
{ {
LOAD_GLES2(glBindTexture); //LOAD_GLES2(glBindTexture);
LOAD_GLES2(glTexParameteri); //LOAD_GLES2(glTexParameteri);
LOAD_GLES2(glGenRenderbuffers); //LOAD_GLES2(glGenRenderbuffers);
LOAD_GLES2(glBindRenderbuffer); //LOAD_GLES2(glBindRenderbuffer);
LOAD_GLES2(glRenderbufferStorage); //LOAD_GLES2(glRenderbufferStorage);
LOAD_GLES2(glGenFramebuffers); //LOAD_GLES2(glGenFramebuffers);
LOAD_GLES2(glBindFramebuffer); //LOAD_GLES2(glBindFramebuffer);
LOAD_GLES2(glFramebufferRenderbuffer); //LOAD_GLES2(glFramebufferRenderbuffer);
LOAD_GLES2(glFramebufferTexture2D); //LOAD_GLES2(glFramebufferTexture2D);
LOAD_GLES2(glCheckFramebufferStatus); //LOAD_GLES2(glCheckFramebufferStatus);
frameBuffer->Width = width; frameBuffer->Width = width;
frameBuffer->Height = height; frameBuffer->Height = height;
@ -512,36 +524,64 @@ static bool ovrFramebuffer_Create( ovrFramebuffer * frameBuffer, const GLenum co
frameBuffer->DepthBuffers = (GLuint *)malloc( frameBuffer->TextureSwapChainLength * sizeof( GLuint ) ); frameBuffer->DepthBuffers = (GLuint *)malloc( frameBuffer->TextureSwapChainLength * sizeof( GLuint ) );
frameBuffer->FrameBuffers = (GLuint *)malloc( frameBuffer->TextureSwapChainLength * sizeof( GLuint ) ); frameBuffer->FrameBuffers = (GLuint *)malloc( frameBuffer->TextureSwapChainLength * sizeof( GLuint ) );
PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glRenderbufferStorageMultisampleEXT =
(PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)eglGetProcAddress("glRenderbufferStorageMultisampleEXT");
PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC glFramebufferTexture2DMultisampleEXT =
(PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC)eglGetProcAddress("glFramebufferTexture2DMultisampleEXT");
for ( int i = 0; i < frameBuffer->TextureSwapChainLength; i++ ) for ( int i = 0; i < frameBuffer->TextureSwapChainLength; i++ )
{ {
// Create the color buffer texture. // Create the color buffer texture.
const GLuint colorTexture = vrapi_GetTextureSwapChainHandle( frameBuffer->ColorTextureSwapChain, i ); const GLuint colorTexture = vrapi_GetTextureSwapChainHandle( frameBuffer->ColorTextureSwapChain, i );
GLenum colorTextureTarget = GL_TEXTURE_2D; GLenum colorTextureTarget = GL_TEXTURE_2D;
GL( gles_glBindTexture( colorTextureTarget, colorTexture ) ); GL( glBindTexture( colorTextureTarget, colorTexture ) );
// Just clamp to edge. However, this requires manually clearing the border // Just clamp to edge. However, this requires manually clearing the border
// around the layer to clear the edge texels. // around the layer to clear the edge texels.
GL( gles_glTexParameteri( colorTextureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ) ); GL( glTexParameteri( colorTextureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ) );
GL( gles_glTexParameteri( colorTextureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ) ); GL( glTexParameteri( colorTextureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ) );
GL( gles_glTexParameteri( colorTextureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR ) ); GL( glTexParameteri( colorTextureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR ) );
GL( gles_glTexParameteri( colorTextureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR ) ); GL( glTexParameteri( colorTextureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR ) );
GL( gles_glBindTexture( colorTextureTarget, 0 ) ); GL( glBindTexture( colorTextureTarget, 0 ) );
if (multisamples > 1 && glRenderbufferStorageMultisampleEXT != NULL && glFramebufferTexture2DMultisampleEXT != NULL)
{
// Create multisampled depth buffer.
GL(glGenRenderbuffers(1, &frameBuffer->DepthBuffers[i]));
GL(glBindRenderbuffer(GL_RENDERBUFFER, frameBuffer->DepthBuffers[i]));
GL(glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER, multisamples, GL_DEPTH_COMPONENT24, width, height));
GL(glBindRenderbuffer(GL_RENDERBUFFER, 0));
// Create the frame buffer.
GL(glGenFramebuffers(1, &frameBuffer->FrameBuffers[i]));
GL(glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer->FrameBuffers[i]));
GL(glFramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorTexture, 0, multisamples));
GL(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, frameBuffer->DepthBuffers[i]));
GL(GLenum renderFramebufferStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER));
GL(glBindFramebuffer(GL_FRAMEBUFFER, 0));
if (renderFramebufferStatus != GL_FRAMEBUFFER_COMPLETE)
{
ALOGE("OVRHelper::Incomplete frame buffer object: %s", GlFrameBufferStatusString(renderFramebufferStatus));
return false;
}
}
else
{ {
{ {
// Create depth buffer. // Create depth buffer.
GL( gles_glGenRenderbuffers( 1, &frameBuffer->DepthBuffers[i] ) ); GL( glGenRenderbuffers( 1, &frameBuffer->DepthBuffers[i] ) );
GL( gles_glBindRenderbuffer( GL_RENDERBUFFER, frameBuffer->DepthBuffers[i] ) ); GL( glBindRenderbuffer( GL_RENDERBUFFER, frameBuffer->DepthBuffers[i] ) );
GL( gles_glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, frameBuffer->Width, frameBuffer->Height ) ); GL( glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, frameBuffer->Width, frameBuffer->Height ) );
GL( gles_glBindRenderbuffer( GL_RENDERBUFFER, 0 ) ); GL( glBindRenderbuffer( GL_RENDERBUFFER, 0 ) );
// Create the frame buffer. // Create the frame buffer.
GL( gles_glGenFramebuffers( 1, &frameBuffer->FrameBuffers[i] ) ); GL( glGenFramebuffers( 1, &frameBuffer->FrameBuffers[i] ) );
GL( gles_glBindFramebuffer( GL_DRAW_FRAMEBUFFER, frameBuffer->FrameBuffers[i] ) ); GL( glBindFramebuffer( GL_DRAW_FRAMEBUFFER, frameBuffer->FrameBuffers[i] ) );
GL( gles_glFramebufferRenderbuffer( GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, frameBuffer->DepthBuffers[i] ) ); GL( glFramebufferRenderbuffer( GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, frameBuffer->DepthBuffers[i] ) );
GL( gles_glFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorTexture, 0 ) ); GL( glFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorTexture, 0 ) );
GL( GLenum renderFramebufferStatus = gles_glCheckFramebufferStatus( GL_DRAW_FRAMEBUFFER ) ); GL( GLenum renderFramebufferStatus = glCheckFramebufferStatus( GL_DRAW_FRAMEBUFFER ) );
GL( gles_glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ) ); GL( glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ) );
if ( renderFramebufferStatus != GL_FRAMEBUFFER_COMPLETE ) if ( renderFramebufferStatus != GL_FRAMEBUFFER_COMPLETE )
{ {
ALOGE( "Incomplete frame buffer object: %s", GlFrameBufferStatusString( renderFramebufferStatus ) ); ALOGE( "Incomplete frame buffer object: %s", GlFrameBufferStatusString( renderFramebufferStatus ) );
@ -556,11 +596,11 @@ static bool ovrFramebuffer_Create( ovrFramebuffer * frameBuffer, const GLenum co
void ovrFramebuffer_Destroy( ovrFramebuffer * frameBuffer ) void ovrFramebuffer_Destroy( ovrFramebuffer * frameBuffer )
{ {
LOAD_GLES2(glDeleteFramebuffers); //LOAD_GLES2(glDeleteFramebuffers);
LOAD_GLES2(glDeleteRenderbuffers); //LOAD_GLES2(glDeleteRenderbuffers);
GL( gles_glDeleteFramebuffers( frameBuffer->TextureSwapChainLength, frameBuffer->FrameBuffers ) ); GL( glDeleteFramebuffers( frameBuffer->TextureSwapChainLength, frameBuffer->FrameBuffers ) );
GL( gles_glDeleteRenderbuffers( frameBuffer->TextureSwapChainLength, frameBuffer->DepthBuffers ) ); GL( glDeleteRenderbuffers( frameBuffer->TextureSwapChainLength, frameBuffer->DepthBuffers ) );
vrapi_DestroyTextureSwapChain( frameBuffer->ColorTextureSwapChain ); vrapi_DestroyTextureSwapChain( frameBuffer->ColorTextureSwapChain );
@ -572,14 +612,14 @@ void ovrFramebuffer_Destroy( ovrFramebuffer * frameBuffer )
void ovrFramebuffer_SetCurrent( ovrFramebuffer * frameBuffer ) void ovrFramebuffer_SetCurrent( ovrFramebuffer * frameBuffer )
{ {
LOAD_GLES2(glBindFramebuffer); //LOAD_GLES2(glBindFramebuffer);
GL( gles_glBindFramebuffer( GL_DRAW_FRAMEBUFFER, frameBuffer->FrameBuffers[frameBuffer->TextureSwapChainIndex] ) ); GL( glBindFramebuffer( GL_DRAW_FRAMEBUFFER, frameBuffer->FrameBuffers[frameBuffer->TextureSwapChainIndex] ) );
} }
void ovrFramebuffer_SetNone() void ovrFramebuffer_SetNone()
{ {
LOAD_GLES2(glBindFramebuffer); //LOAD_GLES2(glBindFramebuffer);
GL( gles_glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ) ); GL( glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ) );
} }
void ovrFramebuffer_Resolve( ovrFramebuffer * frameBuffer ) void ovrFramebuffer_Resolve( ovrFramebuffer * frameBuffer )
@ -601,19 +641,19 @@ void ovrFramebuffer_Advance( ovrFramebuffer * frameBuffer )
void ovrFramebuffer_ClearEdgeTexels( ovrFramebuffer * frameBuffer ) void ovrFramebuffer_ClearEdgeTexels( ovrFramebuffer * frameBuffer )
{ {
LOAD_GLES2(glEnable); //LOAD_GLES2(glEnable);
LOAD_GLES2(glDisable); //LOAD_GLES2(glDisable);
LOAD_GLES2(glViewport); //LOAD_GLES2(glViewport);
LOAD_GLES2(glScissor); //LOAD_GLES2(glScissor);
LOAD_GLES2(glClearColor); //LOAD_GLES2(glClearColor);
LOAD_GLES2(glClear); //LOAD_GLES2(glClear);
GL( gles_glEnable( GL_SCISSOR_TEST ) ); GL( glEnable( GL_SCISSOR_TEST ) );
GL( gles_glViewport( 0, 0, frameBuffer->Width, frameBuffer->Height ) ); GL( glViewport( 0, 0, frameBuffer->Width, frameBuffer->Height ) );
// Explicitly clear the border texels to black because OpenGL-ES does not support GL_CLAMP_TO_BORDER. // Explicitly clear the border texels to black because OpenGL-ES does not support GL_CLAMP_TO_BORDER.
// Clear to fully opaque black. // Clear to fully opaque black.
GL( gles_glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ) ); GL( glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ) );
//Glide comfort mask in and out //Glide comfort mask in and out
static float currentVLevel = 0.0f; static float currentVLevel = 0.0f;
@ -633,21 +673,21 @@ void ovrFramebuffer_ClearEdgeTexels( ovrFramebuffer * frameBuffer )
float height = useMask ? (frameBuffer->Height / 2.0f) * currentVLevel : 1; float height = useMask ? (frameBuffer->Height / 2.0f) * currentVLevel : 1;
// bottom // bottom
GL( gles_glScissor( 0, 0, frameBuffer->Width, width ) ); GL( glScissor( 0, 0, frameBuffer->Width, width ) );
GL( gles_glClear( GL_COLOR_BUFFER_BIT ) ); GL( glClear( GL_COLOR_BUFFER_BIT ) );
// top // top
GL( gles_glScissor( 0, frameBuffer->Height - height, frameBuffer->Width, height ) ); GL( glScissor( 0, frameBuffer->Height - height, frameBuffer->Width, height ) );
GL( gles_glClear( GL_COLOR_BUFFER_BIT ) ); GL( glClear( GL_COLOR_BUFFER_BIT ) );
// left // left
GL( gles_glScissor( 0, 0, width, frameBuffer->Height ) ); GL( glScissor( 0, 0, width, frameBuffer->Height ) );
GL( gles_glClear( GL_COLOR_BUFFER_BIT ) ); GL( glClear( GL_COLOR_BUFFER_BIT ) );
// right // right
GL( gles_glScissor( frameBuffer->Width - width, 0, width, frameBuffer->Height ) ); GL( glScissor( frameBuffer->Width - width, 0, width, frameBuffer->Height ) );
GL( gles_glClear( GL_COLOR_BUFFER_BIT ) ); GL( glClear( GL_COLOR_BUFFER_BIT ) );
GL( gles_glScissor( 0, 0, 0, 0 ) ); GL( glScissor( 0, 0, 0, 0 ) );
GL( gles_glDisable( GL_SCISSOR_TEST ) ); GL( glDisable( GL_SCISSOR_TEST ) );
} }
@ -1074,6 +1114,10 @@ static void ovrApp_HandleVrModeChanges( ovrApp * app )
vrapi_SetPerfThread( app->Ovr, VRAPI_PERF_THREAD_TYPE_RENDERER, app->RenderThreadTid ); vrapi_SetPerfThread( app->Ovr, VRAPI_PERF_THREAD_TYPE_RENDERER, app->RenderThreadTid );
ALOGV( " vrapi_SetPerfThread( RENDERER, %d )", app->RenderThreadTid ); ALOGV( " vrapi_SetPerfThread( RENDERER, %d )", app->RenderThreadTid );
vrapi_SetExtraLatencyMode(app->Ovr, VRAPI_EXTRA_LATENCY_MODE_ON);
ALOGV( " vrapi_SetExtraLatencyMode( %d )", VRAPI_EXTRA_LATENCY_MODE_ON );
} }
} }
} }
@ -1582,11 +1626,6 @@ void * AppThreadFunction( void * parm )
} }
#endif #endif
//Set 90hz mode for Quest 2
if (hmdType == VRAPI_DEVICE_TYPE_OCULUSQUEST2) {
vrapi_SetDisplayRefreshRate(appState.Ovr, 90);
}
// Get the HMD pose, predicted for the middle of the time period during which // Get the HMD pose, predicted for the middle of the time period during which
// the new eye images will be displayed. The number of frames predicted ahead // the new eye images will be displayed. The number of frames predicted ahead
// depends on the pipeline depth of the engine and the synthesis rate. // depends on the pipeline depth of the engine and the synthesis rate.

View file

@ -22,33 +22,33 @@
#define ALOGV(...) #define ALOGV(...)
#endif #endif
bool quake2_initialised; extern bool quake2_initialised;
long long global_time; extern long long global_time;
float playerHeight; extern float playerHeight;
float playerYaw; extern float playerYaw;
bool showingScreenLayer; extern bool showingScreenLayer;
vec3_t worldPosition; extern vec3_t worldPosition;
vec3_t hmdPosition; extern vec3_t hmdPosition;
vec3_t hmdorientation; extern vec3_t hmdorientation;
vec3_t positionDeltaThisFrame; extern vec3_t positionDeltaThisFrame;
vec3_t weaponangles; extern vec3_t weaponangles;
vec3_t weaponoffset; extern vec3_t weaponoffset;
vec3_t flashlightangles; extern vec3_t flashlightangles;
vec3_t flashlightoffset; extern vec3_t flashlightoffset;
#define DUCK_NOTDUCKED 0 #define DUCK_NOTDUCKED 0
#define DUCK_BUTTON 1 #define DUCK_BUTTON 1
#define DUCK_CROUCHED 2 #define DUCK_CROUCHED 2
int ducked; extern int ducked;
bool player_moving; extern bool player_moving;
float radians(float deg); float radians(float deg);

View file

@ -1,10 +1,10 @@
cvar_t *vr_snapturn_angle; extern cvar_t *vr_snapturn_angle;
cvar_t *vr_walkdirection; extern cvar_t *vr_walkdirection;
cvar_t *vr_weapon_pitchadjust; extern cvar_t *vr_weapon_pitchadjust;
cvar_t *vr_lasersight; extern cvar_t *vr_lasersight;
cvar_t *vr_control_scheme; extern cvar_t *vr_control_scheme;
cvar_t *vr_height_adjust; extern cvar_t *vr_height_adjust;
cvar_t *vr_worldscale; extern cvar_t *vr_worldscale;
cvar_t *vr_weaponscale; extern cvar_t *vr_weaponscale;
cvar_t *vr_weapon_stabilised; extern cvar_t *vr_weapon_stabilised;
cvar_t *vr_comfort_mask; extern cvar_t *vr_comfort_mask;

View file

@ -5,26 +5,26 @@
#include "VrCommon.h" #include "VrCommon.h"
//New control scheme definitions to be defined L1VR_SurfaceView.c enumeration //New control scheme definitions to be defined L1VR_SurfaceView.c enumeration
enum control_scheme; extern enum control_scheme;
ovrInputStateTrackedRemote leftTrackedRemoteState_old; extern ovrInputStateTrackedRemote leftTrackedRemoteState_old;
ovrInputStateTrackedRemote leftTrackedRemoteState_new; extern ovrInputStateTrackedRemote leftTrackedRemoteState_new;
ovrTracking leftRemoteTracking_new; extern ovrTracking leftRemoteTracking_new;
ovrInputStateTrackedRemote rightTrackedRemoteState_old; extern ovrInputStateTrackedRemote rightTrackedRemoteState_old;
ovrInputStateTrackedRemote rightTrackedRemoteState_new; extern ovrInputStateTrackedRemote rightTrackedRemoteState_new;
ovrTracking rightRemoteTracking_new; extern ovrTracking rightRemoteTracking_new;
ovrDeviceID controllerIDs[2]; extern ovrDeviceID controllerIDs[2];
int hmdType; extern int hmdType;
float remote_movementSideways; extern float remote_movementSideways;
float remote_movementForward; extern float remote_movementForward;
float remote_movementUp; extern float remote_movementUp;
float positional_movementSideways; extern float positional_movementSideways;
float positional_movementForward; extern float positional_movementForward;
float snapTurn; extern float snapTurn;
void sendButtonAction(const char* action, long buttonDown); void sendButtonAction(const char* action, long buttonDown);
void sendButtonActionSimple(const char* action); void sendButtonActionSimple(const char* action);

View file

@ -17,6 +17,50 @@ Authors : Simon Brown
//keys.h //keys.h
void Key_Event (int key, qboolean down, unsigned time); void Key_Event (int key, qboolean down, unsigned time);
bool quake2_initialised;
long long global_time;
enum control_scheme;
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
ovrInputStateTrackedRemote leftTrackedRemoteState_new;
ovrTracking leftRemoteTracking_new;
ovrInputStateTrackedRemote rightTrackedRemoteState_old;
ovrInputStateTrackedRemote rightTrackedRemoteState_new;
ovrTracking rightRemoteTracking_new;
ovrDeviceID controllerIDs[2];
int hmdType;
float remote_movementSideways;
float remote_movementForward;
float remote_movementUp;
float positional_movementSideways;
float positional_movementForward;
float snapTurn;
float playerHeight;
float playerYaw;
bool showingScreenLayer;
vec3_t worldPosition;
vec3_t hmdPosition;
vec3_t hmdorientation;
vec3_t positionDeltaThisFrame;
vec3_t weaponangles;
vec3_t weaponoffset;
vec3_t flashlightangles;
vec3_t flashlightoffset;
int ducked;
bool player_moving;
void handleTrackedControllerButton(u_int32_t buttonsNew, u_int32_t buttonsOld, uint32_t button, int key) void handleTrackedControllerButton(u_int32_t buttonsNew, u_int32_t buttonsOld, uint32_t button, int key)
{ {

View file

@ -3,7 +3,7 @@
#include "fpe.h" #include "fpe.h"
const char* fpeshader_signature; extern const char* fpeshader_signature;
const char* const* fpe_VertexShader(fpe_state_t *state); const char* const* fpe_VertexShader(fpe_state_t *state);
const char* const* fpe_FragmentShader(fpe_state_t *state); const char* const* fpe_FragmentShader(fpe_state_t *state);

View file

@ -1,7 +1,7 @@
#ifndef _GL4ES_STRING_UTILS_H_ #ifndef _GL4ES_STRING_UTILS_H_
#define _GL4ES_STRING_UTILS_H_ #define _GL4ES_STRING_UTILS_H_
const char* AllSeparators; extern const char* AllSeparators;
int CountString(char* pBuffer, const char* S); int CountString(char* pBuffer, const char* S);
char* ResizeIfNeeded(char* pBuffer, int *size, int addsize); char* ResizeIfNeeded(char* pBuffer, int *size, int addsize);

View file

@ -103,8 +103,8 @@ LOCAL_SRC_FILES := $(CLIENT_OBJS_:.o=.c) \
LOCAL_LDLIBS := -lEGL -ldl -llog -landroid -lOpenSLES -lz LOCAL_LDLIBS := -lEGL -ldl -llog -landroid -lOpenSLES -lz
LOCAL_STATIC_LIBRARIES := gl4es sigc libzip libpng libjpeg LOCAL_STATIC_LIBRARIES := sigc libzip libpng libjpeg
LOCAL_SHARED_LIBRARIES := openal vrapi LOCAL_SHARED_LIBRARIES := gl4es openal vrapi
LOCAL_LDLIBS += -lGLESv3 LOCAL_LDLIBS += -lGLESv3
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)

View file

@ -33,15 +33,15 @@ int sys_frame_time;
qboolean joy_altselector_pressed = false; qboolean joy_altselector_pressed = false;
// Console Variables // Console Variables
cvar_t *vid_fullscreen; extern cvar_t *vid_fullscreen;
cvar_t *freelook; extern cvar_t *freelook;
cvar_t *lookstrafe; extern cvar_t *lookstrafe;
cvar_t *m_forward; extern cvar_t *m_forward;
cvar_t *m_pitch; extern cvar_t *m_pitch;
cvar_t *m_side; extern cvar_t *m_side;
cvar_t *m_up; extern cvar_t *m_up;
cvar_t *m_yaw; extern cvar_t *m_yaw;
cvar_t *sensitivity; extern cvar_t *sensitivity;
void Quest_GetScreenRes(int *width, int *height); void Quest_GetScreenRes(int *width, int *height);
int Quest_GetRefresh(); int Quest_GetRefresh();

View file

@ -204,7 +204,7 @@ import static android.system.Os.setenv;
} }
try { try {
setenv("YQUAKE2_GAMELIBDIR", getFilesDir().getParentFile().getPath() + "/lib", true); setenv("YQUAKE2_GAMELIBDIR", getApplicationInfo().nativeLibraryDir, true);
} }
catch (Exception e) catch (Exception e)
{ {