mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-04-19 14:41:14 +00:00
Compare commits
17 commits
Author | SHA1 | Date | |
---|---|---|---|
|
11ff5a9658 | ||
|
491c1abead | ||
|
b7aedfd0a3 | ||
|
7f7a5476bc | ||
|
b9e0fa74ff | ||
|
d2787fbd4a | ||
|
50d253fcdc | ||
|
4b46ae002f | ||
|
4eca4349d3 | ||
|
b80e8bb7b6 | ||
|
8ac0ee5af5 | ||
|
d628dadf76 | ||
|
913459e45a | ||
|
0a9aa45479 | ||
|
4428ebe881 | ||
|
d33e09733b | ||
|
667edf7b5d |
25 changed files with 295 additions and 126 deletions
Binary file not shown.
|
@ -2,8 +2,8 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.drbeef.ioq3quest"
|
||||
android:installLocation="preferExternal"
|
||||
android:versionCode="49"
|
||||
android:versionName="0.31.4">
|
||||
android:versionCode="57"
|
||||
android:versionName="1.1.2">
|
||||
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
|
||||
<uses-feature android:glEsVersion="0x00030001" />
|
||||
<!-- <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>-->
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
set sv_master1 "13.36.227.32:27950"
|
||||
set vr_master1 "mp.quakevr.com:27950"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
set sv_master1 "13.36.227.32:27950"
|
||||
set vr_master1 "mp.quakevr.com:27950"
|
||||
|
||||
set vr_weapon_adjustment_1 "1.0,0,12,-13,-36,0,100"
|
||||
set vr_weapon_adjustment_2 "1.0,-6,6,-3,0,0,0"
|
||||
|
|
BIN
android/app/src/main/assets/z_custom_background66.pk3
Normal file
BIN
android/app/src/main/assets/z_custom_background66.pk3
Normal file
Binary file not shown.
|
@ -1318,6 +1318,10 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
|
|||
vec3_t angle;
|
||||
CG_CalculateVRWeaponPosition(muzzlePoint, angle);
|
||||
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 {
|
||||
// !CPMA
|
||||
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);
|
||||
break;
|
||||
case WP_LIGHTNING:
|
||||
trap_HapticEvent("RTCWQuest:fire_tesla", position, 0, 100, 0, 0);
|
||||
//Haptics handled in the CG_LightningBolt code
|
||||
break;
|
||||
case WP_RAILGUN:
|
||||
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);
|
||||
break;
|
||||
case WP_GRAPPLING_HOOK:
|
||||
trap_HapticEvent("chainsaw_fire", position, 0, 100, 0, 0);
|
||||
//No Haptics
|
||||
break;
|
||||
#ifdef MISSIONPACK
|
||||
case WP_NAILGUN:
|
||||
|
|
|
@ -620,6 +620,10 @@ void CL_FinishMove( usercmd_t *cmd ) {
|
|||
{
|
||||
angles[ROLL] = 0; // suppress roll
|
||||
}
|
||||
else
|
||||
{
|
||||
angles[ROLL] = vr.hmdorientation[ROLL];
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
cmd->angles[i] = ANGLE2SHORT(angles[i]);
|
||||
|
|
|
@ -3622,7 +3622,12 @@ void CL_Init( void ) {
|
|||
cl_consoleKeys = Cvar_Get( "cl_consoleKeys", "~ ` 0x7e 0x60", CVAR_ARCHIVE);
|
||||
|
||||
// userinfo
|
||||
Cvar_Get ("name", "[VR] Player", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
char playerName[256];
|
||||
Com_sprintf(playerName, 256, "[VR] Player#%i", rand() % (99999999 - 10000000) + 10000000);
|
||||
Cvar_Get ("name", playerName, CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
if (strcmp(Cvar_VariableString("name"), "[VR] Player") == 0) {
|
||||
Cvar_Set( "name", playerName);
|
||||
}
|
||||
cl_rate = Cvar_Get ("rate", "25000", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
Cvar_Get ("snaps", "40", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
Cvar_Get ("model", "sarge", CVAR_USERINFO | CVAR_ARCHIVE );
|
||||
|
@ -4193,7 +4198,7 @@ void CL_GlobalServers_f( void ) {
|
|||
int numAddress = 0;
|
||||
|
||||
for ( i = 1; i <= MAX_MASTER_SERVERS; i++ ) {
|
||||
sprintf(command, "sv_master%d", i);
|
||||
sprintf(command, "vr_master%d", i);
|
||||
masteraddress = Cvar_VariableString(command);
|
||||
|
||||
if(!*masteraddress)
|
||||
|
@ -4211,7 +4216,7 @@ void CL_GlobalServers_f( void ) {
|
|||
return;
|
||||
}
|
||||
|
||||
sprintf(command, "sv_master%d", masterNum);
|
||||
sprintf(command, "vr_master%d", masterNum);
|
||||
masteraddress = Cvar_VariableString(command);
|
||||
|
||||
if(!*masteraddress)
|
||||
|
|
|
@ -213,6 +213,19 @@ static void Controls3_MenuEvent( void* ptr, int notification ) {
|
|||
break;
|
||||
|
||||
case ID_SWITCHTHUMBSTICKS:
|
||||
{
|
||||
if (s_controls3.switchthumbsticks.curvalue) {
|
||||
trap_Cvar_Set("vr_button_map_A", "+button2"); // Use Item
|
||||
trap_Cvar_Set("vr_button_map_B", "+button3"); // Gesture
|
||||
trap_Cvar_Set("vr_button_map_X", "+moveup"); // Jump
|
||||
trap_Cvar_Set("vr_button_map_Y", "+movedown"); // Crouch
|
||||
} else {
|
||||
trap_Cvar_Set("vr_button_map_A", "+moveup"); // Jump
|
||||
trap_Cvar_Set("vr_button_map_B", "+movedown"); // Crouch
|
||||
trap_Cvar_Set("vr_button_map_X", "+button2"); // Use Item
|
||||
trap_Cvar_Set("vr_button_map_Y", "+button3"); // Gesture
|
||||
}
|
||||
}
|
||||
trap_Cvar_SetValue( "vr_switchThumbsticks", s_controls3.switchthumbsticks.curvalue );
|
||||
break;
|
||||
|
||||
|
|
|
@ -107,8 +107,8 @@ Additional Contributions
|
|||
Bummser, Skillfur, Ceno, Cukier, Eispfogel, Pizzaluigi
|
||||
|
||||
Dedicated Beta Testers
|
||||
XQuader, Ceno, Cukier, Bummser, Retro1N, Benny91, April, Ikarus,
|
||||
Bim, Lubos, MasakaPete, Config2, Maniac, Ghostdog72, Slydog43,
|
||||
f2hunter, XQuader, Ceno, Cukier, Bummser, Retro1N, Benny91, April, Ikarus,
|
||||
GeTall, Lubos, MasakaPete, Config2, Maniac, Ghostdog72, Slydog43,
|
||||
Cornelius, Ferret, RealityForge, PvtGenO, SatanSlayer
|
||||
|
||||
Special Thanks to the whole discord!
|
||||
|
@ -140,16 +140,18 @@ Special Thanks to the whole discord!
|
|||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Additional Contributions", UI_CENTER|UI_SMALLFONT, color_red );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawString( 320, y, "Bummser, Skillfur, Ceno, Cukier, Eispfogel, Pizzaluigi", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
UI_DrawString( 320, y, "Bummser, Skillfur, Ceno, Cukier, Eispfogel", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawString( 320, y, "Omarlego (custom Q3Q background), Pizzaluigi", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
|
||||
UI_DrawProportionalString( 320, y, "Dedicated Beta Testers", UI_CENTER|UI_SMALLFONT, color_red );
|
||||
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, Madmac(Ikarus),", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
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, "GeTall, Lubos, MasakaPete, Config2, Maniac, Ghostdog72, Slydog43,", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
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, "Myrothas, April, Cornelius, Ferret, RealityForge, PvtGenO, SatanSlayer", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
|
||||
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 );
|
||||
|
@ -163,7 +165,7 @@ Special Thanks to the whole discord!
|
|||
UI_DrawProportionalString(320, y, "original ioquake3 contributors!", UI_CENTER | UI_SMALLFONT, color_orange);
|
||||
}
|
||||
|
||||
UI_DrawString( 320, 459, "Quake3Quest: https://www.quake3.quakevr.com/", UI_CENTER|UI_SMALLFONT, color_red );
|
||||
UI_DrawString( 320, 459, "Quake3Quest: https://quake3.quakevr.com/", UI_CENTER|UI_SMALLFONT, color_red );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ static void Main_MenuDraw( void ) {
|
|||
int yPos = 410;
|
||||
if (uis.demoversion) {
|
||||
yPos = 372;
|
||||
UI_DrawString( 320, yPos, "Demo: Play the 1st tier of SP or MP on our demo servers", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
UI_DrawString( 320, yPos, "DEMO: You can only play on Demo-Servers and play first part of SP!", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
yPos += SMALLCHAR_HEIGHT;
|
||||
UI_DrawString( 320, yPos, "Install full game for more!", UI_CENTER|UI_SMALLFONT, color_white );
|
||||
yPos += SMALLCHAR_HEIGHT;
|
||||
|
|
|
@ -160,7 +160,7 @@ static char* netnames[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static char quake3questMessage[] = "Visit quake3.quakevr.com - For the Team Beef Discord invite for news/events/chat";
|
||||
static char quake3questMessage[] = "Meetups: 21h CET (EU) / 9pm EST (USA). stats.quakevr.com for server status.";
|
||||
|
||||
const char* punkbuster_items[] = {
|
||||
"Disabled",
|
||||
|
@ -194,6 +194,7 @@ typedef struct servernode_s {
|
|||
int minPing;
|
||||
int maxPing;
|
||||
qboolean bPB;
|
||||
qboolean demo;
|
||||
|
||||
} servernode_t;
|
||||
|
||||
|
@ -395,7 +396,6 @@ static void ArenaServers_UpdatePicture( void ) {
|
|||
servernodeptr = g_arenaservers.table[g_arenaservers.list.curvalue].servernode;
|
||||
Com_sprintf( picname, sizeof(picname), "levelshots/%s.tga", servernodeptr->mapname );
|
||||
g_arenaservers.mappic.generic.name = picname;
|
||||
|
||||
}
|
||||
|
||||
// force shader update during draw
|
||||
|
@ -500,7 +500,17 @@ static void ArenaServers_UpdateMenu( void ) {
|
|||
return;
|
||||
}
|
||||
|
||||
// build list box strings - apply culling filters
|
||||
//Specify should always be grayed out
|
||||
g_arenaservers.specify.generic.flags |= QMF_GRAYED;
|
||||
|
||||
servernode_t* servernode;
|
||||
servernode = g_arenaservers.table[g_arenaservers.list.curvalue].servernode;
|
||||
if( servernode && uis.demoversion && !servernode->demo) {
|
||||
//Demo pak cannot connect to a non-demo server
|
||||
g_arenaservers.go.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
|
||||
// build list box strings - apply culling filters
|
||||
servernodeptr = g_arenaservers.serverlist;
|
||||
count = *g_arenaservers.numservers;
|
||||
for( i = 0, j = 0; i < count; i++, servernodeptr++ ) {
|
||||
|
@ -562,10 +572,20 @@ static void ArenaServers_UpdateMenu( void ) {
|
|||
pingColor = S_COLOR_RED;
|
||||
}
|
||||
|
||||
Com_sprintf( buff, MAX_LISTBOXWIDTH, "%-20.20s %-12.12s %2d/%2d %-8.8s %4s%s%3d " S_COLOR_YELLOW "%s",
|
||||
servernodeptr->hostname, servernodeptr->mapname, servernodeptr->numclients,
|
||||
servernodeptr->maxclients, servernodeptr->gamename,
|
||||
netnames[servernodeptr->nettype], pingColor, servernodeptr->pingtime, servernodeptr->bPB ? "Yes" : "No" );
|
||||
if (uis.demoversion && !servernodeptr->demo)
|
||||
{
|
||||
Com_sprintf( buff, MAX_LISTBOXWIDTH, S_COLOR_MID_GREY "%-20.20s %-12.12s %2d/%2d %-8.8s %4s%s%3d " S_COLOR_YELLOW "%s",
|
||||
servernodeptr->hostname, servernodeptr->mapname, servernodeptr->numclients,
|
||||
servernodeptr->maxclients, servernodeptr->gamename,
|
||||
netnames[servernodeptr->nettype], pingColor, servernodeptr->pingtime, servernodeptr->bPB ? "Yes" : "No" );
|
||||
}
|
||||
else
|
||||
{
|
||||
Com_sprintf( buff, MAX_LISTBOXWIDTH, "%-20.20s %-12.12s %2d/%2d %-8.8s %4s%s%3d " S_COLOR_YELLOW "%s",
|
||||
servernodeptr->hostname, servernodeptr->mapname, servernodeptr->numclients,
|
||||
servernodeptr->maxclients, servernodeptr->gamename,
|
||||
netnames[servernodeptr->nettype], pingColor, servernodeptr->pingtime, servernodeptr->bPB ? "Yes" : "No" );
|
||||
}
|
||||
j++;
|
||||
}
|
||||
|
||||
|
@ -682,6 +702,8 @@ static void ArenaServers_Insert( char* adrstr, char* info, int pingtime )
|
|||
servernodeptr->minPing = atoi( Info_ValueForKey( info, "minPing") );
|
||||
servernodeptr->maxPing = atoi( Info_ValueForKey( info, "maxPing") );
|
||||
servernodeptr->bPB = atoi( Info_ValueForKey( info, "punkbuster") );
|
||||
servernodeptr->demo = (strcasestr(info, "demo") != NULL) ||
|
||||
(strcmp(servernodeptr->hostname, "Quake3Quest") == 0); // Demo can connect to another quest
|
||||
|
||||
/*
|
||||
s = Info_ValueForKey( info, "nettype" );
|
||||
|
@ -1104,7 +1126,7 @@ int ArenaServers_SetType( int type )
|
|||
|
||||
if(type >= UIAS_GLOBAL1 && type <= UIAS_GLOBAL5)
|
||||
{
|
||||
char masterstr[2], cvarname[sizeof("sv_master1")];
|
||||
char masterstr[2], cvarname[sizeof("vr_master1")];
|
||||
int direction;
|
||||
|
||||
if (type == g_servertype || type == ((g_servertype+1) % UIAS_NUM_SOURCES)) {
|
||||
|
@ -1115,7 +1137,7 @@ int ArenaServers_SetType( int type )
|
|||
|
||||
while(type >= UIAS_GLOBAL1 && type <= UIAS_GLOBAL5)
|
||||
{
|
||||
Com_sprintf(cvarname, sizeof(cvarname), "sv_master%d", type - UIAS_GLOBAL0);
|
||||
Com_sprintf(cvarname, sizeof(cvarname), "vr_master%d", type - UIAS_GLOBAL0);
|
||||
trap_Cvar_VariableStringBuffer(cvarname, masterstr, sizeof(masterstr));
|
||||
if(*masterstr)
|
||||
break;
|
||||
|
@ -1239,6 +1261,17 @@ static void ArenaServers_Event( void* ptr, int event ) {
|
|||
case ID_LIST:
|
||||
if( event == QM_GOTFOCUS ) {
|
||||
ArenaServers_UpdatePicture();
|
||||
|
||||
servernode_t* servernode;
|
||||
servernode = g_arenaservers.table[g_arenaservers.list.curvalue].servernode;
|
||||
if( servernode && uis.demoversion && !servernode->demo) {
|
||||
//Demo pak cannot connect to a non-demo server
|
||||
g_arenaservers.go.generic.flags |= QMF_GRAYED;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_arenaservers.go.generic.flags &= ~QMF_GRAYED;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1583,8 +1616,8 @@ static void ArenaServers_MenuInit( void ) {
|
|||
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.create );
|
||||
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.go );
|
||||
|
||||
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.punkbuster );
|
||||
Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.pblogo );
|
||||
// Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.punkbuster );
|
||||
// Menu_AddItem( &g_arenaservers.menu, (void*) &g_arenaservers.pblogo );
|
||||
|
||||
ArenaServers_LoadFavorites();
|
||||
|
||||
|
@ -1602,7 +1635,7 @@ static void ArenaServers_MenuInit( void ) {
|
|||
g_emptyservers = Com_Clamp( 0, 1, ui_browserShowEmpty.integer );
|
||||
g_arenaservers.showempty.curvalue = g_emptyservers;
|
||||
|
||||
g_arenaservers.punkbuster.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "cl_punkbuster" ) );
|
||||
// g_arenaservers.punkbuster.curvalue = Com_Clamp( 0, 1, trap_Cvar_VariableValue( "cl_punkbuster" ) );
|
||||
|
||||
// force to initial state and refresh
|
||||
g_arenaservers.master.curvalue = g_servertype = ArenaServers_SetType(g_servertype);
|
||||
|
@ -1631,7 +1664,7 @@ void ArenaServers_Cache( void ) {
|
|||
trap_R_RegisterShaderNoMip( ART_ARROWS_UP );
|
||||
trap_R_RegisterShaderNoMip( ART_ARROWS_DOWN );
|
||||
trap_R_RegisterShaderNoMip( ART_UNKNOWNMAP );
|
||||
trap_R_RegisterShaderNoMip( ART_PUNKBUSTER );
|
||||
// trap_R_RegisterShaderNoMip( ART_PUNKBUSTER );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -99,6 +99,14 @@ static const char *gametype_items[] = {
|
|||
static int gametype_remap[] = {GT_FFA, GT_TEAM, GT_TOURNAMENT, GT_CTF};
|
||||
static int gametype_remap2[] = {0, 2, 0, 1, 3};
|
||||
|
||||
static int fraglimit_values[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40, 50, 75, 100, 200, 500, -1};
|
||||
static const char *fraglimit_items[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "15",
|
||||
"20", "25", "30", "40", "50", "75", "100", "200", "500", NULL};
|
||||
|
||||
static int timelimit_values[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40, 50, 60, 120, 240, 480, -1};
|
||||
static const char *timelimit_items[] = {"No limit", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "15",
|
||||
"20", "25", "30", "40", "50", "60", "120", "240", "480", NULL};
|
||||
|
||||
// use ui_servers2.c definition
|
||||
extern const char* punkbuster_items[];
|
||||
|
||||
|
@ -631,9 +639,9 @@ typedef struct {
|
|||
menubitmap_s picframe;
|
||||
|
||||
menulist_s dedicated;
|
||||
menufield_s timelimit;
|
||||
menufield_s fraglimit;
|
||||
menufield_s flaglimit;
|
||||
menulist_s timelimit;
|
||||
menulist_s fraglimit;
|
||||
menulist_s flaglimit;
|
||||
menuradiobutton_s friendlyfire;
|
||||
menufield_s hostname;
|
||||
menuradiobutton_s pure;
|
||||
|
@ -735,9 +743,9 @@ static void ServerOptions_Start( void ) {
|
|||
char buf[64];
|
||||
const char *info;
|
||||
|
||||
timelimit = atoi( s_serveroptions.timelimit.field.buffer );
|
||||
fraglimit = atoi( s_serveroptions.fraglimit.field.buffer );
|
||||
flaglimit = atoi( s_serveroptions.flaglimit.field.buffer );
|
||||
timelimit = timelimit_values[s_serveroptions.timelimit.curvalue];
|
||||
fraglimit = fraglimit_values[s_serveroptions.fraglimit.curvalue];
|
||||
flaglimit = fraglimit_values[s_serveroptions.flaglimit.curvalue];
|
||||
dedicated = s_serveroptions.dedicated.curvalue;
|
||||
friendlyfire = s_serveroptions.friendlyfire.curvalue;
|
||||
pure = s_serveroptions.pure.curvalue;
|
||||
|
@ -1127,6 +1135,21 @@ static void ServerOptions_InitBotNames( void ) {
|
|||
}
|
||||
}
|
||||
|
||||
static int getValueIndex(int* values, int value, int defaultVal)
|
||||
{
|
||||
int index = 0;
|
||||
while (values[index] != -1)
|
||||
{
|
||||
if (values[index] == value)
|
||||
{
|
||||
return index;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
//Just return the default
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
|
@ -1141,24 +1164,24 @@ static void ServerOptions_SetMenuItems( void ) {
|
|||
switch( s_serveroptions.gametype ) {
|
||||
case GT_FFA:
|
||||
default:
|
||||
Com_sprintf( s_serveroptions.fraglimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_ffa_fraglimit" ) ) );
|
||||
Com_sprintf( s_serveroptions.timelimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_ffa_timelimit" ) ) );
|
||||
s_serveroptions.fraglimit.curvalue = getValueIndex(fraglimit_values, trap_Cvar_VariableValue( "ui_ffa_fraglimit" ), 11);
|
||||
s_serveroptions.timelimit.curvalue = getValueIndex(timelimit_values, trap_Cvar_VariableValue( "ui_ffa_timelimit" ), 0);
|
||||
break;
|
||||
|
||||
case GT_TOURNAMENT:
|
||||
Com_sprintf( s_serveroptions.fraglimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_tourney_fraglimit" ) ) );
|
||||
Com_sprintf( s_serveroptions.timelimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_tourney_timelimit" ) ) );
|
||||
s_serveroptions.fraglimit.curvalue = getValueIndex(fraglimit_values, trap_Cvar_VariableValue( "ui_tourney_fraglimit" ), 11);
|
||||
s_serveroptions.timelimit.curvalue = getValueIndex(timelimit_values, trap_Cvar_VariableValue( "ui_tourney_timelimit" ), 0);
|
||||
break;
|
||||
|
||||
case GT_TEAM:
|
||||
Com_sprintf( s_serveroptions.fraglimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_team_fraglimit" ) ) );
|
||||
Com_sprintf( s_serveroptions.timelimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_team_timelimit" ) ) );
|
||||
s_serveroptions.fraglimit.curvalue = getValueIndex(fraglimit_values, trap_Cvar_VariableValue( "ui_team_fraglimit"), 11);
|
||||
s_serveroptions.timelimit.curvalue = getValueIndex(timelimit_values, trap_Cvar_VariableValue( "ui_team_timelimit" ), 0);
|
||||
s_serveroptions.friendlyfire.curvalue = (int)Com_Clamp( 0, 1, trap_Cvar_VariableValue( "ui_team_friendly" ) );
|
||||
break;
|
||||
|
||||
case GT_CTF:
|
||||
Com_sprintf( s_serveroptions.flaglimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 100, trap_Cvar_VariableValue( "ui_ctf_capturelimit" ) ) );
|
||||
Com_sprintf( s_serveroptions.timelimit.field.buffer, 4, "%i", (int)Com_Clamp( 0, 999, trap_Cvar_VariableValue( "ui_ctf_timelimit" ) ) );
|
||||
s_serveroptions.flaglimit.curvalue = getValueIndex(fraglimit_values, trap_Cvar_VariableValue( "ui_ctf_capturelimit" ), 11);
|
||||
s_serveroptions.timelimit.curvalue = getValueIndex(timelimit_values, trap_Cvar_VariableValue( "ui_ctf_timelimit" ), 0);
|
||||
s_serveroptions.friendlyfire.curvalue = (int)Com_Clamp( 0, 1, trap_Cvar_VariableValue( "ui_ctf_friendly" ) );
|
||||
break;
|
||||
}
|
||||
|
@ -1281,35 +1304,35 @@ static void ServerOptions_MenuInit( qboolean multiplayer ) {
|
|||
|
||||
y = 272;
|
||||
if( s_serveroptions.gametype != GT_CTF ) {
|
||||
s_serveroptions.fraglimit.generic.type = MTYPE_FIELD;
|
||||
s_serveroptions.fraglimit.generic.type = MTYPE_SPINCONTROL;
|
||||
s_serveroptions.fraglimit.generic.name = "Frag Limit:";
|
||||
s_serveroptions.fraglimit.generic.flags = QMF_NUMBERSONLY|QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_serveroptions.fraglimit.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_serveroptions.fraglimit.generic.x = OPTIONS_X;
|
||||
s_serveroptions.fraglimit.generic.y = y;
|
||||
s_serveroptions.fraglimit.generic.statusbar = ServerOptions_StatusBar;
|
||||
s_serveroptions.fraglimit.field.widthInChars = 3;
|
||||
s_serveroptions.fraglimit.field.maxchars = 3;
|
||||
s_serveroptions.fraglimit.curvalue = 11;
|
||||
s_serveroptions.fraglimit.itemnames = fraglimit_items;
|
||||
}
|
||||
else {
|
||||
s_serveroptions.flaglimit.generic.type = MTYPE_FIELD;
|
||||
s_serveroptions.flaglimit.generic.type = MTYPE_SPINCONTROL;
|
||||
s_serveroptions.flaglimit.generic.name = "Capture Limit:";
|
||||
s_serveroptions.flaglimit.generic.flags = QMF_NUMBERSONLY|QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_serveroptions.flaglimit.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_serveroptions.flaglimit.generic.x = OPTIONS_X;
|
||||
s_serveroptions.flaglimit.generic.y = y;
|
||||
s_serveroptions.flaglimit.generic.statusbar = ServerOptions_StatusBar;
|
||||
s_serveroptions.flaglimit.field.widthInChars = 3;
|
||||
s_serveroptions.flaglimit.field.maxchars = 3;
|
||||
s_serveroptions.flaglimit.curvalue = 9;
|
||||
s_serveroptions.flaglimit.itemnames = fraglimit_items;
|
||||
}
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_serveroptions.timelimit.generic.type = MTYPE_FIELD;
|
||||
s_serveroptions.timelimit.generic.type = MTYPE_SPINCONTROL;
|
||||
s_serveroptions.timelimit.generic.name = "Time Limit:";
|
||||
s_serveroptions.timelimit.generic.flags = QMF_NUMBERSONLY|QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_serveroptions.timelimit.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_serveroptions.timelimit.generic.x = OPTIONS_X;
|
||||
s_serveroptions.timelimit.generic.y = y;
|
||||
s_serveroptions.timelimit.generic.statusbar = ServerOptions_StatusBar;
|
||||
s_serveroptions.timelimit.field.widthInChars = 3;
|
||||
s_serveroptions.timelimit.field.maxchars = 3;
|
||||
s_serveroptions.flaglimit.curvalue = 0;
|
||||
s_serveroptions.timelimit.itemnames = timelimit_items;
|
||||
|
||||
if( s_serveroptions.gametype >= GT_TEAM ) {
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
|
|
|
@ -47,7 +47,7 @@ vec4_t colorLtGrey = {0.75, 0.75, 0.75, 1};
|
|||
vec4_t colorMdGrey = {0.5, 0.5, 0.5, 1};
|
||||
vec4_t colorDkGrey = {0.25, 0.25, 0.25, 1};
|
||||
|
||||
vec4_t g_color_table[8] =
|
||||
vec4_t g_color_table[10] =
|
||||
{
|
||||
{0.0, 0.0, 0.0, 1.0},
|
||||
{1.0, 0.0, 0.0, 1.0},
|
||||
|
@ -57,6 +57,8 @@ vec4_t g_color_table[8] =
|
|||
{0.0, 1.0, 1.0, 1.0},
|
||||
{1.0, 0.0, 1.0, 1.0},
|
||||
{1.0, 1.0, 1.0, 1.0},
|
||||
{0.75, 0.75, 0.75, 1.0},
|
||||
{0.5, 0.5, 0.5, 1.0},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -431,7 +431,9 @@ qboolean Q_IsColorString(const char *p); // ^[0-9a-zA-Z]
|
|||
#define COLOR_CYAN '5'
|
||||
#define COLOR_MAGENTA '6'
|
||||
#define COLOR_WHITE '7'
|
||||
#define ColorIndexForNumber(c) ((c) & 0x07)
|
||||
#define COLOR_LIGHT_GREY '8'
|
||||
#define COLOR_MID_GREY '9'
|
||||
#define ColorIndexForNumber(c) ((c) & 0x0f)
|
||||
#define ColorIndex(c) (ColorIndexForNumber((c) - '0'))
|
||||
|
||||
#define S_COLOR_BLACK "^0"
|
||||
|
@ -442,8 +444,10 @@ qboolean Q_IsColorString(const char *p); // ^[0-9a-zA-Z]
|
|||
#define S_COLOR_CYAN "^5"
|
||||
#define S_COLOR_MAGENTA "^6"
|
||||
#define S_COLOR_WHITE "^7"
|
||||
#define S_COLOR_LIGHT_GREY "^8"
|
||||
#define S_COLOR_MID_GREY "^9"
|
||||
|
||||
extern vec4_t g_color_table[8];
|
||||
extern vec4_t g_color_table[10];
|
||||
|
||||
#define MAKERGB( v, r, g, b ) v[0]=r;v[1]=g;v[2]=b
|
||||
#define MAKERGBA( v, r, g, b, a ) v[0]=r;v[1]=g;v[2]=b;v[3]=a
|
||||
|
|
|
@ -274,7 +274,7 @@ extern cvar_t *sv_maxclients;
|
|||
|
||||
extern cvar_t *sv_privateClients;
|
||||
extern cvar_t *sv_hostname;
|
||||
extern cvar_t *sv_master[MAX_MASTER_SERVERS];
|
||||
extern cvar_t *vr_master[MAX_MASTER_SERVERS];
|
||||
extern cvar_t *sv_reconnectlimit;
|
||||
extern cvar_t *sv_showloss;
|
||||
extern cvar_t *sv_padPackets;
|
||||
|
|
|
@ -672,11 +672,11 @@ void SV_Init (void)
|
|||
sv_allowDownload = Cvar_Get ("sv_allowDownload", "1", CVAR_SERVERINFO);
|
||||
Cvar_Get ("sv_dlURL", "", CVAR_SERVERINFO | CVAR_ARCHIVE);
|
||||
|
||||
sv_master[0] = Cvar_Get("sv_master1", "", 0); // This is set to our Q3Q master
|
||||
sv_master[1] = Cvar_Get("sv_master2", MASTER_SERVER_NAME, 0);
|
||||
sv_master[2] = Cvar_Get("sv_master3", "master.ioquake3.org", 0);
|
||||
vr_master[0] = Cvar_Get("vr_master1", "mp.quakevr.com:27950", 0); // This is set to our Q3Q master
|
||||
vr_master[1] = Cvar_Get("vr_master2", MASTER_SERVER_NAME, 0);
|
||||
vr_master[2] = Cvar_Get("vr_master3", "master.ioquake3.org", 0);
|
||||
for(index = 3; index < MAX_MASTER_SERVERS; index++)
|
||||
sv_master[index] = Cvar_Get(va("sv_master%d", index + 1), "", CVAR_ARCHIVE);
|
||||
vr_master[index] = Cvar_Get(va("vr_master%d", index + 1), "", CVAR_ARCHIVE);
|
||||
|
||||
sv_reconnectlimit = Cvar_Get ("sv_reconnectlimit", "3", 0);
|
||||
sv_showloss = Cvar_Get ("sv_showloss", "0", 0);
|
||||
|
|
|
@ -41,7 +41,7 @@ cvar_t *sv_maxclients;
|
|||
|
||||
cvar_t *sv_privateClients; // number of clients reserved for password
|
||||
cvar_t *sv_hostname;
|
||||
cvar_t *sv_master[MAX_MASTER_SERVERS]; // master server ip address
|
||||
cvar_t *vr_master[MAX_MASTER_SERVERS]; // master server ip address
|
||||
cvar_t *sv_reconnectlimit; // minimum seconds between connect messages
|
||||
cvar_t *sv_showloss; // report when usercmds are lost
|
||||
cvar_t *sv_padPackets; // add nop bytes to messages
|
||||
|
@ -262,20 +262,20 @@ void SV_MasterHeartbeat(const char *message)
|
|||
// send to group masters
|
||||
for (i = 0; i < MAX_MASTER_SERVERS; i++)
|
||||
{
|
||||
if(!sv_master[i]->string[0])
|
||||
if(!vr_master[i]->string[0])
|
||||
continue;
|
||||
|
||||
// see if we haven't already resolved the name or if it's been over 24 hours
|
||||
// resolving usually causes hitches on win95, so only do it when needed
|
||||
if (sv_master[i]->modified || svs.time > svs.masterResolveTime[i])
|
||||
if (vr_master[i]->modified || svs.time > svs.masterResolveTime[i])
|
||||
{
|
||||
sv_master[i]->modified = qfalse;
|
||||
vr_master[i]->modified = qfalse;
|
||||
svs.masterResolveTime[i] = svs.time + MASTERDNS_MSEC;
|
||||
|
||||
if(netenabled & NET_ENABLEV4)
|
||||
{
|
||||
Com_Printf("Resolving %s (IPv4)\n", sv_master[i]->string);
|
||||
res = NET_StringToAdr(sv_master[i]->string, &adr[i][0], NA_IP);
|
||||
Com_Printf("Resolving %s (IPv4)\n", vr_master[i]->string);
|
||||
res = NET_StringToAdr(vr_master[i]->string, &adr[i][0], NA_IP);
|
||||
|
||||
if(res == 2)
|
||||
{
|
||||
|
@ -284,15 +284,15 @@ void SV_MasterHeartbeat(const char *message)
|
|||
}
|
||||
|
||||
if(res)
|
||||
Com_Printf( "%s resolved to %s\n", sv_master[i]->string, NET_AdrToStringwPort(adr[i][0]));
|
||||
Com_Printf( "%s resolved to %s\n", vr_master[i]->string, NET_AdrToStringwPort(adr[i][0]));
|
||||
else
|
||||
Com_Printf( "%s has no IPv4 address.\n", sv_master[i]->string);
|
||||
Com_Printf( "%s has no IPv4 address.\n", vr_master[i]->string);
|
||||
}
|
||||
|
||||
if(netenabled & NET_ENABLEV6)
|
||||
{
|
||||
Com_Printf("Resolving %s (IPv6)\n", sv_master[i]->string);
|
||||
res = NET_StringToAdr(sv_master[i]->string, &adr[i][1], NA_IP6);
|
||||
Com_Printf("Resolving %s (IPv6)\n", vr_master[i]->string);
|
||||
res = NET_StringToAdr(vr_master[i]->string, &adr[i][1], NA_IP6);
|
||||
|
||||
if(res == 2)
|
||||
{
|
||||
|
@ -301,9 +301,9 @@ void SV_MasterHeartbeat(const char *message)
|
|||
}
|
||||
|
||||
if(res)
|
||||
Com_Printf( "%s resolved to %s\n", sv_master[i]->string, NET_AdrToStringwPort(adr[i][1]));
|
||||
Com_Printf( "%s resolved to %s\n", vr_master[i]->string, NET_AdrToStringwPort(adr[i][1]));
|
||||
else
|
||||
Com_Printf( "%s has no IPv6 address.\n", sv_master[i]->string);
|
||||
Com_Printf( "%s has no IPv6 address.\n", vr_master[i]->string);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,7 @@ void SV_MasterHeartbeat(const char *message)
|
|||
}
|
||||
|
||||
|
||||
Com_Printf ("Sending heartbeat to %s\n", sv_master[i]->string );
|
||||
Com_Printf ("Sending heartbeat to %s\n", vr_master[i]->string );
|
||||
|
||||
// this command should be changed if the server info / status format
|
||||
// ever incompatably changes
|
||||
|
|
|
@ -2488,11 +2488,11 @@ static qboolean UI_NetSource_HandleKey(int flags, float *special, int key) {
|
|||
|
||||
if(ui_netSource.integer >= UIAS_GLOBAL1 && ui_netSource.integer <= UIAS_GLOBAL5)
|
||||
{
|
||||
char masterstr[2], cvarname[sizeof("sv_master1")];
|
||||
char masterstr[2], cvarname[sizeof("vr_master1")];
|
||||
|
||||
while(ui_netSource.integer >= UIAS_GLOBAL1 && ui_netSource.integer <= UIAS_GLOBAL5)
|
||||
{
|
||||
Com_sprintf(cvarname, sizeof(cvarname), "sv_master%d", ui_netSource.integer - UIAS_GLOBAL0);
|
||||
Com_sprintf(cvarname, sizeof(cvarname), "vr_master%d", ui_netSource.integer - UIAS_GLOBAL0);
|
||||
trap_Cvar_VariableStringBuffer(cvarname, masterstr, sizeof(masterstr));
|
||||
if(*masterstr)
|
||||
break;
|
||||
|
@ -3223,6 +3223,18 @@ static void UI_Update(const char *name) {
|
|||
trap_Cvar_Set("vr_button_map_RTHUMBLEFT_ALT", ""); // unmapped
|
||||
break;
|
||||
}
|
||||
} else if (Q_stricmp(name, "vr_switchThumbsticks") == 0) {
|
||||
if (val) {
|
||||
trap_Cvar_Set("vr_button_map_A", "+button2"); // Use Item
|
||||
trap_Cvar_Set("vr_button_map_B", "+button3"); // Gesture
|
||||
trap_Cvar_Set("vr_button_map_X", "+moveup"); // Jump
|
||||
trap_Cvar_Set("vr_button_map_Y", "+movedown"); // Crouch
|
||||
} else {
|
||||
trap_Cvar_Set("vr_button_map_A", "+moveup"); // Jump
|
||||
trap_Cvar_Set("vr_button_map_B", "+movedown"); // Crouch
|
||||
trap_Cvar_Set("vr_button_map_X", "+button2"); // Use Item
|
||||
trap_Cvar_Set("vr_button_map_Y", "+button3"); // Gesture
|
||||
}
|
||||
} else if (Q_stricmp(name, "vr_uturn") == 0) {
|
||||
int controlSchema = (int)trap_Cvar_VariableValue( "vr_controlSchema" ) % 3;
|
||||
if (val) {
|
||||
|
|
|
@ -161,14 +161,25 @@ void VR_InitCvars( void )
|
|||
Cvar_Get ("vr_button_map_RTHUMBLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
}
|
||||
|
||||
// Map face buttons based on thumbstick assigned to movement
|
||||
// (cannot move and jump/crouch with same thumb at same time)
|
||||
qboolean switchThumbsticks = Cvar_VariableValue( "vr_switchThumbsticks" ) != 0;
|
||||
if (switchThumbsticks) {
|
||||
Cvar_Get ("vr_button_map_A", "+button2", CVAR_ARCHIVE); // Use Item
|
||||
Cvar_Get ("vr_button_map_B", "+button3", CVAR_ARCHIVE); // Gesture
|
||||
Cvar_Get ("vr_button_map_X", "+moveup", CVAR_ARCHIVE); // Jump
|
||||
Cvar_Get ("vr_button_map_Y", "+movedown", CVAR_ARCHIVE); // Crouch
|
||||
} else {
|
||||
Cvar_Get ("vr_button_map_A", "+moveup", CVAR_ARCHIVE); // Jump
|
||||
Cvar_Get ("vr_button_map_B", "+movedown", CVAR_ARCHIVE); // Crouch
|
||||
Cvar_Get ("vr_button_map_X", "+button2", CVAR_ARCHIVE); // Use Item
|
||||
Cvar_Get ("vr_button_map_Y", "+button3", CVAR_ARCHIVE); // Gesture
|
||||
}
|
||||
|
||||
//Remaining button mapping (buttons not affected by schemas)
|
||||
Cvar_Get ("vr_button_map_A", "+moveup", CVAR_ARCHIVE); // Jump
|
||||
Cvar_Get ("vr_button_map_A_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_B", "+movedown", CVAR_ARCHIVE); // Crouch
|
||||
Cvar_Get ("vr_button_map_B_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_X", "+button2", CVAR_ARCHIVE); // Use Item
|
||||
Cvar_Get ("vr_button_map_X_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_Y", "+button3", CVAR_ARCHIVE); // Gesture
|
||||
Cvar_Get ("vr_button_map_Y_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_SECONDARYTHUMBSTICK", "+scores", CVAR_ARCHIVE); // Scoreboard
|
||||
Cvar_Get ("vr_button_map_SECONDARYTHUMBSTICK_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
package com.drbeef.ioq3quest;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.AssetManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.drbeef.externalhapticsservice.HapticServiceClient;
|
||||
import com.drbeef.externalhapticsservice.HapticsConstants;
|
||||
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
|
@ -24,6 +27,7 @@ import java.io.FileReader;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Vector;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
|
@ -40,7 +44,11 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
|||
|
||||
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
|
||||
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.
|
||||
|
@ -88,26 +106,32 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
|||
}
|
||||
|
||||
public void create() throws IOException {
|
||||
//Make the directories
|
||||
// Prepare base game directory
|
||||
new File("/sdcard/ioquake3Quest/baseq3").mkdirs();
|
||||
new File("/sdcard/ioquake3Quest/missionpack").mkdirs();
|
||||
|
||||
//Copy the command line params file
|
||||
// Copy the command line params file and autoexec
|
||||
copy_asset("/sdcard/ioquake3Quest", "commandline.txt", false);
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "autoexec.cfg", false);
|
||||
copy_asset("/sdcard/ioquake3Quest/missionpack", "autoexec.cfg", false);
|
||||
|
||||
//copy demo
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "pak0.pk3", false);
|
||||
|
||||
//our special pak files
|
||||
// Copy our special pak file and demo
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "pakQ3Q.pk3", true);
|
||||
copy_asset("/sdcard/ioquake3Quest/missionpack", "pakQ3Q.pk3", true);
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "pak0.pk3", false);
|
||||
//Copy Omarlego's excellent replacement background
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "z_custom_background66.pk3", false);
|
||||
// Cleanup incompatible shaders
|
||||
delete_asset("/sdcard/ioquake3Quest/baseq3/glsl");
|
||||
|
||||
//If open arena is installed then copy necessary stuff
|
||||
// If Team Arena is installed then copy necessary stuff
|
||||
if (new File("/sdcard/ioquake3Quest/missionpack").exists()) {
|
||||
copy_asset("/sdcard/ioquake3Quest/missionpack", "autoexec.cfg", false);
|
||||
copy_asset("/sdcard/ioquake3Quest/missionpack", "pakQ3Q.pk3", true);
|
||||
delete_asset("/sdcard/ioquake3Quest/missionpack/glsl");
|
||||
}
|
||||
|
||||
// If Open Arena is installed then copy necessary stuff
|
||||
if (new File("/sdcard/ioquake3Quest/baseoa").exists()) {
|
||||
copy_asset("/sdcard/ioquake3Quest/baseoa", "autoexec_oa.cfg", "autoexec.cfg", false);
|
||||
copy_asset("/sdcard/ioquake3Quest/baseoa", "pakQ3Q.pk3", true);
|
||||
delete_asset("/sdcard/ioquake3Quest/baseoa/glsl");
|
||||
}
|
||||
|
||||
//Read these from a file and pass through
|
||||
|
@ -141,11 +165,15 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
|||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
externalHapticsServiceClient = new HapticServiceClient(this, (state, desc) -> {
|
||||
Log.v(TAG, "ExternalHapticsService is:" + desc);
|
||||
});
|
||||
for (Pair<String, String> serviceDetail : externalHapticsServiceDetails) {
|
||||
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");
|
||||
nativeCreate(this);
|
||||
|
@ -167,6 +195,23 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
|||
}
|
||||
}
|
||||
|
||||
public void delete_asset(String path) {
|
||||
File file = new File(path);
|
||||
delete_asset(file);
|
||||
}
|
||||
|
||||
public void delete_asset(File file) {
|
||||
if (!file.exists()) {
|
||||
return;
|
||||
}
|
||||
if (file.isDirectory()) {
|
||||
for (File nestedFile : file.listFiles()) {
|
||||
delete_asset(nestedFile);
|
||||
}
|
||||
}
|
||||
file.delete();
|
||||
}
|
||||
|
||||
public void _copy_asset(String name_in, String name_out) {
|
||||
AssetManager assets = this.getAssets();
|
||||
|
||||
|
@ -202,39 +247,48 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
|||
|
||||
static {
|
||||
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) {
|
||||
|
||||
if (externalHapticsServiceClient.hasService()) {
|
||||
try {
|
||||
if (!hapticsEnabled)
|
||||
{
|
||||
externalHapticsServiceClient.getHapticsService().hapticEnable();
|
||||
hapticsEnabled = true;
|
||||
return;
|
||||
}
|
||||
boolean areHapticsEnabled = hapticsEnabled;
|
||||
for (HapticServiceClient externalHapticsServiceClient : externalHapticsServiceClients) {
|
||||
|
||||
if (event.compareTo("frame_tick") == 0)
|
||||
{
|
||||
externalHapticsServiceClient.getHapticsService().hapticFrameTick();
|
||||
}
|
||||
if (externalHapticsServiceClient.hasService()) {
|
||||
try {
|
||||
//Enabled all haptics services if required
|
||||
if (!areHapticsEnabled)
|
||||
{
|
||||
externalHapticsServiceClient.getHapticsService().hapticEnable();
|
||||
hapticsEnabled = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
//Use the Doom3Quest haptic patterns for now
|
||||
String app = "Doom3Quest";
|
||||
if (event.contains(":"))
|
||||
{
|
||||
String[] items = event.split(":");
|
||||
app = items[0];
|
||||
event = items[1];
|
||||
if (event.compareTo("frame_tick") == 0)
|
||||
{
|
||||
externalHapticsServiceClient.getHapticsService().hapticFrameTick();
|
||||
}
|
||||
|
||||
//Uses the Doom3Quest and RTCWQuest haptic patterns
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -157,6 +157,7 @@ itemDef {
|
|||
textscale .333
|
||||
forecolor 1 1 1 1
|
||||
visible 1
|
||||
action { uiScript update "vr_switchThumbsticks" }
|
||||
}
|
||||
|
||||
itemDef {
|
||||
|
|
|
@ -279,6 +279,7 @@ itemDef {
|
|||
textscale .25
|
||||
forecolor 1 1 1 1
|
||||
visible 1
|
||||
action { uiScript update "vr_switchThumbsticks" }
|
||||
}
|
||||
|
||||
itemDef {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">ioquake3Quest</string>
|
||||
<string name="app_name">Quake3Quest</string>
|
||||
</resources>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
setlocal
|
||||
|
||||
set BUILD_TYPE=release
|
||||
set VERSION=0.31.4-multiview
|
||||
set VERSION=1.1.2
|
||||
|
||||
@REM Define the following environment variables to sign a release build
|
||||
@REM set KEYSTORE=
|
||||
|
|
Loading…
Reference in a new issue