diff --git a/CHANGELOG.md b/CHANGELOG.md index 6802302c9..aa488a6fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,25 @@ - **Support for intermediate resolutions** (e.g. 3X, 5X) **and 9X (1800p)** - **_Background for all menus_** setting +- **_Vanilla Fake Contrast_** setting +- Toggle for **Diminished Lighting** - **Minimap mode for Automap** - **NUGHUD:** - Ammo and Health icons; - - Toggle to apply patch offsets. + - Toggle to apply patch offsets; + - Vertical view offset setting. - **Further Extended HUD color customization** - **_Show Kills Percentage [in Stats display]_** setting +- **Made the following cheats bindable to keys:** + - Infinite Ammo; + - Fast Weapons; + - Resurrect; + - Flight Mode; + - Repeat Last Summon; + - Linetarget Query; + - MDK Attack; + - MDK Fist; + - Explosive Hitscan. - **Show Save Messages** setting - **_Direct Vertical Aiming_ for melee attacks** - **_Disable Melee Snapping_** setting @@ -17,9 +30,13 @@ - **NUGHUD:** - Let Ammo, Health and Armor icons fall back to vanilla sprites; - Made Patches and icons alignable horizontally and vertically; - - Disabled Armor icon by default. + - Disabled Armor icon by default; + - Changed `weapheight` range from [0, 200] to [-32, 32]. + - Changed `secret_y` default to 84, to match Woof!. - **Speed of non-Melt wipes is now independent of resolution** - **Implemented Teleporter Zoom for multiplayer respawning** +- **_Blink [Automap] Marks_ message now includes number of marks** +- **Applied interpolation for Chasecam speed effect** - **MDK Fist attacks now prioritize enemies over friends** - **Current resolution is now reported by some video-related menu items** - **Disabled `input_spy` and `input_menu_reloadlevel` when typing in Chat** @@ -29,6 +46,12 @@ - **Further corrected view pitch as FOV changes** - **Disabled teleport-to-Automap-pointer during non-Casual Play** - **Excess speed when airborne with noclip enabled** [thanks @kitchen-ace] +- **Blazing door sound fix not applying to Boom doors** - **Teleporter Zoom and BFG "explosion" shake affecting all players in multiplayer** +- **Explosion shake being stopped by the menu during demo playback and netgames** +- **Choppy Chasecam speed effect when looking up or down** +- **View snapping when teleporting to Automap pointer while crouching** +- **View clipping through floor when landing while crouching** - **Fixed a demo desync** caused by a failed weapon autoswitch when picking up ammo +- **_View Height_ increments not being applied immediately** - **Tweaked dark menu background and Automap overlay algorithm** (fixes very low values) diff --git a/README.md b/README.md index 234aa4c22..0fd35978b 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ For these settings, their CVAR names are provided alongside the _CFG-Only_ label - **Support for higher resolutions:** 3X (600p), 4X (800p)... up to 9X (1800p) [by _ceski_] - **Selection of widescreen ratios** in the setup menu itself [i.b. Crispy Doom] -- Toggle to **stretch viewport to fit window** (CFG-Only: `stretch_to_fit`) [i.b. and partially p.f. Crispy Doom; i.b. ZDoom] +- **Stretch viewport to fit window** setting (CFG-Only: `stretch_to_fit`) [i.b. and partially p.f. Crispy Doom; i.b. ZDoom] - **Gamma Correction slider ranging from 0.50 to 2.0 in steps of 0.05** -- Toggle for **Gamma Correction key cycling**, through either original or extended gamma levels (CFG-Only: `gammacycle`) +- **Gamma Correction key cycling** setting, to cycle through either original or extended gamma levels (CFG-Only: `gammacycle`) - **Menu items for _Air Absorption_ and _Doppler Effect_**, both of which are **now set to 5 by default** - **Tweaked _Stretch Short Skies_ algorithm** - _**Screen Wipe Style**_ selection: @@ -57,15 +57,16 @@ For these settings, their CVAR names are provided alongside the _CFG-Only_ label - _**Disable Radiation Suit Tint**_ setting - _**Damage Tint Cap**_ and _**Bonus Tint Cap**_, to attenuate or disable the red and yellow screen tints - _**Fake Contrast**_ setting +- Toggle for **Diminished Lighting** (CFG-Only: `diminished_lighting`) - _**Screen Wipe speed percentage**_ setting - _**Sound Clipping Distance**_ selection, to optionally double the distance at which SFX become audible - **_Organize Saves by IWAD_** setting - _**One-Key Quick Save/Load**_ setting, to skip the confirmation prompt - _**Play Internal Demos**_ setting - _**Quick "Quit Game"**_ setting, to skip the confirmation prompt [p.f. Crispy Doom] -- Toggling of _**Weapon Flash Lighting**_ [p.f. Crispy Doom] -- Toggling of _**Weapon Flash Sprite**_ [p.f. Crispy Doom] -- Toggling of _**Invulnerability Colormap**_ [p.f. Crispy Doom] +- Toggle for _**Weapon Flash Lighting**_ [p.f. Crispy Doom] +- Toggle for _**Weapon Flash Sprite**_ [p.f. Crispy Doom] +- Toggle for _**Invulnerability Colormap**_ [p.f. Crispy Doom] ### Weapons diff --git a/docs/nughud.lmp b/docs/nughud.lmp index c991df08b..b8bb90b6d 100644 --- a/docs/nughud.lmp +++ b/docs/nughud.lmp @@ -200,7 +200,7 @@ nughud_message_align -1 ; Secret Message/Milestone Completion display nughud_secret_x 160 -nughud_secret_y 86 +nughud_secret_y 84 nughud_secret_wide 0 nughud_secret_align 0 @@ -219,5 +219,8 @@ nughud_percents 1 ; Apply graphic offsets when drawing Patches nughud_patch_offsets 1 -; Upwards offset to apply to weapon sprites +; Vertical offset for weapon sprites nughud_weapheight 0 + +; Vertical offset for view window +nughud_viewoffset 0 diff --git a/docs/nughud.md b/docs/nughud.md index 63f87cc93..79fad717a 100644 --- a/docs/nughud.md +++ b/docs/nughud.md @@ -202,10 +202,10 @@ nughud_patch2_wide 0 nughud_patch2_name "STARMS" ``` -### Miscellaneous +### Additional integer properties -**There is an additional fixed-point property, `nughud_weapheight`, to increase the height at which weapon sprites are drawn**. -It can be any value between `0` and `200` (inclusive). +- `nughud_weapheight`: **vertical offset for weapon sprites**, in the [-32, 32] range; greater values shift the sprites upwards. +- `nughud_viewoffset`: **vertical offset for the view window**, in the [-16, 16] range; greater values shift the view downwards. --- diff --git a/src/am_map.c b/src/am_map.c index 272a94ac8..4d11a4468 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -978,7 +978,7 @@ boolean AM_Responder else if (M_InputActivated(input_map_blink) && markpointnum) { markblinktimer = 4*TICRATE; - plr->message = "Blinking marks..."; + displaymsg("Blinking %i mark%s...", markpointnum, (1 < markpointnum) ? "s" : ""); } // Minimap else if (M_InputActivated(input_map_mini)) @@ -999,7 +999,7 @@ boolean AM_Responder P_TeleportMove(mo, (m_x+m_w/2)<z = mo->floorz; - plr->viewz = mo->z + plr->viewheight; + plr->viewz = mo->z + plr->viewheight - plr->crouchoffset; if (fancy_teleport) { R_SetFOVFX(FOVFX_TELEPORT); // Teleporter zoom diff --git a/src/d_player.h b/src/d_player.h index a43e9f79f..ad8781d15 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -73,7 +73,7 @@ typedef enum CF_RENDERSTATS = 64, CF_SHOWFPS = 128, - // [Nugget] All of the following: + // [Nugget] ---------------------------------------------------------------- CF_INFAMMO = 0x00010000, // Infinite ammo CF_FASTWEAPS = 0x00020000, // Fast Weapons @@ -81,7 +81,7 @@ typedef enum CF_LINETARGET = 0x00080000, // Give info on the current linetarget CF_SAITAMA = 0x00100000, // MDK Fist CF_BOOMCAN = 0x00200000, // Explosive Hitscan - + } cheat_t; @@ -215,15 +215,15 @@ typedef struct player_s weapswitch_t switching; - // [Nugget] All of the following: - + // [Nugget] ---------------------------------------------------------------- + weapontype_t lastweapon; int jumptics; // Jumping delay fixed_t crouchoffset; // How many units the player is crouched fixed_t impactpitch, oldimpactpitch; // Pitch view on impact - + // [crispy] blinking key or skull in the status bar int keyblinkkeys[3], keyblinktics; diff --git a/src/doomstat.c b/src/doomstat.c index 676d94932..53a8ffc8e 100644 --- a/src/doomstat.c +++ b/src/doomstat.c @@ -164,6 +164,7 @@ int no_radsuit_tint; int damagecount_cap; int bonuscount_cap; int fake_contrast; +int diminished_lighting; // CFG-Only int wipe_speed_percentage; int s_clipping_dist_x2; int one_key_saveload; diff --git a/src/doomstat.h b/src/doomstat.h index dad965599..67fc0e698 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -492,6 +492,7 @@ extern int no_radsuit_tint; extern int damagecount_cap; extern int bonuscount_cap; extern int fake_contrast; +extern int diminished_lighting; // CFG-Only extern int wipe_speed_percentage; extern int s_clipping_dist_x2; extern int one_key_saveload; diff --git a/src/f_finale.c b/src/f_finale.c index d9597888b..8463993c6 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -29,7 +29,7 @@ #include "m_misc2.h" // [FG] M_StringDuplicate() #include "m_swap.h" #include "r_draw.h" -// [Nugget] Include the following +// [Nugget] #include "g_game.h" // [crispy] key_* #include "m_input.h" #include "m_random.h" // [crispy] Crispy_Random() @@ -101,7 +101,7 @@ void F_StartFinale (void) case retail: { if (!mus_changed) S_ChangeMusic(mus_victor, true); - + switch (gameepisode) { case 1: @@ -110,7 +110,7 @@ void F_StartFinale (void) break; case 2: finaleflat = bgflatE2; - finaletext = s_E2TEXT; // Ty 03/23/98 - Same stuff for each + finaletext = s_E2TEXT; // Ty 03/23/98 - Same stuff for each break; case 3: finaleflat = bgflatE3; @@ -126,7 +126,7 @@ void F_StartFinale (void) } break; } - + // DOOM II and missions packs with E1, M34 case commercial: { @@ -173,7 +173,7 @@ void F_StartFinale (void) // Ty 08/27/98 - end gamemission logic break; - } + } // Indeterminate. default: // Ty 03/30/98 - not externalized @@ -184,7 +184,7 @@ void F_StartFinale (void) } using_FMI = false; - + if (gamemapinfo) { if (U_CheckField(gamemapinfo->intertextsecret) && secretexit) @@ -228,7 +228,7 @@ boolean F_Responder (event_t *event) { if (finalestage == 2) return F_CastResponder (event); - + return false; } @@ -237,7 +237,7 @@ boolean F_Responder (event_t *event) static float Get_TextSpeed(void) { - return midstage ? NEWTEXTSPEED : (midstage=acceleratestage) ? + return midstage ? NEWTEXTSPEED : (midstage=acceleratestage) ? acceleratestage=0, NEWTEXTSPEED : TEXTSPEED; } @@ -296,7 +296,7 @@ void F_Ticker(void) // advance animation finalecount++; - + if (finalestage == 2) F_CastTicker(); @@ -377,7 +377,7 @@ void F_TextWrite (void) int c; int cx; int cy; - + // [FG] if interbackdrop does not specify a valid flat, draw it as a patch instead if (gamemapinfo && W_CheckNumForName(finaleflat) != -1 && (W_CheckNumForName)(finaleflat, ns_flats) == -1) @@ -396,7 +396,7 @@ void F_TextWrite (void) cx = 10; cy = 10; ch = finaletext_rw; - + count = (int)((finalecount - 10)/Get_TextSpeed()); // phares if (count < 0) count = 0; @@ -412,14 +412,14 @@ void F_TextWrite (void) cy += 11; continue; } - + c = toupper(c) - HU_FONTSTART; if (c < 0 || c> HU_FONTSIZE) { cx += 4; continue; } - + w = SHORT (hu_font[c]->width); if (cx+w > SCREENWIDTH) { @@ -459,11 +459,11 @@ int castframes; int castonmelee; boolean castattacking; -// [Nugget] Add the following... ------------------------------ +// [Nugget] /----------------------------------------------------------------- -static signed char castangle; // [crispy] turnable cast -static signed char castskip; // [crispy] skippable cast -static boolean castflip; // [crispy] flippable death sequence +static signed char castangle; // [crispy] turnable cast +static signed char castskip; // [crispy] skippable cast +static boolean castflip; // [crispy] flippable death sequence // [crispy] randomize seestate and deathstate sounds in the cast static int F_RandomizeSound (int sound) @@ -493,13 +493,13 @@ static int F_RandomizeSound (int sound) } } -extern void A_BruisAttack(); extern void A_BspiAttack(); extern void A_CPosAttack(); -extern void A_CPosRefire(); extern void A_CyberAttack(); extern void A_FatAttack1(); -extern void A_FatAttack2(); extern void A_FatAttack3(); extern void A_HeadAttack(); -extern void A_PainAttack(); extern void A_PosAttack(); extern void A_SargAttack(); -extern void A_SkelFist(); extern void A_SkelMissile(); extern void A_SkelWhoosh(); -extern void A_SkullAttack(); extern void A_SPosAttack(); extern void A_TroopAttack(); -extern void A_VileTarget(); extern void A_RandomJump(); +extern void A_BruisAttack(); extern void A_BspiAttack(); extern void A_CPosAttack(); +extern void A_CPosRefire(); extern void A_CyberAttack(); extern void A_FatAttack1(); +extern void A_FatAttack2(); extern void A_FatAttack3(); extern void A_HeadAttack(); +extern void A_PainAttack(); extern void A_PosAttack(); extern void A_SargAttack(); +extern void A_SkelFist(); extern void A_SkelMissile(); extern void A_SkelWhoosh(); +extern void A_SkullAttack(); extern void A_SPosAttack(); extern void A_TroopAttack(); +extern void A_VileTarget(); extern void A_RandomJump(); extern boolean flipcorpses; @@ -539,10 +539,8 @@ static int F_SoundForState (int st) // [crispy] fix Doomguy in casting sequence if (castaction == NULL) { - if (st == S_PLAY_ATK2) - { return sfx_dshtgn; } - else - { return 0; } + if (st == S_PLAY_ATK2) { return sfx_dshtgn; } + else { return 0; } } else { int i; @@ -551,15 +549,17 @@ static int F_SoundForState (int st) { const actionsound_t *const as = &actionsounds[i]; - if ((!as->early && castaction == as->action) || - (as->early && nextaction == as->action)) - { return as->sound; } + if ( (!as->early && castaction == as->action) + || ( as->early && nextaction == as->action)) + { + return as->sound; + } } } return 0; } -// [Nugget] ... up until here. ------------------------------ +// [Nugget] -----------------------------------------------------------------/ // // F_StartCast @@ -591,7 +591,7 @@ void F_StartCast (void) caststate = &states[mobjinfo[castorder[castnum].type].seestate]; casttics = caststate->tics; castdeath = false; - finalestage = 2; + finalestage = 2; castframes = 0; castonmelee = 0; castattacking = false; @@ -606,90 +606,60 @@ void F_CastTicker (void) { int st; int sfx; - + if (--casttics > 0) return; // not time to change state yet - - if (caststate->tics == -1 || caststate->nextstate == S_NULL || castskip) // [crispy] skippable cast + + if (caststate->tics == -1 || caststate->nextstate == S_NULL || castskip) // [Nugget]: [crispy] skippable cast { if (castskip) { - castnum += castskip; - castskip = 0; + castnum += castskip; + castskip = 0; } else // switch from deathstate to next monster castnum++; + castdeath = false; if (castorder[castnum].name == NULL) castnum = 0; if (mobjinfo[castorder[castnum].type].seesound) - S_StartSound (NULL, mobjinfo[castorder[castnum].type].seesound); + S_StartSound (NULL, F_RandomizeSound(mobjinfo[castorder[castnum].type].seesound)); // [Nugget]: [crispy] caststate = &states[mobjinfo[castorder[castnum].type].seestate]; castframes = 0; - // [Nugget] Add these two + // [Nugget] castangle = 0; // [crispy] turnable cast castflip = false; // [crispy] flippable death sequence } - else { + else + { // just advance to next state in animation - // [Nugget]: [crispy] fix Doomguy in casting sequence - /* - if (!castdeath && caststate == &states[S_PLAY_ATK1]) - goto stopattack; // Oh, gross hack! - */ + // [Nugget]: [crispy] fix Doomguy in casting sequence /------------------- + // [crispy] Allow A_RandomJump() in deaths in cast sequence if (caststate->action.p2 == (actionf_p2)A_RandomJump && Woof_Random() < caststate->misc2) { st = caststate->misc1; } else { // [crispy] fix Doomguy in casting sequence if (!castdeath && caststate == &states[S_PLAY_ATK1]) - { st = S_PLAY_ATK2; } + st = S_PLAY_ATK2; else if (!castdeath && caststate == &states[S_PLAY_ATK2]) - { goto stopattack; } // Oh, gross hack! + goto stopattack; // Oh, gross hack! else - { st = caststate->nextstate; } + st = caststate->nextstate; } + + // [Nugget] -------------------------------------------------------------/ + caststate = &states[st]; castframes++; - - sfx = F_SoundForState(st); -/* - // sound hacks.... - switch (st) - { - case S_PLAY_ATK1: sfx = sfx_dshtgn; break; - case S_POSS_ATK2: sfx = sfx_pistol; break; - case S_SPOS_ATK2: sfx = sfx_shotgn; break; - case S_VILE_ATK2: sfx = sfx_vilatk; break; - case S_SKEL_FIST2: sfx = sfx_skeswg; break; - case S_SKEL_FIST4: sfx = sfx_skepch; break; - case S_SKEL_MISS2: sfx = sfx_skeatk; break; - case S_FATT_ATK8: - case S_FATT_ATK5: - case S_FATT_ATK2: sfx = sfx_firsht; break; - case S_CPOS_ATK2: - case S_CPOS_ATK3: - case S_CPOS_ATK4: sfx = sfx_shotgn; break; - case S_TROO_ATK3: sfx = sfx_claw; break; - case S_SARG_ATK2: sfx = sfx_sgtatk; break; - case S_BOSS_ATK2: - case S_BOS2_ATK2: - case S_HEAD_ATK2: sfx = sfx_firsht; break; - case S_SKULL_ATK2: sfx = sfx_sklatk; break; - case S_SPID_ATK2: - case S_SPID_ATK3: sfx = sfx_shotgn; break; - case S_BSPI_ATK2: sfx = sfx_plasma; break; - case S_CYBER_ATK2: - case S_CYBER_ATK4: - case S_CYBER_ATK6: sfx = sfx_rlaunc; break; - case S_PAIN_ATK3: sfx = sfx_sklatk; break; - default: sfx = 0; break; - } -*/ + + sfx = F_SoundForState(st); // [Nugget]: [crispy] + if (sfx) S_StartSound (NULL, sfx); } - + if (castframes == 12) { // go into attack frame @@ -709,7 +679,7 @@ void F_CastTicker (void) &states[mobjinfo[castorder[castnum].type].missilestate]; } } - + if (castattacking) { if (castframes == 24 @@ -721,18 +691,22 @@ void F_CastTicker (void) caststate = &states[mobjinfo[castorder[castnum].type].seestate]; } } - + casttics = caststate->tics; if (casttics == -1) { - // [Nugget] Add all this + // [Nugget]: [crispy] + // [crispy] Allow A_RandomJump() in deaths in cast sequence - if (caststate->action.p2 == (actionf_p2)A_RandomJump) { + if (caststate->action.p2 == (actionf_p2)A_RandomJump) + { if (Woof_Random() < caststate->misc2) { caststate = &states[caststate->misc1]; } else { caststate = &states[caststate->nextstate]; } + casttics = caststate->tics; } + if (casttics == -1) { casttics = 15; } } } @@ -749,59 +723,78 @@ boolean F_CastResponder (event_t* ev) if (ev->type != ev_keydown) return false; + // [Nugget] /--------------------------------------------------------------- + // [crispy] make monsters turnable in cast ... - if (M_InputActivated(input_turnleft)) { + if (M_InputActivated(input_turnleft)) + { if (++castangle > 7) { castangle = 0; } return false; } - else if (M_InputActivated(input_turnright)) { + else if (M_InputActivated(input_turnright)) + { if (--castangle < 0) { castangle = 7; } return false; } // [crispy] ... and allow to skip through them .. - else if (M_InputActivated(input_strafeleft)) { + else if (M_InputActivated(input_strafeleft)) + { castskip = castnum ? -1 : arrlen(castorder)-2; return false; } - else if (M_InputActivated(input_straferight)) { + else if (M_InputActivated(input_straferight)) + { castskip = +1; return false; } // [crispy] ... and finally turn them into gibbs - if (M_InputActivated(input_speed)) { xdeath = true; } + if (M_InputActivated(input_speed)) + { + xdeath = true; + } + // [Nugget] ---------------------------------------------------------------/ + if (castdeath) - return true; // already in dying frames - + return true; // already in dying frames + // go into death frame castdeath = true; + + // [Nugget]: [crispy] if (xdeath && mobjinfo[castorder[castnum].type].xdeathstate) - { caststate = &states[mobjinfo[castorder[castnum].type].xdeathstate]; } + caststate = &states[mobjinfo[castorder[castnum].type].xdeathstate]; else - { caststate = &states[mobjinfo[castorder[castnum].type].deathstate]; } + caststate = &states[mobjinfo[castorder[castnum].type].deathstate]; + casttics = caststate->tics; - // [crispy] Allow A_RandomJump() in deaths in cast sequence + // [Nugget]: [crispy] Allow A_RandomJump() in deaths in cast sequence if (casttics == -1 && caststate->action.p2 == (actionf_p2)A_RandomJump) { if (Woof_Random() < caststate->misc2) { caststate = &states [caststate->misc1]; } else { caststate = &states [caststate->nextstate]; } + casttics = caststate->tics; } + castframes = 0; castattacking = false; + + // [Nugget]: [crispy] if (xdeath && mobjinfo[castorder[castnum].type].xdeathstate) - { S_StartSound (NULL, sfx_slop); } + S_StartSound (NULL, sfx_slop); else + if (mobjinfo[castorder[castnum].type].deathsound) - { S_StartSound (NULL, F_RandomizeSound(mobjinfo[castorder[castnum].type].deathsound)); } + S_StartSound (NULL, F_RandomizeSound(mobjinfo[castorder[castnum].type].deathsound)); // [Nugget]: [crispy] - // [crispy] flippable death sequence + // [Nugget]: [crispy] flippable death sequence castflip = flipcorpses && castdeath && (mobjinfo[castorder[castnum].type].flags2 & MF2_FLIPPABLE) && (Woof_Random() & 1); - + return true; } @@ -813,11 +806,11 @@ void F_CastPrint (char* text) int cx; int w; int width; - + // find width ch = text; width = 0; - + while (ch) { c = *ch++; @@ -829,11 +822,11 @@ void F_CastPrint (char* text) width += 4; continue; } - + w = SHORT (hu_font[c]->width); width += w; } - + // draw it cx = 160-width/2; ch = text; @@ -848,7 +841,7 @@ void F_CastPrint (char* text) cx += 4; continue; } - + w = SHORT (hu_font[c]->width); V_DrawPatch(cx, 180, 0, hu_font[c]); cx+=w; @@ -867,22 +860,24 @@ void F_CastDrawer (void) int lump; boolean flip; patch_t* patch; - + // erase the entire screen to a background //V_DrawPatch (0,0,0, W_CacheLumpName (bgcastcall, PU_CACHE)); // Ty 03/30/98 bg texture extern V_DrawPatchFullScreen(0, W_CacheLumpName (bgcastcall, PU_CACHE)); F_CastPrint (castorder[castnum].name); - + // draw the current frame in the middle of the screen sprdef = &sprites[caststate->sprite]; + // [Nugget]: [crispy] the TNT1 sprite is not supposed to be rendered anyway if (!sprdef->numframes && caststate->sprite == SPR_TNT1) { return; } - sprframe = &sprdef->spriteframes[ caststate->frame & FF_FRAMEMASK]; - lump = sprframe->lump[castangle]; // [crispy] turnable cast - flip = (boolean)sprframe->flip[castangle] ^ castflip; // [crispy] turnable cast, flippable death sequence + sprframe = &sprdef->spriteframes[ caststate->frame & FF_FRAMEMASK]; + lump = sprframe->lump[castangle]; // [Nugget]: [crispy] turnable cast + flip = (boolean)sprframe->flip[castangle] ^ castflip; // [Nugget]: [crispy] turnable cast, flippable death sequence + patch = W_CacheLumpNum (lump+firstspritelump, PU_CACHE); if (flip) V_DrawPatchFlipped (160,170,0,patch); @@ -898,7 +893,7 @@ void F_CastDrawer (void) static void F_DrawPatchCol(int x, patch_t *patch, int col) { - const column_t *column = + const column_t *column = (const column_t *)((byte *) patch + LONG(patch->columnofs[col])); // step through the posts in a column @@ -948,7 +943,7 @@ void F_BunnyScroll (void) int stage; static int laststage; int p2offset, p1offset, pillar_width; - + p1 = W_CacheLumpName ("PFUB2", PU_LEVEL); p2 = W_CacheLumpName ("PFUB1", PU_LEVEL); @@ -995,7 +990,7 @@ void F_BunnyScroll (void) else F_DrawPatchCol (x, p2, x2 - p2offset); } - + if (finalecount < 1130) return; if (finalecount < 1180) @@ -1006,7 +1001,7 @@ void F_BunnyScroll (void) laststage = 0; return; } - + stage = (finalecount-1180) / 5; if (stage > 6) stage = 6; @@ -1015,7 +1010,7 @@ void F_BunnyScroll (void) S_StartSound (NULL, sfx_pistol); laststage = stage; } - + sprintf (name,"END%i",stage); V_DrawPatch ((ORIGWIDTH-13*8)/2, (ORIGHEIGHT-8*8)/2,0, diff --git a/src/hu_stuff.c b/src/hu_stuff.c index d4642eb46..cd756a903 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1544,6 +1544,9 @@ static void HU_UpdateCrosshair(void) { crosshair.x = ORIGWIDTH/2; crosshair.y = (screenblocks <= 10) ? (ORIGHEIGHT-ST_HEIGHT)/2 : ORIGHEIGHT/2; + + // [Nugget] + crosshair.y += STRICTMODE(st_crispyhud) ? nughud.viewoffset : 0; crosshair.side = 0; if (STRICTMODE(hud_crosshair_target || hud_crosshair_lockon)) diff --git a/src/m_cheat.c b/src/m_cheat.c index f81d56b85..1408c4f84 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -106,8 +106,8 @@ static void cheat_gibbers(); // Everything gibs static void cheat_resurrect(); static void cheat_fly(); -static void cheat_nextmap(); // Emulate level exit -static void cheat_nextsecret(); // Emulate secret level exit +static void cheat_normalexit(); // Emulate normal level exit +static void cheat_secretexit(); // Emulate secret level exit static void cheat_turbo(char *buf); // Summon a mobj @@ -367,8 +367,8 @@ struct cheat_s cheat[] = { {"resurrect", NULL, not_net | not_demo, {cheat_resurrect} }, {"idres", NULL, not_net | not_demo, {cheat_resurrect} }, // 'RESURRECT' alternative {"idfly", NULL, not_net | not_demo, {cheat_fly} }, - {"nextmap", NULL, not_net | not_demo, {cheat_nextmap} }, - {"nextsecret", NULL, not_net | not_demo, {cheat_nextsecret} }, + {"nextmap", NULL, not_net | not_demo, {cheat_normalexit} }, + {"nextsecret", NULL, not_net | not_demo, {cheat_secretexit} }, {"turbo", NULL, not_net | not_demo, {cheat_turbo}, -3 }, {"summon", NULL, not_net | not_demo, {cheat_summon} }, // Summon "Menu" {"summone", NULL, not_net | not_demo, {cheat_summone0} }, // Summon Enemy "Menu" @@ -492,12 +492,12 @@ static void cheat_fly() displaymsg("Fly Mode %s", (plyr->cheats & CF_FLY) ? "ON" : "OFF"); } -static void cheat_nextmap() +static void cheat_normalexit() { G_ExitLevel(); } -static void cheat_nextsecret() +static void cheat_secretexit() { G_SecretExitLevel(); } @@ -1696,6 +1696,16 @@ static const struct { { input_notarget, not_net|not_demo, {cheat_notarget}, 0 }, { input_freeze, not_net|not_demo, {cheat_freeze}, 0 }, { input_avj, not_net|not_demo, {cheat_avj}, 0 }, + // [Nugget] ---------------------------------------------------------------- + { input_infammo, not_net|not_demo, {cheat_infammo}, 0 }, + { input_fastweaps, not_net|not_demo, {cheat_fastweaps}, 0 }, + { input_resurrect, not_net|not_demo, {cheat_resurrect}, 0 }, + { input_fly, not_net|not_demo, {cheat_fly}, 0 }, + { input_summonr, not_net|not_demo, {cheat_summonr}, 0 }, + { input_linetarget, not_net|not_demo, {cheat_linetarget}, 0 }, + { input_mdk, not_net|not_demo, {cheat_mdk}, 0 }, + { input_saitama, not_net|not_demo, {cheat_saitama}, 0 }, + { input_boomcan, not_net|not_demo, {cheat_boomcan}, 0 }, }; boolean M_CheatResponder(event_t *ev) diff --git a/src/m_input.h b/src/m_input.h index 0ba8de35b..ec602f26d 100644 --- a/src/m_input.h +++ b/src/m_input.h @@ -108,10 +108,10 @@ enum input_map_zoomout, input_map_mark, input_map_clear, - input_map_mini, // [Nugget] Minimap input_map_blink, // [Nugget] Blink marks input_map_tagfinder, // [Nugget] Tag Finder from PrBoomX input_map_teleport, // [Nugget] Teleport to Automap pointer + input_map_mini, // [Nugget] Minimap input_map_gobig, input_map_grid, input_map_overlay, @@ -141,6 +141,17 @@ enum input_notarget, input_freeze, input_avj, + // [Nugget] /------------------------ + input_infammo, + input_fastweaps, + input_resurrect, + input_fly, + input_summonr, + input_linetarget, + input_mdk, + input_saitama, + input_boomcan, + // [Nugget] ------------------------/ NUM_INPUT_ID }; diff --git a/src/m_menu.c b/src/m_menu.c index 200e79ddd..b3124e1fb 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2821,7 +2821,10 @@ setup_menu_t keys_settings6[]; setup_menu_t keys_settings7[]; setup_menu_t keys_settings8[]; setup_menu_t keys_settings9[]; -setup_menu_t keys_settings10[], keys_settings11[]; // [Nugget] +// [Nugget] +setup_menu_t keys_settings10[]; +setup_menu_t keys_settings11[]; +setup_menu_t keys_settings12[]; // The table which gets you from one screen table to the next. setup_menu_t* keys_settings[] = @@ -2838,6 +2841,7 @@ setup_menu_t* keys_settings[] = // [Nugget] keys_settings10, keys_settings11, + keys_settings12, NULL }; @@ -3208,6 +3212,42 @@ setup_menu_t keys_settings11[] = {"Fancy Teleport", S_YESNO|S_STRICT|S_CRITICAL, m_null, KB_X, M_Y + keys11_fancytp * M_SPC, {"fancy_teleport"}}, {"<- PREV", S_SKIP|S_PREV, m_null, M_X_PREV, M_Y_PREVNEXT, {keys_settings10}}, + {"NEXT ->", S_SKIP|S_NEXT, m_null, M_X_NEXT, M_Y_PREVNEXT, {keys_settings12}}, + + // Final entry + + {0,S_SKIP|S_END,m_null} + +}; + +enum { + keys12_title1, + keys12_infammo, + keys12_fastweaps, + keys12_resurrect, + keys12_fly, + keys12_summonr, + keys12_linetarg, + keys12_mdk, + keys12_saitama, + keys12_boomcan, +}; + +setup_menu_t keys_settings12[] = +{ + {"Nugget - Cheats", S_SKIP|S_TITLE, m_null, CHEAT_X, M_Y + keys12_title1 * M_SPC}, + + {"Infinite Ammo", S_INPUT, m_scrn, CHEAT_X, M_Y + keys12_infammo * M_SPC, {0}, input_infammo}, + {"Fast Weapons", S_INPUT, m_scrn, CHEAT_X, M_Y + keys12_fastweaps * M_SPC, {0}, input_fastweaps}, + {"Resurrect", S_INPUT, m_scrn, CHEAT_X, M_Y + keys12_resurrect * M_SPC, {0}, input_resurrect}, + {"Flight Mode", S_INPUT, m_scrn, CHEAT_X, M_Y + keys12_fly * M_SPC, {0}, input_fly}, + {"Repeat Last Summon", S_INPUT, m_scrn, CHEAT_X, M_Y + keys12_summonr * M_SPC, {0}, input_summonr}, + {"Linetarget Query", S_INPUT, m_scrn, CHEAT_X, M_Y + keys12_linetarg * M_SPC, {0}, input_linetarget}, + {"MDK Attack", S_INPUT, m_scrn, CHEAT_X, M_Y + keys12_mdk * M_SPC, {0}, input_mdk}, + {"MDK Fist", S_INPUT, m_scrn, CHEAT_X, M_Y + keys12_saitama * M_SPC, {0}, input_saitama}, + {"Explosive Hitscan", S_INPUT, m_scrn, CHEAT_X, M_Y + keys12_boomcan * M_SPC, {0}, input_boomcan}, + + {"<- PREV",S_SKIP|S_PREV,m_null,M_X_PREV,M_Y_PREVNEXT, {keys_settings11}}, // Final entry @@ -3672,7 +3712,7 @@ setup_menu_t stat_settings4[] = {"Nugget - Extended HUD", S_SKIP|S_TITLE, m_null, M_X, M_Y + stat4_title1 * M_SPC}, {"Show Powerup Timers", S_YESNO|S_COSMETIC, m_null, M_X, M_Y + stat4_powers * M_SPC, {"hud_power_timers"}}, - {"Alternative Arms Display", S_YESNO, m_null, M_X, M_Y + stat4_altarms * M_SPC, {"alt_arms"}}, + {"Alternative Arms Display", S_YESNO, m_null, M_X, M_Y + stat4_altarms * M_SPC, {"alt_arms"}, 0, ST_createWidgets}, {"Smart Totals", S_YESNO, m_null, M_X, M_Y + stat4_smart * M_SPC, {"smarttotals"}}, {"Show Kills Percentage", S_YESNO, m_null, M_X, M_Y + stat4_killspct * M_SPC, {"hud_kills_percentage"}}, @@ -4840,6 +4880,17 @@ setup_menu_t gen_settings5[] = { // General Settings screen5 // [Nugget] /----------------------------------------------------------------- +static void M_ChangeViewHeight(void) +{ + static int oldviewheight = 0; + + for (int i = 0; i < MAXPLAYERS; i++) + if (playeringame[i] && players[i].playerstate == PST_LIVE) + { players[i].viewheight += (viewheight_value - oldviewheight) * FRACUNIT; } + + oldviewheight = viewheight_value; +} + static const char *over_under_str[] = { "Off", "Player Only", "All Things", NULL }; @@ -4863,7 +4914,7 @@ setup_menu_t gen_settings6[] = { {"Nugget - View", S_SKIP|S_TITLE, m_null, M_X, M_Y + gen6_title2 * M_SPC}, {"Field of View", S_NUM |S_STRICT, m_null, M_X, M_Y + gen6_fov * M_SPC, {"fov"}, 0, M_SetFOV}, - {"View Height", S_NUM |S_STRICT, m_null, M_X, M_Y + gen6_viewheight * M_SPC, {"viewheight_value"}}, + {"View Height", S_NUM |S_STRICT, m_null, M_X, M_Y + gen6_viewheight * M_SPC, {"viewheight_value"}, 0, M_ChangeViewHeight}, {"View Bobbing Percentage", S_NUM, m_null, M_X, M_Y + gen6_viewbobbing * M_SPC, {"view_bobbing_percentage"}}, {"Impact Pitch", S_CHOICE|S_STRICT, m_null, M_X, M_Y + gen6_impactpitch * M_SPC, {"impact_pitch"}, 0, NULL, impact_pitch_str}, {"Explosion Shake Effect", S_YESNO |S_STRICT, m_null, M_X, M_Y + gen6_expshake * M_SPC, {"explosion_shake"}}, @@ -4882,6 +4933,10 @@ setup_menu_t gen_settings6[] = { {0,S_SKIP|S_END,m_null} }; +static const char *fake_contrast_styles[] = { + "Off", "Smooth", "Vanilla", NULL +}; + static const char *s_clipping_dists[] = { "1200", "2400", NULL }; @@ -4894,14 +4949,14 @@ setup_menu_t gen_settings7[] = { {"Nugget - Display", S_SKIP|S_TITLE, m_null, M_X, M_Y + gen7_title1 * M_SPC}, - {"Background For All Menus", S_YESNO, m_null, M_X, M_Y + gen7_menubgall * M_SPC, {"menu_background_all"}}, - {"Disable Palette Tint in Menus", S_YESNO|S_STRICT, m_null, M_X, M_Y + gen7_menutint * M_SPC, {"no_menu_tint"}}, - {"Disable Berserk Tint", S_YESNO|S_STRICT, m_null, M_X, M_Y + gen7_berserktint * M_SPC, {"no_berserk_tint"}}, - {"Disable Radiation Suit Tint", S_YESNO|S_STRICT, m_null, M_X, M_Y + gen7_radsuittint * M_SPC, {"no_radsuit_tint"}}, - {"Damage Tint Cap", S_NUM |S_STRICT, m_null, M_X, M_Y + gen7_dmgcountcap * M_SPC, {"damagecount_cap"}}, - {"Bonus Tint Cap", S_NUM |S_STRICT, m_null, M_X, M_Y + gen7_boncountcap * M_SPC, {"bonuscount_cap"}}, - {"Fake Contrast", S_YESNO|S_STRICT, m_null, M_X, M_Y + gen7_fakecontrast * M_SPC, {"fake_contrast"}}, - {"Screen Wipe Speed Percentage", S_NUM |S_STRICT, m_null, M_X, M_Y + gen7_wipespeed * M_SPC, {"wipe_speed_percentage"}}, + {"Background For All Menus", S_YESNO, m_null, M_X, M_Y + gen7_menubgall * M_SPC, {"menu_background_all"}}, + {"Disable Palette Tint in Menus", S_YESNO |S_STRICT, m_null, M_X, M_Y + gen7_menutint * M_SPC, {"no_menu_tint"}}, + {"Disable Berserk Tint", S_YESNO |S_STRICT, m_null, M_X, M_Y + gen7_berserktint * M_SPC, {"no_berserk_tint"}}, + {"Disable Radiation Suit Tint", S_YESNO |S_STRICT, m_null, M_X, M_Y + gen7_radsuittint * M_SPC, {"no_radsuit_tint"}}, + {"Damage Tint Cap", S_NUM |S_STRICT, m_null, M_X, M_Y + gen7_dmgcountcap * M_SPC, {"damagecount_cap"}}, + {"Bonus Tint Cap", S_NUM |S_STRICT, m_null, M_X, M_Y + gen7_boncountcap * M_SPC, {"bonuscount_cap"}}, + {"Fake Contrast", S_CHOICE|S_STRICT, m_null, M_X, M_Y + gen7_fakecontrast * M_SPC, {"fake_contrast"}, 0, NULL, fake_contrast_styles}, + {"Screen Wipe Speed Percentage", S_NUM |S_STRICT, m_null, M_X, M_Y + gen7_wipespeed * M_SPC, {"wipe_speed_percentage"}}, {"", S_SKIP, m_null, M_X, M_Y + gen7_stub1 * M_SPC}, {"Nugget - Miscellaneous", S_SKIP|S_TITLE, m_null, M_X, M_Y + gen7_title2 * M_SPC}, diff --git a/src/m_misc.c b/src/m_misc.c index 4a6b84347..7fcd20ce0 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -866,8 +866,15 @@ default_t defaults[] = { { "fake_contrast", (config_t *) &fake_contrast, NULL, + {1}, {0,2}, number, ss_gen, wad_yes, + "Fake contrast for walls (0 = Off, 1 = Smooth, 2 = Vanilla)" + }, + + { + "diminished_lighting", + (config_t *) &diminished_lighting, NULL, {1}, {0,1}, number, ss_gen, wad_yes, - "1 to apply fake contrast to walls" + "1 to enable diminished lighting (light emitted by player)" }, { @@ -1688,6 +1695,37 @@ default_t defaults[] = { input_mouselook, { {0, 0} } }, + { // [Nugget] + "input_crosshair", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to toggle crosshair", + input_crosshair, { {0, 0} } + }, + + { // [Nugget] + "input_zoom", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to toggle zoom", + input_zoom, { {0, 0} } + }, + + { // [Nugget] + "zoom_fov", + (config_t *) &zoom_fov, NULL, + {MINFOV}, {MINFOV,MAXFOV}, number, ss_keys, wad_no, + "Field of View when zoom is enabled" + }, + + { // [Nugget] + "input_chasecam", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to cycle through chasecam modes", + input_chasecam, { {0, 0} } + }, + { // phares 3/7/98 "input_menu_right", NULL, NULL, @@ -1880,6 +1918,22 @@ default_t defaults[] = { input_speed, { {input_type_key, KEY_RSHIFT} } }, + { // [Nugget] + "input_jump", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to jump", + input_jump, { {input_type_key, KEY_RALT} } + }, + + { // [Nugget] + "input_crouch", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to crouch/duck", + input_crouch, { {input_type_key, 'c'} } + }, + { "input_savegame", NULL, NULL, @@ -2083,6 +2137,14 @@ default_t defaults[] = { {input_type_mouseb, MOUSE_BUTTON_WHEELDOWN} } }, + { // [Nugget] + "input_map_mini", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to activate minimap mode", + input_map_mini, { {0, 0} } + }, + { "input_map_gobig", NULL, NULL, @@ -2115,6 +2177,37 @@ default_t defaults[] = { input_map_clear, { {input_type_key, 'c'} } }, + { // [Nugget] + "input_map_blink", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to make automap markers blink", + input_map_blink, { {input_type_key, 'b'} } + }, + + { // [Nugget] + "input_map_tagfinder", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to find associated sectors and lines", + input_map_tagfinder, { {0, 0} } + }, + + { // [Nugget] + "input_map_teleport", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to teleport to automap pointer", + input_map_teleport, { {0, 0} } + }, + + { // [Nugget] + "fancy_teleport", + (config_t *) &fancy_teleport, NULL, + {1}, {0,1}, number, ss_keys, wad_no, + "Use effects when teleporting to pointer (fog, sound and zoom)" + }, + { "input_map_grid", NULL, NULL, @@ -2291,6 +2384,82 @@ default_t defaults[] = { input_avj, { {0, 0} } }, + // [Nugget] /--------------------------------------------------------------- + + { + "input_infammo", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to toggle infinite ammo", + input_infammo, { {0, 0} } + }, + + { + "input_fastweaps", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to toggle fast weapons", + input_fastweaps, { {0, 0} } + }, + + { + "input_resurrect", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to resurrect", + input_resurrect, { {0, 0} } + }, + + { + "input_fly", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to toggle fly mode", + input_fly, { {0, 0} } + }, + + { + "input_summonr", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to summon last summoned mobj", + input_summonr, { {0, 0} } + }, + + { + "input_linetarget", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to toggle linetarget query mode", + input_linetarget, { {0, 0} } + }, + + { + "input_mdk", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to perform MDK attack", + input_mdk, { {0, 0} } + }, + + { + "input_saitama", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to toggle MDK Fist", + input_saitama, { {0, 0} } + }, + + { + "input_boomcan", + NULL, NULL, + {0}, {UL,UL}, input, ss_keys, wad_no, + "key to toggle explosive hitscan attacks", + input_boomcan, { {0, 0} } + }, + + // [Nugget] ---------------------------------------------------------------/ + { "input_chat_dest0", NULL, NULL, @@ -2560,96 +2729,6 @@ default_t defaults[] = { "1 to invert gamepad look axis" }, - // [Nugget] /--------------------------------------------------------------- - - { - "input_jump", - NULL, NULL, - {0}, {UL,UL}, input, ss_keys, wad_no, - "key to jump", - input_jump, { {input_type_key, KEY_RALT} } - }, - - { - "input_crouch", - NULL, NULL, - {0}, {UL,UL}, input, ss_keys, wad_no, - "key to crouch/duck", - input_crouch, { {input_type_key, 'c'} } - }, - - { - "input_crosshair", - NULL, NULL, - {0}, {UL,UL}, input, ss_keys, wad_no, - "key to toggle crosshair", - input_crosshair, { {0, 0} } - }, - - { - "input_zoom", - NULL, NULL, - {0}, {UL,UL}, input, ss_keys, wad_no, - "key to toggle zoom", - input_zoom, { {0, 0} } - }, - - { - "input_chasecam", - NULL, NULL, - {0}, {UL,UL}, input, ss_keys, wad_no, - "key to cycle through chasecam modes", - input_chasecam, { {0, 0} } - }, - - { - "zoom_fov", - (config_t *) &zoom_fov, NULL, - {MINFOV}, {MINFOV,MAXFOV}, number, ss_keys, wad_no, - "Field of View when zoom is enabled" - }, - - { - "input_map_mini", - NULL, NULL, - {0}, {UL,UL}, input, ss_keys, wad_no, - "key to activate minimap mode", - input_map_mini, { {0, 0} } - }, - - { - "input_map_blink", - NULL, NULL, - {0}, {UL,UL}, input, ss_keys, wad_no, - "key to make automap markers blink", - input_map_blink, { {input_type_key, 'b'} } - }, - - { - "input_map_tagfinder", - NULL, NULL, - {0}, {UL,UL}, input, ss_keys, wad_no, - "key to find associated sectors and lines", - input_map_tagfinder, { {0, 0} } - }, - - { - "input_map_teleport", - NULL, NULL, - {0}, {UL,UL}, input, ss_keys, wad_no, - "key to teleport to automap pointer", - input_map_teleport, { {0, 0} } - }, - - { - "fancy_teleport", - (config_t *) &fancy_teleport, NULL, - {1}, {0,1}, number, ss_keys, wad_no, - "Use effects when teleporting to pointer (fog, sound and zoom)" - }, - - // [Nugget] ---------------------------------------------------------------/ - { //jff 4/3/98 allow unlimited sensitivity "mouse_sensitivity", (config_t *) &mouseSensitivity_horiz, NULL, diff --git a/src/m_nughud.c b/src/m_nughud.c index 59824b75b..04918206b 100644 --- a/src/m_nughud.c +++ b/src/m_nughud.c @@ -109,7 +109,7 @@ default_t nughud_defaults[] = { { "nughud_message_y", (config_t *)&nughud.message.y, NULL, { 0 }, { 0, 200 }, number }, { "nughud_message_wide", (config_t *)&nughud.message.wide, NULL, { -2 }, { -2, 2 }, number }, { "nughud_message_align", (config_t *)&nughud.message.align, NULL, { -1 }, { -1, 1 }, number }, - TEXTLINE( "nughud_secret", nughud.secret, 160, 86, 0, 0 ), + TEXTLINE( "nughud_secret", nughud.secret, 160, 84, 0, 0 ), PATCH( "nughud_patch1", 0 ), PATCH( "nughud_patch2", 1 ), PATCH( "nughud_patch3", 2 ), @@ -121,7 +121,8 @@ default_t nughud_defaults[] = { TOGGLE( "nughud_percents", nughud.percents, 1 ), TOGGLE( "nughud_patch_offsets", nughud.patch_offsets, 1 ), - { "nughud_weapheight", (config_t *)&nughud.weapheight, NULL, { 0 }, { 0, 200 }, number }, + { "nughud_weapheight", (config_t *)&nughud.weapheight, NULL, { 0 }, { -32, 32 }, number }, + { "nughud_viewoffset", (config_t *)&nughud.viewoffset, NULL, { 0 }, { -16, 16 }, number }, { NULL } // last entry }; diff --git a/src/m_nughud.h b/src/m_nughud.h index ba89921a9..ec56dc58f 100644 --- a/src/m_nughud.h +++ b/src/m_nughud.h @@ -77,6 +77,7 @@ typedef struct nughud_s { boolean percents; fixed_t weapheight; + int viewoffset; } nughud_t; extern nughud_t nughud; diff --git a/src/p_doors.c b/src/p_doors.c index 17ed723fb..0160f8902 100644 --- a/src/p_doors.c +++ b/src/p_doors.c @@ -168,6 +168,7 @@ void T_VerticalDoor (vldoor_t *door) // [Nugget]: [crispy] fix "fast doors reopening with wrong sound" case blazeRaise: + case genBlazeRaise: if (STRICTMODE(!comp_blazing2)) { door->direction = 1; diff --git a/src/p_map.c b/src/p_map.c index 6d877eb55..4292e643e 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2014,8 +2014,8 @@ void P_PositionChasecam(fixed_t z, fixed_t dist, fixed_t slope) const boolean intercepts_overflow_enabled = overflow[emu_intercepts].enabled; dist += FRACUNIT; - x2 = viewx + (dist >> FRACBITS) * finecosine[angle]; - y2 = viewy + (dist >> FRACBITS) * finesine[angle]; + x2 = viewx + FixedMul(dist, finecosine[angle]); + y2 = viewy + FixedMul(dist, finesine[angle]); shootz = z; attackrange = dist; aimslope = slope; diff --git a/src/p_user.c b/src/p_user.c index 07d849774..efe07cf93 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -179,7 +179,7 @@ void P_CalcHeight (player_t* player) player->viewheight += breathing_val; } - + if (player->viewheight > view) { player->viewheight = view; @@ -201,9 +201,20 @@ void P_CalcHeight (player_t* player) } } - // [Nugget] Account for crouching - player->viewz = player->mo->z + player->viewheight + bob - player->crouchoffset; - + player->viewz = player->mo->z + player->viewheight + bob; + + // [Nugget] Account for crouching, but don't clip view through the floor + if (player->crouchoffset) + { + fixed_t crouchoffset = player->crouchoffset; + + if ((player->viewz - crouchoffset) < (player->mo->floorz + FRACUNIT)) + { crouchoffset = player->viewz - (player->mo->floorz + FRACUNIT); } + + // Do clip view through the floor if not because of crouching + player->viewz -= MAX(0, crouchoffset); + } + if (player->viewz > player->mo->ceilingz-4*FRACUNIT) player->viewz = player->mo->ceilingz-4*FRACUNIT; } @@ -219,9 +230,7 @@ void P_MovePlayer (player_t* player) { ticcmd_t *cmd = &player->cmd; mobj_t *mo = player->mo; - // [Nugget] - static boolean crouchKeyDown = false; - int cforwardmove, csidemove; + static boolean crouchKeyDown = false; // [Nugget] mo->angle += cmd->angleturn << 16; onground = (mo->z <= mo->floorz @@ -378,23 +387,26 @@ void P_MovePlayer (player_t* player) int bobfactor = friction < ORIG_FRICTION ? movefactor : ORIG_FRICTION_FACTOR; - // [Nugget] - cforwardmove = cmd->forwardmove; - csidemove = cmd->sidemove; - // Check for crouching + // [Nugget] /------------------------------------------------------- + + char forwardmove = cmd->forwardmove, + sidemove = cmd->sidemove; + if (player->mo->intflags & MIF_CROUCHING) - { cforwardmove /= 2; csidemove /= 2; } + { forwardmove /= 2; sidemove /= 2; } + + // [Nugget] -------------------------------------------------------/ if (cmd->forwardmove) { - P_Bob(player,mo->angle,cforwardmove*bobfactor); - P_Thrust(player,mo->angle,cforwardmove*movefactor); + P_Bob(player,mo->angle,forwardmove*bobfactor); + P_Thrust(player,mo->angle,forwardmove*movefactor); } if (cmd->sidemove) { - P_Bob(player,mo->angle-ANG90,csidemove*bobfactor); - P_Thrust(player,mo->angle-ANG90,csidemove*movefactor); + P_Bob(player,mo->angle-ANG90,sidemove*bobfactor); + P_Thrust(player,mo->angle-ANG90,sidemove*movefactor); } } // [Nugget] Allow minimal mid-air movement if Jumping is enabled diff --git a/src/r_main.c b/src/r_main.c index 6e3f86b07..b5a5e6be4 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -31,6 +31,7 @@ #include "st_stuff.h" #include "hu_stuff.h" // [Nugget] +#include "m_nughud.h" #include "m_random.h" #include "p_map.h" #include "p_mobj.h" @@ -629,7 +630,11 @@ void R_ExecuteSetViewSize (void) if (fovfx[FOVFX_ZOOM].target != zoomtarget) { fovchange = true; } else for (i = 0; i < NUMFOVFX; i++) - if (fovfx[i].target || fovfx[i].current) { fovchange = true; } + if (fovfx[i].target || fovfx[i].current) + { + fovchange = true; + break; + } } if (fovchange) @@ -639,6 +644,7 @@ void R_ExecuteSetViewSize (void) fovchange = false; fovfx[FOVFX_ZOOM].old = fovfx[FOVFX_ZOOM].current = fovfx[FOVFX_ZOOM].target; + if (zoomtarget || fovfx[FOVFX_ZOOM].target) { // Special handling for zoom @@ -650,13 +656,16 @@ void R_ExecuteSetViewSize (void) if ( (sign > 0 && fovfx[FOVFX_ZOOM].target > zoomtarget) || (sign < 0 && fovfx[FOVFX_ZOOM].target < zoomtarget)) - { fovfx[FOVFX_ZOOM].target = zoomtarget; } + { + fovfx[FOVFX_ZOOM].target = zoomtarget; + } if (fovfx[FOVFX_ZOOM].current != fovfx[FOVFX_ZOOM].target) { fovchange = true; } } fovfx[FOVFX_TELEPORT].old = fovfx[FOVFX_TELEPORT].current = fovfx[FOVFX_TELEPORT].target; + if (fovfx[FOVFX_TELEPORT].target) { if ((fovfx[FOVFX_TELEPORT].target -= 5) < 0) @@ -878,13 +887,15 @@ void R_SetupFrame (player_t *player) // [Nugget] Mitigate `PLAYER_SLOPE()` and `lookdir` misalignment pitch *= FOVDIFF2; + if (STRICTMODE(st_crispyhud)) { pitch += nughud.viewoffset; } // [Nugget] NUGHUD + // [Nugget] Explosion shake effect chasecamheight = chasecam_height * FRACUNIT; if (shake > 0) { static fixed_t xofs=0, yofs=0, zofs=0; - if (!(menuactive || paused)) + if (!((menuactive && !demoplayback && !netgame) || paused)) { static int oldtime = -1; @@ -909,12 +920,12 @@ void R_SetupFrame (player_t *player) chasecam_on = STRICTMODE(chasecam_mode || (death_camera && player->mo->health <= 0 && player->playerstate == PST_DEAD)); if (chasecam_on) { - static fixed_t extradist = 0; + static fixed_t oldextradist = 0, extradist = 0; const fixed_t z = MIN(playerz + ((player->mo->health <= 0 && player->playerstate == PST_DEAD) ? 6*FRACUNIT : chasecamheight), player->mo->ceilingz - (2*FRACUNIT)); fixed_t slope; - fixed_t dist = chasecam_distance*FRACUNIT; - const fixed_t oldviewx = viewx, oldviewy = viewy; + fixed_t dist = chasecam_distance * FRACUNIT; + const fixed_t oldviewx = viewx, oldviewy = viewy; const angle_t oldviewangle = viewangle; if (chasecam_mode == CHASECAMMODE_FRONT) @@ -924,19 +935,24 @@ void R_SetupFrame (player_t *player) pitch = -pitch; } - dist += extradist; - - { // `extradist` is applied on the next tic + { static int oldtic = -1; - if (gametic != oldtic) { + if (oldtic != gametic) { + oldextradist = extradist; extradist = FixedMul(player->mo->momx, finecosine[viewangle >> ANGLETOFINESHIFT]) + FixedMul(player->mo->momy, finesine[viewangle >> ANGLETOFINESHIFT]); } - + oldtic = gametic; } + if (uncapped && leveltime > 1 && player->mo->interp == true && leveltime > oldleveltime) + { + dist += oldextradist + FixedMul(extradist - oldextradist, fractionaltic); + } + else { dist += extradist; } + P_PositionChasecam(z, dist, slope = (-(lookdir * FRACUNIT) / PLAYER_SLOPE_DENOM)); if (chasecam.hit) { @@ -945,15 +961,17 @@ void R_SetupFrame (player_t *player) viewz = chasecam.z; } else { - const fixed_t dx = FixedMul(dist, finecosine[viewangle >> ANGLETOFINESHIFT]); - const fixed_t dy = FixedMul(dist, finesine[viewangle >> ANGLETOFINESHIFT]); + const fixed_t dx = FixedMul(dist, finecosine[viewangle >> ANGLETOFINESHIFT]), + dy = FixedMul(dist, finesine[viewangle >> ANGLETOFINESHIFT]); + const sector_t *const sec = R_PointInSubsector(viewx-dx, viewy-dy)->sector; - viewz = z + (slope * (dist / FRACUNIT)); + viewz = z + FixedMul(slope, dist); if (viewz < sec->floorheight+FRACUNIT || sec->ceilingheight-FRACUNIT < viewz) { fixed_t frac; + viewz = BETWEEN(sec->floorheight+FRACUNIT, sec->ceilingheight-FRACUNIT, viewz); frac = FixedDiv(viewz - z, FixedMul(slope, dist)); viewx -= FixedMul(dx, frac); diff --git a/src/r_plane.c b/src/r_plane.c index f14db09eb..e56ef9b6c 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -165,6 +165,9 @@ static void R_MapPlane(int y, int x1, int x2) index = distance >> LIGHTZSHIFT; if (index >= MAXLIGHTZ ) index = MAXLIGHTZ-1; + + if (STRICTMODE(!diminished_lighting)) { index = MAXLIGHTZ-1; } // [Nugget] + ds_colormap[0] = planezlight[index]; ds_colormap[1] = fullcolormap; } diff --git a/src/r_segs.c b/src/r_segs.c index 18836dba7..bd151f926 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -113,15 +113,19 @@ void R_RenderMaskedSegRange(drawseg_t *ds, int x1, int x2) ->lightlevel >> LIGHTSEGSHIFT)+extralight; // [crispy] smoother fake contrast - if (NOTSTRICTMODE(fake_contrast)) // [Nugget] - { lightnum += curline->fakecontrast; } -#if 0 - if (curline->v1->y == curline->v2->y) - lightnum--; - else - if (curline->v1->x == curline->v2->x) - lightnum++; -#endif + if (BETWEEN(strictmode, 2, fake_contrast) == 1) // [Nugget] + { + lightnum += curline->fakecontrast; + } + // [Nugget] Vanilla effect + else if (BETWEEN(strictmode, 2, fake_contrast) == 2) + { + if (curline->v1->y == curline->v2->y) + lightnum--; + else + if (curline->v1->x == curline->v2->x) + lightnum++; + } walllights = lightnum >= LIGHTLEVELS ? scalelight[LIGHTLEVELS-1] : lightnum < 0 ? scalelight[0] : scalelight[lightnum]; @@ -164,6 +168,8 @@ void R_RenderMaskedSegRange(drawseg_t *ds, int x1, int x2) if (index >= MAXLIGHTSCALE ) index = MAXLIGHTSCALE-1; + if (STRICTMODE(!diminished_lighting)) { index = 0; } // [Nugget] + dc_colormap[0] = dc_colormap[1] = walllights[index]; } @@ -381,6 +387,9 @@ static void R_RenderSegLoop (void) if (index >= MAXLIGHTSCALE ) index = MAXLIGHTSCALE-1; + + if (STRICTMODE(!diminished_lighting)) { index = 0; } // [Nugget] + dc_colormap[0] = walllights[index]; dc_colormap[1] = (!fixedcolormap && STRICTMODE(brightmaps)) ? fullcolormap : dc_colormap[0]; @@ -777,14 +786,19 @@ void R_StoreWallRange(const int start, const int stop) int lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT)+extralight; // [crispy] smoother fake contrast - if (NOTSTRICTMODE(fake_contrast)) // [Nugget] - { lightnum += curline->fakecontrast; } -#if 0 - if (curline->v1->y == curline->v2->y) - lightnum--; - else if (curline->v1->x == curline->v2->x) - lightnum++; -#endif + if (BETWEEN(strictmode, 2, fake_contrast) == 1) // [Nugget] + { + lightnum += curline->fakecontrast; + } + // [Nugget] Vanilla effect + else if (BETWEEN(strictmode, 2, fake_contrast) == 2) + { + if (curline->v1->y == curline->v2->y) + lightnum--; + else if (curline->v1->x == curline->v2->x) + lightnum++; + } + if (lightnum < 0) walllights = scalelight[0]; else if (lightnum >= LIGHTLEVELS) diff --git a/src/r_things.c b/src/r_things.c index d96aeffcf..6bf4b2bc8 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -640,6 +640,9 @@ void R_ProjectSprite (mobj_t* thing) int index = (int) (xscale/fovdiff) / ((1 << LIGHTSCALESHIFT) * hires); // killough 11/98 if (index >= MAXLIGHTSCALE) index = MAXLIGHTSCALE-1; + + if (STRICTMODE(!diminished_lighting)) { index = 0; } // [Nugget] + vis->colormap[0] = spritelights[index]; vis->colormap[1] = fullcolormap; } @@ -799,7 +802,10 @@ void R_DrawPSprite (pspdef_t *psp, boolean translucent) // [Nugget] Translucent vis->colormap[0] = vis->colormap[1] = fullcolormap; // full bright // killough 3/20/98 else { - vis->colormap[0] = spritelights[MAXLIGHTSCALE-1]; // local light + // [Nugget] + const int index = (STRICTMODE(!diminished_lighting)) ? 0 : MAXLIGHTSCALE-1; + + vis->colormap[0] = spritelights[index]; // local light vis->colormap[1] = fullcolormap; } vis->brightmap = R_BrightmapForState(psp->state - states); diff --git a/src/st_stuff.c b/src/st_stuff.c index a43efaa22..cbd0bf72c 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -129,8 +129,6 @@ int st_crispyhud; // [Nugget] Now an int static boolean st_classicstatusbar; static boolean st_statusbarface; // [Nugget] Face may still be drawn in NUGHUD -void ST_createWidgets(); // [Nugget] Prototype this - // !deathmatch static boolean st_notdeathmatch; @@ -1199,18 +1197,15 @@ void ST_Drawer(boolean fullscreen, boolean refresh) st_classicstatusbar = st_statusbaron && !st_crispyhud; st_statusbarface = st_classicstatusbar || (st_crispyhud && nughud.face.x > -1); - // [Nugget] NUGHUD /-------------------------------------------------------- - + // [Nugget] NUGHUD if (oldcrispy != st_crispyhud) { ST_createWidgets(); ST_updateWidgets(); HU_Start(); - } - - oldcrispy = st_crispyhud; - // [Nugget] ---------------------------------------------------------------/ + oldcrispy = st_crispyhud; + } ST_doPaletteStuff(); // Do red-/gold-shifts from damage/items diff --git a/src/st_stuff.h b/src/st_stuff.h index 1b3b35d14..d42602280 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -139,6 +139,8 @@ void ST_Warnings(void); // [crispy] forcefully initialize the status bar backing screen extern void ST_refreshBackground(boolean force); +extern void ST_createWidgets(void); // [Nugget] + // killough 5/2/98: moved from m_misc.c: // [Alaux]