mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 21:20:54 +00:00
Cvar and menu option to let user increase turn speed
cam_turnmultiplier and cam2_turnmultiplier. "Camera Speed" has been renamed to "Camera Spacial Speed" in the menu. "Camera Turning Speed" is now an option.
This commit is contained in:
parent
2d68eac528
commit
4f9e227830
5 changed files with 18 additions and 10 deletions
13
src/g_game.c
13
src/g_game.c
|
@ -1090,14 +1090,14 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
else
|
||||
{
|
||||
if (turnright)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - angleturn[tspeed]);
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - (FixedMul(angleturn[tspeed]<<FRACBITS, cv_cam_turnmultiplier.value)>>FRACBITS));
|
||||
else if (turnleft)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn + angleturn[tspeed]);
|
||||
cmd->angleturn = (INT16)(cmd->angleturn + (FixedMul(angleturn[tspeed]<<FRACBITS, cv_cam_turnmultiplier.value)>>FRACBITS));
|
||||
|
||||
if (analogjoystickmove && axis != 0)
|
||||
{
|
||||
// JOYAXISRANGE should be 1023 (divide by 1024)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - ((axis * angleturn[1]) >> 10)); // ANALOG!
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - (FixedMul(((axis * angleturn[1]) >> 10)<<FRACBITS, cv_cam_turnmultiplier.value)>>FRACBITS)); // ANALOG!
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1420,14 +1420,14 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics)
|
|||
else
|
||||
{
|
||||
if (turnright)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - angleturn[tspeed]);
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - (FixedMul(angleturn[tspeed]<<FRACBITS, cv_cam2_turnmultiplier.value)>>FRACBITS));
|
||||
else if (turnleft)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn + angleturn[tspeed]);
|
||||
cmd->angleturn = (INT16)(cmd->angleturn + (FixedMul(angleturn[tspeed]<<FRACBITS, cv_cam2_turnmultiplier.value)>>FRACBITS));
|
||||
|
||||
if (analogjoystickmove && axis != 0)
|
||||
{
|
||||
// JOYAXISRANGE should be 1023 (divide by 1024)
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - ((axis * angleturn[1]) >> 10)); // ANALOG!
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - (FixedMul(((axis * angleturn[1]) >> 10)<<FRACBITS, cv_cam2_turnmultiplier.value)>>FRACBITS)); // ANALOG!
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3652,6 +3652,7 @@ void G_LoadGameData(void)
|
|||
{
|
||||
rtemp = READUINT8(save_p);
|
||||
for (j = 0; j < 8 && j+i < MAXUNLOCKABLES; ++j)
|
||||
//unlockables[j+i].unlocked = ((rtemp >> j) & 1);
|
||||
unlockables[j+i].unlocked = ((rtemp >> j) & 1);
|
||||
i += j;
|
||||
}
|
||||
|
|
|
@ -1178,7 +1178,8 @@ static menuitem_t OP_CameraOptionsMenu[] =
|
|||
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_dist, 60},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_height, 70},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Speed", &cv_cam_speed, 80},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam_speed, 80},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Turning Speed", &cv_cam_turnmultiplier, 90},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 100},
|
||||
};
|
||||
|
@ -1192,7 +1193,8 @@ static menuitem_t OP_Camera2OptionsMenu[] =
|
|||
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam2_dist, 60},
|
||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam2_height, 70},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Speed", &cv_cam2_speed, 80},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam2_speed, 80},
|
||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Turning Speed", &cv_cam2_turnmultiplier, 90},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 100},
|
||||
};
|
||||
|
|
|
@ -115,10 +115,10 @@ typedef struct camera_s
|
|||
|
||||
extern camera_t camera, camera2;
|
||||
extern consvar_t cv_cam_dist, cv_cam_still, cv_cam_height;
|
||||
extern consvar_t cv_cam_speed, cv_cam_rotate, cv_cam_rotspeed, cv_cam_orbit, cv_cam_adjust;
|
||||
extern consvar_t cv_cam_speed, cv_cam_rotate, cv_cam_rotspeed, cv_cam_turnmultiplier, cv_cam_orbit, cv_cam_adjust;
|
||||
|
||||
extern consvar_t cv_cam2_dist, cv_cam2_still, cv_cam2_height;
|
||||
extern consvar_t cv_cam2_speed, cv_cam2_rotate, cv_cam2_rotspeed, cv_cam2_orbit, cv_cam2_adjust;
|
||||
extern consvar_t cv_cam2_speed, cv_cam2_rotate, cv_cam2_rotspeed, cv_cam2_turnmultiplier, cv_cam2_orbit, cv_cam2_adjust;
|
||||
|
||||
extern fixed_t t_cam_dist, t_cam_height, t_cam_rotate;
|
||||
extern fixed_t t_cam2_dist, t_cam2_height, t_cam2_rotate;
|
||||
|
|
|
@ -9589,6 +9589,7 @@ static void CV_CamRotate2_OnChange(void)
|
|||
static CV_PossibleValue_t CV_CamSpeed[] = {{0, "MIN"}, {1*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {45, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NULL}};
|
||||
static CV_PossibleValue_t multiplier_cons_t[] = {{0, "MIN"}, {3*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_cam_dist = {"cam_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_height = {"cam_height", "25", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -9596,6 +9597,7 @@ consvar_t cv_cam_still = {"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL,
|
|||
consvar_t cv_cam_speed = {"cam_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_rotate = {"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_turnmultiplier = {"cam_turnmultiplier", "1.0", CV_FLOAT|CV_SAVE, multiplier_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_orbit = {"cam_orbit", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_adjust = {"cam_adjust", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_dist = {"cam2_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
@ -9604,6 +9606,7 @@ consvar_t cv_cam2_still = {"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL
|
|||
consvar_t cv_cam2_speed = {"cam2_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_rotate = {"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_rotspeed = {"cam2_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_turnmultiplier = {"cam2_turnmultiplier", "1.0", CV_FLOAT|CV_SAVE, multiplier_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_orbit = {"cam2_orbit", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_adjust = {"cam2_adjust", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
|
|
@ -1190,6 +1190,7 @@ void R_RegisterEngineStuff(void)
|
|||
CV_RegisterVar(&cv_cam_speed);
|
||||
CV_RegisterVar(&cv_cam_rotate);
|
||||
CV_RegisterVar(&cv_cam_rotspeed);
|
||||
CV_RegisterVar(&cv_cam_turnmultiplier);
|
||||
CV_RegisterVar(&cv_cam_orbit);
|
||||
CV_RegisterVar(&cv_cam_adjust);
|
||||
|
||||
|
@ -1199,6 +1200,7 @@ void R_RegisterEngineStuff(void)
|
|||
CV_RegisterVar(&cv_cam2_speed);
|
||||
CV_RegisterVar(&cv_cam2_rotate);
|
||||
CV_RegisterVar(&cv_cam2_rotspeed);
|
||||
CV_RegisterVar(&cv_cam2_turnmultiplier);
|
||||
CV_RegisterVar(&cv_cam2_orbit);
|
||||
CV_RegisterVar(&cv_cam2_adjust);
|
||||
|
||||
|
|
Loading…
Reference in a new issue