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 bunny scroll for 32:9 aspect ratio #1783

Merged
merged 1 commit into from
Jul 12, 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
44 changes: 25 additions & 19 deletions src/f_finale.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,34 +690,40 @@ void F_BunnyScroll (void)
char name[16];
int stage;
static int laststage;
int offset;

p1 = V_CachePatchName ("PFUB2", PU_LEVEL);
p2 = V_CachePatchName ("PFUB1", PU_LEVEL);
p1 = V_CachePatchName ("PFUB1", PU_LEVEL);
p2 = V_CachePatchName ("PFUB2", PU_LEVEL);

scrolled = 320 - (finalecount-230)/2;
if (scrolled > 320)
scrolled = 320;
if (scrolled < 0)
scrolled = 0;

offset = 0;
if (SHORT(p2->width) != SCREENWIDTH)
int p1offset = (video.unscaledw - SHORT(p1->width) + 1) / 2;
if (SHORT(p1->width) == 320)
{
offset = video.deltaw;
p1offset += (SHORT(p2->width) - 320) / 2;
}

if (scrolled > 0)
V_DrawPatch(320 - scrolled - offset, 0, p2);
if (scrolled < 320)
V_DrawPatch(-scrolled - offset, 0, p1);
int p2offset = (video.unscaledw - SHORT(p2->width) + 1) / 2;

if (SHORT(p2->width) == SCREENWIDTH)
if (scrolled <= 0)
{
V_FillRect(0, 0, video.deltaw, SCREENHEIGHT, v_darkest_color);
V_FillRect(video.deltaw + SCREENWIDTH, 0,
video.unscaledw - (video.deltaw + SCREENWIDTH), SCREENHEIGHT,
v_darkest_color);
V_DrawPatch(p2offset - video.deltaw, 0, p2);
}
else if (scrolled >= 320)
{
V_DrawPatch(p1offset - video.deltaw, 0, p1);
V_DrawPatch(-320 + p2offset - video.deltaw, 0, p2);
}
else
{
V_DrawPatch(320 - scrolled + p1offset - video.deltaw, 0, p1);
V_DrawPatch(-scrolled + p2offset - video.deltaw, 0, p2);
}

if (p2offset > 0)
{
V_FillRect(0, 0, p2offset, SCREENHEIGHT, v_darkest_color);
V_FillRect(p2offset + SHORT(p2->width), 0, p2offset, SCREENHEIGHT,
v_darkest_color);
}

if (finalecount < 1130)
Expand Down
10 changes: 6 additions & 4 deletions src/v_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,14 @@ static void DrawPatchInternal(int x, int y, patch_t *patch, boolean flipped)
{
texturecolumn = startfrac >> FRACBITS;

#ifdef RANGECHECK
if (texturecolumn < 0 || texturecolumn >= w)
if (texturecolumn < 0)
{
I_Error("V_DrawPatchInt: bad texturecolumn %d", texturecolumn);
continue;
}
else if (texturecolumn >= w)
{
break;
}
#endif

column = (column_t *)((byte *)patch
+ LONG(patch->columnofs[texturecolumn]));
Expand Down
Loading