Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Feb 13, 2025
1 parent d48bc71 commit 3e2bf4e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 24 deletions.
4 changes: 2 additions & 2 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Changes have been made to further improve the overall performance and stability of *DOOM Retro*.
* Minor changes have been made to text that is output to the console.
* Very long player messages now wrap to a second line when the `vid_widescreen` CVAR is `on`.
* Minor improvements have been made to the support of [*Back To Saturn X E1: Get Out Of My Stations*](https://www.doomworld.com/idgames/levels/doom2/megawads/btsx_e1) or [*Back To Saturn X E2: Tower In The Fountain Of Sparks*](https://www.doomworld.com/forum/topic/69960).
* Minor improvements have been made to the support of [*Back To Saturn X E1: Get Out Of My Stations*](https://www.doomworld.com/idgames/levels/doom2/megawads/btsx_e1) and [*Back To Saturn X E2: Tower In The Fountain Of Sparks*](https://www.doomworld.com/forum/topic/69960).
* Per-column lighting is now cast on sprites using the new `r_percolumnlighting` CVAR, which is `on` by default and `off` when vanilla mode is enabled.
* Blood splats are no longer spawned when killing lost souls using the `kill` CCMD.
* Blood splats no longer spawn when lost souls are killed using the `kill` CCMD.
* The `IDMUS` cheat can now be used in the console when not playing a game.
* Cheats now become redacted in the console before pressing the <kbd><b>ENTER</b></kbd> key.
* A crash no longer occurs when using the `mapstats` CCMD in the console in some rare instances.
Expand Down
60 changes: 41 additions & 19 deletions src/p_enemy.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ static const fixed_t yspeed[] = { 0, 47000, FRACUNIT, 47000, 0, -47000, -FRAC

static bool P_Move(mobj_t *actor, const int dropoff) // killough 09/12/98
{
bool try_ok;
fixed_t tryx, tryy;
fixed_t deltax, deltay;
fixed_t origx, origy;
int movefactor;
int friction = ORIG_FRICTION;
int speed;
Expand All @@ -287,14 +287,45 @@ static bool P_Move(mobj_t *actor, const int dropoff) // killough 09/12/98

speed = actor->info->speed;

if (friction < ORIG_FRICTION // sludge
if (friction < ORIG_FRICTION // sludge
&& !(speed = ((ORIG_FRICTION_FACTOR - (ORIG_FRICTION_FACTOR - movefactor) / 2) * speed) / ORIG_FRICTION_FACTOR))
speed = 1; // always give the monster a little bit of speed
speed = 1; // always give the monster a little bit of speed

tryx = (origx = actor->x) + (deltax = speed * xspeed[actor->movedir]);
tryy = (origy = actor->y) + (deltay = speed * yspeed[actor->movedir]);
tryx = actor->x + (deltax = speed * xspeed[actor->movedir]);
tryy = actor->y + (deltay = speed * yspeed[actor->movedir]);

if (!P_TryMove(actor, tryx, tryy, dropoff))
// killough 12/98: rearrange, fix potential for stickiness on ice
if (friction <= ORIG_FRICTION)
try_ok = P_TryMove(actor, tryx, tryy, dropoff);
else
{
fixed_t x = actor->x;
fixed_t y = actor->y;
fixed_t floorz = actor->floorz;
fixed_t ceilingz = actor->ceilingz;
fixed_t dropoffz = actor->dropoffz;

// killough 10/98:
// Let normal momentum carry them, instead of steptoeing them across ice.
if ((try_ok = P_TryMove(actor, tryx, tryy, dropoff)))
{
P_UnsetThingPosition(actor);

actor->x = x;
actor->y = y;
actor->floorz = floorz;
actor->ceilingz = ceilingz;
actor->dropoffz = dropoffz;

P_SetThingPosition(actor);

movefactor *= FRACUNIT / ORIG_FRICTION_FACTOR / 4;
actor->momx += FixedMul(deltax, movefactor);
actor->momy += FixedMul(deltay, movefactor);
}
}

if (!try_ok)
{
// open any specials
int good;
Expand Down Expand Up @@ -330,24 +361,15 @@ static bool P_Move(mobj_t *actor, const int dropoff) // killough 09/12/98
if (P_UseSpecialLine(actor, spechit[numspechit], 0, false))
good |= (spechit[numspechit] == blockline ? 1 : 2);

// There are checks elsewhere for numspechit == 0, so we don't want to
// leave numspechit == -1.
numspechit = 0;

return (good && ((M_Random() >= 230) ^ (good & 1)));
}
else
{
actor->flags &= ~MF_INFLOAT;

// killough 10/98:
// Let normal momentum carry them, instead of steptoeing them across ice.
if (friction > ORIG_FRICTION)
{
actor->x = origx;
actor->y = origy;
movefactor *= FRACUNIT / ORIG_FRICTION_FACTOR / 4;
actor->momx += FixedMul(deltax, movefactor);
actor->momy += FixedMul(deltay, movefactor);
}
}

// killough 11/98: fall more slowly, under gravity, if felldown == true
if (!(actor->flags & MF_FLOAT) && !felldown)
actor->z = actor->floorz;
Expand Down
4 changes: 2 additions & 2 deletions src/p_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,6 @@ bool P_CheckPosition(mobj_t *thing, const fixed_t x, const fixed_t y)
yl = P_GetSafeBlockY(tmbbox[BOXBOTTOM] - bmaporgy - MAXRADIUS);
yh = P_GetSafeBlockY(tmbbox[BOXTOP] - bmaporgy + MAXRADIUS);

validcount++;

for (int bx = xl; bx <= xh; bx++)
for (int by = yl; by <= yh; by++)
if (!P_BlockThingsIterator(bx, by, &PIT_CheckThing,
Expand All @@ -867,6 +865,8 @@ bool P_CheckPosition(mobj_t *thing, const fixed_t x, const fixed_t y)
yl = P_GetSafeBlockY(tmbbox[BOXBOTTOM] - bmaporgy);
yh = P_GetSafeBlockY(tmbbox[BOXTOP] - bmaporgy);

validcount++;

for (int bx = xl; bx <= xh; bx++)
for (int by = yl; by <= yh; by++)
if (!P_BlockLinesIterator(bx, by, &PIT_CheckLine))
Expand Down
2 changes: 1 addition & 1 deletion src/r_things.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ static void R_DrawVisSpriteWithShadow(const vissprite_t *vis)
shadowshift = (shadowtopscreen * 9 / 10) >> FRACBITS;
fuzz1pos = 0;

if (percolumnlighting = (r_percolumnlighting && !vis->fullbright && dc_colormap[0] && !fixedcolormap))
if (percolumnlighting = (r_percolumnlighting && !vis->fullbright && !fixedcolormap))
{
const int angle = (viewangle - ANG90) >> ANGLETOFINESHIFT;

Expand Down

0 comments on commit 3e2bf4e

Please sign in to comment.