Some small changes

- draw selection beam on weapon selector
- Change direction weapons, weakest start at the bottom (with gauntlet) and then increase clockwise
- small change to menu footer text
- Increased size of Quake III Arena logo on main screen
- Build batch file will create vr_version.h to include in the menu
This commit is contained in:
Simon 2022-03-11 19:16:44 +00:00
parent 217a6fa2b7
commit fdbc101841
8 changed files with 54 additions and 28 deletions

1
.gitignore vendored
View file

@ -55,3 +55,4 @@ Release/
.project
local.properties
drbeef-release-key.keystore
android/app/src/main/cpp/code/vr/vr_version.h

View file

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.ioq3quest"
android:installLocation="preferExternal"
android:versionCode="29"
android:versionName="0.21.0">
android:versionCode="30"
android:versionName="0.21.1">
<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"/>-->

View file

@ -2777,7 +2777,7 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
VectorCopy( cg.refdef.vieworg, baseOrg );
float heightOffset = 0.0f;
float worldscale = trap_Cvar_VariableValue("vr_worldscale");
float worldscale = cg.worldscale;
if ( cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_FOLLOW && vr->follow_mode == VRFM_THIRDPERSON))
{
worldscale *= SPECTATOR_WORLDSCALE_MULTIPLIER;

View file

@ -479,6 +479,8 @@ typedef struct {
qboolean thisFrameTeleport;
qboolean nextFrameTeleport;
float worldscale;
int frametime; // cg.time - cg.oldTime
int time; // this is the time value that the client
@ -1414,7 +1416,7 @@ void CG_AddViewWeapon (playerState_t *ps);
void CG_DrawHolsteredWeapons( void );
void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent, int team );
void CG_DrawWeaponSelect( void );
void CG_LaserSight( vec3_t start, vec3_t end, byte colour[4] );
void CG_LaserSight( vec3_t start, vec3_t end, byte colour[4], float width );
void CG_OutOfAmmoChange( void ); // should this be in pmove?

View file

@ -757,7 +757,7 @@ static int CG_CalcViewValues( stereoFrame_t stereoView ) {
colour[2] = 0x00;
colour[3] = 0x40;
CG_LaserSight(weaponorigin, trace.endpos, colour);
CG_LaserSight(weaponorigin, trace.endpos, colour, 1.0f);
}
{
@ -788,7 +788,7 @@ static int CG_CalcViewValues( stereoFrame_t stereoView ) {
colour[2] = 0x00;
colour[3] = 0x40;
CG_LaserSight(cg.refdef.vieworg, trace2.endpos, colour);
CG_LaserSight(cg.refdef.vieworg, trace2.endpos, colour, 1.0f);
}
//convert to real-world angles - should be very close to real weapon angles
@ -931,6 +931,8 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo
cg.time = serverTime;
cg.demoPlayback = demoPlayback;
cg.worldscale = trap_Cvar_VariableValue("vr_worldscale");
// update cvars
CG_UpdateCvars();

View file

@ -249,9 +249,8 @@ void CG_ConvertFromVR(vec3_t in, vec3_t offset, vec3_t out)
vrSpace[0] = -r[0];
vrSpace[1] = -r[1];
float worldscale = trap_Cvar_VariableValue("vr_worldscale");
vec3_t temp;
VectorScale(vrSpace, worldscale, temp);
VectorScale(vrSpace, cg.worldscale, temp);
if (offset) {
VectorAdd(temp, offset, out);
@ -262,8 +261,6 @@ void CG_ConvertFromVR(vec3_t in, vec3_t offset, vec3_t out)
static void CG_CalculateVRPositionInWorld( vec3_t in_position, vec3_t in_offset, vec3_t in_orientation, vec3_t origin, vec3_t angles )
{
float worldscale = trap_Cvar_VariableValue("vr_worldscale");
if (!cgs.localServer)
{
//Use absolute position for the faked 6DoF for multiplayer
@ -272,7 +269,7 @@ static void CG_CalculateVRPositionInWorld( vec3_t in_position, vec3_t in_offset
offset[1] = 0; // up/down is index 1 in this case
CG_ConvertFromVR(offset, cg.refdef.vieworg, origin);
origin[2] -= PLAYER_HEIGHT;
origin[2] += in_position[1] * worldscale;
origin[2] += in_position[1] * cg.worldscale;
}
else
{
@ -282,7 +279,7 @@ static void CG_CalculateVRPositionInWorld( vec3_t in_position, vec3_t in_offset
offset[1] = 0; // up/down is index 1 in this case
CG_ConvertFromVR(offset, cg.refdef.vieworg, origin);
origin[2] -= PLAYER_HEIGHT;
origin[2] += in_position[1] * worldscale;
origin[2] += in_position[1] * cg.worldscale;
}
VectorCopy(in_orientation, angles);
@ -504,7 +501,7 @@ static void CG_NailgunEjectBrass( centity_t *cent ) {
CG_LaserSight
==========================
*/
void CG_LaserSight( vec3_t start, vec3_t end, byte colour[4] ) {
void CG_LaserSight( vec3_t start, vec3_t end, byte colour[4], float width ) {
refEntity_t re;
memset( &re, 0, sizeof( re ) );
@ -517,6 +514,9 @@ void CG_LaserSight( vec3_t start, vec3_t end, byte colour[4] ) {
VectorCopy( start, re.origin );
VectorCopy( end, re.oldorigin );
//radius is used to store width info
re.radius = width;
AxisClear( re.axis );
re.shaderRGBA[0] = colour[0];
@ -1736,7 +1736,7 @@ void CG_AddViewWeapon( playerState_t *ps ) {
colour[2] = 0x00;
colour[3] = 0x40;
CG_LaserSight(hand.origin, trace.endpos, colour);
CG_LaserSight(hand.origin, trace.endpos, colour, 1.0f);
}
//Scale / Move gun etc
@ -2055,9 +2055,7 @@ void CG_DrawHolsteredWeapons( void )
VectorCopy(vr->weaponoffset, cg.weaponHolsterOffset);
}
float worldscale = trap_Cvar_VariableValue("vr_worldscale");
float SCALE = 0.04f;
float SCALE = 0.05f;
const float DIST = 5.0f;
const float SEP = 360.0f / (WP_NUM_WEAPONS - 1); // Exclude grappling hook
float frac = (cg.time - cg.weaponHolsterTime) / (25 * DIST);
@ -2067,12 +2065,13 @@ void CG_DrawHolsteredWeapons( void )
CG_CalculateVRWeaponPosition(controllerOrigin, controllerAngles);
VectorSubtract(vr->weaponposition, cg.weaponHolsterOrigin, controllerOffset);
vec3_t holsterAngles, holsterOrigin, holsterForward, holsterRight, holsterUp, dummy;
vec3_t holsterAngles, holsterOrigin, beamOrigin, holsterForward, holsterRight, holsterUp;
CG_CalculateVRPositionInWorld(cg.weaponHolsterOrigin, cg.weaponHolsterOffset, cg.weaponHolsterAngles, holsterOrigin, holsterAngles);
AngleVectors(holsterAngles, holsterForward, holsterRight, holsterUp);
VectorMA(holsterOrigin, (DIST*frac), holsterForward, holsterOrigin);
VectorCopy(holsterOrigin, beamOrigin);
VectorMA(holsterOrigin, ((DIST*2.0f)*frac), holsterForward, holsterOrigin);
VectorCopy(holsterOrigin, selectorOrigin);
float x = ((holsterAngles[YAW] - controllerAngles[YAW]) / 22.5f);
@ -2098,12 +2097,20 @@ void CG_DrawHolsteredWeapons( void )
blob.nonNormalizedAxes = qtrue;
blob.hModel = cgs.media.smallSphereModel;
trap_R_AddRefEntityToScene( &blob );
byte colour[4];
colour[0] = 0x00;
colour[1] = 0x00;
colour[2] = 0xff;
colour[3] = 0x40;
CG_LaserSight(beamOrigin, selectorOrigin, colour, 0.1f);
}
//float startingPositionYaw = AngleNormalize360(holsterAngles[YAW] + (((WP_NUM_WEAPONS-2)/2.0f) * SEP));
qboolean selected = qfalse;
for (int w = WP_NUM_WEAPONS-1; w > 0; --w)
int w = 0;
for (int c = 0; c < WP_NUM_WEAPONS-1; ++c, ++w)
{
if (w == WP_GRAPPLING_HOOK)
{
@ -2118,7 +2125,7 @@ void CG_DrawHolsteredWeapons( void )
VectorClear(angles);
angles[YAW] = holsterAngles[YAW];
angles[PITCH] = holsterAngles[PITCH];
angles[ROLL] = AngleNormalize360(180 - (w * SEP) - 4); // add a few degrees as models aren't central
angles[ROLL] = AngleNormalize360(180 + (w * SEP) - 4); // add a few degrees as models aren't central
vec3_t forward, up;
AngleVectors(angles, forward, NULL, up);

View file

@ -31,6 +31,8 @@ MAIN MENU
#include "ui_local.h"
#include "../vr/vr_version.h"
#define ID_SINGLEPLAYER 10
#define ID_MULTIPLAYER 11
@ -190,7 +192,7 @@ static void Main_MenuDraw( void ) {
origin[0] = 300;
origin[1] = 0;
origin[2] = -32;
origin[2] = -128;
trap_R_ClearScene();
@ -198,9 +200,12 @@ static void Main_MenuDraw( void ) {
memset( &ent, 0, sizeof(ent) );
adjust = 5.0 * sin( (float)uis.realtime / 5000 );
VectorSet( angles, 0, 180 + adjust, 0 );
//adjust = 5.0 * sin( (float)uis.realtime / 4000 );
VectorSet( angles, 5.0 * sin( (float)uis.realtime / 3000 ), 180 + 5.0 * sin( (float)uis.realtime / 4000 ), 0 );
AnglesToAxis( angles, ent.axis );
VectorScale(ent.axis[1], 1.6f, ent.axis[1]);
VectorScale(ent.axis[2], 6.0f, ent.axis[2]);
ent.nonNormalizedAxes = qtrue;
ent.hModel = s_main.bannerModel;
VectorCopy( origin, ent.origin );
VectorCopy( origin, ent.lightingOrigin );
@ -221,11 +226,18 @@ static void Main_MenuDraw( void ) {
Menu_Draw( &s_main.menu );
}
int yPos = 410;
if (uis.demoversion) {
UI_DrawProportionalString( 320, 372, "DEMO FOR MATURE AUDIENCES DEMO", UI_CENTER|UI_SMALLFONT, color );
UI_DrawString( 320, 400, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
UI_DrawProportionalString( 320, 372, "DEMO DEMO DEMO DEMO DEMO DEMO DEMO DEMO DEMO", UI_CENTER|UI_SMALLFONT, color );
UI_DrawString( 320, yPos, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
} else {
UI_DrawString( 320, 450, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
UI_DrawString( 320, yPos, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Quake3Quest " Q3QVERSION " - Visit Quake3Quest.com for discord invite.", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Join our discord for news, leaderboards and community!", UI_CENTER|UI_SMALLFONT, color );
yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Get mods & mappacks via the companion app!", UI_CENTER|UI_SMALLFONT, color );
}
}

View file

@ -5,7 +5,7 @@ setlocal
set BUILD_TYPE=release
set KEYSTORE=
set KEYSTORE_PASS=
set VERSION=0.12.0
set VERSION=0.21.1
set ANDROID_SDK_ROOT=%AppData%\..\Local\Android\Sdk
set adb="%ANDROID_SDK_ROOT%\platform-tools\adb.exe"
@ -26,6 +26,8 @@ if %BUILD_TYPE%==debug (
set GRADLE_BUILD_TYPE=:app:assembleDebug
)
echo #define Q3QVERSION "%VERSION%" > .\android\app\src\main\cpp\code\vr\vr_version.h
pushd %~dp0\..
%make% -j %NUMBER_OF_PROCESSORS% %BUILD_TYPE%