Weapon alignments and save games

This commit is contained in:
Simon 2020-07-19 11:04:54 +01:00
parent e9ba317825
commit 5fab5734fe
10 changed files with 68 additions and 65 deletions

View file

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

View file

@ -1314,7 +1314,6 @@ void RTCWVR_Init()
//Defaults //Defaults
vr_control_scheme = Cvar_Get( "vr_control_scheme", "0", CVAR_ARCHIVE); vr_control_scheme = Cvar_Get( "vr_control_scheme", "0", CVAR_ARCHIVE);
vr_weapon_test_values = Cvar_Get( "vr_weapon_test_values", "0.0,0.0,0.0,0.0,0.0,0.0,0.0", CVAR_ARCHIVE);
//Set up vr client info //Set up vr client info
vr.backpackitemactive = 0; vr.backpackitemactive = 0;

View file

@ -8,4 +8,3 @@ cvar_t *vr_control_scheme;
cvar_t *vr_height_adjust; cvar_t *vr_height_adjust;
cvar_t *vr_weaponscale; cvar_t *vr_weaponscale;
cvar_t *vr_comfort_mask; cvar_t *vr_comfort_mask;
cvar_t *vr_weapon_test_values;

View file

@ -206,12 +206,15 @@ void HandleInput_WeaponAlign( ovrInputStateTrackedRemote *pDominantTrackedRemote
} }
} }
sprintf(vr.test_name, "%s: %.2f", item_names[item_index], *(items[item_index])); Com_sprintf(vr.test_name, sizeof(vr.test_name), "%s: %.2f", item_names[item_index], *(items[item_index]));
char cvar_name[64];
Com_sprintf(cvar_name, sizeof(cvar_name), "vr_weapon_adjustment_%i", vr.weaponid);
char buffer[256]; char buffer[256];
sprintf(buffer, "%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f", vr.test_scale, (vr.test_offset[0] / vr.test_scale), (vr.test_offset[1] / vr.test_scale), (vr.test_offset[2] / vr.test_scale), Com_sprintf(buffer, sizeof(buffer), "%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f", vr.test_scale, (vr.test_offset[0] / vr.test_scale), (vr.test_offset[1] / vr.test_scale), (vr.test_offset[2] / vr.test_scale),
(vr.test_angles[PITCH]), (vr.test_angles[YAW]), (vr.test_angles[ROLL])); (vr.test_angles[PITCH]), (vr.test_angles[YAW]), (vr.test_angles[ROLL]));
Cvar_Set("vr_weapon_test_values", buffer ); Cvar_Set(cvar_name, buffer );
} }

View file

