Turn "intangible to camera" sector special into a sector flag

This commit is contained in:
MascaraSnake 2021-12-30 20:37:57 +01:00
parent 7b830fbddf
commit 570a6ab395
10 changed files with 29 additions and 12 deletions

View file

@ -81,6 +81,7 @@ sectorflags
invertprecip = "Invert Precipitation";
gravityflip = "Flip Objects in Reverse Gravity";
heatwave = "Heat Wave";
noclipcamera = "Intangible to the Camera";
}
thingflags

View file

@ -340,7 +340,7 @@ static inline int lib_getenum(lua_State *L)
}
else if (fastncmp("MSF_", word, 3)) {
p = word + 4;
for (i = 0; i < 6; i++)
for (i = 0; i < 7; i++)
if (MSF_LIST[i] && fastcmp(p, MSF_LIST[i])) {
lua_pushinteger(L, ((lua_Integer)1 << i));
return 1;

View file

@ -4472,13 +4472,14 @@ const char *const ML_LIST[16] = {
};
// Sector flags
const char *const MSF_LIST[6] = {
const char *const MSF_LIST[7] = {
"FLIPSPECIAL_FLOOR",
"FLIPSPECIAL_CEILING",
"TRIGGERSPECIAL_TOUCH",
"TRIGGERSPECIAL_HEADBUMP",
"GRAVITYFLIP",
"HEATWAVE",
"NOCLIPCAMERA",
};
const char *COLOR_ENUMS[] = {

View file

@ -65,7 +65,7 @@ extern const char *const MAPTHINGFLAG_LIST[4];
extern const char *const PLAYERFLAG_LIST[];
extern const char *const GAMETYPERULE_LIST[];
extern const char *const ML_LIST[16]; // Linedef flags
extern const char* const MSF_LIST[6]; // Sector flags
extern const char* const MSF_LIST[7]; // Sector flags
extern const char *COLOR_ENUMS[];
extern const char *const POWERS_LIST[];
extern const char *const HUDITEMS_LIST[];

View file

@ -2319,7 +2319,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
mapcampointer = thiscam;
if (GETSECSPECIAL(newsubsec->sector->special, 4) == 12)
if (newsubsec->sector->flags & MSF_NOCLIPCAMERA)
{ // Camera noclip on entire sector.
tmfloorz = tmdropoffz = thiscam->z;
tmceilingz = tmdrpoffceilz = thiscam->z + thiscam->height;
@ -2359,7 +2359,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, x, y, NULL);
@ -2431,7 +2431,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
// We're inside it! Yess...
polysec = po->lines[0]->backsector;
if (GETSECSPECIAL(polysec->special, 4) == 12)
if (polysec->flags & MSF_NOCLIPCAMERA)
{ // Camera noclip polyobj.
plink = (polymaplink_t *)(plink->link.next);
continue;

View file

@ -374,7 +374,7 @@ void P_CameraLineOpening(line_t *linedef)
for (rover = front->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, tmx, tmy, linedef);
@ -398,7 +398,7 @@ void P_CameraLineOpening(line_t *linedef)
for (rover = back->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, tmx, tmy, linedef);

View file

@ -1677,6 +1677,8 @@ static void ParseTextmapSectorParameter(UINT32 i, char *param, char *val)
sectors[i].flags |= MSF_GRAVITYFLIP;
else if (fastcmp(param, "heatwave") && fastcmp("true", val))
sectors[i].flags |= MSF_HEATWAVE;
else if (fastcmp(param, "noclipcamera") && fastcmp("true", val))
sectors[i].flags |= MSF_NOCLIPCAMERA;
else if (fastcmp(param, "friction"))
sectors[i].friction = atol(val);
else if (fastcmp(param, "gravity"))
@ -5017,6 +5019,18 @@ static void P_ConvertBinaryMap(void)
}
}
for (i = 0; i < numsectors; i++)
{
switch(GETSECSPECIAL(sectors[i].special, 4))
{
case 12: //Intangible to the camera
sectors[i].flags |= MSF_NOCLIPCAMERA;
break;
default:
break;
}
}
for (i = 0; i < NUMMOBJTYPES; i++)
{
if (mobjinfo[i].doomednum < 0 || mobjinfo[i].doomednum >= 4096)

View file

@ -5017,7 +5017,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
if (isTouching)
P_ProcessRopeHang(player, sector, sectag);
break;
case 12: // Camera noclip
case 12: // Unused
case 13: // Unused
case 14: // Unused
case 15: // Unused

View file

@ -10057,7 +10057,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
@ -10121,7 +10121,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
// We're inside it! Yess...
polysec = po->lines[0]->backsector;
if (GETSECSPECIAL(polysec->special, 4) == 12)
if (polysec->flags & MSF_NOCLIPCAMERA)
{ // Camera noclip polyobj.
plink = (polymaplink_t *)(plink->link.next);
continue;
@ -10183,7 +10183,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if ((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && GETSECSPECIAL(rover->master->frontsector->special, 4) != 12)
if ((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && !(rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
{
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
bottomheight = P_CameraGetFOFBottomZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);

View file

@ -286,6 +286,7 @@ typedef enum
MSF_INVERTPRECIP = 1<<4,
MSF_GRAVITYFLIP = 1<<5,
MSF_HEATWAVE = 1<<6,
MSF_NOCLIPCAMERA = 1<<7,
} sectorflags_t;