mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-12 23:54:07 +00:00
Support for ForeceTube/ProTube Stock
Also added f2hunter to the credits
This commit is contained in:
parent
8cf2ffc445
commit
b659a9e09e
6 changed files with 72 additions and 37 deletions
Binary file not shown.
|
@ -2,8 +2,8 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.drbeef.ioq3quest"
|
package="com.drbeef.ioq3quest"
|
||||||
android:installLocation="preferExternal"
|
android:installLocation="preferExternal"
|
||||||
android:versionCode="52"
|
android:versionCode="53"
|
||||||
android:versionName="1.0.0">
|
android:versionName="1.1.0">
|
||||||
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
|
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
|
||||||
<uses-feature android:glEsVersion="0x00030001" />
|
<uses-feature android:glEsVersion="0x00030001" />
|
||||||
<!-- <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>-->
|
<!-- <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>-->
|
||||||
|
|
|
@ -1318,6 +1318,10 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
|
||||||
vec3_t angle;
|
vec3_t angle;
|
||||||
CG_CalculateVRWeaponPosition(muzzlePoint, angle);
|
CG_CalculateVRWeaponPosition(muzzlePoint, angle);
|
||||||
AngleVectors(angle, forward, NULL, NULL );
|
AngleVectors(angle, forward, NULL, NULL );
|
||||||
|
|
||||||
|
//Handle this here so it is refreshed on every frame, not just when the lightning gun is first fired
|
||||||
|
int position = vr->weapon_stabilised ? 4 : (vr->right_handed ? 1 : 2);
|
||||||
|
trap_HapticEvent("RTCWQuest:fire_tesla", position, 0, 100, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
// !CPMA
|
// !CPMA
|
||||||
AngleVectors( cent->lerpAngles, forward, NULL, NULL );
|
AngleVectors( cent->lerpAngles, forward, NULL, NULL );
|
||||||
|
@ -2529,7 +2533,7 @@ void CG_FireWeapon( centity_t *cent ) {
|
||||||
trap_HapticEvent("rocket_fire", position, 0, 100, 0, 0);
|
trap_HapticEvent("rocket_fire", position, 0, 100, 0, 0);
|
||||||
break;
|
break;
|
||||||
case WP_LIGHTNING:
|
case WP_LIGHTNING:
|
||||||
trap_HapticEvent("RTCWQuest:fire_tesla", position, 0, 100, 0, 0);
|
//Haptics handled in the CG_LightningBolt code
|
||||||
break;
|
break;
|
||||||
case WP_RAILGUN:
|
case WP_RAILGUN:
|
||||||
trap_HapticEvent("RTCWQuest:fire_sniper", position, 0, 100, 0, 0);
|
trap_HapticEvent("RTCWQuest:fire_sniper", position, 0, 100, 0, 0);
|
||||||
|
@ -2543,7 +2547,7 @@ void CG_FireWeapon( centity_t *cent ) {
|
||||||
trap_HapticEvent("bfg_fire", position, 0, 100, 0, 0);
|
trap_HapticEvent("bfg_fire", position, 0, 100, 0, 0);
|
||||||
break;
|
break;
|
||||||
case WP_GRAPPLING_HOOK:
|
case WP_GRAPPLING_HOOK:
|
||||||
trap_HapticEvent("chainsaw_fire", position, 0, 100, 0, 0);
|
//No Haptics
|
||||||
break;
|
break;
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
case WP_NAILGUN:
|
case WP_NAILGUN:
|
||||||
|
|
|
@ -145,11 +145,11 @@ Special Thanks to the whole discord!
|
||||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||||
UI_DrawProportionalString( 320, y, "Dedicated Beta Testers", UI_CENTER|UI_SMALLFONT, color_red );
|
UI_DrawProportionalString( 320, y, "Dedicated Beta Testers", UI_CENTER|UI_SMALLFONT, color_red );
|
||||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||||
UI_DrawString( 320, y, "XQuader, Ceno, Cukier, Bummser, Retro1N, Benny91, April, Ikarus,", UI_CENTER|UI_SMALLFONT, color_white );
|
UI_DrawString( 320, y, "f2hunter, XQuader, Ceno, Cukier, Bummser, Retro1N, Benny91, Ikarus,", UI_CENTER|UI_SMALLFONT, color_white );
|
||||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||||
UI_DrawString( 320, y, "Bim, Lubos, MasakaPete, Config2, Maniac, Ghostdog72, Slydog43,", UI_CENTER|UI_SMALLFONT, color_white );
|
UI_DrawString( 320, y, "Bim, Lubos, MasakaPete, Config2, Maniac, Ghostdog72, Slydog43,", UI_CENTER|UI_SMALLFONT, color_white );
|
||||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||||
UI_DrawString( 320, y, "Cornelius, Ferret, RealityForge, PvtGenO, SatanSlayer", UI_CENTER|UI_SMALLFONT, color_white );
|
UI_DrawString( 320, y, "April, Cornelius, Ferret, RealityForge, PvtGenO, SatanSlayer", UI_CENTER|UI_SMALLFONT, color_white );
|
||||||
|
|
||||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||||
UI_DrawProportionalString( 320, y, "Special Thanks to the whole Team Beef discord!", UI_CENTER|UI_SMALLFONT, color_red );
|
UI_DrawProportionalString( 320, y, "Special Thanks to the whole Team Beef discord!", UI_CENTER|UI_SMALLFONT, color_red );
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
package com.drbeef.ioq3quest;
|
package com.drbeef.ioq3quest;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.util.Pair;
|
||||||
|
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
import com.drbeef.externalhapticsservice.HapticServiceClient;
|
import com.drbeef.externalhapticsservice.HapticServiceClient;
|
||||||
|
import com.drbeef.externalhapticsservice.HapticsConstants;
|
||||||
|
|
||||||
import org.libsdl.app.SDLActivity;
|
import org.libsdl.app.SDLActivity;
|
||||||
|
|
||||||
|
@ -24,6 +27,7 @@ import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.util.Vector;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
|
@ -40,7 +44,11 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
||||||
|
|
||||||
String commandLineParams;
|
String commandLineParams;
|
||||||
|
|
||||||
private HapticServiceClient externalHapticsServiceClient = null;
|
private Vector<HapticServiceClient> externalHapticsServiceClients = new Vector<>();
|
||||||
|
|
||||||
|
//Use a vector of pairs, it is possible a given package _could_ in the future support more than one haptic service
|
||||||
|
//so a map here of Package -> Action would not work.
|
||||||
|
private static Vector<Pair<String, String>> externalHapticsServiceDetails = new Vector<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -53,6 +61,16 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override protected void onDestroy()
|
||||||
|
{
|
||||||
|
Log.i(TAG, "onDestroy called");
|
||||||
|
|
||||||
|
for (HapticServiceClient externalHapticsServiceClient : externalHapticsServiceClients) {
|
||||||
|
externalHapticsServiceClient.stopBinding();
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the Activity only if the permission has been granted.
|
* Initializes the Activity only if the permission has been granted.
|
||||||
|
@ -143,11 +161,15 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
externalHapticsServiceClient = new HapticServiceClient(this, (state, desc) -> {
|
for (Pair<String, String> serviceDetail : externalHapticsServiceDetails) {
|
||||||
Log.v(TAG, "ExternalHapticsService is:" + desc);
|
HapticServiceClient client = new HapticServiceClient(this, (state, desc) -> {
|
||||||
});
|
Log.v(TAG, "ExternalHapticsService " + serviceDetail.second + ": " + desc);
|
||||||
|
}, new Intent(serviceDetail.second)
|
||||||
|
.setPackage(serviceDetail.first));
|
||||||
|
|
||||||
externalHapticsServiceClient.bindService();
|
client.bindService();
|
||||||
|
externalHapticsServiceClients.add(client);
|
||||||
|
}
|
||||||
|
|
||||||
Log.d(TAG, "nativeCreate");
|
Log.d(TAG, "nativeCreate");
|
||||||
nativeCreate(this);
|
nativeCreate(this);
|
||||||
|
@ -204,39 +226,48 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
||||||
|
|
||||||
static {
|
static {
|
||||||
System.loadLibrary("main");
|
System.loadLibrary("main");
|
||||||
|
|
||||||
|
//Add possible external haptic service details here
|
||||||
|
externalHapticsServiceDetails.add(Pair.create(HapticsConstants.BHAPTICS_PACKAGE, HapticsConstants.BHAPTICS_ACTION_FILTER));
|
||||||
|
externalHapticsServiceDetails.add(Pair.create(HapticsConstants.FORCETUBE_PACKAGE, HapticsConstants.FORCETUBE_ACTION_FILTER));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void haptic_event(String event, int position, int flags, int intensity, float angle, float yHeight) {
|
public void haptic_event(String event, int position, int flags, int intensity, float angle, float yHeight) {
|
||||||
|
|
||||||
if (externalHapticsServiceClient.hasService()) {
|
boolean areHapticsEnabled = hapticsEnabled;
|
||||||
try {
|
for (HapticServiceClient externalHapticsServiceClient : externalHapticsServiceClients) {
|
||||||
if (!hapticsEnabled)
|
|
||||||
{
|
|
||||||
externalHapticsServiceClient.getHapticsService().hapticEnable();
|
|
||||||
hapticsEnabled = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.compareTo("frame_tick") == 0)
|
if (externalHapticsServiceClient.hasService()) {
|
||||||
{
|
try {
|
||||||
externalHapticsServiceClient.getHapticsService().hapticFrameTick();
|
//Enabled all haptics services if required
|
||||||
}
|
if (!areHapticsEnabled)
|
||||||
|
{
|
||||||
|
externalHapticsServiceClient.getHapticsService().hapticEnable();
|
||||||
|
hapticsEnabled = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//Use the Doom3Quest haptic patterns for now
|
if (event.compareTo("frame_tick") == 0)
|
||||||
String app = "Doom3Quest";
|
{
|
||||||
if (event.contains(":"))
|
externalHapticsServiceClient.getHapticsService().hapticFrameTick();
|
||||||
{
|
}
|
||||||
String[] items = event.split(":");
|
|
||||||
app = items[0];
|
//Uses the Doom3Quest and RTCWQuest haptic patterns
|
||||||
event = items[1];
|
String app = "Doom3Quest";
|
||||||
|
String eventID = event;
|
||||||
|
if (event.contains(":"))
|
||||||
|
{
|
||||||
|
String[] items = event.split(":");
|
||||||
|
app = items[0];
|
||||||
|
eventID = items[1];
|
||||||
|
}
|
||||||
|
externalHapticsServiceClient.getHapticsService().hapticEvent(app, eventID, position, flags, intensity, angle, yHeight);
|
||||||
|
}
|
||||||
|
catch (RemoteException r)
|
||||||
|
{
|
||||||
|
Log.v(TAG, r.toString());
|
||||||
}
|
}
|
||||||
externalHapticsServiceClient.getHapticsService().hapticEvent(app, event, position, flags, intensity, angle, yHeight);
|
|
||||||
}
|
|
||||||
catch (RemoteException r)
|
|
||||||
{
|
|
||||||
Log.v(TAG, r.toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
setlocal
|
setlocal
|
||||||
|
|
||||||
set BUILD_TYPE=release
|
set BUILD_TYPE=release
|
||||||
set VERSION=1.0.0-rc1
|
set VERSION=1.1.0
|
||||||
|
|
||||||
@REM Define the following environment variables to sign a release build
|
@REM Define the following environment variables to sign a release build
|
||||||
@REM set KEYSTORE=
|
@REM set KEYSTORE=
|
||||||
|
|
Loading…
Reference in a new issue