Weapon Scaling / Keyboard Input

Improved the scaling of the weapons so they look much better
Now made it possible to join multiplayer servers using the keyboard
input
This commit is contained in:
Simon 2019-06-07 23:05:52 +01:00
parent 5baf3c8f3d
commit ebdcff18a9
2 changed files with 32 additions and 10 deletions

View file

@ -75,7 +75,7 @@ cvar_t cl_followmodel_up_highpass1 = {CVAR_SAVE, "cl_followmodel_up_highpass1",
cvar_t cl_followmodel_up_highpass = {CVAR_SAVE, "cl_followmodel_up_highpass", "2", "gun following upward highpass in 1/s"};
cvar_t cl_followmodel_up_lowpass = {CVAR_SAVE, "cl_followmodel_up_lowpass", "10", "gun following upward lowpass in 1/s"};
cvar_t cl_viewmodel_scale = {0, "cl_viewmodel_scale", "0.45", "changes size of gun model, lower values prevent poking into walls but cause strange artifacts on lighting and especially r_stereo/vid_stereobuffer options where the size of the gun becomes visible"};
cvar_t cl_viewmodel_scale = {0, "cl_viewmodel_scale", "0.6", "changes size of gun model, lower values prevent poking into walls but cause strange artifacts on lighting and especially r_stereo/vid_stereobuffer options where the size of the gun becomes visible"};
cvar_t v_kicktime = {0, "v_kicktime", "0.0", "how long a view kick from damage lasts"};
cvar_t v_kickroll = {0, "v_kickroll", "0.0", "how much a view kick from damage rolls your view"};
@ -894,11 +894,31 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa
vieworg[1] - weaponOffset[0] * r_worldscale.value,
vieworg[2] + weaponOffset[1] * r_worldscale.value);
//Custom scaling required
float weaponScale = cl_viewmodel_scale.value;
if (cl.stats[STAT_ACTIVEWEAPON] == IT_ROCKET_LAUNCHER ||
cl.stats[STAT_ACTIVEWEAPON] == IT_AXE)
{
weaponScale = 0.45f;
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_SUPER_SHOTGUN)
{
weaponScale = 1.0f;
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_SUPER_NAILGUN)
{
weaponScale = 0.4f;
}
else if (cl.stats[STAT_ACTIVEWEAPON] == IT_NAILGUN)
{
weaponScale = 0.5f;
}
Matrix4x4_CreateFromQuakeEntity(&viewmodelmatrix_withbob, gunorg[0],
gunorg[1],
gunorg[2],
gunangles[0] - 3.0f,
gunangles[1], 0.0f, cl_viewmodel_scale.value);
gunangles[1], 0.0f, weaponScale);
VectorCopy(vieworg, cl.csqc_vieworiginfromengine);

View file

@ -1465,8 +1465,8 @@ int left_grid = 0;
char left_lower[3][10] = {"bcfihgdae", "klorqpmjn", "tuwzyxvs "};
char left_shift[3][10] = {"BCFIHGDAE", "KLORQPMJN", "TUWZYXVS "};
int right_grid = 0;
char right_lower[2][10] = {"236987415", "+-)]&[(?#"};
char right_shift[2][10] = {"\"*:|.~_/0", "%^}>,<{\\@"};
char right_lower[2][10] = {"236987415", "+-)]&[(?0"};
char right_shift[2][10] = {"\"*:|._~/#", "%^}>,<{\\@"};
char left_grid_map[2][3][3][8] = {
{
@ -1498,10 +1498,10 @@ char left_grid_map[2][3][3][8] = {
char right_grid_map[2][3][2][8] = {
{
{
"1 2 3", "? + -"
"1 2 3", "? + -"
},
{
"4 5 6", "( # )"
"4 5 6", "( 0 )"
},
{
"7 8 9", "[ & ]"
@ -1512,10 +1512,10 @@ char right_grid_map[2][3][2][8] = {
"/ \" *", "\\ % ^"
},
{
"_ 0 :", "{ @ }"
"~ # :", "{ @ }"
},
{
"~ . |", "< , >"
"_ . |", "< , >"
},
}
};
@ -1666,13 +1666,15 @@ static void ovrApp_HandleInput( ovrApp * app )
//Use Left Character
if ((leftTrackedRemoteState_new.Buttons & ovrButton_Trigger) !=
(leftTrackedRemoteState_old.Buttons & ovrButton_Trigger)) {
QC_KeyEvent((leftTrackedRemoteState_new.Buttons & ovrButton_Trigger) > 0 ? 1 : 0, 0, left_char);
QC_KeyEvent((leftTrackedRemoteState_new.Buttons & ovrButton_Trigger) > 0 ? 1 : 0,
left_char, left_char);
}
//Use Right Character
if ((rightTrackedRemoteState_new.Buttons & ovrButton_Trigger) !=
(rightTrackedRemoteState_old.Buttons & ovrButton_Trigger)) {
QC_KeyEvent((rightTrackedRemoteState_new.Buttons & ovrButton_Trigger) > 0 ? 1 : 0, 0, right_char);
QC_KeyEvent((rightTrackedRemoteState_new.Buttons & ovrButton_Trigger) > 0 ? 1 : 0,
right_char, right_char);
}
if (textInput) {