From 25fccaae92e72f57cceccf2ee080bb0eed75fd11 Mon Sep 17 00:00:00 2001 From: Eric Vidal Date: Sun, 8 May 2022 05:15:45 +0800 Subject: [PATCH] - extended viewsize (and mouse sensitivity) limits --- README.md | 7 ++++++- WOLFSRC/VERSION.H | 2 +- WOLFSRC/WL_ACT2.C | 3 +++ WOLFSRC/WL_DRAW.C | 24 ++++++++++++++++++++++++ WOLFSRC/WL_GAME.C | 20 ++++++++++++++++++++ WOLFSRC/WL_INTER.C | 10 ++++++++++ WOLFSRC/WL_MENU.C | 33 +++++++++++++++++---------------- WOLFSRC/_WVER.H | 2 +- 8 files changed, 82 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 5de0711..7a8553e 100644 --- a/README.md +++ b/README.md @@ -300,8 +300,13 @@ Usage Version History =============== -1.49 (2022-xx-xx) +1.49 (2022-05-08) ----------------- +- Now allows menu setting of the view size and mouse sensitivity to be stretched to the unofficial limits supported by the engine, both in the modern-controls and MPU-only versions. (Why both? Because players have enabled this on vanilla Wolf3D by hacking the config file -- so we might as well give them the full freedom. :)) +- Special fixes to make the maximum view size (AKA "borderless mode") work better: + - Fixed missing vertical wall lines/columns by disabling the related column-drawing optimization (but only for this view size). This eliminates no-clip-like artifacts when hugging walls at an angle, but note that this makes the game run a bit slower than vanilla, so only use the maximum view size if you don't mind (or notice) the performance penalty. + - Now properly renders the view's bottom border. (This also entails erasing this border when the game goes into the Get Psyched, level completion and victory screens.) + - Note that game logic determinism is slightly different on maximum view size. In fact, if you ever feel that the game plays differently, e.g., enemies take unusually more shots, it's probably due to your view size. _This is a known problem of the vanilla Wolf3D engine,_ with the view size determining your exact shooting radius. To see the problem in action, play back the shareware version's first demo on different view sizes -- the demo ends sooner than normal at the maximum view size, when BJ misses a shot on a guard and tries to run past him instead. - Expanded COMP 256 to include other sound fixes that potentially alter gameplay from the original (such as muted door re-opening, non-positioned pushwall sound, etc.). - Fixed some quirks when using the mouse to navigate menus (e.g., continuous triggering of options when the mouse button is held down). diff --git a/WOLFSRC/VERSION.H b/WOLFSRC/VERSION.H index f44b4e5..4352c9a 100644 --- a/WOLFSRC/VERSION.H +++ b/WOLFSRC/VERSION.H @@ -7,6 +7,6 @@ //#define DEBCHECK #define CARMACIZED //#define UPLOAD -#define VERSION 1.48 +#define VERSION 1.49 #define WOLFDOSMPU #define WASD diff --git a/WOLFSRC/WL_ACT2.C b/WOLFSRC/WL_ACT2.C index e5f0024..9d297d3 100644 --- a/WOLFSRC/WL_ACT2.C +++ b/WOLFSRC/WL_ACT2.C @@ -3783,6 +3783,9 @@ void A_StartDeathCam (objtype *ob) } gamestate.victoryflag = true; +#ifdef WOLFDOSMPU + VWB_Hlin(0, 319, 160, 127); +#endif // WOLFDOSMPU VW_Bar (0,0,320,200-STATUSLINES,127); FizzleFade(bufferofs,displayofs,320,200-STATUSLINES,70,false); diff --git a/WOLFSRC/WL_DRAW.C b/WOLFSRC/WL_DRAW.C index c6eccde..a00d7c3 100644 --- a/WOLFSRC/WL_DRAW.C +++ b/WOLFSRC/WL_DRAW.C @@ -490,7 +490,11 @@ void HitVertWall (void) if (lastside==1 && lastintercept == xtile && lasttilehit == tilehit) { // in the same wall type as last time, so check for optimized draw +#ifdef WOLFDOSMPU + if (texture == (unsigned) postsource && viewwidth < 320) +#else // WOLFDOSMPU if (texture == (unsigned)postsource) +#endif // WOLFDOSMPU { // wide scale postwidth++; @@ -567,7 +571,11 @@ void HitHorizWall (void) if (lastside==0 && lastintercept == ytile && lasttilehit == tilehit) { // in the same wall type as last time, so check for optimized draw +#ifdef WOLFDOSMPU + if (texture == (unsigned) postsource && viewwidth < 320) +#else // WOLFDOSMPU if (texture == (unsigned)postsource) +#endif // WOLFDOSMPU { // wide scale postwidth++; @@ -639,7 +647,11 @@ void HitHorizDoor (void) if (lasttilehit == tilehit) { // in the same door as last time, so check for optimized draw +#ifdef WOLFDOSMPU + if (texture == (unsigned) postsource && viewwidth < 320) +#else // WOLFDOSMPU if (texture == (unsigned)postsource) +#endif // WOLFDOSMPU { // wide scale postwidth++; @@ -707,7 +719,11 @@ void HitVertDoor (void) if (lasttilehit == tilehit) { // in the same door as last time, so check for optimized draw +#ifdef WOLFDOSMPU + if (texture == (unsigned) postsource && viewwidth < 320) +#else // WOLFDOSMPU if (texture == (unsigned)postsource) +#endif // WOLFDOSMPU { // wide scale postwidth++; @@ -786,7 +802,11 @@ void HitHorizPWall (void) if (lasttilehit == tilehit) { // in the same wall type as last time, so check for optimized draw +#ifdef WOLFDOSMPU + if (texture == (unsigned) postsource && viewwidth < 320) +#else // WOLFDOSMPU if (texture == (unsigned)postsource) +#endif // WOLFDOSMPU { // wide scale postwidth++; @@ -850,7 +870,11 @@ void HitVertPWall (void) if (lasttilehit == tilehit) { // in the same wall type as last time, so check for optimized draw +#ifdef WOLFDOSMPU + if (texture == (unsigned) postsource && viewwidth < 320) +#else // WOLFDOSMPU if (texture == (unsigned)postsource) +#endif // WOLFDOSMPU { // wide scale postwidth++; diff --git a/WOLFSRC/WL_GAME.C b/WOLFSRC/WL_GAME.C index 74666f8..0346a96 100644 --- a/WOLFSRC/WL_GAME.C +++ b/WOLFSRC/WL_GAME.C @@ -934,6 +934,13 @@ void DrawPlayBorderSides (void) yl = (200-STATUSLINES-viewheight)/2; #ifdef WOLFDOSMPU + if (viewwidth == 320) + { + VWB_Hlin(0, 319, 160, 125); + return; + } + VWB_Hlin(0, 319, 160, 127); + VWB_Bar (xl-1,0,viewwidth+2,yl-1,127); VWB_Bar (xl-1,yl+viewheight+1,viewwidth+2,yl-1,127); VWB_Hlin (xl,xl+viewwidth-1,yl-1,0); @@ -1019,6 +1026,15 @@ void DrawPlayBorder (void) yl = (200-STATUSLINES-viewheight)/2; VWB_Bar (xl,yl,viewwidth,viewheight,0); +#ifdef WOLFDOSMPU + if (viewwidth == 320) + { + VWB_Hlin(0, 319, 160, 125); + return; + } + VWB_Hlin(0, 319, 160, 127); +#endif // WOLFDOSMPU + VWB_Hlin (xl-1,xl+viewwidth,yl-1,0); VWB_Hlin (xl-1,xl+viewwidth,yl+viewheight,125); VWB_Vlin (yl-1,yl+viewheight,xl-1,0); @@ -1052,6 +1068,10 @@ void DrawPlayScreen (void) bufferofs = screenloc[i]; DrawPlayBorder (); VWB_DrawPic (0,200-STATUSLINES,STATUSBARPIC); +#ifdef WOLFDOSMPU + if (viewwidth == 320) + VWB_Hlin(0, 319, 160, 125); +#endif // WOLFDOSMPU } bufferofs = temp; diff --git a/WOLFSRC/WL_INTER.C b/WOLFSRC/WL_INTER.C index 5a0266c..9240655 100644 --- a/WOLFSRC/WL_INTER.C +++ b/WOLFSRC/WL_INTER.C @@ -162,6 +162,10 @@ void Victory (void) #endif +#ifdef WOLFDOSMPU + VWB_Hlin(0, 319, 160, 127); +#endif // WOLFDOSMPU + VWB_Bar (0,0,320,200-STATUSLINES,127); #ifdef JAPAN #ifndef JAPDEMO @@ -585,6 +589,9 @@ void LevelCompleted (void) CacheLump(LEVELEND_LUMP_START,LEVELEND_LUMP_END); ClearSplitVWB (); // set up for double buffering in split screen +#ifdef WOLFDOSMPU + VWB_Hlin(0, 319, 160, 127); +#endif // WOLFDOSMPU VWB_Bar (0,0,320,200-STATUSLINES,127); StartCPMusic(ENDLEVEL_MUS); @@ -1025,6 +1032,9 @@ void PreloadGraphics(void) DrawLevel (); ClearSplitVWB (); // set up for double buffering in split screen +#ifdef WOLFDOSMPU + VWB_Hlin(0, 319, 160, 127); +#endif // WOLFDOSMPU VWB_Bar (0,0,320,200-STATUSLINES,127); LatchDrawPic (20-14,80-3*8,GETPSYCHEDPIC); diff --git a/WOLFSRC/WL_MENU.C b/WOLFSRC/WL_MENU.C index b7cdfd8..8db4e97 100644 --- a/WOLFSRC/WL_MENU.C +++ b/WOLFSRC/WL_MENU.C @@ -2192,13 +2192,13 @@ void DrawMouseSens(void) VWB_Bar(60,97,200,10,TEXTCOLOR); DrawOutline(60,97,200,10,0,HIGHLIGHT); -#ifdef WASD +#ifdef WOLFDOSMPU DrawOutline(60+15*mouseadjustment,97,20,10,0,READCOLOR); VWB_Bar(61+15*mouseadjustment,98,19,9,READHCOLOR); -#else // WASD +#else // WOLFDOSMPU DrawOutline(60+20*mouseadjustment,97,20,10,0,READCOLOR); VWB_Bar(61+20*mouseadjustment,98,19,9,READHCOLOR); -#endif // WASD +#endif // WOLFDOSMPU VW_UpdateScreen(); MenuFadeIn(); @@ -2275,13 +2275,13 @@ void MouseSensitivity(void) mouseadjustment--; VWB_Bar(60,97,200,10,TEXTCOLOR); DrawOutline(60,97,200,10,0,HIGHLIGHT); -#ifdef WASD +#ifdef WOLFDOSMPU DrawOutline(60+15*mouseadjustment,97,20,10,0,READCOLOR); VWB_Bar(61+15*mouseadjustment,98,19,9,READHCOLOR); -#else // WASD +#else // WOLFDOSMPU DrawOutline(60+20*mouseadjustment,97,20,10,0,READCOLOR); VWB_Bar(61+20*mouseadjustment,98,19,9,READHCOLOR); -#endif // WASD +#endif // WOLFDOSMPU VW_UpdateScreen(); SD_PlaySound(MOVEGUN1SND); while(Keyboard[sc_LeftArrow]); @@ -2291,31 +2291,27 @@ void MouseSensitivity(void) case dir_South: case dir_East: -#ifdef WASD +#ifdef WOLFDOSMPU if (mouseadjustment<12) -#else // WASD +#else // WOLFDOSMPU if (mouseadjustment<9) -#endif // WASD +#endif // WOLFDOSMPU { #ifdef WOLFDOSMPU if (Keyboard[sc_DownArrow]) -#ifdef WASD mouseadjustment = 12; -#else // WASD - mouseadjustment = 9; -#endif // WASD else #endif // WOLFDOSMPU mouseadjustment++; VWB_Bar(60,97,200,10,TEXTCOLOR); DrawOutline(60,97,200,10,0,HIGHLIGHT); -#ifdef WASD +#ifdef WOLFDOSMPU DrawOutline(60+15*mouseadjustment,97,20,10,0,READCOLOR); VWB_Bar(61+15*mouseadjustment,98,19,9,READHCOLOR); -#else // WASD +#else // WOLFDOSMPU DrawOutline(60+20*mouseadjustment,97,20,10,0,READCOLOR); VWB_Bar(61+20*mouseadjustment,98,19,9,READHCOLOR); -#endif // WASD +#endif // WOLFDOSMPU VW_UpdateScreen(); SD_PlaySound(MOVEGUN1SND); while(Keyboard[sc_RightArrow]); @@ -3340,8 +3336,13 @@ void CP_ChangeView(void) case dir_North: case dir_East: newview++; +#ifdef WOLFDOSMPU + if (newview > 20) + newview = 20; +#else // WOLFDOSMPU if (newview>19) newview=19; +#endif // WOLFDOSMPU ShowViewSize(newview); VW_UpdateScreen(); SD_PlaySound(HITWALLSND); diff --git a/WOLFSRC/_WVER.H b/WOLFSRC/_WVER.H index bdc631d..632a30d 100644 --- a/WOLFSRC/_WVER.H +++ b/WOLFSRC/_WVER.H @@ -1 +1 @@ -#define VERSION 1.48 +#define VERSION 1.49