Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Sep 14, 2024
1 parent 82a7c86 commit 7330c5d
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 42 deletions.
2 changes: 2 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* The order in which multiple `MAPINFO` lumps are loaded is now correct.
* `EPISODE` is now parsed in more instances.
* Up to 10 episodes can now be specified using `EPISODE` and will display correctly in the episode menu.
* If the fists or chainsaw are replaced with a weapon as specified in a `DEHACKED` lump, that weapon can now consume ammo.
* The volume of MP3 and Ogg Vorbis music lumps has increased slightly.
* The [fake contrast](https://doomwiki.org/wiki/Fake_contrast) applied to wall textures is now smoother.
* A bug is fixed whereby the player’s aim was slightly lower when the `freelook` CVAR was `on` and the `r_screensize` CVAR was `8`.
Expand All @@ -37,6 +38,7 @@
* The mouse wheel can no longer be used to advance *DOOM II’s* cast sequence.
* The amount of ammo the player has is no longer momentarily translucent at the start of each map if the `animatedstats` CVAR is `on`.
* A bug is fixed whereby the help screen wouldn’t be fully displayed when the `vid_widescreen` CVAR was `off`.
* Using the mouse pointer to move the scroll bar in the console is now more responsive when the `m_pointer` CVAR is `on`.

![](https://github.com/bradharding/www.doomretro.com/raw/master/wiki/bigdivider.png)

Expand Down
94 changes: 52 additions & 42 deletions src/r_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ static byte *R_DistortedFlat(const int flatnum)
//
void R_DrawPlanes(void)
{
const angle_t *xtoskyangle = (r_linearskies ? linearskyangle : xtoviewangle);

if (r_liquid_swirl)
updateswirl = !(consoleactive || helpscreen || paused || freeze);

Expand All @@ -440,7 +442,25 @@ void R_DrawPlanes(void)
{
const int picnum = pl->picnum;

if (picnum == skyflatnum || (picnum & PL_SKYFLAT))
if (picnum == skyflatnum)
{
// Normal DOOM sky, only one allowed per level
dc_texheight = textureheight[skytexture] >> FRACBITS;
dc_texturemid = skytexturemid;
dc_iscale = skyiscale;

for (dc_x = pl->left; dc_x <= pl->right; dc_x++)
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX
&& dc_yl <= (dc_yh = pl->bottom[dc_x]))
{
dc_source = R_GetTextureColumn(R_CacheTextureCompositePatchNum(skytexture),
(((viewangle + xtoskyangle[dc_x])
/ (1 << (ANGLETOSKYSHIFT - FRACBITS))) + skycolumnoffset) / FRACUNIT);

skycolfunc();
}
}
else if (picnum & PL_SKYFLAT)
{
// sky flat
int texture;
Expand All @@ -453,56 +473,46 @@ void R_DrawPlanes(void)
// to use info lumps.
angle_t angle = viewangle;

if (picnum & PL_SKYFLAT)
{
// Sky linedef
const line_t *line = lines + (picnum & ~PL_SKYFLAT);
// Sky linedef
const line_t *line = lines + (picnum & ~PL_SKYFLAT);

// Sky transferred from first sidedef
const side_t *side = sides + *line->sidenum;
// Sky transferred from first sidedef
const side_t *side = sides + *line->sidenum;

if (side->missingtoptexture)
{
for (dc_x = pl->left; dc_x <= pl->right; dc_x++)
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX
&& dc_yl <= (dc_yh = pl->bottom[dc_x]))
R_DrawColorColumn();
if (side->missingtoptexture)
{
for (dc_x = pl->left; dc_x <= pl->right; dc_x++)
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX
&& dc_yl <= (dc_yh = pl->bottom[dc_x]))
R_DrawColorColumn();

continue;
}
continue;
}

// Texture comes from upper texture of reference sidedef
texture = texturetranslation[side->toptexture];
// Texture comes from upper texture of reference sidedef
texture = texturetranslation[side->toptexture];

// Horizontal offset is turned into an angle offset,
// to allow sky rotation as well as careful positioning.
// However, the offset is scaled very small, so that it
// allows a long-period of sky rotation.
angle += side->textureoffset;
// Horizontal offset is turned into an angle offset,
// to allow sky rotation as well as careful positioning.
// However, the offset is scaled very small, so that it
// allows a long-period of sky rotation.
angle += side->textureoffset;

// Vertical offset allows careful sky positioning.
dc_texturemid = side->rowoffset - 28 * FRACUNIT;
// Vertical offset allows careful sky positioning.
dc_texturemid = side->rowoffset - 28 * FRACUNIT;

dc_texheight = textureheight[texture] >> FRACBITS;
dc_texheight = textureheight[texture] >> FRACBITS;

if (canfreelook)
dc_texturemid = dc_texturemid * dc_texheight / SKYSTRETCH_HEIGHT;
if (canfreelook)
dc_texturemid = dc_texturemid * dc_texheight / SKYSTRETCH_HEIGHT;

// We sometimes flip the picture horizontally.
// We sometimes flip the picture horizontally.

// DOOM always flipped the picture, so we make it optional,
// to make it easier to use the new feature, while to still
// allow old sky textures to be used.
if (line->special != TransferSkyTextureToTaggedSectors_Flipped)
flip = ~0U;
}
else
{
// Normal DOOM sky, only one allowed per level
texture = skytexture;
dc_texheight = textureheight[texture] >> FRACBITS;
dc_texturemid = skytexturemid;
}
// DOOM always flipped the picture, so we make it optional,
// to make it easier to use the new feature, while to still
// allow old sky textures to be used.
if (line->special != TransferSkyTextureToTaggedSectors_Flipped)
flip = ~0U;

dc_iscale = skyiscale;
tex_patch = R_CacheTextureCompositePatchNum(texture);
Expand All @@ -512,7 +522,7 @@ void R_DrawPlanes(void)
&& dc_yl <= (dc_yh = pl->bottom[dc_x]))
{
dc_source = R_GetTextureColumn(tex_patch,
((((angle + (r_linearskies ? linearskyangle[dc_x] : xtoviewangle[dc_x])) ^ flip)
((((angle + xtoskyangle[dc_x]) ^ flip)
/ (1 << (ANGLETOSKYSHIFT - FRACBITS))) + skycolumnoffset) / FRACUNIT);

skycolfunc();
Expand Down

0 comments on commit 7330c5d

Please sign in to comment.