mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-19 07:51:43 +00:00
Allow changing titlemap's cameraref via Line 422 Cut-Away View; change music too
This commit is contained in:
parent
758647fab2
commit
f3be97a95a
3 changed files with 29 additions and 12 deletions
|
@ -1351,6 +1351,8 @@ void F_GameEndTicker(void)
|
||||||
// ==============
|
// ==============
|
||||||
// TITLE SCREEN
|
// TITLE SCREEN
|
||||||
// ==============
|
// ==============
|
||||||
|
mobj_t *titlemapcameraref = NULL;
|
||||||
|
|
||||||
void F_StartTitleScreen(void)
|
void F_StartTitleScreen(void)
|
||||||
{
|
{
|
||||||
if (menumeta[MN_MAIN].musname[0])
|
if (menumeta[MN_MAIN].musname[0])
|
||||||
|
@ -1535,22 +1537,28 @@ void F_TitleScreenTicker(boolean run)
|
||||||
mobj_t *mo2;
|
mobj_t *mo2;
|
||||||
mobj_t *cameraref = NULL;
|
mobj_t *cameraref = NULL;
|
||||||
|
|
||||||
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
// If there's a Line 422 Switch Cut-Away view, don't force us.
|
||||||
|
if (!titlemapcameraref || titlemapcameraref->type != MT_ALTVIEWMAN)
|
||||||
{
|
{
|
||||||
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
for (th = thinkercap.next; th != &thinkercap; th = th->next)
|
||||||
continue;
|
{
|
||||||
|
if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj thinker
|
||||||
|
continue;
|
||||||
|
|
||||||
mo2 = (mobj_t *)th;
|
mo2 = (mobj_t *)th;
|
||||||
|
|
||||||
if (!mo2)
|
if (!mo2)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (mo2->type != MT_ALTVIEWMAN)
|
if (mo2->type != MT_ALTVIEWMAN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cameraref = mo2;
|
cameraref = titlemapcameraref = mo2;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
cameraref = titlemapcameraref;
|
||||||
|
|
||||||
if (cameraref)
|
if (cameraref)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,6 +80,7 @@ typedef enum
|
||||||
} titlemap_enum;
|
} titlemap_enum;
|
||||||
|
|
||||||
extern UINT8 titlemapinaction;
|
extern UINT8 titlemapinaction;
|
||||||
|
extern mobj_t *titlemapcameraref;
|
||||||
|
|
||||||
//
|
//
|
||||||
// WIPE
|
// WIPE
|
||||||
|
|
12
src/p_spec.c
12
src/p_spec.c
|
@ -2591,7 +2591,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
|
|
||||||
case 413: // Change music
|
case 413: // Change music
|
||||||
// console player only unless NOCLIMB is set
|
// console player only unless NOCLIMB is set
|
||||||
if ((line->flags & ML_NOCLIMB) || (mo && mo->player && P_IsLocalPlayer(mo->player)))
|
if ((line->flags & ML_NOCLIMB) || (mo && mo->player && P_IsLocalPlayer(mo->player)) || titlemapinaction)
|
||||||
{
|
{
|
||||||
UINT16 tracknum = (UINT16)sides[line->sidenum[0]].bottomtexture;
|
UINT16 tracknum = (UINT16)sides[line->sidenum[0]].bottomtexture;
|
||||||
|
|
||||||
|
@ -2890,7 +2890,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
{
|
{
|
||||||
mobj_t *altview;
|
mobj_t *altview;
|
||||||
|
|
||||||
if (!mo || !mo->player) // only players have views
|
if ((!mo || !mo->player) && !titlemapinaction) // only players have views, and title screens
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((secnum = P_FindSectorFromLineTag(line, -1)) < 0)
|
if ((secnum = P_FindSectorFromLineTag(line, -1)) < 0)
|
||||||
|
@ -2900,6 +2900,14 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
if (!altview)
|
if (!altview)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// If titlemap, set the camera ref for title's thinker
|
||||||
|
// This is not revoked until overwritten; awayviewtics is ignored
|
||||||
|
if (titlemapinaction)
|
||||||
|
{
|
||||||
|
titlemapcameraref = altview;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
P_SetTarget(&mo->player->awayviewmobj, altview);
|
P_SetTarget(&mo->player->awayviewmobj, altview);
|
||||||
mo->player->awayviewtics = P_AproxDistance(line->dx, line->dy)>>FRACBITS;
|
mo->player->awayviewtics = P_AproxDistance(line->dx, line->dy)>>FRACBITS;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue