use arrays for all the cam cvars
This commit is contained in:
1 parent
4180949307
commit
ab4bbbff72
9 files changed
+256
-395
No files matched your search
+4
-4
@@ -2241,7 +2241,7 @@ void SendWeaponPref(void)
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam.value)
|
||||
if (cv_flipcam[0].value)
|
||||
buf[0] |= 1;
|
||||
if (cv_analog.value)
|
||||
buf[0] |= 2;
|
||||
@@ -2253,7 +2253,7 @@ void SendWeaponPref2(void)
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam2.value)
|
||||
if (cv_flipcam[1].value)
|
||||
buf[0] |= 1;
|
||||
if (cv_analog2.value)
|
||||
buf[0] |= 2;
|
||||
@@ -2265,7 +2265,7 @@ void SendWeaponPref3(void)
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam3.value)
|
||||
if (cv_flipcam[2].value)
|
||||
buf[0] |= 1;
|
||||
if (cv_analog3.value)
|
||||
buf[0] |= 2;
|
||||
@@ -2277,7 +2277,7 @@ void SendWeaponPref4(void)
|
||||
UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam4.value)
|
||||
if (cv_flipcam[3].value)
|
||||
buf[0] |= 1;
|
||||
if (cv_analog4.value)
|
||||
buf[0] |= 2;
|
||||
|
||||
+8
-8
@@ -1498,7 +1498,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||
|
||||
static void Analog_OnChange(void)
|
||||
{
|
||||
if (!cv_cam_dist.string)
|
||||
if (!cv_cam_dist[0].string)
|
||||
return;
|
||||
|
||||
SendWeaponPref();
|
||||
@@ -1506,7 +1506,7 @@ static void Analog_OnChange(void)
|
||||
|
||||
static void Analog2_OnChange(void)
|
||||
{
|
||||
if (!(splitscreen || botingame) || !cv_cam2_dist.string)
|
||||
if (!splitscreen || !cv_cam_dist[1].string)
|
||||
return;
|
||||
|
||||
SendWeaponPref2();
|
||||
@@ -1514,7 +1514,7 @@ static void Analog2_OnChange(void)
|
||||
|
||||
static void Analog3_OnChange(void)
|
||||
{
|
||||
if (splitscreen < 2 || !cv_cam3_dist.string)
|
||||
if (splitscreen < 2 || !cv_cam_dist[2].string)
|
||||
return;
|
||||
|
||||
SendWeaponPref3();
|
||||
@@ -1522,7 +1522,7 @@ static void Analog3_OnChange(void)
|
||||
|
||||
static void Analog4_OnChange(void)
|
||||
{
|
||||
if (splitscreen < 3 || !cv_cam4_dist.string)
|
||||
if (splitscreen < 3 || !cv_cam_dist[3].string)
|
||||
return;
|
||||
|
||||
SendWeaponPref4();
|
||||
@@ -1790,7 +1790,7 @@ boolean G_Responder(event_t *ev)
|
||||
if (!camtoggledelay)
|
||||
{
|
||||
camtoggledelay = NEWTICRATE / 7;
|
||||
CV_SetValue(&cv_chasecam, cv_chasecam.value ? 0 : 1);
|
||||
CV_SetValue(&cv_chasecam[0], cv_chasecam[0].value ? 0 : 1);
|
||||
}
|
||||
}
|
||||
if (ev->data1 == gamecontrolbis[gc_camtoggle][0]
|
||||
@@ -1799,7 +1799,7 @@ boolean G_Responder(event_t *ev)
|
||||
if (!camtoggledelay2)
|
||||
{
|
||||
camtoggledelay2 = NEWTICRATE / 7;
|
||||
CV_SetValue(&cv_chasecam2, cv_chasecam2.value ? 0 : 1);
|
||||
CV_SetValue(&cv_chasecam[1], cv_chasecam[1].value ? 0 : 1);
|
||||
}
|
||||
}
|
||||
if (ev->data1 == gamecontrol3[gc_camtoggle][0]
|
||||
@@ -1808,7 +1808,7 @@ boolean G_Responder(event_t *ev)
|
||||
if (!camtoggledelay3)
|
||||
{
|
||||
camtoggledelay3 = NEWTICRATE / 7;
|
||||
CV_SetValue(&cv_chasecam3, cv_chasecam3.value ? 0 : 1);
|
||||
CV_SetValue(&cv_chasecam[2], cv_chasecam[2].value ? 0 : 1);
|
||||
}
|
||||
}
|
||||
if (ev->data1 == gamecontrol4[gc_camtoggle][0]
|
||||
@@ -1817,7 +1817,7 @@ boolean G_Responder(event_t *ev)
|
||||
if (!camtoggledelay4)
|
||||
{
|
||||
camtoggledelay4 = NEWTICRATE / 7;
|
||||
CV_SetValue(&cv_chasecam4, cv_chasecam4.value ? 0 : 1);
|
||||
CV_SetValue(&cv_chasecam[3], cv_chasecam[3].value ? 0 : 1);
|
||||
}
|
||||
}
|
||||
if (ev->data1 == gamecontrol[gc_spectate][0]
|
||||
|
||||
+24
-24
@@ -1851,52 +1851,52 @@ static menuitem_t OP_Player1CamOptionsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "Player 1 Camera Options", NULL, 0},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam, 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist, 40},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Rotation Speed", &cv_cam_rotspeed, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[0], 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[0], 40},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[0], 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[0], 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Rotation Speed", &cv_cam_rotspeed[0], 70},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam, 85},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[0], 85},
|
||||
};
|
||||
|
||||
static menuitem_t OP_Player2CamOptionsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "Player 2 Camera Options", NULL, 0},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam2, 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam2_dist, 40},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam2_height, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam2_speed, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Rotation Speed", &cv_cam2_rotspeed, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[1], 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[1], 40},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[1], 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[1], 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Rotation Speed", &cv_cam_rotspeed[1], 70},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam2, 85},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[1], 85},
|
||||
};
|
||||
|
||||
static menuitem_t OP_Player3CamOptionsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "Player 3 Camera Options", NULL, 0},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam3, 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam3_dist, 40},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam3_height, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam3_speed, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Rotation Speed", &cv_cam3_rotspeed, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[2], 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[2], 40},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[2], 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[2], 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Rotation Speed", &cv_cam_rotspeed[2], 70},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam3, 85},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[2], 85},
|
||||
};
|
||||
|
||||
static menuitem_t OP_Player4CamOptionsMenu[] =
|
||||
{
|
||||
{IT_HEADER, NULL, "Player 4 Camera Options", NULL, 0},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam4, 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam4_dist, 40},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam4_height, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam4_speed, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Rotation Speed", &cv_cam4_rotspeed, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Flipcam", &cv_flipcam[3], 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Distance", &cv_cam_dist[3], 40},
|
||||
{IT_STRING | IT_CVAR | IT_CV_BIGFLOAT, NULL, "Camera Height", &cv_cam_height[3], 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Speed", &cv_cam_speed[3], 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Camera Rotation Speed", &cv_cam_rotspeed[3], 70},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam4, 85},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third Person Camera", &cv_chasecam[3], 85},
|
||||
};
|
||||
|
||||
static const char* OP_PlayerCamOptionsTooltips[] =
|
||||
|
||||
+32
-108
@@ -2507,123 +2507,47 @@ void T_CameraScanner(elevator_t *elevator)
|
||||
{
|
||||
// leveltime is compared to make multiple scanners in one map function correctly.
|
||||
static tic_t lastleveltime = 32000; // any number other than 0 should do here
|
||||
static boolean camerascanned, camerascanned2, camerascanned3, camerascanned4;
|
||||
static boolean camerascanned[MAXSPLITSCREENPLAYERS];
|
||||
static fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS] = {-42, -42, -42, -42};
|
||||
static fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = {-42, -42, -42, -42};
|
||||
|
||||
if (leveltime != lastleveltime) // Back on the first camera scanner
|
||||
{
|
||||
camerascanned = camerascanned2 = camerascanned3 = camerascanned4 = false;
|
||||
for (UINT8 i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
camerascanned[i] = false;
|
||||
}
|
||||
lastleveltime = leveltime;
|
||||
}
|
||||
|
||||
if (players[displayplayers[0]].mo)
|
||||
for (UINT8 i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (players[displayplayers[0]].mo->subsector->sector == elevator->actionsector)
|
||||
if (players[displayplayers[i]].mo)
|
||||
{
|
||||
if (t_cam_dist == -42)
|
||||
t_cam_dist = cv_cam_dist.value;
|
||||
if (t_cam_height == -42)
|
||||
t_cam_height = cv_cam_height.value;
|
||||
if (t_cam_rotate == -42)
|
||||
t_cam_rotate = cv_cam_rotate.value;
|
||||
CV_SetValue(&cv_cam_height, FixedInt(elevator->sector->floorheight));
|
||||
CV_SetValue(&cv_cam_dist, FixedInt(elevator->sector->ceilingheight));
|
||||
CV_SetValue(&cv_cam_rotate, elevator->distance);
|
||||
camerascanned = true;
|
||||
}
|
||||
else if (!camerascanned)
|
||||
{
|
||||
if (t_cam_height != -42 && cv_cam_height.value != t_cam_height)
|
||||
CV_Set(&cv_cam_height, va("%f", (double)FIXED_TO_FLOAT(t_cam_height)));
|
||||
if (t_cam_dist != -42 && cv_cam_dist.value != t_cam_dist)
|
||||
CV_Set(&cv_cam_dist, va("%f", (double)FIXED_TO_FLOAT(t_cam_dist)));
|
||||
if (t_cam_rotate != -42 && cv_cam_rotate.value != t_cam_rotate)
|
||||
CV_Set(&cv_cam_rotate, va("%f", (double)t_cam_rotate));
|
||||
if (players[displayplayers[i]].mo->subsector->sector == elevator->actionsector)
|
||||
{
|
||||
if (t_cam_dist[i] == -42)
|
||||
t_cam_dist[i] = cv_cam_dist[i].value;
|
||||
if (t_cam_height[i] == -42)
|
||||
t_cam_height[i] = cv_cam_height[i].value;
|
||||
if (t_cam_rotate[i] == -42)
|
||||
t_cam_rotate[i] = cv_cam_rotate[i].value;
|
||||
CV_SetValue(&cv_cam_height[i], FixedInt(elevator->sector->floorheight));
|
||||
CV_SetValue(&cv_cam_dist[i], FixedInt(elevator->sector->ceilingheight));
|
||||
CV_SetValue(&cv_cam_rotate[i], elevator->distance);
|
||||
camerascanned[i] = true;
|
||||
}
|
||||
else if (!camerascanned[i])
|
||||
{
|
||||
if (t_cam_height[i] != -42 && cv_cam_height[i].value != t_cam_height[i])
|
||||
CV_Set(&cv_cam_height[i], va("%f", (double)FIXED_TO_FLOAT(t_cam_height[i])));
|
||||
if (t_cam_dist[i] != -42 && cv_cam_dist[i].value != t_cam_dist[i])
|
||||
CV_Set(&cv_cam_dist[i], va("%f", (double)FIXED_TO_FLOAT(t_cam_dist[i])));
|
||||
if (t_cam_rotate[i] != -42 && cv_cam_rotate[i].value != t_cam_rotate[i])
|
||||
CV_Set(&cv_cam_rotate[i], va("%f", (double)t_cam_rotate[i]));
|
||||
|
||||
t_cam_dist = t_cam_height = t_cam_rotate = -42;
|
||||
}
|
||||
}
|
||||
|
||||
if (splitscreen && players[displayplayers[1]].mo)
|
||||
{
|
||||
if (players[displayplayers[1]].mo->subsector->sector == elevator->actionsector)
|
||||
{
|
||||
if (t_cam2_rotate == -42)
|
||||
t_cam2_dist = cv_cam2_dist.value;
|
||||
if (t_cam2_rotate == -42)
|
||||
t_cam2_height = cv_cam2_height.value;
|
||||
if (t_cam2_rotate == -42)
|
||||
t_cam2_rotate = cv_cam2_rotate.value;
|
||||
CV_SetValue(&cv_cam2_height, FixedInt(elevator->sector->floorheight));
|
||||
CV_SetValue(&cv_cam2_dist, FixedInt(elevator->sector->ceilingheight));
|
||||
CV_SetValue(&cv_cam2_rotate, elevator->distance);
|
||||
camerascanned2 = true;
|
||||
}
|
||||
else if (!camerascanned2)
|
||||
{
|
||||
if (t_cam2_height != -42 && cv_cam2_height.value != t_cam2_height)
|
||||
CV_Set(&cv_cam2_height, va("%f", (double)FIXED_TO_FLOAT(t_cam2_height)));
|
||||
if (t_cam2_dist != -42 && cv_cam2_dist.value != t_cam2_dist)
|
||||
CV_Set(&cv_cam2_dist, va("%f", (double)FIXED_TO_FLOAT(t_cam2_dist)));
|
||||
if (t_cam2_rotate != -42 && cv_cam2_rotate.value != t_cam2_rotate)
|
||||
CV_Set(&cv_cam2_rotate, va("%f", (double)t_cam2_rotate));
|
||||
|
||||
t_cam2_dist = t_cam2_height = t_cam2_rotate = -42;
|
||||
}
|
||||
}
|
||||
|
||||
if (splitscreen > 1 && players[displayplayers[2]].mo)
|
||||
{
|
||||
if (players[displayplayers[2]].mo->subsector->sector == elevator->actionsector)
|
||||
{
|
||||
if (t_cam3_rotate == -42)
|
||||
t_cam3_dist = cv_cam3_dist.value;
|
||||
if (t_cam3_rotate == -42)
|
||||
t_cam3_height = cv_cam3_height.value;
|
||||
if (t_cam3_rotate == -42)
|
||||
t_cam3_rotate = cv_cam3_rotate.value;
|
||||
CV_SetValue(&cv_cam3_height, FixedInt(elevator->sector->floorheight));
|
||||
CV_SetValue(&cv_cam3_dist, FixedInt(elevator->sector->ceilingheight));
|
||||
CV_SetValue(&cv_cam3_rotate, elevator->distance);
|
||||
camerascanned3 = true;
|
||||
}
|
||||
else if (!camerascanned3)
|
||||
{
|
||||
if (t_cam3_height != -42 && cv_cam3_height.value != t_cam3_height)
|
||||
CV_Set(&cv_cam3_height, va("%f", (double)FIXED_TO_FLOAT(t_cam3_height)));
|
||||
if (t_cam3_dist != -42 && cv_cam3_dist.value != t_cam3_dist)
|
||||
CV_Set(&cv_cam3_dist, va("%f", (double)FIXED_TO_FLOAT(t_cam3_dist)));
|
||||
if (t_cam3_rotate != -42 && cv_cam3_rotate.value != t_cam3_rotate)
|
||||
CV_Set(&cv_cam3_rotate, va("%f", (double)t_cam3_rotate));
|
||||
|
||||
t_cam3_dist = t_cam3_height = t_cam3_rotate = -42;
|
||||
}
|
||||
}
|
||||
|
||||
if (splitscreen > 2 && players[displayplayers[3]].mo)
|
||||
{
|
||||
if (players[displayplayers[3]].mo->subsector->sector == elevator->actionsector)
|
||||
{
|
||||
if (t_cam4_rotate == -42)
|
||||
t_cam4_dist = cv_cam4_dist.value;
|
||||
if (t_cam4_rotate == -42)
|
||||
t_cam4_height = cv_cam4_height.value;
|
||||
if (t_cam4_rotate == -42)
|
||||
t_cam4_rotate = cv_cam4_rotate.value;
|
||||
CV_SetValue(&cv_cam4_height, FixedInt(elevator->sector->floorheight));
|
||||
CV_SetValue(&cv_cam4_dist, FixedInt(elevator->sector->ceilingheight));
|
||||
CV_SetValue(&cv_cam4_rotate, elevator->distance);
|
||||
camerascanned4 = true;
|
||||
}
|
||||
else if (!camerascanned4)
|
||||
{
|
||||
if (t_cam4_height != -42 && cv_cam4_height.value != t_cam4_height)
|
||||
CV_Set(&cv_cam4_height, va("%f", (double)FIXED_TO_FLOAT(t_cam4_height)));
|
||||
if (t_cam4_dist != -42 && cv_cam4_dist.value != t_cam4_dist)
|
||||
CV_Set(&cv_cam4_dist, va("%f", (double)FIXED_TO_FLOAT(t_cam4_dist)));
|
||||
if (t_cam4_rotate != -42 && cv_cam4_rotate.value != t_cam4_rotate)
|
||||
CV_Set(&cv_cam4_rotate, va("%f", (double)t_cam4_rotate));
|
||||
|
||||
t_cam4_dist = t_cam4_height = t_cam4_rotate = -42;
|
||||
t_cam_dist[i] = t_cam_height[i] = t_cam_rotate[i] = -42;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-16
@@ -116,7 +116,7 @@ struct demofreecam_s {
|
||||
|
||||
camera_t *cam; // this is useful when the game is paused, notably
|
||||
mobj_t *soundmobj; // mobj to play sound from, used in s_sound
|
||||
|
||||
|
||||
angle_t localangle; // keeps track of the cam angle for cmds
|
||||
angle_t localaiming; // ditto with aiming
|
||||
boolean turnheld; // holding turn button for gradual turn speed
|
||||
@@ -126,17 +126,12 @@ struct demofreecam_s {
|
||||
extern struct demofreecam_s democam;
|
||||
|
||||
extern camera_t camera[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_dist, cv_cam_still, cv_cam_height;
|
||||
extern consvar_t cv_cam_speed, cv_cam_rotate, cv_cam_rotspeed;
|
||||
|
||||
extern consvar_t cv_cam2_dist, cv_cam2_still, cv_cam2_height;
|
||||
extern consvar_t cv_cam2_speed, cv_cam2_rotate, cv_cam2_rotspeed;
|
||||
|
||||
extern consvar_t cv_cam3_dist, cv_cam3_still, cv_cam3_height;
|
||||
extern consvar_t cv_cam3_speed, cv_cam3_rotate, cv_cam3_rotspeed;
|
||||
|
||||
extern consvar_t cv_cam4_dist, cv_cam4_still, cv_cam4_height;
|
||||
extern consvar_t cv_cam4_speed, cv_cam4_rotate, cv_cam4_rotspeed;
|
||||
extern consvar_t cv_cam_dist[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_still[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_height[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_rotate[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_cam_rotspeed[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern consvar_t cv_tilting;
|
||||
extern consvar_t cv_quaketilt;
|
||||
@@ -146,10 +141,7 @@ extern consvar_t cv_actionmovie;
|
||||
|
||||
extern consvar_t cv_lookbackmom;
|
||||
|
||||
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_cam3_dist, t_cam3_height, t_cam3_rotate;
|
||||
extern fixed_t t_cam4_dist, t_cam4_height, t_cam4_rotate;
|
||||
extern fixed_t t_cam_rotate[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
fixed_t P_GetPlayerHeight(player_t *player);
|
||||
fixed_t P_GetPlayerSpinHeight(player_t *player);
|
||||
|
||||
+10
-23
@@ -2466,17 +2466,11 @@ static void P_InitCamera(void)
|
||||
P_SetupCamera(displayplayers[i], &camera[i]);
|
||||
|
||||
// Though, I don't think anyone would care about cam_rotate being reset back to the only value that makes sense :P
|
||||
if (!cv_cam_rotate.changed)
|
||||
CV_Set(&cv_cam_rotate, cv_cam_rotate.defaultvalue);
|
||||
|
||||
if (!cv_cam2_rotate.changed)
|
||||
CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue);
|
||||
|
||||
if (!cv_cam3_rotate.changed)
|
||||
CV_Set(&cv_cam3_rotate, cv_cam3_rotate.defaultvalue);
|
||||
|
||||
if (!cv_cam4_rotate.changed)
|
||||
CV_Set(&cv_cam4_rotate, cv_cam4_rotate.defaultvalue);
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
if (!cv_cam_rotate[i].changed)
|
||||
CV_Set(&cv_cam_rotate[i], cv_cam_rotate[i].defaultvalue);
|
||||
}
|
||||
|
||||
displayplayers[0] = consoleplayer; // Start with your OWN view, please!
|
||||
}
|
||||
@@ -2600,18 +2594,11 @@ boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate)
|
||||
|
||||
if (!dedicated)
|
||||
{
|
||||
if (!cv_chasecam.changed)
|
||||
CV_SetValue(&cv_chasecam, chase);
|
||||
|
||||
// same for second player
|
||||
if (!cv_chasecam2.changed)
|
||||
CV_SetValue(&cv_chasecam2, chase);
|
||||
|
||||
if (!cv_chasecam3.changed)
|
||||
CV_SetValue(&cv_chasecam3, chase);
|
||||
|
||||
if (!cv_chasecam4.changed)
|
||||
CV_SetValue(&cv_chasecam4, chase);
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
if (!cv_chasecam[i].changed)
|
||||
CV_SetValue(&cv_chasecam[i], chase);
|
||||
}
|
||||
}
|
||||
|
||||
// Initial height of PointOfView
|
||||
|
||||
+119
-152
@@ -2976,34 +2976,34 @@ camera_t camera[MAXSPLITSCREENPLAYERS]; // Four cameras, three for splitscreen
|
||||
|
||||
static void CV_CamRotate_OnChange(void)
|
||||
{
|
||||
if (cv_cam_rotate.value < 0)
|
||||
CV_SetValue(&cv_cam_rotate, cv_cam_rotate.value + 360);
|
||||
else if (cv_cam_rotate.value > 359)
|
||||
CV_SetValue(&cv_cam_rotate, cv_cam_rotate.value % 360);
|
||||
if (cv_cam_rotate[0].value < 0)
|
||||
CV_SetValue(&cv_cam_rotate[0], cv_cam_rotate[0].value + 360);
|
||||
else if (cv_cam_rotate[0].value > 359)
|
||||
CV_SetValue(&cv_cam_rotate[0], cv_cam_rotate[0].value % 360);
|
||||
}
|
||||
|
||||
static void CV_CamRotate2_OnChange(void)
|
||||
{
|
||||
if (cv_cam2_rotate.value < 0)
|
||||
CV_SetValue(&cv_cam2_rotate, cv_cam2_rotate.value + 360);
|
||||
else if (cv_cam2_rotate.value > 359)
|
||||
CV_SetValue(&cv_cam2_rotate, cv_cam2_rotate.value % 360);
|
||||
if (cv_cam_rotate[1].value < 0)
|
||||
CV_SetValue(&cv_cam_rotate[1], cv_cam_rotate[1].value + 360);
|
||||
else if (cv_cam_rotate[1].value > 359)
|
||||
CV_SetValue(&cv_cam_rotate[1], cv_cam_rotate[1].value % 360);
|
||||
}
|
||||
|
||||
static void CV_CamRotate3_OnChange(void)
|
||||
{
|
||||
if (cv_cam3_rotate.value < 0)
|
||||
CV_SetValue(&cv_cam3_rotate, cv_cam3_rotate.value + 360);
|
||||
else if (cv_cam3_rotate.value > 359)
|
||||
CV_SetValue(&cv_cam3_rotate, cv_cam3_rotate.value % 360);
|
||||
if (cv_cam_rotate[2].value < 0)
|
||||
CV_SetValue(&cv_cam_rotate[2], cv_cam_rotate[2].value + 360);
|
||||
else if (cv_cam_rotate[2].value > 359)
|
||||
CV_SetValue(&cv_cam_rotate[2], cv_cam_rotate[2].value % 360);
|
||||
}
|
||||
|
||||
static void CV_CamRotate4_OnChange(void)
|
||||
{
|
||||
if (cv_cam4_rotate.value < 0)
|
||||
CV_SetValue(&cv_cam4_rotate, cv_cam4_rotate.value + 360);
|
||||
else if (cv_cam4_rotate.value > 359)
|
||||
CV_SetValue(&cv_cam4_rotate, cv_cam4_rotate.value % 360);
|
||||
if (cv_cam_rotate[3].value < 0)
|
||||
CV_SetValue(&cv_cam_rotate[3], cv_cam_rotate[3].value + 360);
|
||||
else if (cv_cam_rotate[3].value > 359)
|
||||
CV_SetValue(&cv_cam_rotate[3], cv_cam_rotate[3].value % 360);
|
||||
}
|
||||
|
||||
static CV_PossibleValue_t CV_CamSpeed[] = {{0, "MIN"}, {1*FRACUNIT, "MAX"}, {0, NULL}};
|
||||
@@ -3074,33 +3074,47 @@ static void CV_PlayerCam4_OnChange(void)
|
||||
P_ResetCamera(&players[displayplayers[3]], &camera[3]);
|
||||
}
|
||||
|
||||
consvar_t cv_cam_dist = {"cam_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam1_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_height = {"cam_height", "50", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam1_OnChange, 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.4", 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_dist[MAXSPLITSCREENPLAYERS] = {
|
||||
{"cam_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam1_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam2_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam3_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam3_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam4_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam4_OnChange, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_cam2_dist = {"cam2_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam2_height = {"cam2_height", "50", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam2_OnChange, 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.4", 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_cam_height[MAXSPLITSCREENPLAYERS] = {
|
||||
{"cam_height", "50", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam1_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_height", "50", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam2_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam3_height", "50", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam3_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam4_height", "50", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam4_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
};
|
||||
|
||||
consvar_t cv_cam3_dist = {"cam3_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam3_height = {"cam3_height", "50", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam3_still = {"cam3_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam3_speed = {"cam3_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam3_rotate = {"cam3_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam3_rotspeed = {"cam3_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_still[MAXSPLITSCREENPLAYERS] = {
|
||||
{"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam3_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam4_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_cam4_dist = {"cam4_dist", "160", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam4_height = {"cam4_height", "50", CV_FLOAT|CV_SAVE|CV_CALL|CV_NOINIT, NULL, CV_PlayerCam4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam4_still = {"cam4_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam4_speed = {"cam4_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam4_rotate = {"cam4_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam4_rotspeed = {"cam4_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS] = {
|
||||
{"cam_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam3_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam4_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_cam_rotate[MAXSPLITSCREENPLAYERS] = {
|
||||
{"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam3_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate3_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam4_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate4_OnChange, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_cam_rotspeed[MAXSPLITSCREENPLAYERS] = {
|
||||
{"cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam2_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam3_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"cam4_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_tilting = {"tilting", "Off", CV_SAVE|CV_CALL, CV_OnOff, Bird_menu_Onchange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_quaketilt = {"quaketilt", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -3111,18 +3125,7 @@ consvar_t cv_actionmovie = {"actionmovie", "Off", CV_SAVE, CV_OnOff, NULL, 0, NU
|
||||
static CV_PossibleValue_t lookbackmom_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Double"}, {0, NULL}};
|
||||
consvar_t cv_lookbackmom = {"cameralookbackmom", "Off", CV_SAVE, lookbackmom_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
fixed_t t_cam_dist = -42;
|
||||
fixed_t t_cam_height = -42;
|
||||
fixed_t t_cam_rotate = -42;
|
||||
fixed_t t_cam2_dist = -42;
|
||||
fixed_t t_cam2_height = -42;
|
||||
fixed_t t_cam2_rotate = -42;
|
||||
fixed_t t_cam3_dist = -42;
|
||||
fixed_t t_cam3_height = -42;
|
||||
fixed_t t_cam3_rotate = -42;
|
||||
fixed_t t_cam4_dist = -42;
|
||||
fixed_t t_cam4_height = -42;
|
||||
fixed_t t_cam4_rotate = -42;
|
||||
fixed_t t_cam_rotate[MAXSPLITSCREENPLAYERS] = {-42, -42, -42, -42};
|
||||
|
||||
#define MAXCAMERADIST 140*FRACUNIT // Max distance the camera can be in front of the player (2D mode)
|
||||
|
||||
@@ -3388,10 +3391,10 @@ void P_ResetCamera(player_t *player, camera_t *thiscam)
|
||||
thiscam->z = z;
|
||||
thiscam->reset = true;
|
||||
|
||||
if (!(thiscam == &camera[0] && (cv_cam_still.value || cv_analog.value))
|
||||
&& !(thiscam == &camera[1] && (cv_cam2_still.value || cv_analog2.value))
|
||||
&& !(thiscam == &camera[2] && (cv_cam3_still.value || cv_analog3.value))
|
||||
&& !(thiscam == &camera[3] && (cv_cam4_still.value || cv_analog4.value)))
|
||||
if (!(thiscam == &camera[0] && (cv_cam_still[0].value || cv_analog.value))
|
||||
&& !(thiscam == &camera[1] && (cv_cam_still[1].value || cv_analog2.value))
|
||||
&& !(thiscam == &camera[2] && (cv_cam_still[2].value || cv_analog3.value))
|
||||
&& !(thiscam == &camera[3] && (cv_cam_still[3].value || cv_analog4.value)))
|
||||
{
|
||||
thiscam->angle = player->mo->angle;
|
||||
thiscam->aiming = 0;
|
||||
@@ -3410,7 +3413,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||
{
|
||||
static boolean lookbackactive[MAXSPLITSCREENPLAYERS];
|
||||
static UINT8 lookbackdelay[MAXSPLITSCREENPLAYERS];
|
||||
UINT8 num;
|
||||
UINT8 i, num;
|
||||
angle_t angle = 0, focusangle = 0, focusaiming = 0;
|
||||
fixed_t x, y, z, dist, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight;
|
||||
fixed_t pan, xpan, ypan;
|
||||
@@ -3458,42 +3461,40 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||
if (player->spectator) // force cam off for spectators
|
||||
return true;
|
||||
|
||||
if (!cv_chasecam.value && thiscam == &camera[0])
|
||||
return true;
|
||||
|
||||
if (!cv_chasecam2.value && thiscam == &camera[1])
|
||||
return true;
|
||||
|
||||
if (!cv_chasecam3.value && thiscam == &camera[2])
|
||||
return true;
|
||||
|
||||
if (!cv_chasecam4.value && thiscam == &camera[3])
|
||||
return true;
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (!cv_chasecam[i].value && thiscam == &camera[i])
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!thiscam->chase && !resetcalled)
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
focusangle = localangle[0];
|
||||
else if (player == &players[displayplayers[1]])
|
||||
focusangle = localangle[1];
|
||||
else if (player == &players[displayplayers[2]])
|
||||
focusangle = localangle[2];
|
||||
else if (player == &players[displayplayers[3]])
|
||||
focusangle = localangle[3];
|
||||
else
|
||||
focusangle = mo->angle;
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (player == &players[displayplayers[i]])
|
||||
{
|
||||
focusangle = localangle[i];
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
focusangle = mo->angle;
|
||||
}
|
||||
}
|
||||
|
||||
if (thiscam == &camera[0])
|
||||
camrotate = cv_cam_rotate.value;
|
||||
else if (thiscam == &camera[1])
|
||||
camrotate = cv_cam2_rotate.value;
|
||||
else if (thiscam == &camera[2])
|
||||
camrotate = cv_cam3_rotate.value;
|
||||
else if (thiscam == &camera[3])
|
||||
camrotate = cv_cam4_rotate.value;
|
||||
else
|
||||
camrotate = 0;
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (thiscam == &camera[i])
|
||||
{
|
||||
camrotate = cv_cam_rotate[i].value;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
camrotate = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (leveltime < introtime) // Whoooshy camera!
|
||||
{
|
||||
@@ -3519,74 +3520,40 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||
focusangle = mo->angle;
|
||||
focusaiming = 0;
|
||||
}
|
||||
else if (player == &players[consoleplayer])
|
||||
{
|
||||
focusangle = localangle[0];
|
||||
focusaiming = localaiming[0];
|
||||
}
|
||||
else if (player == &players[displayplayers[1]])
|
||||
{
|
||||
focusangle = localangle[1];
|
||||
focusaiming = localaiming[1];
|
||||
}
|
||||
else if (player == &players[displayplayers[2]])
|
||||
{
|
||||
focusangle = localangle[2];
|
||||
focusaiming = localaiming[2];
|
||||
}
|
||||
else if (player == &players[displayplayers[3]])
|
||||
{
|
||||
focusangle = localangle[3];
|
||||
focusaiming = localaiming[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
focusangle = mo->angle;
|
||||
focusaiming = player->aiming;
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
if (player == &players[displayplayers[i]])
|
||||
{
|
||||
focusangle = localangle[i];
|
||||
focusaiming = localaiming[i];
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
focusangle = mo->angle;
|
||||
focusaiming = player->aiming;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (P_CameraThinker(player, thiscam, resetcalled))
|
||||
return true;
|
||||
|
||||
if (thiscam == &camera[1]) // Camera 2
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
{
|
||||
num = 1;
|
||||
camspeed = cv_cam2_speed.value;
|
||||
camstill = cv_cam2_still.value;
|
||||
camrotate = cv_cam2_rotate.value;
|
||||
camdist = FixedMul(cv_cam2_dist.value, mapobjectscale);
|
||||
camheight = FixedMul(cv_cam2_height.value, mapobjectscale);
|
||||
lookback = camspin[1];
|
||||
}
|
||||
else if (thiscam == &camera[2]) // Camera 3
|
||||
{
|
||||
num = 2;
|
||||
camspeed = cv_cam3_speed.value;
|
||||
camstill = cv_cam3_still.value;
|
||||
camrotate = cv_cam3_rotate.value;
|
||||
camdist = FixedMul(cv_cam3_dist.value, mapobjectscale);
|
||||
camheight = FixedMul(cv_cam3_height.value, mapobjectscale);
|
||||
lookback = camspin[2];
|
||||
}
|
||||
else if (thiscam == &camera[3]) // Camera 4
|
||||
{
|
||||
num = 3;
|
||||
camspeed = cv_cam4_speed.value;
|
||||
camstill = cv_cam4_still.value;
|
||||
camrotate = cv_cam4_rotate.value;
|
||||
camdist = FixedMul(cv_cam4_dist.value, mapobjectscale);
|
||||
camheight = FixedMul(cv_cam4_height.value, mapobjectscale);
|
||||
lookback = camspin[3];
|
||||
}
|
||||
else // Camera 1
|
||||
{
|
||||
num = 0;
|
||||
camspeed = cv_cam_speed.value;
|
||||
camstill = cv_cam_still.value;
|
||||
camrotate = cv_cam_rotate.value;
|
||||
camdist = FixedMul(cv_cam_dist.value, mapobjectscale);
|
||||
camheight = FixedMul(cv_cam_height.value, mapobjectscale);
|
||||
lookback = camspin[0];
|
||||
if (thiscam == &camera[i])
|
||||
{
|
||||
num = i;
|
||||
camspeed = cv_cam_speed[i].value;
|
||||
camstill = cv_cam_still[i].value;
|
||||
camrotate = cv_cam_rotate[i].value;
|
||||
camdist = FixedMul(cv_cam_dist[i].value, mapobjectscale);
|
||||
camheight = FixedMul(cv_cam_height[i].value, mapobjectscale);
|
||||
lookback = camspin[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (timeover)
|
||||
@@ -3651,10 +3618,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||
}
|
||||
|
||||
if (!resetcalled && (leveltime > starttime && timeover != 2)
|
||||
&& ((thiscam == &camera[0] && t_cam_rotate != -42)
|
||||
|| (thiscam == &camera[1] && t_cam2_rotate != -42)
|
||||
|| (thiscam == &camera[2] && t_cam3_rotate != -42)
|
||||
|| (thiscam == &camera[3] && t_cam4_rotate != -42)))
|
||||
&& ((thiscam == &camera[0] && t_cam_rotate[0] != -42)
|
||||
|| (thiscam == &camera[1] && t_cam_rotate[1] != -42)
|
||||
|| (thiscam == &camera[2] && t_cam_rotate[2] != -42)
|
||||
|| (thiscam == &camera[3] && t_cam_rotate[3] != -42)))
|
||||
{
|
||||
angle = FixedAngle(camrotate*FRACUNIT);
|
||||
thiscam->angle = angle;
|
||||
|
||||
+49
-58
@@ -168,14 +168,20 @@ void SendWeaponPref4(void);
|
||||
static void Precipstuff_OnChange(void);
|
||||
|
||||
consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_chasecam = {"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_chasecam2 = {"chasecam2", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_chasecam3 = {"chasecam3", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_chasecam4 = {"chasecam4", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_flipcam = {"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_flipcam2 = {"flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_flipcam3 = {"flipcam3", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_flipcam4 = {"flipcam4", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_chasecam[MAXSPLITSCREENPLAYERS] = {
|
||||
{"chasecam", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam2", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam3", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"chasecam4", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_flipcam[MAXSPLITSCREENPLAYERS] = {
|
||||
{"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam2_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam3", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam3_OnChange, 0, NULL, NULL, 0, 0, NULL},
|
||||
{"flipcam4", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam4_OnChange, 0, NULL, NULL, 0, 0, NULL}
|
||||
};
|
||||
|
||||
consvar_t cv_shadow = {"shadow", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_shadowoffs = {"offsetshadows", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -1285,23 +1291,6 @@ void R_SkyboxFrame(player_t *player)
|
||||
R_SetupCommonFrame(player, viewmobj->subsector);
|
||||
}
|
||||
|
||||
static inline UINT8 R_GetCamVar(UINT8 num)
|
||||
{
|
||||
switch (num)
|
||||
{
|
||||
case 0:
|
||||
return cv_chasecam.value;
|
||||
case 1:
|
||||
return cv_chasecam2.value;
|
||||
case 2:
|
||||
return cv_chasecam3.value;
|
||||
case 3:
|
||||
return cv_chasecam4.value;
|
||||
default:
|
||||
return cv_chasecam.value;
|
||||
}
|
||||
}
|
||||
|
||||
void R_SetupFrame(player_t *player, boolean skybox)
|
||||
{
|
||||
camera_t *thiscam;
|
||||
@@ -1312,7 +1301,7 @@ void R_SetupFrame(player_t *player, boolean skybox)
|
||||
if (player == &players[displayplayers[i]])
|
||||
{
|
||||
thiscam = &camera[i];
|
||||
chasecam = R_GetCamVar(i);
|
||||
chasecam = cv_chasecam[i].value;
|
||||
R_SetViewContext(VIEWCONTEXT_PLAYER1 + i);
|
||||
if (thiscam->reset)
|
||||
{
|
||||
@@ -1665,10 +1654,10 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_soniccd);
|
||||
CV_RegisterVar(&cv_allowmlook);
|
||||
CV_RegisterVar(&cv_homremoval);
|
||||
CV_RegisterVar(&cv_flipcam);
|
||||
CV_RegisterVar(&cv_flipcam2);
|
||||
CV_RegisterVar(&cv_flipcam3);
|
||||
CV_RegisterVar(&cv_flipcam4);
|
||||
CV_RegisterVar(&cv_flipcam[0]);
|
||||
CV_RegisterVar(&cv_flipcam[1]);
|
||||
CV_RegisterVar(&cv_flipcam[2]);
|
||||
CV_RegisterVar(&cv_flipcam[3]);
|
||||
|
||||
// Enough for dedicated server
|
||||
if (dedicated)
|
||||
@@ -1681,43 +1670,45 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_mobjscaleprecip);
|
||||
CV_RegisterVar(&cv_fov);
|
||||
|
||||
CV_RegisterVar(&cv_chasecam);
|
||||
CV_RegisterVar(&cv_chasecam2);
|
||||
CV_RegisterVar(&cv_chasecam3);
|
||||
CV_RegisterVar(&cv_chasecam4);
|
||||
CV_RegisterVar(&cv_chasecam[0]);
|
||||
CV_RegisterVar(&cv_chasecam[1]);
|
||||
CV_RegisterVar(&cv_chasecam[2]);
|
||||
CV_RegisterVar(&cv_chasecam[3]);
|
||||
CV_RegisterVar(&cv_shadow);
|
||||
CV_RegisterVar(&cv_shadowoffs);
|
||||
CV_RegisterVar(&cv_skybox);
|
||||
CV_RegisterVar(&cv_ffloorclip);
|
||||
CV_RegisterVar(&cv_spriteclip);
|
||||
|
||||
CV_RegisterVar(&cv_cam_dist);
|
||||
CV_RegisterVar(&cv_cam_still);
|
||||
CV_RegisterVar(&cv_cam_height);
|
||||
CV_RegisterVar(&cv_cam_speed);
|
||||
CV_RegisterVar(&cv_cam_rotate);
|
||||
CV_RegisterVar(&cv_cam_rotspeed);
|
||||
CV_RegisterVar(&cv_cam_dist[0]);
|
||||
CV_RegisterVar(&cv_cam_dist[1]);
|
||||
CV_RegisterVar(&cv_cam_dist[2]);
|
||||
CV_RegisterVar(&cv_cam_dist[3]);
|
||||
|
||||
CV_RegisterVar(&cv_cam2_dist);
|
||||
CV_RegisterVar(&cv_cam2_still);
|
||||
CV_RegisterVar(&cv_cam2_height);
|
||||
CV_RegisterVar(&cv_cam2_speed);
|
||||
CV_RegisterVar(&cv_cam2_rotate);
|
||||
CV_RegisterVar(&cv_cam2_rotspeed);
|
||||
CV_RegisterVar(&cv_cam_still[0]);
|
||||
CV_RegisterVar(&cv_cam_still[1]);
|
||||
CV_RegisterVar(&cv_cam_still[2]);
|
||||
CV_RegisterVar(&cv_cam_still[3]);
|
||||
|
||||
CV_RegisterVar(&cv_cam3_dist);
|
||||
CV_RegisterVar(&cv_cam3_still);
|
||||
CV_RegisterVar(&cv_cam3_height);
|
||||
CV_RegisterVar(&cv_cam3_speed);
|
||||
CV_RegisterVar(&cv_cam3_rotate);
|
||||
CV_RegisterVar(&cv_cam3_rotspeed);
|
||||
CV_RegisterVar(&cv_cam_height[0]);
|
||||
CV_RegisterVar(&cv_cam_height[1]);
|
||||
CV_RegisterVar(&cv_cam_height[2]);
|
||||
CV_RegisterVar(&cv_cam_height[3]);
|
||||
|
||||
CV_RegisterVar(&cv_cam4_dist);
|
||||
CV_RegisterVar(&cv_cam4_still);
|
||||
CV_RegisterVar(&cv_cam4_height);
|
||||
CV_RegisterVar(&cv_cam4_speed);
|
||||
CV_RegisterVar(&cv_cam4_rotate);
|
||||
CV_RegisterVar(&cv_cam4_rotspeed);
|
||||
CV_RegisterVar(&cv_cam_speed[0]);
|
||||
CV_RegisterVar(&cv_cam_speed[1]);
|
||||
CV_RegisterVar(&cv_cam_speed[2]);
|
||||
CV_RegisterVar(&cv_cam_speed[3]);
|
||||
|
||||
CV_RegisterVar(&cv_cam_rotate[0]);
|
||||
CV_RegisterVar(&cv_cam_rotate[1]);
|
||||
CV_RegisterVar(&cv_cam_rotate[2]);
|
||||
CV_RegisterVar(&cv_cam_rotate[3]);
|
||||
|
||||
CV_RegisterVar(&cv_cam_rotspeed[0]);
|
||||
CV_RegisterVar(&cv_cam_rotspeed[1]);
|
||||
CV_RegisterVar(&cv_cam_rotspeed[2]);
|
||||
CV_RegisterVar(&cv_cam_rotspeed[3]);
|
||||
|
||||
CV_RegisterVar(&cv_tilting);
|
||||
CV_RegisterVar(&cv_quaketilt);
|
||||
|
||||
+2
-2
@@ -137,8 +137,8 @@ extern ps_metric_t ps_numpolyobjects;
|
||||
|
||||
extern consvar_t cv_showhud, cv_translucenthud, cv_uncappedhud;
|
||||
extern consvar_t cv_homremoval;
|
||||
extern consvar_t cv_chasecam, cv_chasecam2, cv_chasecam3, cv_chasecam4;
|
||||
extern consvar_t cv_flipcam, cv_flipcam2, cv_flipcam3, cv_flipcam4;
|
||||
extern consvar_t cv_chasecam[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_flipcam[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_shadow, cv_shadowoffs;
|
||||
extern consvar_t cv_ffloorclip, cv_spriteclip;
|
||||
extern consvar_t cv_translucency;
|
||||
|
||||
Reference in new issue
Block a user