mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Save separate camera settings for standard/simple modes
This commit is contained in:
parent
b46cbe76d6
commit
085c39128f
5 changed files with 69 additions and 23 deletions
31
src/m_menu.c
31
src/m_menu.c
|
@ -1190,8 +1190,8 @@ static menuitem_t OP_CameraOptionsMenu[] =
|
||||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam_adjust, 21},
|
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam_adjust, 21},
|
||||||
|
|
||||||
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_dist, 36},
|
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_savedist[0][0], 36},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_height, 41},
|
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_saveheight[0][0], 41},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam_speed, 46},
|
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam_speed, 46},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam_turnmultiplier, 51},
|
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam_turnmultiplier, 51},
|
||||||
|
|
||||||
|
@ -1208,8 +1208,8 @@ static menuitem_t OP_Camera2OptionsMenu[] =
|
||||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam2_adjust, 21},
|
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam2_adjust, 21},
|
||||||
|
|
||||||
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam2_dist, 36},
|
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_savedist[0][1], 36},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam2_height, 41},
|
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_saveheight[0][1], 41},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam2_speed, 46},
|
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam2_speed, 46},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam2_turnmultiplier, 51},
|
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam2_turnmultiplier, 51},
|
||||||
|
|
||||||
|
@ -1226,8 +1226,8 @@ static menuitem_t OP_CameraExtendedOptionsMenu[] =
|
||||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam_adjust, 21},
|
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam_adjust, 21},
|
||||||
|
|
||||||
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_dist, 36},
|
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_savedist[1][0], 36},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_height, 41},
|
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_saveheight[1][0], 41},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam_speed, 46},
|
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam_speed, 46},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam_turnmultiplier, 51},
|
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam_turnmultiplier, 51},
|
||||||
|
|
||||||
|
@ -1256,8 +1256,8 @@ static menuitem_t OP_Camera2ExtendedOptionsMenu[] =
|
||||||
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam2_adjust, 21},
|
{IT_STRING | IT_CVAR, NULL, "Downhill Slope Adjustment", &cv_cam2_adjust, 21},
|
||||||
|
|
||||||
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
{IT_HEADER, NULL, "Camera Positioning", NULL, 30},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam2_dist, 36},
|
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Distance", &cv_cam_savedist[1][1], 36},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam2_height, 41},
|
{IT_STRING | IT_CVAR | IT_CV_INTEGERSTEP, NULL, "Camera Height", &cv_cam_saveheight[1][1], 41},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam2_speed, 46},
|
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Camera Spacial Speed", &cv_cam2_speed, 46},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam2_turnmultiplier, 51},
|
{IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER, NULL, "Rotation Speed", &cv_cam2_turnmultiplier, 51},
|
||||||
|
|
||||||
|
@ -11664,18 +11664,11 @@ static void M_HandlePlaystyleMenu(INT32 choice)
|
||||||
S_StartSound(NULL, sfx_menu1);
|
S_StartSound(NULL, sfx_menu1);
|
||||||
if (cv_abilitydirection[playstyle_activeplayer].value != (playstyle_currentchoice/2))
|
if (cv_abilitydirection[playstyle_activeplayer].value != (playstyle_currentchoice/2))
|
||||||
{
|
{
|
||||||
if (cv_abilitydirection[playstyle_activeplayer].value)
|
|
||||||
{
|
|
||||||
CV_Set((playstyle_activeplayer ? &cv_cam2_dist : &cv_cam_dist), cv_cam_dist.defaultvalue);
|
|
||||||
CV_Set((playstyle_activeplayer ? &cv_cam2_height : &cv_cam_height), cv_cam_height.defaultvalue);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CV_SetValue((playstyle_activeplayer ? &cv_cam2_dist : &cv_cam_dist), 224);
|
|
||||||
CV_SetValue((playstyle_activeplayer ? &cv_cam2_height : &cv_cam_height), 50);
|
|
||||||
}
|
|
||||||
|
|
||||||
CV_SetValue(&cv_abilitydirection[playstyle_activeplayer], playstyle_currentchoice/2);
|
CV_SetValue(&cv_abilitydirection[playstyle_activeplayer], playstyle_currentchoice/2);
|
||||||
|
if (playstyle_activeplayer)
|
||||||
|
CV_UpdateCam2Dist();
|
||||||
|
else
|
||||||
|
CV_UpdateCamDist();
|
||||||
}
|
}
|
||||||
CV_SetValue((playstyle_activeplayer ? &cv_directionchar2 : &cv_directionchar), playstyle_currentchoice ? 1 : 0);
|
CV_SetValue((playstyle_activeplayer ? &cv_directionchar2 : &cv_directionchar), playstyle_currentchoice ? 1 : 0);
|
||||||
CV_SetValue((playstyle_activeplayer ? &cv_useranalog2 : &cv_useranalog), 0);
|
CV_SetValue((playstyle_activeplayer ? &cv_useranalog2 : &cv_useranalog), 0);
|
||||||
|
|
|
@ -120,6 +120,10 @@ extern consvar_t cv_cam_speed, cv_cam_rotate, cv_cam_rotspeed, cv_cam_turnmultip
|
||||||
extern consvar_t cv_cam2_dist, cv_cam2_still, cv_cam2_height;
|
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_turnmultiplier, 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 consvar_t cv_cam_savedist[2][2], cv_cam_saveheight[2][2];
|
||||||
|
void CV_UpdateCamDist(void);
|
||||||
|
void CV_UpdateCam2Dist(void);
|
||||||
|
|
||||||
extern fixed_t t_cam_dist, t_cam_height, t_cam_rotate;
|
extern fixed_t t_cam_dist, t_cam_height, t_cam_rotate;
|
||||||
extern fixed_t t_cam2_dist, t_cam2_height, t_cam2_rotate;
|
extern fixed_t t_cam2_dist, t_cam2_height, t_cam2_rotate;
|
||||||
|
|
||||||
|
|
|
@ -2692,6 +2692,9 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
/*if (!cv_cam_speed.changed)
|
/*if (!cv_cam_speed.changed)
|
||||||
CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue);*/
|
CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue);*/
|
||||||
|
|
||||||
|
CV_UpdateCamDist();
|
||||||
|
CV_UpdateCam2Dist();
|
||||||
|
|
||||||
if (!cv_chasecam.changed)
|
if (!cv_chasecam.changed)
|
||||||
CV_SetValue(&cv_chasecam, chase);
|
CV_SetValue(&cv_chasecam, chase);
|
||||||
|
|
||||||
|
|
44
src/p_user.c
44
src/p_user.c
|
@ -9729,8 +9729,8 @@ static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {25, "MAX"}, {0, NULL
|
||||||
static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "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}};
|
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_dist = {"cam_curdist", "160", CV_FLOAT, 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};
|
consvar_t cv_cam_height = {"cam_curheight", "25", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_cam_still = {"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_cam_still = {"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, 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_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_rotate = {"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
@ -9738,8 +9738,8 @@ consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NUL
|
||||||
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_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_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_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};
|
consvar_t cv_cam2_dist = {"cam2_curdist", "160", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_cam2_height = {"cam2_height", "25", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_cam2_height = {"cam2_curheight", "25", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_cam2_still = {"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_cam2_still = {"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, 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_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_rotate = {"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
@ -9748,6 +9748,42 @@ consvar_t cv_cam2_turnmultiplier = {"cam2_turnmultiplier", "1.0", CV_FLOAT|CV_SA
|
||||||
consvar_t cv_cam2_orbit = {"cam2_orbit", "Off", CV_SAVE, CV_OnOff, 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};
|
consvar_t cv_cam2_adjust = {"cam2_adjust", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
// [standard vs simple][p1 or p2]
|
||||||
|
consvar_t cv_cam_savedist[2][2] = {
|
||||||
|
{ // standard
|
||||||
|
{"cam_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist, 0, NULL, NULL, 0, 0, NULL},
|
||||||
|
{"cam2_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist, 0, NULL, NULL, 0, 0, NULL}
|
||||||
|
},
|
||||||
|
{ // simple
|
||||||
|
{"cam_simpledist", "224", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist, 0, NULL, NULL, 0, 0, NULL},
|
||||||
|
{"cam2_simpledist", "224", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist, 0, NULL, NULL, 0, 0, NULL}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
consvar_t cv_cam_saveheight[2][2] = {
|
||||||
|
{ // standard
|
||||||
|
{"cam_height", "25", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist, 0, NULL, NULL, 0, 0, NULL},
|
||||||
|
{"cam2_height", "25", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist, 0, NULL, NULL, 0, 0, NULL}
|
||||||
|
},
|
||||||
|
{ // simple
|
||||||
|
{"cam_simpleheight", "48", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCamDist, 0, NULL, NULL, 0, 0, NULL},
|
||||||
|
{"cam2_simpleheight", "48", CV_FLOAT|CV_SAVE|CV_CALL, NULL, CV_UpdateCam2Dist, 0, NULL, NULL, 0, 0, NULL}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void CV_UpdateCamDist(void)
|
||||||
|
{
|
||||||
|
CV_Set(&cv_cam_dist, va("%f", FIXED_TO_FLOAT(cv_cam_savedist[cv_abilitydirection[0].value][0].value)));
|
||||||
|
CV_Set(&cv_cam_height, va("%f", FIXED_TO_FLOAT(cv_cam_saveheight[cv_abilitydirection[0].value][0].value)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CV_UpdateCam2Dist(void)
|
||||||
|
{
|
||||||
|
CV_Set(&cv_cam2_dist, va("%f", FIXED_TO_FLOAT(cv_cam_savedist[cv_abilitydirection[1].value][1].value)));
|
||||||
|
CV_Set(&cv_cam2_height, va("%f", FIXED_TO_FLOAT(cv_cam_saveheight[cv_abilitydirection[1].value][1].value)));
|
||||||
|
}
|
||||||
|
|
||||||
fixed_t t_cam_dist = -42;
|
fixed_t t_cam_dist = -42;
|
||||||
fixed_t t_cam_height = -42;
|
fixed_t t_cam_height = -42;
|
||||||
fixed_t t_cam_rotate = -42;
|
fixed_t t_cam_rotate = -42;
|
||||||
|
|
10
src/r_main.c
10
src/r_main.c
|
@ -1206,6 +1206,16 @@ void R_RegisterEngineStuff(void)
|
||||||
CV_RegisterVar(&cv_cam2_orbit);
|
CV_RegisterVar(&cv_cam2_orbit);
|
||||||
CV_RegisterVar(&cv_cam2_adjust);
|
CV_RegisterVar(&cv_cam2_adjust);
|
||||||
|
|
||||||
|
CV_RegisterVar(&cv_cam_savedist[0][0]);
|
||||||
|
CV_RegisterVar(&cv_cam_savedist[0][1]);
|
||||||
|
CV_RegisterVar(&cv_cam_savedist[1][0]);
|
||||||
|
CV_RegisterVar(&cv_cam_savedist[1][1]);
|
||||||
|
|
||||||
|
CV_RegisterVar(&cv_cam_saveheight[0][0]);
|
||||||
|
CV_RegisterVar(&cv_cam_saveheight[0][1]);
|
||||||
|
CV_RegisterVar(&cv_cam_saveheight[1][0]);
|
||||||
|
CV_RegisterVar(&cv_cam_saveheight[1][1]);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_showhud);
|
CV_RegisterVar(&cv_showhud);
|
||||||
CV_RegisterVar(&cv_translucenthud);
|
CV_RegisterVar(&cv_translucenthud);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue