Add signpost camera (and fix a typo whoops)
This commit is contained in:
parent
8203c6ae90
commit
3734eab7b6
|
@ -5183,7 +5183,7 @@ void A_SignPlayer(mobj_t *actor)
|
||||||
ov->color = SKINCOLOR_NONE;
|
ov->color = SKINCOLOR_NONE;
|
||||||
P_SetMobjState(ov, actor->info->meleestate); // S_EGGMANSIGN
|
P_SetMobjState(ov, actor->info->meleestate); // S_EGGMANSIGN
|
||||||
if (signcolor)
|
if (signcolor)
|
||||||
acotor->tracer->color = signcolor;
|
actor->tracer->color = signcolor;
|
||||||
else
|
else
|
||||||
actor->tracer->color = signcolor = SKINCOLOR_CARBON;
|
actor->tracer->color = signcolor = SKINCOLOR_CARBON;
|
||||||
actor->tracer->frame = signframe += (15 - Color_Opposite[Color_Opposite[signcolor - 1][0] - 1][1]);
|
actor->tracer->frame = signframe += (15 - Color_Opposite[Color_Opposite[signcolor - 1][0] - 1][1]);
|
||||||
|
|
|
@ -4054,6 +4054,9 @@ void P_SetupSignExit(player_t *player)
|
||||||
if (thing->type != MT_SIGN)
|
if (thing->type != MT_SIGN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (!player->mo->target || player->mo->target->type != MT_SIGN)
|
||||||
|
P_SetTarget(&player->mo->target, thing);
|
||||||
|
|
||||||
if (thing->state != &states[thing->info->spawnstate])
|
if (thing->state != &states[thing->info->spawnstate])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -4080,6 +4083,9 @@ void P_SetupSignExit(player_t *player)
|
||||||
if (thing->type != MT_SIGN)
|
if (thing->type != MT_SIGN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (!player->mo->target || player->mo->target->type != MT_SIGN)
|
||||||
|
P_SetTarget(&player->mo->target, thing);
|
||||||
|
|
||||||
if (thing->state != &states[thing->info->spawnstate])
|
if (thing->state != &states[thing->info->spawnstate])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
52
src/p_user.c
52
src/p_user.c
|
@ -9501,7 +9501,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
fixed_t x, y, z, dist, distxy, distz, checkdist, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight, slopez = 0;
|
fixed_t x, y, z, dist, distxy, distz, checkdist, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight, slopez = 0;
|
||||||
INT32 camrotate;
|
INT32 camrotate;
|
||||||
boolean camstill, cameranoclip, camorbit;
|
boolean camstill, cameranoclip, camorbit;
|
||||||
mobj_t *mo;
|
mobj_t *mo, *sign = NULL;
|
||||||
subsector_t *newsubsec;
|
subsector_t *newsubsec;
|
||||||
fixed_t f1, f2;
|
fixed_t f1, f2;
|
||||||
|
|
||||||
|
@ -9511,6 +9511,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
|
|
||||||
mo = player->mo;
|
mo = player->mo;
|
||||||
|
|
||||||
|
if (player->exiting && mo->target && mo->target->type == MT_SIGN)
|
||||||
|
sign = mo->target;
|
||||||
|
|
||||||
cameranoclip = (player->powers[pw_carry] == CR_NIGHTSMODE || player->pflags & PF_NOCLIP) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!!
|
cameranoclip = (player->powers[pw_carry] == CR_NIGHTSMODE || player->pflags & PF_NOCLIP) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!!
|
||||||
|
|
||||||
if (!(player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || tutorialmode))
|
if (!(player->climbing || (player->powers[pw_carry] == CR_NIGHTSMODE) || player->playerstate == PST_DEAD || tutorialmode))
|
||||||
|
@ -9557,6 +9560,11 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
focusangle = mo->angle;
|
focusangle = mo->angle;
|
||||||
focusaiming = 0;
|
focusaiming = 0;
|
||||||
}
|
}
|
||||||
|
else if (sign)
|
||||||
|
{
|
||||||
|
focusangle = FixedAngle(sign->spawnpoint->angle << FRACBITS) + ANGLE_180;
|
||||||
|
focusaiming = 0;
|
||||||
|
}
|
||||||
else if (player == &players[consoleplayer])
|
else if (player == &players[consoleplayer])
|
||||||
{
|
{
|
||||||
focusangle = localangle;
|
focusangle = localangle;
|
||||||
|
@ -9705,6 +9713,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
camheight = FixedMul(camheight, 6*FRACUNIT/5);
|
camheight = FixedMul(camheight, 6*FRACUNIT/5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sign)
|
||||||
|
{
|
||||||
|
camheight = mo->scale << 7;
|
||||||
|
camspeed = FRACUNIT/12;
|
||||||
|
}
|
||||||
|
|
||||||
if (player->climbing || player->exiting || player->playerstate == PST_DEAD || (player->powers[pw_carry] == CR_ROPEHANG || player->powers[pw_carry] == CR_GENERIC || player->powers[pw_carry] == CR_MACESPIN))
|
if (player->climbing || player->exiting || player->playerstate == PST_DEAD || (player->powers[pw_carry] == CR_ROPEHANG || player->powers[pw_carry] == CR_GENERIC || player->powers[pw_carry] == CR_MACESPIN))
|
||||||
dist <<= 1;
|
dist <<= 1;
|
||||||
}
|
}
|
||||||
|
@ -9751,8 +9765,16 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
distz = slopez;
|
distz = slopez;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = mo->x - FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), distxy);
|
if (sign)
|
||||||
y = mo->y - FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), distxy);
|
{
|
||||||
|
x = sign->x - FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), distxy);
|
||||||
|
y = sign->y - FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), distxy);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = mo->x - FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), distxy);
|
||||||
|
y = mo->y - FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), distxy);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (twodlevel || (mo->flags2 & MF2_TWOD))
|
if (twodlevel || (mo->flags2 & MF2_TWOD))
|
||||||
|
@ -9997,14 +10019,30 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
// point viewed by the camera
|
// point viewed by the camera
|
||||||
// this point is just 64 unit forward the player
|
// this point is just 64 unit forward the player
|
||||||
dist = FixedMul(64 << FRACBITS, mo->scale);
|
dist = FixedMul(64 << FRACBITS, mo->scale);
|
||||||
viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
if (sign)
|
||||||
viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
{
|
||||||
|
viewpointx = sign->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||||
|
viewpointy = sign->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||||
|
viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||||
|
}
|
||||||
|
|
||||||
if (!camstill && !resetcalled && !paused)
|
if (!camstill && !resetcalled && !paused)
|
||||||
thiscam->angle = R_PointToAngle2(thiscam->x, thiscam->y, viewpointx, viewpointy);
|
thiscam->angle = R_PointToAngle2(thiscam->x, thiscam->y, viewpointx, viewpointy);
|
||||||
|
|
||||||
viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
if (sign)
|
||||||
viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
{
|
||||||
|
viewpointx = sign->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||||
|
viewpointy = sign->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||||
|
viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (twodlevel || (mo->flags2 & MF2_TWOD))
|
if (twodlevel || (mo->flags2 & MF2_TWOD))
|
||||||
|
|
Loading…
Reference in New Issue