Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix solid bg HOM #1626

Merged
merged 3 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ static void AM_initScreenSize(void)
if (automapoverlay && scaledviewheight == SCREENHEIGHT)
f_h = video.height;
else
f_h = video.height - V_ScaleY(ST_HEIGHT);
f_h = V_ScaleY(SCREENHEIGHT - ST_HEIGHT);
}

void AM_ResetScreenSize(void)
Expand Down
11 changes: 4 additions & 7 deletions src/r_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@
// and the total size == width*height*depth/8.,
//

byte *viewimage;
int viewwidth;
int scaledviewwidth;
int scaledviewheight; // killough 11/98
int scaledviewx;
int scaledviewy;
int viewwidth;
int viewheight;
int viewwindowx;
int viewwindowy;
Expand Down Expand Up @@ -941,18 +940,16 @@ void R_VideoErase(int x, int y, int w, int h)

void R_DrawViewBorder(void)
{
int side;

if (scaledviewwidth == video.unscaledw || background_buffer == NULL)
return;

// copy top
R_VideoErase(0, 0, video.unscaledw, scaledviewy);

// copy sides
side = scaledviewx;
R_VideoErase(0, scaledviewy, side, scaledviewheight);
R_VideoErase(video.unscaledw - side, scaledviewy, side, scaledviewheight);
R_VideoErase(0, scaledviewy, scaledviewx, scaledviewheight);
R_VideoErase(scaledviewx + scaledviewwidth, scaledviewy, scaledviewx,
scaledviewheight);

// copy bottom
R_VideoErase(0, scaledviewy + scaledviewheight, video.unscaledw, scaledviewy);
Expand Down
2 changes: 1 addition & 1 deletion src/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ void R_ExecuteSetViewSize (void)
}

// [crispy] forcefully initialize the status bar backing screen
ST_refreshBackground(true);
ST_refreshBackground();

pspr_interp = false;
}
Expand Down
23 changes: 3 additions & 20 deletions src/st_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static void ST_DrawSolidBackground(int st_x)
Z_ChangeTag (pal, PU_CACHE);
}

void ST_refreshBackground(boolean force)
void ST_refreshBackground(void)
{
int st_x;

Expand Down Expand Up @@ -441,24 +441,7 @@ void ST_refreshBackground(boolean force)

// [crispy] copy entire video.unscaledw, to preserve the pattern to the left
// and right of the status bar in widescren mode
if (!force)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even remember why this branch was here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another V_CopyRect in ST_drawWidgets, so it's not necessary to copy the ST_BAR itself in case of R_ExecuteSetViewSize. I don't think we need this complication.

{
V_CopyRect(ST_X, 0, st_backing_screen,
video.unscaledw, ST_HEIGHT,
ST_X, ST_Y);
}
else
{
if (video.deltaw > 0 && !st_firsttime)
{
V_CopyRect(0, 0, st_backing_screen,
video.deltaw, ST_HEIGHT,
0, ST_Y);
V_CopyRect(SCREENWIDTH + video.deltaw, 0, st_backing_screen,
video.deltaw, ST_HEIGHT,
SCREENWIDTH + video.deltaw, ST_Y);
}
}
V_CopyRect(0, 0, st_backing_screen, video.unscaledw, ST_HEIGHT, 0, ST_Y);
}

// Respond to keyboard input events,
Expand Down Expand Up @@ -1087,7 +1070,7 @@ void ST_Drawer(boolean fullscreen, boolean refresh)
st_firsttime = false;

// draw status bar background to off-screen buff
ST_refreshBackground(false);
ST_refreshBackground();
}

ST_drawWidgets();
Expand Down
2 changes: 1 addition & 1 deletion src/st_stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void ST_Init(void);
void ST_Warnings(void);

// [crispy] forcefully initialize the status bar backing screen
void ST_refreshBackground(boolean force);
void ST_refreshBackground(void);

void ST_InitRes(void);

Expand Down