Remove external haptics menu option

if external service is present, then it will be used, no need for a toggle
This commit is contained in:
Simon 2021-05-10 22:04:26 +01:00
parent 4295cd3c16
commit 812e38969d
7 changed files with 4 additions and 23 deletions

View file

@ -2287,9 +2287,7 @@ void idCommonLocal::Vibrate(int channel, float low, float high)
void idCommonLocal::HapticEvent(const char* event, int position, int flags, int intensity, float angle, float yHeight )
{
if (cvarSystem->GetCVarBool("vr_useHapticsService")) {
Doom3Quest_HapticEvent(event, position, flags, intensity, angle, yHeight);
}
Doom3Quest_HapticEvent(event, position, flags, intensity, angle, yHeight);
}
void idCommonLocal::HapticStopEvent(const char* event)

View file

@ -814,18 +814,10 @@ void idGameLocal::SetVRClientInfo(vrClientInfo *pVR)
{
pVRClientInfo = pVR;
//Only triggers haptic enabling if value of cvar changes or the first time this is called
static bool firstTime = true;
static bool lastUseHapticsService = false;
if (firstTime || (lastUseHapticsService != vr_useHapticsService.GetBool())) {
if (vr_useHapticsService.GetBool()) {
common->HapticEnable();
} else {
common->HapticDisable();
}
if (firstTime) {
common->HapticEnable();
firstTime = false;
lastUseHapticsService = vr_useHapticsService.GetBool();
}
}

View file

@ -12631,9 +12631,7 @@ void idPlayer::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
}
}
if ( IsType( idPlayer::Type ) &&
//Save the effort of going through this code if vr_useHapticsService isn't enabled
vr_useHapticsService.GetBool()) {
if ( IsType( idPlayer::Type )) {
idVec3 bodyOrigin = vec3_zero;
idMat3 bodyAxis;
GetViewPos( bodyOrigin, bodyAxis );

View file

@ -27,10 +27,6 @@
idCVar vr_d3qversion( "vr_d3qversion", ENGINE_VERSION, CVAR_ROM | CVAR_GUI, "Version" );
// *** Haptics Service ***
idCVar vr_useHapticsService( "vr_useHapticsService", "0", CVAR_BOOL | CVAR_ARCHIVE | CVAR_GAME, "Whether full-body haptics are enabled via the external haptics service" );
// *** Oculus HMD Variables
idCVar vr_scale( "vr_scale", "1.0", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_GAME, "World scale. Everything virtual is this times as big." );
//In Menu - added virtual function - needs testing

View file

@ -415,8 +415,6 @@ private:
};
extern idCVar vr_useHapticsService;
extern idCVar vr_scale;
extern idCVar vr_normalViewHeight;
extern idCVar vr_useFloorHeight;

View file

@ -841,7 +841,6 @@ int idSoundEmitterLocal::StartSound( const idSoundShader *shader, const s_channe
chan->stopped = false;
chan->Start();
if (cvarSystem->GetCVarBool("vr_useHapticsService"))
{
idVec3 direction = (soundWorld->listenerPos / DOOM_TO_METERS) - origin;

Binary file not shown.