mirror of
https://github.com/DrBeef/QuakeQuest.git
synced 2025-01-21 08:21:00 +00:00
Handedness cvar
a few other items too clean shutdown
This commit is contained in:
parent
a776e05058
commit
c43b7c6a43
8 changed files with 162 additions and 87 deletions
|
@ -1,10 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.drbeef.quakequest"
|
||||
android:versionCode="13"
|
||||
android:versionName="1.3.4" android:installLocation="auto" >
|
||||
android:versionCode="1"
|
||||
android:versionName="0.1.0" android:installLocation="auto" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="25" />
|
||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>
|
||||
<!-- Network access needed for OVRMonitor -->
|
||||
|
|
|
@ -445,6 +445,11 @@ cvar_t cl_pitchspeed = {CVAR_SAVE, "cl_pitchspeed","150","keyboard pitch turning
|
|||
cvar_t cl_yawmult = {CVAR_SAVE, "cl_yawmult","1.0","Multiplier for yaw (leave at 1.0)"};
|
||||
cvar_t cl_pitchmult = {CVAR_SAVE, "cl_pitchmult","1.0","Multiplier for yaw (leave at 1.0)"};
|
||||
cvar_t cl_controllerdeadzone = {0, "cl_controllerdeadzone","0.05","Amount of deadzone to prevent movement drift due to badly calibrated controller (0.0 to 1.0)"};
|
||||
cvar_t cl_righthanded = {CVAR_SAVE, "cl_righthanded","1","right-handed?"};
|
||||
|
||||
cvar_t cl_weapon_offset_lr = {CVAR_SAVE, "cl_weapon_offset_lr","0.0","left/right weapon offset (+ve move right)"};
|
||||
cvar_t cl_weapon_offset_fb = {CVAR_SAVE, "cl_weapon_offset_fb","0.15","front/back weapon offset (+ve move back)"};
|
||||
|
||||
|
||||
cvar_t cl_anglespeedkey = {CVAR_SAVE, "cl_anglespeedkey","1.5","how much +speed multiplies keyboard turning speed"};
|
||||
|
||||
|
@ -2260,7 +2265,9 @@ void CL_InitInput (void)
|
|||
Cvar_RegisterVariable(&cl_pitchmult);
|
||||
Cvar_RegisterVariable(&cl_yawmult);
|
||||
Cvar_RegisterVariable(&cl_controllerdeadzone);
|
||||
|
||||
Cvar_RegisterVariable(&cl_righthanded);
|
||||
Cvar_RegisterVariable(&cl_weapon_offset_lr);
|
||||
Cvar_RegisterVariable(&cl_weapon_offset_fb);
|
||||
|
||||
Cvar_RegisterVariable(&cl_movecliptokeyboard);
|
||||
Cvar_RegisterVariable(&cl_movement);
|
||||
|
|
|
@ -304,7 +304,7 @@ cvar_t cl_decals_newsystem = {CVAR_SAVE, "cl_decals_newsystem", "1", "enables ne
|
|||
cvar_t cl_decals_newsystem_intensitymultiplier = {CVAR_SAVE, "cl_decals_newsystem_intensitymultiplier", "2", "boosts intensity of decals (because the distance fade can make them hard to see otherwise)"};
|
||||
cvar_t cl_decals_newsystem_immediatebloodstain = {CVAR_SAVE, "cl_decals_newsystem_immediatebloodstain", "2", "0: no on-spawn blood stains; 1: on-spawn blood stains for pt_blood; 2: always use on-spawn blood stains"};
|
||||
cvar_t cl_decals_newsystem_bloodsmears = {CVAR_SAVE, "cl_decals_newsystem_bloodsmears", "1", "enable use of particle velocity as decal projection direction rather than surface normal"};
|
||||
cvar_t cl_decals_models = {CVAR_SAVE, "cl_decals_models", "0", "enables decals on animated models (if newsystem is also 1)"};
|
||||
cvar_t cl_decals_models = {CVAR_SAVE, "cl_decals_models", "1", "enables decals on animated models (if newsystem is also 1)"};
|
||||
cvar_t cl_decals_bias = {CVAR_SAVE, "cl_decals_bias", "0.125", "distance to bias decals from surface to prevent depth fighting"};
|
||||
cvar_t cl_decals_max = {CVAR_SAVE, "cl_decals_max", "4096", "maximum number of decals allowed to exist in the world at once"};
|
||||
|
||||
|
|
|
@ -30,7 +30,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <time.h>
|
||||
|
||||
int current_skill;
|
||||
#ifndef NDEBUG
|
||||
cvar_t sv_cheats = {0, "sv_cheats", "1", "cheats enabled in debug builds"};
|
||||
#else
|
||||
cvar_t sv_cheats = {0, "sv_cheats", "0", "enables cheat commands in any game, and cheat impulses in dpmod"};
|
||||
#endif
|
||||
cvar_t sv_adminnick = {CVAR_SAVE, "sv_adminnick", "", "nick name to use for admin messages instead of host name"};
|
||||
cvar_t sv_status_privacy = {CVAR_SAVE, "sv_status_privacy", "0", "do not show IP addresses in 'status' replies to clients"};
|
||||
cvar_t sv_status_show_qcstatus = {CVAR_SAVE, "sv_status_show_qcstatus", "0", "show the 'qcstatus' field in status replies, not the 'frags' field. Turn this on if your mod uses this field, and the 'frags' field on the other hand has no meaningful value."};
|
||||
|
|
|
@ -40,7 +40,6 @@ static const char* sYes = "Yes";
|
|||
|
||||
//Game always starts in vr mode, showing the menu on the big screen in stereo
|
||||
int vrMode = 2;
|
||||
int stereoMode = 1;
|
||||
|
||||
extern int andrw;
|
||||
|
||||
|
@ -52,6 +51,7 @@ extern char *strGameFolder;
|
|||
|
||||
extern cvar_t r_worldscale;
|
||||
extern cvar_t r_lasersight;
|
||||
extern cvar_t cl_righthanded;
|
||||
|
||||
extern void BigScreenMode(int mode);
|
||||
extern void SwitchStereoMode(int mode);
|
||||
|
@ -1726,9 +1726,7 @@ static void M_Menu_Options_AdjustSliders (int dir)
|
|||
S_LocalSound ("sound/misc/menu3.wav");
|
||||
|
||||
optnum = 0;
|
||||
if (options_cursor == optnum++) {
|
||||
stereoMode = 1 - stereoMode;
|
||||
}
|
||||
if (options_cursor == optnum++) ;
|
||||
else if (options_cursor == optnum++) ;
|
||||
else if (options_cursor == optnum++) ;
|
||||
else if (options_cursor == optnum++) ;
|
||||
|
@ -1850,20 +1848,11 @@ static void M_Options_Draw (void)
|
|||
visible = (int)((menu_height - 32) / 8);
|
||||
opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_ITEMS - visible)) * 8;
|
||||
|
||||
switch (stereoMode)
|
||||
{
|
||||
case 0:
|
||||
M_Options_PrintCommand( " Stereo Mode: MONO", true);
|
||||
break;
|
||||
case 1:
|
||||
M_Options_PrintCommand( " Stereo Mode: STEREO", true);
|
||||
break;
|
||||
}
|
||||
|
||||
M_Options_PrintCommand( " ", false);
|
||||
M_Options_PrintCommand( " Controller Settings", true);
|
||||
M_Options_PrintCommand( " Open Quake Console", true);
|
||||
M_Options_PrintCommand( " Reset to defaults", true);
|
||||
M_Options_PrintCommand( " ", true);
|
||||
M_Options_PrintCommand( " ", false);
|
||||
M_Options_PrintCommand( " Key/Button Bindings", true);
|
||||
switch (r_lasersight.integer)
|
||||
{
|
||||
|
@ -1925,7 +1914,6 @@ static void M_Options_Key (int k, int ascii)
|
|||
switch (options_cursor)
|
||||
{
|
||||
case 0:
|
||||
stereoMode = 1 - stereoMode;
|
||||
break;
|
||||
case 1:
|
||||
M_Menu_YawPitchControl_f ();
|
||||
|
@ -3004,7 +2992,7 @@ static void M_Reset_Draw (void)
|
|||
M_Print(8 + 4 * (linelength - 11), 16, "Press y / n");
|
||||
}
|
||||
|
||||
#define YAWCONTROL_ITEMS 3
|
||||
#define YAWCONTROL_ITEMS 4
|
||||
|
||||
static int controllermode_cursor;
|
||||
|
||||
|
@ -3023,6 +3011,7 @@ static void M_Menu_YawPitchControl_AdjustSliders (int dir)
|
|||
optnum = 0;
|
||||
|
||||
if (controllermode_cursor == optnum++) ;
|
||||
else if (controllermode_cursor == optnum++) ;
|
||||
else if (controllermode_cursor == optnum++ && cl_yawmode.integer == 1)
|
||||
{
|
||||
float value = 45.0f;
|
||||
|
@ -3082,7 +3071,11 @@ static void M_Menu_YawPitchControl_Key (int key, int ascii)
|
|||
|
||||
case 'a':
|
||||
case K_LEFTARROW:
|
||||
if (controllermode_cursor == 0)
|
||||
if (controllermode_cursor == 0)
|
||||
{
|
||||
Cvar_SetValueQuick (&cl_righthanded, 1 - cl_righthanded.integer);
|
||||
}
|
||||
else if (controllermode_cursor == 1)
|
||||
{
|
||||
int newYawMode = cl_yawmode.integer;
|
||||
if (--newYawMode < 0)
|
||||
|
@ -3096,7 +3089,11 @@ static void M_Menu_YawPitchControl_Key (int key, int ascii)
|
|||
|
||||
case 'd':
|
||||
case K_RIGHTARROW:
|
||||
if (controllermode_cursor == 0)
|
||||
if (controllermode_cursor == 0)
|
||||
{
|
||||
Cvar_SetValueQuick (&cl_righthanded, 1 - cl_righthanded.integer);
|
||||
}
|
||||
else if (controllermode_cursor == 1)
|
||||
{
|
||||
int newYawMode = cl_yawmode.integer;
|
||||
if (++newYawMode > 2)
|
||||
|
@ -3129,6 +3126,11 @@ static void M_Menu_YawPitchControl_Draw (void)
|
|||
visible = (int)((menu_height - 32) / 8);
|
||||
opty = 32 - bound(0, optcursor - (visible >> 1), max(0, YAWCONTROL_ITEMS - visible)) * 8;
|
||||
|
||||
if (cl_righthanded.integer == 0)
|
||||
M_Options_PrintCommand("Controller: Left Handed", true);
|
||||
else if (cl_righthanded.integer == 1)
|
||||
M_Options_PrintCommand("Controller: Right Handed", true);
|
||||
|
||||
if (cl_yawmode.integer == 0)
|
||||
M_Options_PrintCommand(" Turn Mode: Swivel-Chair (default)", true);
|
||||
else if (cl_yawmode.integer == 1)
|
||||
|
|
|
@ -48,9 +48,7 @@ void Sys_Quit (int returnvalue)
|
|||
Sys_AllowProfiling(false);
|
||||
|
||||
//Inform the main rendering loop we are exiting the game
|
||||
QC_exit(1);
|
||||
//host_shuttingdown = true;
|
||||
//Host_Shutdown();
|
||||
QC_exit(0);
|
||||
}
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
|
|
|
@ -91,7 +91,10 @@ PFNEGLGETSYNCATTRIBKHRPROC eglGetSyncAttribKHR;
|
|||
#include "VrApi_SystemUtils.h"
|
||||
#include "VrApi_Input.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define DEBUG 1
|
||||
#endif
|
||||
|
||||
#define LOG_TAG "QuakeQuest"
|
||||
|
||||
#define ALOGE(...) __android_log_print( ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__ )
|
||||
|
@ -118,11 +121,12 @@ extern cvar_t cl_forwardspeed;
|
|||
extern cvar_t cl_postrackmultiplier;
|
||||
extern cvar_t cl_controllerstrafe;
|
||||
extern cvar_t cl_controllerdeadzone;
|
||||
extern cvar_t cl_righthanded;
|
||||
extern cvar_t cl_weapon_offset_lr;
|
||||
extern cvar_t cl_weapon_offset_fb;
|
||||
|
||||
extern int key_consoleactive;
|
||||
|
||||
qboolean rightHanded = true;
|
||||
|
||||
static float radians(float deg) {
|
||||
return (deg * M_PI) / 180.0;
|
||||
}
|
||||
|
@ -276,10 +280,10 @@ int Sys_Milliseconds (void)
|
|||
return curtime;
|
||||
}
|
||||
|
||||
int returnvalue = -1;
|
||||
int runStatus = -1;
|
||||
void QC_exit(int exitCode)
|
||||
{
|
||||
returnvalue = exitCode;
|
||||
runStatus = exitCode;
|
||||
}
|
||||
|
||||
vec3_t hmdorientation;
|
||||
|
@ -958,10 +962,10 @@ static float uvs[8] = {
|
|||
};
|
||||
|
||||
static float SCREEN_COORDS[12] = {
|
||||
-1.5f, 1.25f, 0.0f,
|
||||
-1.5f, -1.25f, 0.0f,
|
||||
1.5f, -1.25f, 0.0f,
|
||||
1.5f, 1.25f, 0.0f
|
||||
-3.0f, 2.0f, 0.0f,
|
||||
-3.0f, -2.0f, 0.0f,
|
||||
3.0f, -2.0f, 0.0f,
|
||||
3.0f, 2.0f, 0.0f
|
||||
};
|
||||
|
||||
int vignetteTexture = 0;
|
||||
|
@ -1435,6 +1439,7 @@ static void rotateAboutOrigin(float v1, float v2, float rotation, vec2_t out)
|
|||
out[1] = v[1];
|
||||
}
|
||||
|
||||
|
||||
ovrInputStateTrackedRemote leftTrackedRemoteState_old;
|
||||
ovrInputStateTrackedRemote leftTrackedRemoteState_new;
|
||||
ovrTracking leftRemoteTracking;
|
||||
|
@ -1485,11 +1490,11 @@ static void ovrApp_HandleInput( ovrApp * app )
|
|||
}
|
||||
}
|
||||
|
||||
ovrInputStateTrackedRemote dominantTrackedRemoteState = rightHanded ? rightTrackedRemoteState_new : leftTrackedRemoteState_new;
|
||||
ovrInputStateTrackedRemote dominantTrackedRemoteStateOld = rightHanded ? rightTrackedRemoteState_old : leftTrackedRemoteState_old;
|
||||
ovrTracking dominantRemoteTracking = rightHanded ? rightRemoteTracking : leftRemoteTracking;
|
||||
ovrInputStateTrackedRemote offHandTrackedRemoteState = !rightHanded ? rightTrackedRemoteState_new : leftTrackedRemoteState_new;
|
||||
ovrTracking offHandRemoteTracking = !rightHanded ? rightRemoteTracking : leftRemoteTracking;
|
||||
ovrInputStateTrackedRemote dominantTrackedRemoteState = cl_righthanded.integer ? rightTrackedRemoteState_new : leftTrackedRemoteState_new;
|
||||
ovrInputStateTrackedRemote dominantTrackedRemoteStateOld = cl_righthanded.integer ? rightTrackedRemoteState_old : leftTrackedRemoteState_old;
|
||||
ovrTracking dominantRemoteTracking = cl_righthanded.integer ? rightRemoteTracking : leftRemoteTracking;
|
||||
ovrInputStateTrackedRemote offHandTrackedRemoteState = !cl_righthanded.integer ? rightTrackedRemoteState_new : leftTrackedRemoteState_new;
|
||||
ovrTracking offHandRemoteTracking = !cl_righthanded.integer ? rightRemoteTracking : leftRemoteTracking;
|
||||
|
||||
//dominant hand stuff first
|
||||
{
|
||||
|
@ -1505,6 +1510,13 @@ static void ovrApp_HandleInput( ovrApp * app )
|
|||
weaponOffset[0] = v[0];
|
||||
weaponOffset[2] = v[1];
|
||||
|
||||
//Doesn't work - leaving out for now
|
||||
/* // Adjust right (+ve), adjust Back (+ve)
|
||||
rotateAboutOrigin(cl_weapon_offset_lr.value, cl_weapon_offset_fb.value, -gunangles[YAW]-yawOffset, v);
|
||||
vec3_t adjustment;
|
||||
VectorSet(adjustment, v[0], 0.0f, v[1]);
|
||||
VectorAdd(adjustment, weaponOffset, weaponOffset);
|
||||
*/
|
||||
|
||||
//Set gun angles
|
||||
const ovrQuatf quatRemote = dominantRemoteTracking.HeadPose.Pose.Orientation;
|
||||
|
@ -1537,8 +1549,8 @@ static void ovrApp_HandleInput( ovrApp * app )
|
|||
|
||||
//This section corrects for the fact that the controller actually controls direction of movement, but we want to move relative to the direction the
|
||||
//player is facing for positional tracking
|
||||
float multiplier = /*arbitrary value that works ->*/
|
||||
(2000.0f * cl_postrackmultiplier.value) / cl_forwardspeed.value;
|
||||
float multiplier = /*arbitrary value that works - The date Quake was released, 22nd June 1996 ->*/
|
||||
(1996.0622f * cl_postrackmultiplier.value) / cl_forwardspeed.value;
|
||||
|
||||
vec2_t v;
|
||||
rotateAboutOrigin(-positionDeltaThisFrame[0] * multiplier, positionDeltaThisFrame[2] * multiplier, -hmdorientation[YAW], v);
|
||||
|
@ -1582,7 +1594,7 @@ static void ovrApp_HandleInput( ovrApp * app )
|
|||
handleTrackedControllerButton(&rightTrackedRemoteState_new, &rightTrackedRemoteState_old, ovrButton_A, K_SPACE);
|
||||
}
|
||||
|
||||
if (rightHanded) {
|
||||
if (cl_righthanded.integer) {
|
||||
//Fire
|
||||
handleTrackedControllerButton(&rightTrackedRemoteState_new,
|
||||
&rightTrackedRemoteState_old,
|
||||
|
@ -1597,6 +1609,17 @@ static void ovrApp_HandleInput( ovrApp * app )
|
|||
//Next Weapon
|
||||
handleTrackedControllerButton(&rightTrackedRemoteState_new, &rightTrackedRemoteState_old, ovrButton_GripTrigger, '/');
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
//Adjust Weapon Offset
|
||||
if ((leftTrackedRemoteState_new.Buttons & ovrButton_B) && bigScreen == 0 &&
|
||||
(leftTrackedRemoteState_new.Buttons & ovrButton_B) != (leftTrackedRemoteState_old.Buttons & ovrButton_B))
|
||||
{
|
||||
SCR_CenterPrint("Mmmm Sausage!");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
rightTrackedRemoteState_old = rightTrackedRemoteState_new;
|
||||
|
||||
}
|
||||
|
@ -1634,7 +1657,7 @@ static void ovrApp_HandleInput( ovrApp * app )
|
|||
remote_movementSideways = v[0];
|
||||
remote_movementForward = v[1];
|
||||
|
||||
if (rightHanded) {
|
||||
if (cl_righthanded.integer) {
|
||||
//Run
|
||||
handleTrackedControllerButton(&leftTrackedRemoteState_new,
|
||||
&leftTrackedRemoteState_old,
|
||||
|
@ -1649,12 +1672,22 @@ static void ovrApp_HandleInput( ovrApp * app )
|
|||
//Prev Weapon
|
||||
handleTrackedControllerButton(&leftTrackedRemoteState_new, &leftTrackedRemoteState_old, ovrButton_GripTrigger, '#');
|
||||
|
||||
#ifndef NDEBUG
|
||||
//Give all weapons and all ammo and god mode
|
||||
if ((leftTrackedRemoteState_new.Buttons & ovrButton_X) &&
|
||||
(leftTrackedRemoteState_new.Buttons & ovrButton_X) != (leftTrackedRemoteState_old.Buttons & ovrButton_X)) {
|
||||
Cbuf_InsertText("God\n");
|
||||
Cbuf_InsertText("Impulse 9\n");
|
||||
}
|
||||
|
||||
//Change handedness - temporary for testing
|
||||
if ((leftTrackedRemoteState_new.Buttons & ovrButton_Y) &&
|
||||
(leftTrackedRemoteState_new.Buttons & ovrButton_Y) != (leftTrackedRemoteState_old.Buttons & ovrButton_Y))
|
||||
{
|
||||
rightHanded = !rightHanded;
|
||||
Cvar_SetValueQuick (&cl_righthanded, 1 - cl_righthanded.integer);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
leftTrackedRemoteState_old = leftTrackedRemoteState_new;
|
||||
}
|
||||
|
@ -1869,6 +1902,8 @@ typedef struct
|
|||
ANativeWindow * NativeWindow;
|
||||
} ovrAppThread;
|
||||
|
||||
long shutdownCountdown;
|
||||
|
||||
void * AppThreadFunction( void * parm )
|
||||
{
|
||||
ovrAppThread * appThread = (ovrAppThread *)parm;
|
||||
|
@ -1958,7 +1993,6 @@ void * AppThreadFunction( void * parm )
|
|||
//Ensure game starts with credits active
|
||||
MR_ToggleMenu(2);
|
||||
}
|
||||
returnvalue = -1;
|
||||
break;
|
||||
}
|
||||
case MESSAGE_ON_RESUME:
|
||||
|
@ -1996,9 +2030,13 @@ void * AppThreadFunction( void * parm )
|
|||
continue;
|
||||
}
|
||||
|
||||
// Create the scene if not yet created.
|
||||
// This is the only place the frame index is incremented, right before
|
||||
// calling vrapi_GetPredictedDisplayTime().
|
||||
appState.FrameIndex++;
|
||||
|
||||
// Create the scene if not yet created.
|
||||
// The scene is created here to be able to show a loading icon.
|
||||
if (!quake_initialised)
|
||||
if (!quake_initialised || runStatus != -1)
|
||||
{
|
||||
// Show a loading icon.
|
||||
int frameFlags = 0;
|
||||
|
@ -2027,51 +2065,75 @@ void * AppThreadFunction( void * parm )
|
|||
vrapi_SubmitFrame2( appState.Ovr, &frameDesc );
|
||||
}
|
||||
|
||||
// This is the only place the frame index is incremented, right before
|
||||
// calling vrapi_GetPredictedDisplayTime().
|
||||
appState.FrameIndex++;
|
||||
if (runStatus == -1) {
|
||||
#ifndef NDEBUG
|
||||
if (appState.FrameIndex > 10800)
|
||||
{
|
||||
//Trigger shutdown after a couple of minutes in debug mode
|
||||
runStatus = 0;
|
||||
}
|
||||
#endif
|
||||
// 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
|
||||
// depends on the pipeline depth of the engine and the synthesis rate.
|
||||
// The better the prediction, the less black will be pulled in at the edges.
|
||||
const double predictedDisplayTime = vrapi_GetPredictedDisplayTime(appState.Ovr,
|
||||
appState.FrameIndex);
|
||||
const ovrTracking2 tracking = vrapi_GetPredictedTracking2(appState.Ovr,
|
||||
predictedDisplayTime);
|
||||
|
||||
// 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
|
||||
// depends on the pipeline depth of the engine and the synthesis rate.
|
||||
// The better the prediction, the less black will be pulled in at the edges.
|
||||
const double predictedDisplayTime = vrapi_GetPredictedDisplayTime( appState.Ovr, appState.FrameIndex );
|
||||
const ovrTracking2 tracking = vrapi_GetPredictedTracking2( appState.Ovr, predictedDisplayTime );
|
||||
appState.DisplayTime = predictedDisplayTime;
|
||||
|
||||
appState.DisplayTime = predictedDisplayTime;
|
||||
|
||||
ovrApp_HandleInput( &appState );
|
||||
ovrApp_HandleInput(&appState);
|
||||
|
||||
|
||||
// Render eye images and setup the primary layer using ovrTracking2.
|
||||
const ovrLayerProjection2 worldLayer = ovrRenderer_RenderFrame( &appState.Renderer, &appState.Java,
|
||||
&tracking, appState.Ovr );
|
||||
// Render eye images and setup the primary layer using ovrTracking2.
|
||||
const ovrLayerProjection2 worldLayer = ovrRenderer_RenderFrame(&appState.Renderer,
|
||||
&appState.Java,
|
||||
&tracking, appState.Ovr);
|
||||
|
||||
const ovrLayerHeader2 * layers[] =
|
||||
const ovrLayerHeader2 *layers[] =
|
||||
{
|
||||
&worldLayer.Header
|
||||
};
|
||||
|
||||
ovrSubmitFrameDescription2 frameDesc = {};
|
||||
frameDesc.Flags = 0;
|
||||
frameDesc.SwapInterval = appState.SwapInterval;
|
||||
frameDesc.FrameIndex = appState.FrameIndex;
|
||||
frameDesc.DisplayTime = appState.DisplayTime;
|
||||
frameDesc.LayerCount = 1;
|
||||
frameDesc.Layers = layers;
|
||||
|
||||
// Hand over the eye images to the time warp.
|
||||
vrapi_SubmitFrame2(appState.Ovr, &frameDesc);
|
||||
}
|
||||
else
|
||||
{
|
||||
&worldLayer.Header
|
||||
};
|
||||
|
||||
ovrSubmitFrameDescription2 frameDesc = {};
|
||||
frameDesc.Flags = 0;
|
||||
frameDesc.SwapInterval = appState.SwapInterval;
|
||||
frameDesc.FrameIndex = appState.FrameIndex;
|
||||
frameDesc.DisplayTime = appState.DisplayTime;
|
||||
frameDesc.LayerCount = 1;
|
||||
frameDesc.Layers = layers;
|
||||
|
||||
// Hand over the eye images to the time warp.
|
||||
vrapi_SubmitFrame2( appState.Ovr, &frameDesc );
|
||||
|
||||
if (returnvalue != -1)
|
||||
{
|
||||
Host_Shutdown();
|
||||
jni_terminateAudio();
|
||||
ovrRenderer_Destroy( &appState.Renderer );
|
||||
ovrEgl_DestroyContext( &appState.Egl );
|
||||
(*java.Vm)->DetachCurrentThread( java.Vm );
|
||||
vrapi_Shutdown();
|
||||
exit( 0 );
|
||||
//We are now shutting down
|
||||
if (runStatus == 0)
|
||||
{
|
||||
//Give us half a second (36 frames)
|
||||
shutdownCountdown = 36;
|
||||
runStatus++;
|
||||
} else if (runStatus == 1)
|
||||
{
|
||||
if (--shutdownCountdown == 0) {
|
||||
runStatus++;
|
||||
}
|
||||
} else if (runStatus == 2)
|
||||
{
|
||||
Host_Shutdown();
|
||||
jni_terminateAudio();
|
||||
runStatus++;
|
||||
} else if (runStatus == 3)
|
||||
{
|
||||
ovrRenderer_Destroy( &appState.Renderer );
|
||||
ovrEgl_DestroyContext( &appState.Egl );
|
||||
(*java.Vm)->DetachCurrentThread( java.Vm );
|
||||
vrapi_Shutdown();
|
||||
exit( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,3 +56,5 @@ bind MOUSE3 "+mlook"
|
|||
"fov" "100"
|
||||
"sensitivity" "4"
|
||||
"snd_speed" "44100"
|
||||
"cl_weapon_offset_lr" "0.0"
|
||||
"cl_weapon_offset_fb" "0.16"
|
||||
|
|
Loading…
Reference in a new issue