Merge branch 'main' into contributions

This commit is contained in:
Petr Bartos 2023-03-31 08:43:50 +02:00
commit 822d1ddbba
19 changed files with 115 additions and 75 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.jkxr"
android:versionCode="46"
android:versionName="0.7.6" android:installLocation="auto" >
android:versionCode="47"
android:versionName="0.7.7" android:installLocation="auto" >
<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>

View file

@ -8587,11 +8587,6 @@ Ghoul2 Insert End
else if ( val > 1.0f )
{
val = 1.0f;
CGCam_Shake( 0.1f, 100 );
}
else
{
CGCam_Shake( val * val * 0.3f, 100 );
}
val += Q_flrand(0.0f, 1.0f) * 0.5f;

View file

@ -2364,7 +2364,7 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
VectorMA( handEnt.origin, -3.0f, forward, handEnt.origin );
handEnt.renderfx = RF_DEPTHHACK | RF_VRVIEWMODEL;
handEnt.renderfx = RF_DEPTHHACK | RF_VRNOCULLFACE;
if (cg.snap->ps.powerups[PW_FORCE_PUSH] > cg.time ||
(cg.snap->ps.forcePowersActive & (1<<FP_GRIP)) ||

View file

@ -1323,7 +1323,7 @@ void CG_AddViewWeapon( playerState_t *ps )
AnglesToAxis( angles, gun.axis );
CG_PositionEntityOnTag( &gun, &hand, weapon->handsModel, "tag_weapon");
gun.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON | RF_VRVIEWMODEL;
gun.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON;
//---------
// OK, we are making an assumption here that if we have the phaser that it is always on....
@ -1454,6 +1454,7 @@ void CG_AddViewWeapon( playerState_t *ps )
scale = 1.75f;
}
if ( val < 0.0f )
{
val = 0.0f;
@ -1461,11 +1462,6 @@ void CG_AddViewWeapon( playerState_t *ps )
else if ( val > 1.0f )
{
val = 1.0f;
CGCam_Shake( 0.1f, 100 );
}
else
{
CGCam_Shake( val * val * 0.3f, 100 );
}
val += Q_flrand(0.0f, 1.0f) * 0.5f;

View file

@ -5536,6 +5536,13 @@ extern cvar_t *g_skippingcin;
// execute client events
ClientEvents( ent, oldEventSequence );
//Stun Baton is _always_ firing
if (ent->s.weapon == WP_STUN_BATON)
{
//Use alt-fire to indicate not to make a noise, but do inflict damage
FireWeapon(ent, qtrue);
}
if ( pm.useEvent )
{
//TODO: Use

View file

@ -27,6 +27,9 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "w_local.h"
#include "bg_local.h"
std::map<int, int> damagedEntities;
extern weaponData_t weaponData[WP_NUM_WEAPONS];
//---------------------------------------------------------
void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire )
{
@ -34,7 +37,14 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire )
trace_t tr;
vec3_t mins, maxs, end, start;
G_Sound( ent, G_SoundIndex( "sound/weapons/baton/fire" ));
// If alt_fire is false, then this was triggered by the EV_FIRE_WEAPON event, and we should only make the sound
// and return, if alt_fire is true, then the stun baton is checked every frame in ClientThink_real and shouldn't play
// a sound and should inflict damage
if (!alt_fire)
{
G_Sound(ent, G_SoundIndex("sound/weapons/baton/fire"));
return;
}
vec3_t angs, forward;
if ( BG_UseVRPosition(ent))
@ -61,8 +71,27 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire )
return;
}
//First clear out any entities that can be damaged again
std::map<int, int> copyDamagedEntities = damagedEntities;
for (auto &damagedEntity : copyDamagedEntities)
{
if (damagedEntity.second <= level.time)
{
damagedEntities.erase(damagedEntity.first);
}
}
tr_ent = &g_entities[tr.entityNum];
//Is it too soon to hurt this entity again?
if (damagedEntities.find(tr.entityNum) != damagedEntities.end())
{
return;
}
//We are good to inflict damage, store this entity and the next time we can hurt them
damagedEntities[tr.entityNum] = level.time + weaponData[WP_STUN_BATON].fireTime;
if ( tr_ent && tr_ent->takedamage && tr_ent->client )
{
G_PlayEffect( "stunBaton/flesh_impact", tr.endpos, tr.plane.normal );

View file

@ -76,7 +76,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define RF_FORCE_ENT_ALPHA 0x800000 // override shader alpha settings
#define RF_VRVIEWMODEL 0x1000000 // specifically drawing a VR hand/weapon model
#define RF_VRNOCULLFACE 0x1000000 // specifically drawing a VR hand so back face culling is disabled
// refdef flags
#define RDF_NOWORLDMODEL 1 // used for player configuration screen

View file

@ -810,7 +810,7 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
depthRange = qtrue;
}
if (backEnd.currentEntity->e.renderfx & RF_VRVIEWMODEL) {
if (backEnd.currentEntity->e.renderfx & RF_VRNOCULLFACE) {
isVRViewModel = qtrue;
}
} else {

View file

@ -4808,8 +4808,11 @@ Ghoul2 Insert End
VectorSubtract(vec3_origin, axis[2], hiltEnt.axis[0]);
VectorCopy(axis[1], hiltEnt.axis[1]);
VectorCopy(axis[0], hiltEnt.axis[2]);
VectorMA(hiltEnt.origin, 1.0f, hiltEnt.axis[2], hiltEnt.origin);
VectorMA(hiltEnt.origin, 1.2f, hiltEnt.axis[2], hiltEnt.origin);
VectorCopy(hiltEnt.origin, hiltEnt.oldorigin);
for (auto & axi : hiltEnt.axis)
VectorScale(axi, 0.7f, axi);
cgi_R_AddRefEntityToScene(&hiltEnt);
}
@ -6102,11 +6105,11 @@ Ghoul2 Insert End
VectorSubtract(vec3_origin, axis[2], hiltEnt.axis[0]);
VectorCopy(axis[1], hiltEnt.axis[1]);
VectorCopy(axis[0], hiltEnt.axis[2]);
VectorMA(hiltEnt.origin, 1.0f, hiltEnt.axis[2], hiltEnt.origin);
VectorMA(hiltEnt.origin, 1.2f, hiltEnt.axis[2], hiltEnt.origin);
VectorCopy(hiltEnt.origin, hiltEnt.oldorigin);
for (auto & axi : hiltEnt.axis)
VectorScale(axi, 0.85f, axi);
VectorScale(axi, 0.7f, axi);
cgi_R_AddRefEntityToScene(&hiltEnt);
@ -6153,6 +6156,7 @@ Ghoul2 Insert End
scale = 1.75f;
}
if ( val < 0.0f )
{
val = 0.0f;
@ -6160,11 +6164,6 @@ Ghoul2 Insert End
else if ( val > 1.0f )
{
val = 1.0f;
CGCam_Shake( 0.1f, 100 );
}
else
{
CGCam_Shake( val * val * 0.3f, 100 );
}
val += Q_flrand(0.0f, 1.0f) * 0.5f;

View file

@ -2052,7 +2052,7 @@ wasForceSpeed=isForceSpeed;
VectorMA( handEnt.origin, -3.0f, forward, handEnt.origin );
handEnt.renderfx = RF_DEPTHHACK | RF_VRVIEWMODEL;
handEnt.renderfx = RF_DEPTHHACK | RF_VRNOCULLFACE;
if (cg.snap->ps.powerups[PW_FORCE_PUSH] > cg.time ||
(cg.snap->ps.forcePowersActive & (1<<FP_GRIP)) ||

View file

@ -1230,7 +1230,7 @@ void CG_AddViewWeapon( playerState_t *ps )
AnglesToAxis( angles, gun.axis );
CG_PositionEntityOnTag( &gun, &hand, weapon->handsModel, "tag_weapon");
gun.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON | RF_VRVIEWMODEL;
gun.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON ;
//---------
@ -1343,6 +1343,7 @@ void CG_AddViewWeapon( playerState_t *ps )
scale = 1.75f;
}
if ( val < 0.0f )
{
val = 0.0f;
@ -1350,11 +1351,6 @@ void CG_AddViewWeapon( playerState_t *ps )
else if ( val > 1.0f )
{
val = 1.0f;
CGCam_Shake( 0.1f, 100 );
}
else
{
CGCam_Shake( val * val * 0.3f, 100 );
}
val += Q_flrand(0.0f, 1.0f) * 0.5f;

View file

@ -2931,6 +2931,13 @@ extern cvar_t *g_skippingcin;
// execute client events
ClientEvents( ent, oldEventSequence );
//Stun Baton is _always_ firing
if (ent->s.weapon == WP_STUN_BATON)
{
//Use alt-fire to indicate not to make a noise, but do inflict damage
FireWeapon(ent, qtrue);
}
if ( pm.useEvent )
{
//TODO: Use

View file

@ -29,6 +29,9 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_functions.h"
#include "bg_local.h"
std::map<int, int> damagedEntities;
extern weaponData_t weaponData[WP_NUM_WEAPONS];
//---------------------------------------------------------
void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire )
{
@ -36,7 +39,14 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire )
trace_t tr;
vec3_t mins, maxs, end, start;
G_Sound( ent, G_SoundIndex( "sound/weapons/baton/fire" ));
// If alt_fire is false, then this was triggered by the EV_FIRE_WEAPON event, and we should only make the sound
// and return, if alt_fire is true, then the stun baton is checked every frame in ClientThink_real and shouldn't play
// a sound and should inflict damage
if (!alt_fire)
{
G_Sound(ent, G_SoundIndex("sound/weapons/baton/fire"));
return;
}
vec3_t angs, forward;
if ( BG_UseVRPosition(ent))
@ -63,8 +73,27 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire )
return;
}
//First clear out any entities that can be damaged again
std::map<int, int> copyDamagedEntities = damagedEntities;
for (auto &damagedEntity : copyDamagedEntities)
{
if (damagedEntity.second <= level.time)
{
damagedEntities.erase(damagedEntity.first);
}
}
tr_ent = &g_entities[tr.entityNum];
//Is it too soon to hurt this entity again?
if (damagedEntities.find(tr.entityNum) != damagedEntities.end())
{
return;
}
//We are good to inflict damage, store this entity and the next time we can hurt them
damagedEntities[tr.entityNum] = level.time + weaponData[WP_STUN_BATON].fireTime;
if ( tr_ent && tr_ent->takedamage && tr_ent->client )
{
G_PlayEffect( "stunBaton/flesh_impact", tr.endpos, tr.plane.normal );

Binary file not shown.

View file

@ -1,6 +1,24 @@
The following excellent mods were included in the apk:
=============================================================================================================================
TITLE: Vince Crusty and Elin's VR Fully Modeled Weapons Pack
AUTHORS: Elin and Vince Crusty
FILE NAME: z_Crusty_and_Elin_vr_weapons.pk3
FILE SIZE: 1.0 MB
DATE RELEASED: 21 MAR 2023
DESCRIPTION: This mod replaces all the Jedi Outcast weapons with fully modeled weapons for use in VR
THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS.
=============================================================================================================================
Author:
Grab
@ -20,38 +38,3 @@ Copyright:
Grab
=============================================================================================================================
TITLE: KYLE'S LIGHTSABER HILT HD
AUTHORS: CPT. BROSKI / PUNISHER
FILE NAME: kyle's_lightsaber_hilt_hd.pk3
FILE SIZE: 1.6 MB
DATE RELEASED: 21 JULY 2021
DESCRIPTION: This mod replaces Kyle's original lightsaber with a new model.
The model is based entirely on the in-game model, but it uses better shaders to shine.
INSTALL: Put the hilt_lightsaber_kyle's_hd.pk3 to your Jedi Outcast\GameData\base folder.
UNINSTALL: Remove the hilt_lightsaber_kyle's_hd.pk3 from your Jedi Outcast\GameData\base folder.
BUGS: none
THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS.
=============================================================================================================================
TITLE: Vince Crusty and Elin's VR Fully Modeled Weapons Pack
AUTHORS: Elin and Vince Crusty
FILE NAME: z_Crusty_and_Elin_vr_weapons.pk3
FILE SIZE: 1.0 MB
DATE RELEASED: 21 MAR 2023
DESCRIPTION: This mod replaces all the Jedi Outcast weapons with fully modeled weapons for use in VR
THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS.

Binary file not shown.

View file

@ -242,16 +242,15 @@ import java.util.Vector;
if (!new File("/sdcard/JKXR/JK2/base/no_copy").exists()) {
copy_asset("/sdcard/JKXR/JK2/base", "packaged_mods_credits.txt", false);
copy_asset("/sdcard/JKXR/JK2/base", "GGDynamicWeapons.pk3", false);
copy_asset("/sdcard/JKXR/JK2/base", "Kyle's_lightsaber_hilt_hd.pk3", false);
//Weapon Models
copy_asset("/sdcard/JKXR/JK2/base", "z_Crusty_and_Elin_vr_weapons.pk3", false);
copy_asset("/sdcard/JKXR/JK2/base", "z_Crusty_and_Elin_vr_weapons.pk3", true);
}
//Bunch of cool mods and their credits - only copy if user wants them
if (!new File("/sdcard/JKXR/JK3/base/no_copy").exists()) {
//Weapon Models
copy_asset("/sdcard/JKXR/JK3/base", "z_Crusty_and_Elin_vr_weapons.pk3", false);
copy_asset("/sdcard/JKXR/JK3/base", "z_Crusty_and_Elin_vr_weapons_JKAcademy.pk3", true);
}
//Copy mods to the demo folder if demo assets exist, since the demo doesn't seem to be able to load mods from base
@ -261,15 +260,15 @@ import java.util.Vector;
copy_asset("/sdcard/JKXR/JK2/jk2demo", "weapons_vr_jo.cfg", true);
//Our assets
copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_vr_assets.pk3", true);
copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_vr_assets_base.pk3", true);
copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_vr_assets_jko.pk3", true);
//Bunch of cool mods and their credits - only copy if user wants them
copy_asset("/sdcard/JKXR/JK2/jk2demo", "packaged_mods_credits.txt", false);
copy_asset("/sdcard/JKXR/JK2/jk2demo", "GGDynamicWeapons.pk3", false);
copy_asset("/sdcard/JKXR/JK2/jk2demo", "Kyle's_lightsaber_hilt_hd.pk3", false);
//Weapon Models
copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_Crusty_and_Elin_vr_weapons.pk3", false);
copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_Crusty_and_Elin_vr_weapons.pk3", true);
}
//Read these from a file and pass through

View file

@ -261,7 +261,7 @@
name none
type ITEM_TYPE_TEXT
rect 0 455 640 40
text "JKXR: https://www.quakevr.com/jkxr"
text "Join our Patreon: patreon.com/teambeef"
font 2
forecolor 1 0 0 1
textscale 1.0