mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-01-31 13:00:52 +00:00
6f3875e9a2
- When you die you now won't lose head tracking (I won't spoil what does happen now...) - Lightning Gun Beam is now correct w.r.t cross hair - Enemy Lightning Gun Beams fire in the direction they are aiming (not in the direction you are aiming!!) - Sped up crosshair in the menu, as it was too sluggish still - Restored OG rail gun - Removed Vertex Lighting cvar - After match, the Win screen should be shown in the front of player
96 lines
2.6 KiB
C
96 lines
2.6 KiB
C
#include "vr_base.h"
|
|
#include "../VrApi/Include/VrApi.h"
|
|
#include "../VrApi/Include/VrApi_Helpers.h"
|
|
#include "../VrApi/Include/VrApi_Types.h"
|
|
#include "../qcommon/q_shared.h"
|
|
#include "../qcommon/qcommon.h"
|
|
#include "../client/client.h"
|
|
|
|
//#if __ANDROID__
|
|
|
|
#pragma clang diagnostic push
|
|
#pragma clang diagnostic ignored "-Wstrict-prototypes"
|
|
#pragma clang diagnostic pop
|
|
|
|
#include <EGL/egl.h>
|
|
|
|
#include <assert.h>
|
|
|
|
static engine_t vr_engine;
|
|
|
|
cvar_t *vr_worldscale = NULL;
|
|
|
|
engine_t* VR_Init( ovrJava java )
|
|
{
|
|
ovrInitParms initParams;
|
|
ovrResult initResult;
|
|
|
|
memset(&vr_engine, 0, sizeof(vr_engine));
|
|
|
|
initParams = vrapi_DefaultInitParms(&java);
|
|
initResult = vrapi_Initialize(&initParams);
|
|
assert(initResult == VRAPI_INITIALIZE_SUCCESS);
|
|
|
|
vr_engine.java = java;
|
|
|
|
return &vr_engine;
|
|
}
|
|
|
|
void VR_InitCvars( void )
|
|
{
|
|
vr_worldscale = Cvar_Get ("vr_worldscale", "32.0", CVAR_ARCHIVE);
|
|
|
|
// Values are: scale,right,up,forward,pitch,yaw,roll
|
|
// VALUES PROVIDED BY SkillFur - Thank-you!
|
|
Cvar_Get ("vr_weapon_adjustment_1", "1,-4.0,7,-10,-20,-15,0", CVAR_ARCHIVE);
|
|
Cvar_Get ("vr_weapon_adjustment_2", "0.8,-3.0,5.5,0,0,0,0", CVAR_ARCHIVE);
|
|
Cvar_Get ("vr_weapon_adjustment_3", "0.7,-2.5,5.5,0,0,0,0", CVAR_ARCHIVE);
|
|
Cvar_Get ("vr_weapon_adjustment_4", "0.75,-4.0,6.5,-4,0,0,0", CVAR_ARCHIVE);
|
|
Cvar_Get ("vr_weapon_adjustment_5", "0.8,-3.8,6,7.5,0,0,0", CVAR_ARCHIVE);
|
|
Cvar_Get ("vr_weapon_adjustment_6", "0.8,-3.3,6,7,0,0,0", CVAR_ARCHIVE);
|
|
Cvar_Get ("vr_weapon_adjustment_7", "0.8,-3.3,6,0,0,0,0", CVAR_ARCHIVE);
|
|
Cvar_Get ("vr_weapon_adjustment_8", "0.8,-3.5,6,1.5,0,0,0", CVAR_ARCHIVE);
|
|
Cvar_Get ("vr_weapon_adjustment_9", "0.8,-5.5,6,0,0,0,0", CVAR_ARCHIVE);
|
|
|
|
}
|
|
|
|
void VR_Destroy( engine_t* engine )
|
|
{
|
|
if (engine == &vr_engine) {
|
|
vrapi_Shutdown();
|
|
}
|
|
}
|
|
|
|
void VR_EnterVR( engine_t* engine, ovrJava java ) {
|
|
if (!engine->ovr) {
|
|
ovrModeParms modeParams = vrapi_DefaultModeParms(&java);
|
|
modeParams.Display = (size_t)eglGetCurrentDisplay();
|
|
modeParams.WindowSurface = (size_t)eglGetCurrentSurface(EGL_DRAW);
|
|
modeParams.ShareContext = (size_t)eglGetCurrentContext();
|
|
|
|
engine->ovr = vrapi_EnterVrMode(&modeParams);
|
|
engine->frameIndex = 0;
|
|
|
|
vrapi_SetTrackingSpace(engine->ovr, VRAPI_TRACKING_SPACE_LOCAL_FLOOR);
|
|
}
|
|
}
|
|
|
|
void VR_LeaveVR( engine_t* engine ) {
|
|
if (engine->ovr) {
|
|
vrapi_LeaveVrMode(engine->ovr);
|
|
engine->ovr = NULL;
|
|
}
|
|
}
|
|
|
|
engine_t* VR_GetEngine( void ) {
|
|
return &vr_engine;
|
|
}
|
|
|
|
bool VR_useScreenLayer( void )
|
|
{
|
|
int keyCatcher = Key_GetCatcher( );
|
|
return (bool)( clc.state != CA_ACTIVE ||
|
|
//( cl.snap.ps.stats[STAT_HEALTH] <= 0 ) ||
|
|
( keyCatcher & (KEYCATCH_UI | KEYCATCH_CONSOLE) ));
|
|
}
|
|
//#endif
|