Skip to content

Commit

Permalink
- extended viewsize (and mouse sensitivity) limits
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvids committed May 7, 2022
1 parent 1231b24 commit 25fccaa
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 19 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion WOLFSRC/VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
//#define DEBCHECK
#define CARMACIZED
//#define UPLOAD
#define VERSION 1.48
#define VERSION 1.49
#define WOLFDOSMPU
#define WASD
3 changes: 3 additions & 0 deletions WOLFSRC/WL_ACT2.C
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
24 changes: 24 additions & 0 deletions WOLFSRC/WL_DRAW.C
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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++;
Expand Down
20 changes: 20 additions & 0 deletions WOLFSRC/WL_GAME.C
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions WOLFSRC/WL_INTER.C
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
33 changes: 17 additions & 16 deletions WOLFSRC/WL_MENU.C
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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]);
Expand All @@ -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]);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion WOLFSRC/_WVER.H
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define VERSION 1.48
#define VERSION 1.49

0 comments on commit 25fccaa

Please sign in to comment.