mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 12:30:40 +00:00
- wall[] in light.cpp and player.cpp
This commit is contained in:
parent
732aa2023b
commit
9c21483279
6 changed files with 24 additions and 47 deletions
|
@ -75,19 +75,6 @@ extern ParentalStruct aVoxelArray[MAXTILES];
|
||||||
// F U N C T I O N S //////////////////////////////////////////////////////////////////////////////
|
// F U N C T I O N S //////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
|
||||||
// SpawnWallSound
|
|
||||||
/////////////////////////////////////////////////////
|
|
||||||
void SpawnWallSound(short sndnum, short i)
|
|
||||||
{
|
|
||||||
vec3_t mid;
|
|
||||||
|
|
||||||
// Get wall midpoint for offset in mirror view
|
|
||||||
mid.vec2 = wall[i].center();
|
|
||||||
mid.z = (sector[wall[i].nextsector].ceilingz + sector[wall[i].nextsector].floorz) / 2;
|
|
||||||
|
|
||||||
PlaySound(sndnum, &mid, v3df_dontpan | v3df_doppler);
|
|
||||||
}
|
|
||||||
|
|
||||||
short
|
short
|
||||||
CheckTileSound(short picnum)
|
CheckTileSound(short picnum)
|
||||||
|
@ -162,7 +149,6 @@ JS_SpriteSetup(void)
|
||||||
{
|
{
|
||||||
SPRITEp sp;
|
SPRITEp sp;
|
||||||
USERp u;
|
USERp u;
|
||||||
short i;
|
|
||||||
|
|
||||||
SWStatIterator it(STAT_DEFAULT);
|
SWStatIterator it(STAT_DEFAULT);
|
||||||
while (auto actor = it.Next())
|
while (auto actor = it.Next())
|
||||||
|
@ -240,12 +226,9 @@ JS_SpriteSetup(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check for certain walls to make sounds
|
// Check for certain walls to make sounds
|
||||||
for (i = 0; i < numwalls; i++)
|
for(auto& wal : walls())
|
||||||
{
|
{
|
||||||
short picnum;
|
int picnum = wal.picnum;
|
||||||
|
|
||||||
|
|
||||||
picnum = wall[i].picnum;
|
|
||||||
|
|
||||||
// Set the don't stick bit for liquid tiles
|
// Set the don't stick bit for liquid tiles
|
||||||
switch (picnum)
|
switch (picnum)
|
||||||
|
@ -261,7 +244,7 @@ JS_SpriteSetup(void)
|
||||||
case 2608:
|
case 2608:
|
||||||
case 2616:
|
case 2616:
|
||||||
//case 3834:
|
//case 3834:
|
||||||
SET(wall[i].extra, WALLFX_DONT_STICK);
|
SET(wal.extra, WALLFX_DONT_STICK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,7 +290,7 @@ void JS_InitMirrors(void)
|
||||||
{
|
{
|
||||||
if (mirrorcnt >= MAXMIRRORS)
|
if (mirrorcnt >= MAXMIRRORS)
|
||||||
{
|
{
|
||||||
Printf("MAXMIRRORS reached! Skipping mirror wall[%d]\n", i);
|
Printf("MAXMIRRORS reached! Skipping mirror wall\n");
|
||||||
wal.overpicnum = sec->ceilingpicnum;
|
wal.overpicnum = sec->ceilingpicnum;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -391,7 +374,7 @@ void JS_InitMirrors(void)
|
||||||
if (!Found_Cam)
|
if (!Found_Cam)
|
||||||
{
|
{
|
||||||
Printf("Did not find drawtotile for camera number %d\n", mirrorcnt);
|
Printf("Did not find drawtotile for camera number %d\n", mirrorcnt);
|
||||||
Printf("wall[%d].hitag == %d\n", i, wal.hitag);
|
Printf("wall(%d).hitag == %d\n", wallnum(&wal), wal.hitag);
|
||||||
Printf("Map Coordinates: x = %d, y = %d\n", wal.x, wal.y);
|
Printf("Map Coordinates: x = %d, y = %d\n", wal.x, wal.y);
|
||||||
RESET_BOOL1(&mirror[mirrorcnt].cameraActor->s());
|
RESET_BOOL1(&mirror[mirrorcnt].cameraActor->s());
|
||||||
}
|
}
|
||||||
|
|
|
@ -475,13 +475,11 @@ int DoBloodSpray(DSWActor* actor)
|
||||||
|
|
||||||
// !FRANK! bit of a hack
|
// !FRANK! bit of a hack
|
||||||
// yvel is the hit_wall
|
// yvel is the hit_wall
|
||||||
if (bsp->yvel >= 0)
|
if (bldActor->tempwall)
|
||||||
{
|
{
|
||||||
short wallnum = bsp->yvel;
|
|
||||||
|
|
||||||
// sy & sz are the ceiling and floor of the sector you are sliding down
|
// sy & sz are the ceiling and floor of the sector you are sliding down
|
||||||
if (wall[wallnum].nextsector >= 0)
|
if (bldActor->tempwall->twoSided())
|
||||||
getzsofslope(wall[wallnum].nextsector, sp->x, sp->y, &u->sy, &u->sz);
|
getzsofslopeptr(bldActor->tempwall->nextSector(), sp->x, sp->y, &u->sy, &u->sz);
|
||||||
else
|
else
|
||||||
u->sy = u->sz; // ceiling and floor are equal - white wall
|
u->sy = u->sz; // ceiling and floor are equal - white wall
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ void SectorLightShade(DSWActor* actor, short intensity)
|
||||||
{
|
{
|
||||||
auto u = actor->hasU()? actor->u() : nullptr;
|
auto u = actor->hasU()? actor->u() : nullptr;
|
||||||
auto sp = &actor->s();
|
auto sp = &actor->s();
|
||||||
short w, startwall, endwall;
|
|
||||||
int8_t* wall_shade;
|
int8_t* wall_shade;
|
||||||
short base_shade;
|
short base_shade;
|
||||||
short wallcount;
|
short wallcount;
|
||||||
|
@ -82,27 +81,25 @@ void SectorLightShade(DSWActor* actor, short intensity)
|
||||||
{
|
{
|
||||||
ASSERT(u && u->WallShade.Data());
|
ASSERT(u && u->WallShade.Data());
|
||||||
wall_shade = u->WallShade.Data();
|
wall_shade = u->WallShade.Data();
|
||||||
|
int wallcount = 0;
|
||||||
|
|
||||||
startwall = sp->sector()->wallptr;
|
for(auto &wal : wallsofsector(sp->sector()))
|
||||||
endwall = startwall + sp->sector()->wallnum - 1;
|
|
||||||
|
|
||||||
for (w = startwall, wallcount = 0; w <= endwall; w++)
|
|
||||||
{
|
{
|
||||||
base_shade = wall_shade[wallcount];
|
base_shade = wall_shade[wallcount];
|
||||||
wall[w].shade = base_shade + intensity;
|
wal.shade = base_shade + intensity;
|
||||||
if (!TEST_BOOL6(sp))
|
if (!TEST_BOOL6(sp))
|
||||||
wall[w].pal = sp->pal;
|
wal.pal = sp->pal;
|
||||||
wallcount++;
|
wallcount++;
|
||||||
|
|
||||||
if (TEST(sp->extra, SPRX_BOOL5))
|
if (TEST(sp->extra, SPRX_BOOL5))
|
||||||
{
|
{
|
||||||
uint16_t const nextwall = wall[w].nextwall;
|
if (wal.twoSided())
|
||||||
if (validWallIndex(nextwall))
|
|
||||||
{
|
{
|
||||||
|
auto nextWall = wal.nextWall();
|
||||||
base_shade = wall_shade[wallcount];
|
base_shade = wall_shade[wallcount];
|
||||||
wall[nextwall].shade = base_shade + intensity;
|
nextWall->shade = base_shade + intensity;
|
||||||
if (!TEST_BOOL6(sp))
|
if (!TEST_BOOL6(sp))
|
||||||
wall[nextwall].pal = sp->pal;
|
nextWall->pal = sp->pal;
|
||||||
wallcount++;
|
wallcount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2629,15 +2629,12 @@ void DoPlayerMoveVehicle(PLAYERp pp)
|
||||||
{
|
{
|
||||||
for (sectp = sop->sectp, wallcount = 0, j = 0; *sectp; sectp++, j++)
|
for (sectp = sop->sectp, wallcount = 0, j = 0; *sectp; sectp++, j++)
|
||||||
{
|
{
|
||||||
startwall = (*sectp)->wallptr;
|
for(auto& wal : wallsofsector(*sectp))
|
||||||
endwall = startwall + (*sectp)->wallnum - 1;
|
|
||||||
|
|
||||||
for (wp = &wall[startwall], k = startwall; k <= endwall; wp++, k++)
|
|
||||||
{
|
{
|
||||||
if (wp->extra && TEST(wp->extra, WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY) == WALLFX_LOOP_OUTER)
|
if (wal.extra && TEST(wal.extra, WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY) == WALLFX_LOOP_OUTER)
|
||||||
{
|
{
|
||||||
x[count] = wp->x;
|
x[count] = wal.x;
|
||||||
y[count] = wp->y;
|
y[count] = wal.y;
|
||||||
|
|
||||||
ox[count] = sop->xmid - sop->xorig[wallcount];
|
ox[count] = sop->xmid - sop->xorig[wallcount];
|
||||||
oy[count] = sop->ymid - sop->yorig[wallcount];
|
oy[count] = sop->ymid - sop->yorig[wallcount];
|
||||||
|
@ -3402,6 +3399,7 @@ void DoPlayerClimb(PLAYERp pp)
|
||||||
|
|
||||||
if (wal >= 0)
|
if (wal >= 0)
|
||||||
{
|
{
|
||||||
|
auto wp = &wall[wal];
|
||||||
auto lActor = FindNearSprite(pp->Actor(), STAT_CLIMB_MARKER);
|
auto lActor = FindNearSprite(pp->Actor(), STAT_CLIMB_MARKER);
|
||||||
if (!lActor) return;
|
if (!lActor) return;
|
||||||
auto lsp = &lActor->s();
|
auto lsp = &lActor->s();
|
||||||
|
@ -3412,7 +3410,7 @@ void DoPlayerClimb(PLAYERp pp)
|
||||||
ny = MOVEy(100, lsp->ang);
|
ny = MOVEy(100, lsp->ang);
|
||||||
|
|
||||||
// set ladder sector
|
// set ladder sector
|
||||||
pp->LadderSector = wall[wal].nextsector >= 0? wall[wal].nextsector : wall[wal].sector;
|
pp->LadderSector = wp->nextsector >= 0? wp->nextsector : wp->sector;
|
||||||
|
|
||||||
// set players "view" distance from the ladder - needs to be farther than
|
// set players "view" distance from the ladder - needs to be farther than
|
||||||
// the sprite
|
// the sprite
|
||||||
|
|
|
@ -14,6 +14,7 @@ public:
|
||||||
|
|
||||||
bool hasUser;
|
bool hasUser;
|
||||||
USER user;
|
USER user;
|
||||||
|
walltype* tempwall; // transient, to replace a hack using a 16 bit sprite field.
|
||||||
|
|
||||||
DSWActor() :index(int(this - base())) { /*assert(index >= 0 && index < kMaxSprites);*/ }
|
DSWActor() :index(int(this - base())) { /*assert(index >= 0 && index < kMaxSprites);*/ }
|
||||||
DSWActor& operator=(const DSWActor& other) = default;
|
DSWActor& operator=(const DSWActor& other) = default;
|
||||||
|
|
|
@ -18985,7 +18985,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
|
||||||
sp->y = hitinfo.pos.y;
|
sp->y = hitinfo.pos.y;
|
||||||
sp->z = hitinfo.pos.z;
|
sp->z = hitinfo.pos.z;
|
||||||
sp->shade -= 5; // Brighten it up just a bit
|
sp->shade -= 5; // Brighten it up just a bit
|
||||||
sp->yvel = hitinfo.hitwall; // pass hitinfo.wall in yvel
|
spawnedActor->tempwall = hitinfo.wall(); // pass hitinfo.wall
|
||||||
|
|
||||||
SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
|
SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
|
||||||
SET(sp->cstat, CSTAT_SPRITE_ONE_SIDED);
|
SET(sp->cstat, CSTAT_SPRITE_ONE_SIDED);
|
||||||
|
|
Loading…
Reference in a new issue