mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-12 22:02:12 +00:00
extrainfo now determines "skybox ID", a number between 0 and 16 to identify the viewpoint or centerpoint
also I made that change skybox linedef exec special I guess (linedef type 448)
This commit is contained in:
parent
6c619af9ce
commit
bdb3c2ea0e
4 changed files with 46 additions and 4 deletions
|
@ -9718,9 +9718,9 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
|||
{
|
||||
case MT_SKYBOX:
|
||||
if (mthing->options & MTF_OBJECTSPECIAL)
|
||||
skyboxmo[1] = mobj;
|
||||
skyboxcenterpnts[mthing->extrainfo] = mobj;
|
||||
else
|
||||
skyboxmo[0] = mobj;
|
||||
skyboxviewpnts[mthing->extrainfo] = mobj;
|
||||
break;
|
||||
case MT_FAN:
|
||||
if (mthing->options & MTF_OBJECTSPECIAL)
|
||||
|
|
|
@ -2728,6 +2728,9 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
for (i = 0; i < 2; i++)
|
||||
skyboxmo[i] = NULL;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
skyboxviewpnts[i] = skyboxcenterpnts[i] = NULL;
|
||||
|
||||
P_MapStart();
|
||||
|
||||
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
||||
|
@ -2737,6 +2740,9 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
#endif
|
||||
|
||||
P_LoadThings();
|
||||
// skybox mobj defaults
|
||||
skyboxmo[0] = skyboxviewpnts[0];
|
||||
skyboxmo[1] = skyboxcenterpnts[0];
|
||||
|
||||
P_SpawnSecretItems(loademblems);
|
||||
|
||||
|
|
36
src/p_spec.c
36
src/p_spec.c
|
@ -46,7 +46,9 @@
|
|||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
mobj_t *skyboxmo[2];
|
||||
mobj_t *skyboxmo[2]; // current skybox mobjs: 0 = viewpoint, 1 = centerpoint
|
||||
mobj_t *skyboxviewpnts[16]; // array of MT_SKYBOX viewpoint mobjs
|
||||
mobj_t *skyboxcenterpnts[16]; // array of MT_SKYBOX centerpoint mobjs
|
||||
|
||||
// Amount (dx, dy) vector linedef is shifted right to get scroll amount
|
||||
#define SCROLL_SHIFT 5
|
||||
|
@ -3159,6 +3161,38 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
}
|
||||
break;
|
||||
|
||||
case 448: // Change skybox viewpoint/centerpoint
|
||||
if ((mo && mo->player && P_IsLocalPlayer(mo->player)) || (line->flags & ML_NOCLIMB))
|
||||
{
|
||||
INT32 viewid = sides[line->sidenum[0]].textureoffset>>FRACBITS;
|
||||
INT32 centerid = sides[line->sidenum[0]].rowoffset>>FRACBITS;
|
||||
|
||||
// set viewpoint mobj
|
||||
if (!(line->flags & ML_EFFECT4))
|
||||
{
|
||||
if (viewid >= 0 && viewid < 16)
|
||||
skyboxmo[0] = skyboxviewpnts[viewid];
|
||||
else
|
||||
skyboxmo[0] = NULL;
|
||||
}
|
||||
|
||||
// set centerpoint mobj
|
||||
if (line->flags & ML_BLOCKMONSTERS)
|
||||
{
|
||||
if (centerid >= 0 && centerid < 16)
|
||||
skyboxmo[1] = skyboxcenterpnts[centerid];
|
||||
else
|
||||
skyboxmo[1] = NULL;
|
||||
}
|
||||
|
||||
CONS_Debug(DBG_GAMELOGIC, "Line type 448 Executor: viewid = %d, centerid = %d, viewpoint? = %s, centerpoint? = %s\n",
|
||||
viewid,
|
||||
centerid,
|
||||
((line->flags & ML_EFFECT4) ? "no" : "yes"),
|
||||
((line->flags & ML_BLOCKMONSTERS) ? "yes" : "no"));
|
||||
}
|
||||
break;
|
||||
|
||||
case 450: // Execute Linedef Executor - for recursion
|
||||
P_LinedefExecute(line->tag, mo, NULL);
|
||||
break;
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
#ifndef __P_SPEC__
|
||||
#define __P_SPEC__
|
||||
|
||||
extern mobj_t *skyboxmo[2];
|
||||
extern mobj_t *skyboxmo[2]; // current skybox mobjs: 0 = viewpoint, 1 = centerpoint
|
||||
extern mobj_t *skyboxviewpnts[16]; // array of MT_SKYBOX viewpoint mobjs
|
||||
extern mobj_t *skyboxcenterpnts[16]; // array of MT_SKYBOX centerpoint mobjs
|
||||
|
||||
// GETSECSPECIAL (specialval, section)
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue