- use a flag for outer space textures.

This commit is contained in:
Christoph Oelckers 2022-11-25 17:43:13 +01:00
parent 006f1b3fdf
commit 1b3f551216
12 changed files with 46 additions and 102 deletions

View file

@ -451,7 +451,7 @@ void moveplayers(void)
act->SetHitOwner(act);
if (ud.god == 0)
if (fi.ceilingspace(act->sector()) || fi.floorspace(act->sector()))
if (ceilingspace(act->sector()) || floorspace(act->sector()))
quickkill(p);
}
else
@ -4028,11 +4028,11 @@ void makeitfall(DDukeActor* actor)
{
double grav;
if( fi.floorspace(actor->sector()) )
if( floorspace(actor->sector()) )
grav = 0;
else
{
if( fi.ceilingspace(actor->sector()) || actor->sector()->lotag == ST_2_UNDERWATER)
if( ceilingspace(actor->sector()) || actor->sector()->lotag == ST_2_UNDERWATER)
grav = gs.gravity/6;
else grav = gs.gravity;
}
@ -4269,11 +4269,11 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
double grav;
int sphit = fallspecial? fallspecial(actor, playernum) : 0;
if (fi.floorspace(actor->sector()))
if (floorspace(actor->sector()))
grav = 0;
else
{
if (fi.ceilingspace(actor->sector()) || actor->sector()->lotag == 2)
if (ceilingspace(actor->sector()) || actor->sector()->lotag == 2)
grav = gs.gravity / 6;
else grav = gs.gravity;
}

View file

@ -43,46 +43,6 @@ This file contains parts of DukeGDX by Alexander Makarov-[M210] (m210-2007@mail.
BEGIN_DUKE_NS
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool ceilingspace_d(sectortype* sectp)
{
if (sectp && (sectp->ceilingstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0)
{
switch(sectp->ceilingpicnum)
{
case MOONSKY1:
case BIGORBIT1:
return 1;
}
}
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool floorspace_d(sectortype* sectp)
{
if (sectp && (sectp->floorstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0)
{
switch(sectp->floorpicnum)
{
case MOONSKY1:
case BIGORBIT1:
return 1;
}
}
return 0;
}
//---------------------------------------------------------------------------
//
//
@ -758,10 +718,10 @@ void movefallers_d(void)
}
double grav;
if (fi.floorspace(act->sector())) grav = 0;
if (floorspace(act->sector())) grav = 0;
else
{
if (fi.ceilingspace(act->sector()))
if (ceilingspace(act->sector()))
grav = gs.gravity / 6;
else
grav = gs.gravity;

View file

@ -45,47 +45,6 @@ void resetpins(sectortype* sect);
void resetlanepics(void);
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool ceilingspace_r(sectortype* sectp)
{
if (sectp && (sectp->ceilingstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0)
{
switch(sectp->ceilingpicnum)
{
case MOONSKY1:
case BIGORBIT1:
return 1;
}
}
return 0;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool floorspace_r(sectortype* sectp)
{
if (sectp && (sectp->floorstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0)
{
switch(sectp->floorpicnum)
{
case MOONSKY1:
case BIGORBIT1:
return 1;
}
}
return 0;
}
//---------------------------------------------------------------------------
//
//
@ -625,10 +584,10 @@ void movefallers_r(void)
}
double grav;
if (fi.floorspace(act->sector())) grav = 0;
if (floorspace(act->sector())) grav = 0;
else
{
if (fi.ceilingspace(act->sector()))
if (ceilingspace(act->sector()))
grav = gs.gravity / 6;
else
grav = gs.gravity;

View file

@ -380,6 +380,7 @@ enum
TFLAG_SLIME = 1 << 4,
TFLAG_DOORWALL = 1 << 5,
TFLAG_BLOCKDOOR = 1 << 6,
TFLAG_OUTERSPACE = 1 << 7,
};

View file

@ -54,10 +54,6 @@ void checkhitdefault_r(DDukeActor* i, DDukeActor* sn);
void checksectors_d(int snum);
void checksectors_r(int snum);
bool ceilingspace_d(sectortype*);
bool ceilingspace_r(sectortype*);
bool floorspace_d(sectortype*);
bool floorspace_r(sectortype*);
void addweapon_d(player_struct* p, int weapon, bool wswitch);
void addweapon_r(player_struct* p, int weapon, bool wswitch);
void hitradius_d(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4);
@ -122,8 +118,6 @@ void SetDispatcher()
checksectors_d,
spawninit_d,
ceilingspace_d,
floorspace_d,
addweapon_d,
hitradius_d,
lotsofmoney_d,
@ -164,8 +158,6 @@ void SetDispatcher()
checksectors_r,
spawninit_r,
ceilingspace_r,
floorspace_r,
addweapon_r,
hitradius_r,
lotsoffeathers_r,

View file

@ -86,8 +86,6 @@ struct Dispatcher
void (*checksectors)(int low);
DDukeActor* (*spawninit)(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>* actors);
bool (*ceilingspace)(sectortype* sectp);
bool (*floorspace)(sectortype* sectp);
void (*addweapon)(player_struct *p, int weapon, bool wswitch);
void (*hitradius)(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4);
void (*lotsofmoney)(DDukeActor *s, int n);

View file

@ -21,6 +21,9 @@ void addtorch(sectortype* sect, int shade, int lotag);
void addlightning(sectortype* sect, int shade);
int addambient(int hitag, int lotag);
bool ceilingspace(sectortype* sectp);
bool floorspace(sectortype* sectp);
void movecyclers(void);
void movedummyplayers(void);
void resetlanepics(void);

View file

@ -2507,7 +2507,7 @@ int ParseState::parse(void)
}
break;
case concmd_ifinspace:
parseifelse(fi.ceilingspace(g_ac->sector()));
parseifelse(ceilingspace(g_ac->sector()));
break;
case concmd_spritepal:
@ -2815,7 +2815,7 @@ int ParseState::parse(void)
insptr++;
break;
case concmd_ifinouterspace:
parseifelse( fi.floorspace(g_ac->sector()));
parseifelse( floorspace(g_ac->sector()));
break;
case concmd_ifnotmoving:
parseifelse( g_ac->movflag > kHitSector );

View file

@ -44,6 +44,29 @@ BEGIN_DUKE_NS
static int interptype[] = { Interp_Sect_Floorz, Interp_Sect_Ceilingz, Interp_Wall_X, Interp_Wall_Y };
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool ceilingspace(sectortype* sectp)
{
return (sectp && (sectp->ceilingstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0 && (tileflags(sectp->ceilingpicnum) & TFLAG_OUTERSPACE));
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
bool floorspace(sectortype* sectp)
{
return (sectp && (sectp->floorstat & CSTAT_SECTOR_SKY) && sectp->floorpal == 0 && (tileflags(sectp->floorpicnum) & TFLAG_OUTERSPACE));
}
//---------------------------------------------------------------------------
//
//

View file

@ -8,3 +8,4 @@ define TFLAG_CLEARINVENTORY 8
define TFLAG_SLIME 16
define TFLAG_DOORWALL 32
define TFLAG_BLOCKDOOR 64
define TFLAG_OUTERSPACE 128

View file

@ -187,3 +187,8 @@ tileflag TFLAG_DOORWALL {
DOORTILE22
DOORTILE23
}
tileflag TFLAG_OUTERSPACE {
MOONSKY1
BIGORBIT1
}

View file

@ -1,3 +1,5 @@
include "engine/defines.def"
spawnclasses
{
2430 = RedneckCactusLargeYellow