Skip to content

Commit

Permalink
Fix status-bar chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlaux committed Sep 21, 2024
1 parent db1944a commit cd05385
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
2 changes: 0 additions & 2 deletions src/i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,8 +1289,6 @@ static void ResetResolution(int height, boolean reset_pitch)
AM_ResetScreenSize();
}

ST_InitChunkBar(); // [Nugget] NUGHUD: Status-Bar chunks

I_Printf(VB_DEBUG, "ResetResolution: %dx%d", video.width, video.height);

drs_skip_frame = true;
Expand Down
28 changes: 15 additions & 13 deletions src/st_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,16 @@ static void ST_DrawSolidBackground(int st_x)

void ST_refreshBackground(void)
{
// [Nugget] NUGHUD: Status-Bar chunks /-----------------------------------

V_UseBuffer(st_bar);

V_DrawPatch(ST_X + (SCREENWIDTH - SHORT(sbar->width)) / 2 + SHORT(sbar->leftoffset), 0, sbar);

V_RestoreBuffer();

// [Nugget] -------------------------------------------------------------/

int st_x;

if (!st_classicstatusbar)
Expand Down Expand Up @@ -2123,25 +2133,17 @@ void ST_Init(void)
ST_loadData();
}

// [Nugget] NUGHUD: Status-Bar chunks
void ST_InitChunkBar(void)
{
// More than necessary, but so be it
st_bar = Z_Malloc((video.pitch * V_ScaleY(StatusBarBufferHeight())) * sizeof(*st_bar), PU_RENDERER, 0);

V_UseBuffer(st_bar);

V_DrawPatch(ST_X + (SCREENWIDTH - SHORT(sbar->width)) / 2 + SHORT(sbar->leftoffset), 0, sbar);

V_RestoreBuffer();
}

void ST_InitRes(void)
{
int height = V_ScaleY(StatusBarBufferHeight());

// killough 11/98: allocate enough for hires
st_backing_screen = Z_Malloc(video.pitch * height * sizeof(*st_backing_screen), PU_RENDERER, 0);

// [Nugget] Status-Bar chunks ----------------------------------------------

// More than necessary (we only use the section visible in 4:3), but so be it
st_bar = Z_Malloc((video.pitch * height) * sizeof(*st_bar), PU_RENDERER, 0);
}

void ST_Warnings(void)
Expand Down
2 changes: 0 additions & 2 deletions src/st_stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ void ST_refreshBackground(void);

void ST_InitRes(void);

void ST_InitChunkBar(void); // [Nugget] NUGHUD: Status-Bar chunks

void ST_createWidgets(void); // [Nugget] Made global

// killough 5/2/98: moved from m_misc.c:
Expand Down

0 comments on commit cd05385

Please sign in to comment.