@ -1213,8 +1213,8 @@ gentity_t *weapon_crowbar_throw( gentity_t *ent ) {
return m; return m;
} }
#define OLDEST_READING 7 #define OLDEST_READING 5
#define NEWEST_READING 3 #define NEWEST_READING 2
gentity_t *weapon_grenadelauncher_fire_vr( gentity_t *ent, int grenType ) { gentity_t *weapon_grenadelauncher_fire_vr( gentity_t *ent, int grenType ) {
gentity_t *m, *te; // JPW NERVE gentity_t *m, *te; // JPW NERVE

View file

@ -42,7 +42,7 @@ If you have questions concerning this license or the applicable additional terms
// q_shared.h -- included first by ALL program modules. // q_shared.h -- included first by ALL program modules.
// A user mod should never modify this file // A user mod should never modify this file
#define Q3_VERSION "RTCWQuest 0.14.0 (Wolf 1.41)" #define Q3_VERSION "RTCWQuest 0.15.0 (Wolf 1.41)"
// ver 1.0.0 - release // ver 1.0.0 - release
// ver 1.0.1 - post-release work // ver 1.0.1 - post-release work
// ver 1.1.0 - patch 1 (12/12/01) // ver 1.1.0 - patch 1 (12/12/01)

View file

@ -2008,7 +2008,7 @@ void Com_Init( char *commandLine ) {
Cbuf_AddText( "exec autoexec.cfg\n" ); Cbuf_AddText( "exec autoexec.cfg\n" );
//Execute last to overwrite wepon locations with our desired adjustments //Execute last to overwrite wepon locations with our desired adjustments
Cbuf_AddText( "exec weapons.cfg\n" ); Cbuf_AddText( "exec weapons_hd.cfg\n" );
Cbuf_Execute(); Cbuf_Execute();

View file

@ -3488,6 +3488,36 @@ static int QDECL UI_SavegamesQsortCompare( const void *arg1, const void *arg2 )
} }
} }
static char *monthStr[12] =
{
"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"
};
/*
==============
G_Save_TimeStr
==============
*/
char *UI_Save_TimeStr( void )
{
qtime_t tm;
//
trap_RealTime( &tm );
//
return va( "%i%i%i_%s%i%s%i%s%i",
1900 + tm.tm_year,
tm.tm_mon,
tm.tm_mday,
( tm.tm_hour > 9 ? "" : "0" ), // hour padding
tm.tm_hour, // 24 hour format
( tm.tm_min > 9 ? "" : "0" ), // minute padding
tm.tm_min,
( tm.tm_sec > 9 ? "" : "0" ), // second padding
tm.tm_sec);
}
/* /*
============== ==============
UI_SavegameSort UI_SavegameSort
@ -3511,14 +3541,18 @@ void UI_SavegameSort( int column, qboolean force ) {
UI_FeederSelection( FEEDER_SAVEGAMES, cursel ); UI_FeederSelection( FEEDER_SAVEGAMES, cursel );
Menu_SetFeederSelection( NULL, FEEDER_SAVEGAMES, cursel, NULL ); Menu_SetFeederSelection( NULL, FEEDER_SAVEGAMES, cursel, NULL );
// and clear out the text entry
trap_Cvar_Set( "ui_savegame", "" );
} else { } else {
trap_Cvar_Set( "ui_savegameName", "" ); trap_Cvar_Set( "ui_savegameName", "" );
trap_Cvar_Set( "ui_savegameInfo", "(no savegames)" ); trap_Cvar_Set( "ui_savegameInfo", "(no savegames)" );
} }
static char filename[SAVE_INFOSTRING_LENGTH];
Com_sprintf( filename, sizeof( filename ), "%s",
UI_Save_TimeStr());
// and set default filename using date/time
trap_Cvar_Set( "ui_savegame", filename );
} }
//----(SA) end //----(SA) end
@ -3609,16 +3643,6 @@ static void UI_DelSavegame() {
#define SAVE_INFOSTRING_LENGTH 256 // defined in g_save.c #define SAVE_INFOSTRING_LENGTH 256 // defined in g_save.c
/*
==============
UI_ParseSavegame
==============
*/
static char *monthStr[12] =
{
"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"
};
/* /*
============== ==============

View file

@ -29,48 +29,26 @@
// Weapon offsets - This is the default for the weapon models // Weapon offsets - This is the default for the weapon models
// put the weapon id at the end of the cvar name, so the knife is vr_weapon_adjustment_1 // put the weapon id at the end of the cvar name, so the knife is vr_weapon_adjustment_1
// Values are: scale,right,up,forward,pitch,yaw,roll // Values are: scale,right,up,forward,pitch,yaw,roll
// Default values are: "0.62,-9.8,11.3,-16.1,0.0,0.0,0.0"
// Knife seta vr_weapon_adjustment_20 "0.50,-7.00,10.40,-20.42,0.80,-1.40,0.00"
seta vr_weapon_adjustment_1 "0.58,-5.36,9.07,-10.87,23.20,-10.00,-21.20" seta vr_weapon_adjustment_19 "0.50,-9.12,10.72,-20.60,-2.80,-4.60,0.00"
seta vr_weapon_adjustment_14 "0.54,-10.78,14.78,-19.89,0.00,7.20,-8.00"
// Luger seta vr_weapon_adjustment_8 "0.54,-9.08,8.38,-6.61,0.00,0.00,0.00"
seta vr_weapon_adjustment_2 "0.5,-14,17.0,-20.1,0.0,0.0,0.0" seta vr_weapon_adjustment_5 "0.55,-8.70,5.91,-16.49,0.00,1.40,0.00"
seta vr_weapon_adjustment_4 "0.50,-8.65,8.80,-1.39,-1.20,-1.80,0.00"
// MP40 seta vr_weapon_adjustment_22 "0.49,-11.93,14.43,-21.31,0.00,0.00,0.00"
seta vr_weapon_adjustment_3 "0.6,-13.8,9.5,-14.1,0.0,0.0,0.0" seta vr_weapon_adjustment_13 "0.55,-9.38,7.32,-1.27,0.00,-1.80,0.00"
seta vr_weapon_adjustment_10 "0.54,-8.41,4.83,0.00,0.00,0.00,0.00"
// Grenade Launcher seta vr_weapon_adjustment_9 "0.54,-9.52,4.83,4.39,0.00,0.00,0.00"
seta vr_weapon_adjustment_6 "0.55,-14,18.0,-24.0,0.0,0.0,0.0" seta vr_weapon_adjustment_7 "0.91,-5.53,6.43,1.19,0.00,0.00,0.00"
seta vr_weapon_adjustment_18 "0.50,-8.53,9.52,0.00,-5.20,0.00,0.00"
// Sten seta vr_weapon_adjustment_12 "0.64,-7.66,7.35,-8.82,-3.20,0.00,0.00"
seta vr_weapon_adjustment_6 "0.62,-9.8,10.5,-16.1,-1.0,0.0,0.0" seta vr_weapon_adjustment_11 "0.50,-9.60,10.40,-22.42,0.80,-1.40,0.00"
seta vr_weapon_adjustment_6 "0.54,-10.78,14.78,-19.89,0.00,7.20,-8.00"
// Colt seta vr_weapon_adjustment_3 "0.60,-8.23,5.95,-9.46,-2.00,0.00,0.00"
seta vr_weapon_adjustment_11 "0.5,-14,17.0,-20.1,0.0,0.0,0.0" seta vr_weapon_adjustment_2 "0.50,-8.99,10.81,-21.90,-5.20,-4.20,0.00"
seta vr_weapon_adjustment_1 "0.52,-4.62,8.89,-10.08,24.20,-2.80,-4.80"
// Thompson
seta vr_weapon_adjustment_12 "0.7,-13.8,11.3,-16.1,0.0,0.0,0.0"
// Sten
seta vr_weapon_adjustment_18 "0.52,-13.8,11.3,-16.1,0.0,0.0,0.0"
// Panzer Faust (Rocket Launcher)
seta vr_weapon_adjustment_7 "0.9,-9.0,8.0,-5.0,0.0,0.0,0.0"
// Flame Thrower
seta vr_weapon_adjustment_9 "0.7,-13.8,5.9,-9.0,0.0,0.0,0.0"
// Tesla Coil
seta vr_weapon_adjustment_10 "0.615999,-4.939996,2.919998,1.159999,0.000000,0.000000,0.000000"
// Garand (snooper scope sniper rifle)
seta vr_weapon_adjustment_13 "0.59,-13.8,10.0,-12.0,0.0,0.0,0.0"
// Dynamite
seta vr_weapon_adjustment_22 "0.55,-14,18.0,-24.0,0.0,0.0,0.0"

View file

@ -171,7 +171,7 @@ import static android.system.Os.setenv;
new File("/sdcard/RTCWQuest/Main").mkdirs(); new File("/sdcard/RTCWQuest/Main").mkdirs();
//Copy the weapon adjustment config //Copy the weapon adjustment config
copy_asset("/sdcard/RTCWQuest/Main", "weapons.cfg"); copy_asset("/sdcard/RTCWQuest/Main", "weapons_hd.cfg");
//Read these from a file and pass through //Read these from a file and pass through