From 7330c5d9f5c70bfdb10a9bbe9e37682ea190e5b7 Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Sun, 15 Sep 2024 06:14:17 +1000 Subject: [PATCH] Minor tweaks --- releasenotes.md | 2 ++ src/r_plane.c | 94 +++++++++++++++++++++++++++---------------------- 2 files changed, 54 insertions(+), 42 deletions(-) diff --git a/releasenotes.md b/releasenotes.md index 5a400cd95..26fd30d60 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -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`. @@ -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) diff --git a/src/r_plane.c b/src/r_plane.c index 9cf54a64c..d1d706c35 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -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); @@ -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; @@ -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); @@ -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();