Skip to content

Commit

Permalink
Classic DOOM can now properly load status bar backgrounds that are wi…
Browse files Browse the repository at this point in the history
…der than 320 pixels
  • Loading branch information
MadDeCoDeR committed Aug 29, 2024
1 parent a0165df commit 4060a82
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
11 changes: 10 additions & 1 deletion doomclassic/doom/st_stuff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,15 @@ void ST_refreshBackground(void)
if (!in_photomode.GetBool()) {
if (::g->st_statusbaron)
{
if (::g->sbar->width > 320) {
if (::g->ASPECT_IMAGE_SCALER > GLOBAL_IMAGE_SCALER) {
V_DrawPatch(ST_X, 0, BG, ::g->sbar, true);
} else {
V_DrawPatch(ST_X, 0, BG, ::g->sbar, true, ::g->mapt->width, ::g->spwr->width);
}
} else {
V_DrawPatch(ST_X + ::g->ASPECT_POS_OFFSET, 0, BG, ::g->sbar, true);
}
short widthoffset = 0;
if (::g->ASPECT_IMAGE_SCALER > GLOBAL_IMAGE_SCALER) {
V_DrawPatch(ST_X, 0, BG, ::g->mapt, true);
Expand All @@ -374,7 +383,7 @@ void ST_refreshBackground(void)
widthoffset += ::g->spwr->width;
}

V_DrawPatch(ST_X + ::g->ASPECT_POS_OFFSET, 0, BG, ::g->sbar, true);



if (::g->netgame)
Expand Down
10 changes: 6 additions & 4 deletions doomclassic/doom/v_video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ V_DrawPatch
int y,
int scrn,
patch_t* patch,
bool aspect)
bool aspect,
int xLeadingOffs,
int xEndingOffs)
{

int count;
Expand All @@ -238,13 +240,13 @@ V_DrawPatch
#endif

if (!scrn)
V_MarkRect (x, y, SHORT(patch->width), SHORT(patch->height));
V_MarkRect (x, y, SHORT(patch->width - (xLeadingOffs + xEndingOffs)), SHORT(patch->height));

col = 0;
col = xLeadingOffs;
int destx = x;
int desty = y;

w = SHORT(patch->width);
w = SHORT(patch->width) - xEndingOffs;

// SMF - rewritten for scaling
for ( ; col < w ; x++, col++ ) {
Expand Down
4 changes: 3 additions & 1 deletion doomclassic/doom/v_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ V_DrawPatch
int y,
int scrn,
patch_t* patch,
bool aspect);
bool aspect,
int xLeadingOffs = 0,
int xEndingoffs = 0);

void
V_DrawPatchDirect
Expand Down

0 comments on commit 4060a82

Please sign in to comment.